-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_index.php
executable file
·108 lines (88 loc) · 3.44 KB
/
admin_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
<?php
//Set permission level threshold for this page remove if page is good for all levels
$permission_level=5;
include"auth_check_header.php";
?>
<!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=iso-8859-1' />
<title>AMS Agent Index</title>
</head>
<body topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><div align="center"><strong><font size="3"><font face="Verdana, Arial, Helvetica, sans-serif">
<legend><font size="4">Admin Index</font><font size="2"><br />
</font></legend>
</font></font></strong>
</div>
<div style="text-align:left; width:100%; margin-top:10px;">
<p align="center">
<?php include"include_menu.php"; ?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">|</font> <strong><font face="Verdana, Arial, Helvetica, sans-serif"><a href="traffic.php"><font size="2">Traffic Report</font></a></font></strong></p>
<form action="admin_index.php" method="post" name="form" id="form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">
<input name="q" type='text' id='q' />
<input type="submit" name="Submit22" value="Search Users" />
</div></td>
</tr>
</table>
<p>
<?php
$var = $_REQUEST['q'];
$color1 = "#ffffff";
$color2 = "#ebebeb";
echo"<font size='2' face='Verdana, Arial, Helvetica, sans-serif'>
<table width='100%' cellpadding='5'>";
$query = "SELECT * FROM users WHERE (`id` LIKE \"%$var%\" OR `username` LIKE \"%$var%\" OR `password` LIKE \"%$var%\" OR `email` LIKE \"%$var%\" OR `lastname`LIKE \"%$var%\" OR `firstname`LIKE \"%$var%\") ORDER BY `id` desc";
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
// get results
$result = mysql_query($query) or die("Couldn't execute query");
// now you can display the results returned
while ($row= mysql_fetch_array($result)) {
$id= $row["id"];
$username= $row["username"];
$password= $row["password"];
$lastname= $row["lastname"];
$firstname= $row["firstname"];
$phone= $row["phone"];
$email= $row["email"];
$permissions = $row["permissions"];
$email_sub = substr($email, 0, 50);
$row_color = ($row_count % 2) ? $color1 : $color2;
//DISPLAY DATA HERE_____________
echo "
<tr>
<td width='100%' bgcolor='$row_color'>
<table width= '100%'><tr>
<td width='20%' bgcolor='$row_color' >$username</a></td>
<td width='10%' bgcolor='$row_color' >$lastname, $firstname</td>
<td width='10%' bgcolor='$row_color' >$phone</td>
<td width='20%' bgcolor='$row_color' >$email_sub</td>
<td width='10%' bgcolor='$row_color' >$permissions</td>
<td width='100' bgcolor='$row_color' ><a href='edit_user.php?id=$id'>edit</a></td>
</tr>
</table>
</td>
</tr>
";
$row_count++;
}
echo"</tabel></font>";
?>
</p>
<p> </p>
</form>
</p>
</div></td>
</tr>
</table>
<br>
<br>
</body>
</html>