-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewusers.php
95 lines (91 loc) · 2.85 KB
/
viewusers.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
<?php
include("header.php");
include("connection.php");
if(isset($_POST[button]) && $_POST[institute] != "")
{
$resulta = mysqli_query($con,"SELECT * FROM user where inst_id = '$_POST[institute]'");
}
else
{
$resulta = mysqli_query($con,"SELECT * FROM user");
}
$result = mysqli_query($con,"SELECT * FROM institute");
?>
<div id="main">
<div id="content" class="left">
<div class="highlight">
<h3>View Users</h3>
<form id="form1" name="form1" method="post" action="">
<p>
<label for="institute"> <a href="user.php"><strong>Add new User</strong></a> Select institution</label>
<select name="institute" id="institute">
<option value="">All</option>
<?php
while($row = mysqli_fetch_array($result))
{
if($_POST[institute] == $row[inst_id])
{
echo "<option value='$row[inst_id]' selected='selected'>$row[inst_name]</option>";
}
else
{
echo "<option value='$row[inst_id]'>$row[inst_name]</option>";
}
}
?>
</select>
<input type="submit" name="button" id="button" value="Submit" />
</p>
</form>
<table width="600" border="1">
<tr>
<th width="57" height="51" scope="col">SL No.</th>
<th width="118" scope="col">Institution <br />
name</th>
<th width="113" scope="col">Emloyee <br />
Name</th>
<th width="98" scope="col">Email ID</th>
<th width="89" scope="col">Created at</th>
<th width="85" scope="col">Last login</th>
</tr>
<?php
while($rowa = mysqli_fetch_array($resulta))
{
echo "<tr>";
echo "<td> $rowa[user_id]</td>";
$resultb = mysqli_query($con,"SELECT * FROM institute where inst_id='$rowa[inst_id]'");
while($rowb = mysqli_fetch_array($resultb))
{
$instname = $rowb[inst_name];
}
echo "<td> $instname</td>";
$instname = "";
echo "<td> <a href='viewuserprofile.php?proid=$rowa[user_id]'> $rowa[emp_fname] $rowa[emp_lname]</a></td>";
echo "<td> $rowa[s_emailid]</td>";
echo "<td> $rowa[created_at]</td>";
echo "<td> $rowa[lastlogin]</td>";
echo "</tr>";
}
?>
</table>
<p> </p>
</div>
<div class="projects">
<div class="item"></div>
<div class="item">
<div class="cl"> </div>
</div>
</div>
</div>
<?php
include("sidebar.php");
?>
<div class="cl"> </div>
</div>
<div class="shadow-l"></div>
<div class="shadow-r"></div>
<div class="shadow-b"></div>
</div>
<?php
include("footer.php");
?>