-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.php
More file actions
53 lines (49 loc) · 1.57 KB
/
users.php
File metadata and controls
53 lines (49 loc) · 1.57 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
session_start();
include_once "php/config.php";
if(!isset($_SESSION['unique_id'])){
header("location: login.php");
}
if($_SESSION['admin'] == 1){
header("location: dashboard.php");
}
?>
<?php include_once "header.php"; ?>
<body>
<div class="wrapper">
<section class="users">
<header>
<div class="content">
<?php
$sql = mysqli_query($conn, "SELECT * FROM users WHERE unique_id = {$_SESSION['unique_id']}");
if(mysqli_num_rows($sql) > 0){
$row = mysqli_fetch_assoc($sql);
$_SESSION['addc'] = 0;
if($row['user_type'] == 'service')
$_SESSION['addc'] = 1;
$_SESSION['servicedb'] = $row['fname']."_commands";
}
?>
<img src="php/images/<?php echo $row['img']; ?>" onerror="this.src='php/images/Default.png'" alt="">
<div class="details">
<span><?php echo $row['fname']. " " . $row['lname'] ?></span>
<p><?php echo $row['about']; ?></p>
<input class="user-active" type="text" value="<?php echo $row['unique_id']; ?>" hidden>
</div>
</div>
<?php
if($_SESSION['addc'] == 1)
echo '<a href="commands.php" class="logout">Commands</a>';
else
echo '<a href="edit.php" class="logout">Edit</a>';
?>
<a href="php/logout.php" class="logout">Logout</a>
</header>
<br>
<div class="users-list">
</div>
</section>
</div>
<script src="javascript/users.js"></script>
</body>
</html>