-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminPoruke.php
More file actions
76 lines (55 loc) · 2.03 KB
/
adminPoruke.php
File metadata and controls
76 lines (55 loc) · 2.03 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
session_start();
include_once 'db_connection.php';
$conn = OpenConn();
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stil.css">
</head>
<body>
<div id="menu">
<?php include 'templates/menu.php';?>
</div>
<div class="row">
<div id="preglednar">
<?php
if(isset($_SESSION['korisnik']) && $_SESSION['korisnik'] = 'admin'){
?>
<h3>Pregled Poruka:</h3>
<table id="preglednarudzbatabela" border= 1>
<tr>
<th>Datum:</th>
<th>e-mail:</th>
<th>Predmet:</th>
<th>Opcije:</th>
</tr>
<?php
$sql = "SELECT * FROM `poruka`";
$result = $conn->query($sql);
if($result->num_rows > 0){
while($row = $result->fetch_assoc()){
?>
<tr>
<td><?php echo $row["datum"]; ?></td>
<td><?php echo $row["email"]; ?></td>
<td><?php echo $row["predmet"]; ?></td>
<form action="adminPorukaPregled.php" method="GET">
<input type="text" name ="id" value="<?php echo $row["id"]; ?>" hidden>
<td><input class="myButton" type="submit" value="Pogledaj poruku"></td>
</form>
</tr>
<?php
}
}
?>
</table>
<?php
}else{
echo "Niste ovlašteni pristupiti ovoj stranici";
}
?>
</div>
</div>
</body>
</html>