-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_messages.php
45 lines (42 loc) · 1.32 KB
/
admin_messages.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
<?php
$title = "پیامهای کاربران";
include("includes/header.php");
if ((isset($_SESSION["state_login"]) && $_SESSION["state_login"] === true && $_SESSION["user_type"] === "nonadmin") ||
!isset($_SESSION["state_login"])
) {
?>
<script>
location.replace("./restricted.php");
</script>
<?php
}
include("includes/db_link.php");
$query = "SELECT * FROM messages";
$request = mysqli_query($link, $query);
?>
<table border="1px" cellpadding='5px' cellspacing=0 style="text-align:center;width:100%">
<thead style="font-weight: 700">
<tr>
<td>کد پیام</td>
<td>نام کاربر</td>
<td>ایمیل کاربر</td>
<td>متن پیام</td>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($request)) {
?>
<tr>
<td><?= $row["id"] ?></td>
<td><?= $row["realname"] ?></td>
<td><?= $row["email"] ?><br><a href="mailto:<?= $row["email"] ?>">ارسال ایمیل به کاربر</a></td>
<td><textarea style="cursor:default;align-content:center" cols="25" rows="5" wrap="virtual" readonly><?= $row["content"] ?></textarea></td>
</tr>
<?php
}
?>
</table>
<?php
include("./includes/footer.php");
?>