-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewusers.php
72 lines (64 loc) · 1.73 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
<?php
include("header.php");
if(isset($_GET[delid]))
{
$sqldel ="DELETE FROM users where userid=$_GET[delid]";
$seldelresult = mysqli_query($con,$sqldel);
if(mysqli_affected_rows($con) == 1)
{
$delresult = "<font color=green><strong>Record deleted successfully..</strong></font>";
}
}
$selusers = "select users.*,course.coursename from users INNER JOIN course ON users.courseid = course.courseid ";
$selresult = mysqli_query($con,$selusers);
?>
<div class="slider_top2">
<h2>View Users</h2>
</div>
<div class="clr"></div>
<div class="body_resize">
<div class="body">
<div class="full">
<?php
echo $delresult;
echo "<table class=tftable width=200 border=1>
<tr>
<th scope=col> Course</th>
<th scope=col> Name</th>
<th scope=col> Designation</th>
<th scope=col> User type</th>
<th scope=col> Username</th>
<th scope=col> Created at</th>
<th scope=col> Last login</th>
<th scope=col> Status</th>
<th scope=col> Action</th>
</tr>";
while($rs = mysqli_fetch_array($selresult))
{
echo "
<tr>
<td> $rs[coursename]</td>
<td> $rs[name]</td>
<td> $rs[designation]</td>
<td> $rs[usertype]</td>
<td> $rs[username]</td>
<td> " . date("d-m-Y",strtotime($rs[createdat])) . "</td>
<td> " . date("d-m-Y h:i A",strtotime($rs[lastlogin])) . "</td>
<td> $rs[status]</td>
<td>
<a href=users.php?userid=$rs[userid]>Edit</a> |
<a href=viewusers.php?delid=$rs[userid]>Delete</a>
</td>
</tr>
";
}
?>
</table>
</table>
</div>
<div class="clr"></div>
</div>
</div>
<?php
include("footer.php");
?>