-
Notifications
You must be signed in to change notification settings - Fork 17
/
View_Users.php
90 lines (80 loc) · 3.3 KB
/
View_Users.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
<!--for delete Record -->
<?php
$msg="";
$opr="";
if(isset($_GET['opr']))
$opr=$_GET['opr'];
if(isset($_GET['rs_id']))
$id=$_GET['rs_id'];
if($opr=="del")
{
$del_sql=mysql_query("DELETE FROM users_tbl WHERE u_id=$id");
if($del_sql)
$msg="1 Record Deleted... !";
else
$msg="Could not Delete :".mysql_error();
}
echo $msg;
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style_view.css" />
<title>::. Build Bright University .::</title>
</head>
<body>
<div id="style_div" >
<form method="post">
<table width="755">
<tr>
<td width="190px" style="font-size:18px; color:#006; text-indent:30px;">View Users</td>
<td><a href="?tag=susers_entry"><input type="button" title="Add new student" name="butAdd" value="Add New" id="button-search" /></a></td>
<td><input type="text" name="searchtxt" title="Enter name for search " class="search" autocomplete="off"/></td>
<td style="float:right"><input type="submit" name="btnsearch" value="Search" id="button-search" title="Search Users" /></td>
</tr>
</table>
</form>
</div><!--- end of style_div -->
<br />
<div id="content-input">
<form method="post">
<table border="1" width="805px" align="center" cellpadding="3" class="mytable" cellspacing="0">
<tr>
<th style="text-align: center;">No</th>
<th style="text-align: center;">Users Name</th>
<th style="text-align: center;">Password</th>
<th style="text-align: center;">Type</th>
<th style="text-align: center;">Note</th>
<th style="text-align: center;"colspan="2">Operation</th>
</tr>
<?php
$key="";
if(isset($_POST['searchtxt']))
$key=$_POST['searchtxt'];
if($key !="")
$sql_sel=mysql_query("SElECT * FROM users_tbl WHERE username like '%$key%' ");
else
$sql_sel=mysql_query("SELECT * FROM users_tbl");
$i=0;
while($row=mysql_fetch_array($sql_sel)){
$i++;
$color=($i%2==0)?"lightblue":"white";
?>
<tr bgcolor="<?php echo $color?>">
<td><?php echo $i;?></td>
<td><?php echo $row['username'];?></td>
<td><?php echo $row['password'];?></td>
<td><?php echo $row['type'];?></td>
<td><?php echo $row['note'];?></td>
<td align="center"><a href="?tag=susers_entry&opr=upd&rs_id=<?php echo $row['u_id'];?>" title="Upate"><img style="-webkit-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);-moz-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);" src="picture/update.png" height="20" alt="Update" /></a></td>
<td align="center"><a href="?tag=view_users&opr=del&rs_id=<?php echo $row['u_id'];?>" title="Delete"><img style="-webkit-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);-moz-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);" src="picture/delete.jpg" height="20" alt="Delete" /></a></td>
</tr>
<?php
}
?>
</table>
</form>
</div><!-- end of content-input -->
</body>
</html>