-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_users.php
96 lines (68 loc) · 3.03 KB
/
edit_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
91
92
93
94
95
96
<!DOCTYPE html>
<meta charset="UTF-8">
<html>
<link rel="stylesheet" type="text/css" href="css/css_all.css">
<link rel="stylesheet" type="text/css" href="css/tables.css">
<body>
<div class="container">
<div class="content">
<?php
session_start();
include 'menu.php';
if (isset($_SESSION['logged_in'])){ //ean eimaste syndedemenoi
if ($_SESSION['admin_stat']==1) //ean eimaste admin
{
include 'connect_db.php';
if (isset($_GET['xid']) && is_numeric($_GET['xid'])) //åëåã÷ïõìå åáí ôï id ôïõ ÷ñçóôç âñéóêåôáé óôçí äéåõèõíóç êáé åáí åéíáé åãêõñï
{
$id = $_GET['xid'];
$query = "SELECT * FROM xristes WHERE x_id='$id'";
$result = $con->query($query);
$row = mysqli_fetch_array($result); //epeidh epeksergazomaste ta stoixeia enos sygkekrhmenou xrhsth, den xreiazetai na valoume while
$email=$row['email'];
$onoma=$row['onoma'];
$password=$row['password'];
$epwnymo=$row['epwnymo'];
$thlefwno=$row['thlefwno'];
?>
<div id="page-wrap" >
<table border='1' cellpadding='10'>
<form id="f1" action='update_users.php?xid=<?php echo $row['x_id'] ?>' method='POST'>
<tr>
<th>ID</th><td><?php echo $row['x_id'] ?></td></tr>
<tr>
<th>Email</th> <td><input type="email" name="email" value="<?php echo $email ?>"></td></tr>
<tr>
<th>Password</th><td> <input type="password" name="new_pass" value="<?php echo $password ?>"></td></tr>
<tr>
<th>First Name</th> <td> <input type="text" name="new_name" value="<?php echo $onoma ?>"></td></tr>
<tr>
<th>Last Name</th> <td><input type="text" name="new_surname" value="<?php echo $epwnymo ?>"></td></tr>
<tr>
<th>Phone</th><td> <input type="tel" name="new_phone" value="<?php echo $thlefwno ?>"></td></tr>
</form>
<tr>
<th>Submit | Reset | Delete</th>
<td style="float:center";><button form="f1" type="submit" style=" cursor: pointer; border: 0; background: transparent">
<img src="/images/tick.png" width="17" height="17" alt="submit" />
</button>
<button form="f1" type="reset" style=" cursor: pointer; border: 0; background: transparent">
<img src="/images/refresh1.png" width="17" height="17" alt="submit" />
</button> <button form="f2" type="submit" style=" cursor: pointer; border: 0; background: transparent">
<img src="/images/fail.png" width="17" height="17" alt="submit" />
</button></td>
<form id="f2" action="delete_users.php?xid=<?php echo $row['x_id'] ?>" method="POST">
</form>
</tr>
<br />
</table>
<?php
} else echo 'ΟÏπς!Κάτι πήγε στÏαβά!';
} else echo "You have no previlage to be here!";
}
else //ean den exoume kanei login
echo '<meta http-equiv="refresh" content="0; url=index.php" />';
?>
</div></div></div>
</body>
</html>