-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
112 lines (100 loc) · 4.86 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php include 'config/config.php'; ?>
<?php include 'session_check.php'; ?>
<link rel="stylesheet" href="<?php echo constant("HOST11") . '/web/css/UserStyleSheet.css' ?>" type="text/css" />
<title>Online Thesis Manager</title>
</head>
<body>
<div id="bodyPanel">
<div id="adminHeader">
<div id="adminHeaderTitle">
<?php include 'Macros/headerImage.php';?>
</div>
<div id="adminHeaderLocation"></div>
</div>
<div id="middle">
<div id="adminVMenu">
<?php include 'Macros/VerticalMenuItems.php'; ?>
</div>
<div id="adminMiddle">
<div id="welcome">Welcome, <?php echo $_SESSION['name'] ?></div>
<div id="change_password">
</br>
<?php
include 'config/connect.php';
$sql = "SELECT pass_changed, class FROM student WHERE user_nm LIKE '".$_SESSION['user_nm']."'";
$query_run = mysql_query($sql);
if (mysql_num_rows($query_run)==1) {
while($query_row=mysql_fetch_assoc($query_run))
{
$status=$query_row['pass_changed'];
$class = $query_row['class'];
// echo $status;
}
}
if ($status!="YES" && $status!="yes") {
echo "You have to change your default password before uploading your thesis";
}
$sql = "SELECT last_date FROM schedule WHERE class LIKE '".$class."'";
$query_run = mysql_query($sql);
if (mysql_num_rows($query_run)==1) {
while($query_row=mysql_fetch_assoc($query_run))
{
$date1=$query_row['last_date'];
list($year, $month, $date) = explode("-", $date);
$date2=date("Y-m-d");
$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
$time_left = "<strong>Time left for thesis submission</strong>".'</br>';
if ($years>0) {
$time_left = $time_left." ".$years." years, ";
}
if ($months>0) {
$time_left = $time_left." ".$months." months, ";
}
if ($days>0) {
$time_left = $time_left." ".$days." days ";
}
$time_left = $time_left;
}
}
?>
</div>
<?php echo $time_left; ?>
<br>
<strong>Last login</strong><br>
Time:<?php echo $_SESSION['login_time']; ?><br>
Ip:<?php echo $_SESSION['ip_address']; ?>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/User.js"></script>
<div id="rightPanel">
</div>
<div id="chat">
<?php
session_start();
if (isset($_GET['redirect']) && !empty($_GET['redirect'])) {
$include_path = $_GET['redirect'];
switch ($include_path) {
case 'chat':
//echo $include_path;
header("Location: ".constant("HOST11")."/chat/index.php");
break;
default:
break;
}
}
?>
</div>
</div>
<div id="adminFooter">
<?php include 'Macros/AdminFooter.php'; ?>
</div>
</div>
</body>
</html>