-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow_users.php
More file actions
35 lines (34 loc) · 1.62 KB
/
show_users.php
File metadata and controls
35 lines (34 loc) · 1.62 KB
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
<br>
<?php
session_start();
$user = $_SESSION["user"];
$stat = $_SESSION["auth"];
?>
<?php
require_once 'connect_db.php';
$mysqli = connect_db();
$result = $mysqli->query("SELECT id,
login,
password,
full_name,
date_of_registration
FROM users"
);
$rows = $result->fetch_assoc();
if(!empty($rows))
do {
echo "<table>";
if($stat == "ok") {
echo "<tr><td><button class='btn btn-primary btn-xs' id='delete' name = 'delete' value='".$rows['login']."'>Delete</button> <button id = 'update' class='btn btn-primary btn-xs' name = 'update' value = '".$rows['id']."'>Update</button></tr></td>";
}
//echo "Delete user<a href = '?delete=".$rows['login']."'>[x]</a> | <a href = '?update=".$rows['login']." '>Update</a> user";
echo "<tr><td>Полное имя:</td> <td><input style='width:200px' type = 'text' name = 'full_name' id='".$rows['id']."' value='".$rows['full_name'] . "'/></td></tr>";
//echo "<p>Полное имя: <b>" . $rows['full_name'] . "</b></p>" ;
echo "<tr><td>Login:</td> <td><input style='width:200px' type = 'text' name = 'login_user' id='".$rows['id']."' value='".$rows['login'] . "'/></td></tr>";
//echo "<p>Login: <b>" . $rows['login'] . "</b></p>" ;
echo "<tr><td>Password:</td> <td><input style='width:200px' type = 'text' name = 'password_user' id='".$rows['id']."' value='".$rows['password'] . "'/></td></tr>";
echo "<tr><td>Дата регистрации: </td> <td><b>" . $rows['date_of_registration'] . "</b></td></tr></table><br>" ;
//echo "</hr>";
// $rows = $result->fetch_assoc();
} while($rows = $result->fetch_assoc());
?>