-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
112 lines (95 loc) · 3.62 KB
/
admin.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
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php include_once('php/includes/common-css-js.php'); ?>
<link rel="stylesheet" href="styles/admintable.css"/>
<title>Document</title>
</head>
<body>
<?php
include("php/templates/header.php");
?>
<h1 style='text-align:center;'>Update user details</details></h1>
<div class="hcenter">
<div class="texxst">
<form method="POST" action="php\controllers\admin-ctrl.php">
<label class="admin">User ID :</label>
<input class="admins" type="text" name="user_id" ><br><br>
<label class="admin">Firest Name :</label>
<input class="admins" type="text" name="first_name" ><br><br>
<label class="admin">Last Name :</label>
<input class="admins" type="text" name="last_name" ><br><br>
<label class="admin">E-mail :</label>
<input class="admins" type="text" name="email" ><br><br>
<label class="admin">Account Status:</label>
<select name="status1">
<option value="valid">Valid</option>
<option value="suspend">Suspended</option>
<option value="banned">Banned</option>
</select><br><br>
<label>Account Type:</label>
<select name="status2">
<option value="user">User</option>
<option value="mod">Mod</option>
<option value="admin">Admin</option>
</select><br><br>
<label class="admin">About:</label>
<input class="admins" type="text" name="about"><br><br>
<input type="submit" name="Update" value="Update">
</form>
</div>
</div>
<?php
include_once 'php\includes\dbcon.php';
$sql1="SELECT user_id,first_name,last_name,email,account_status,account_type,about FROM users";
$result2=$con->query($sql1);
//Shows the Request table details
if ($result2->num_rows > 0) {
echo("<h1 style='text-align:center;'>All Users</h1>");
echo("<table border='5' class='table1'>");
echo("<th>User ID</th>");
echo("<th>First Name</th>");
echo("<th>Last Name</th>");
echo("<th>E-mail</th>");
echo("<th>Account Status</th>");
echo("<th>Account Type</th>");
echo("<th>About</th>");
echo("<th>Remove</th>");
echo("<th>Profile</th>");
while($row = $result2->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row["user_id"]."</td>";
echo "<td>".$row["first_name"]."</td>";
echo "<td>".$row["last_name"]."</td>";
echo "<td>".$row["email"]."</td>";
echo "<td>".$row["account_status"]."</td>";
echo "<td>".$row["account_type"]."</td>";
echo "<td>".$row["about"]."</td>";
?>
<td class="delete"><a style="text-decoration: none;" href="php\controllers\admin-del-ctrl.php?user_id=<?php echo $row["user_id"]; ?>">Delete</a></td>
<style>
.viewws{
background-color:rgba(14, 140, 243, 0.737) ;
}
.viewws:hover{
background-color:rgba(41, 240, 140, 0.7) ;
}
</style>
<td class="viewws"><a style="text-decoration: none;" href="userview.php?id=<?php echo $row["user_id"]; ?>">View</a></td>
<?php
echo "</tr>";
}
echo ("</table>");
}else{
echo ('<h1 class="warnings">The Users table is empty</h1>');
}
$con->close();
include("php/templates/footer.php");
?>
</div>
</body>
</html>