-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheader.php
113 lines (95 loc) · 3.13 KB
/
header.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
113
<?php
session_start();
include("connection.php");
date_default_timezone_set('Asia/Kolkata');
$dttime = date("Y-m-d h:i:s");
//code for administratot
if(isset($_SESSION["loginid"]) && $_SESSION["logintype"]=="Admin")
{
$result = mysqli_query($con,"SELECT * FROM admin
WHERE login_id='$_SESSION[loginid]' ");
while($row = mysqli_fetch_array($result))
{
$_SESSION["adminname"] = $row['admin_name'];
$_SESSION["lastlogin"] = $row['last_login'];
}
mysqli_query($con,"UPDATE admin SET last_login='$dttime'
WHERE login_id='$_SESSION[loginid]'");
}
//ends here
if(isset($_SESSION["loginid"]) && $_SESSION["logintype"]=="User")
{
$result = mysqli_query($con,"SELECT * FROM user
WHERE s_emailid='$_SESSION[loginid]' ");
while($row = mysqli_fetch_array($result))
{
$_SESSION["username"] = $row['emp_fname']. " ". $row['emp_lname'];
$_SESSION["lastlogin"] = $row['lastlogin'];
}
mysqli_query($con,"UPDATE user SET last_login='$dttime'
WHERE s_emailid='$_SESSION[loginid]'");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Survey of schools</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="css/jquery.jcarousel.css" type="text/css" media="all" />
<!--[if IE 6]><link rel="stylesheet" href="css/ie6.css" type="text/css" media="all" /><![endif]-->
<link rel="shortcut icon" href="css/images/favicon.ico" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.jcarousel.pack.js"></script>
<script type="text/javascript" src="js/func.js"></script>
<style type="text/css">
#apDiv1 {
position:absolute;
width:185px;
height:89px;
z-index:1;
left: 523px;
top: 4px;
}
</style>
</head>
<body>
<div class="shell">
<div class="border">
<div id="header">
<h1 id="logo"><a href="#" class="notext">beSMART</a></h1>
<div id="sidebar" class="right">
<div class="sidebar-nav">
<?php
if($_SESSION["logintype"]=="Admin")
{
?>
<p>Welcome <?php echo $_SESSION["loginid"];?></p>
<p>Admin name : <?php echo $_SESSION["adminname"];?></p>
<p>Last login : <?php echo $_SESSION["lastlogin"];?></p>
<?php
}
else if($_SESSION["logintype"]=="User")
{
?>
<p>Welcome <?php echo $_SESSION["loginid"];?></p>
<p>Name : <?php echo $_SESSION["username"];?></p>
<p>Last login : <?php echo $_SESSION["lastlogin"];?></p>
<?php
}
?>
</div>
</div>
<div class="cl"> </div>
</div>
<div id="navigation">
<ul>
<li><a href="index.php" class="active">Home</a></li>
<li><a href="history.php">History</a></li>
<li><a href="contacts.php">Contact</a></li>
<li><a href="viewphotogallery.php">gallery</a></li>
<li><a href="userlogin.php">application</a></li>
<li><a href="newsupdates.php">whats new</a></li>
</ul>
<div class="cl"> </div>
</div>