forked from NotClynt/Panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsub.php
77 lines (52 loc) · 1.34 KB
/
sub.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
<?php
require_once '../app/require.php';
require_once '../app/controllers/AdminController.php';
$user = new UserController();
$admin = new AdminController();
Session::init();
$username = Session::get("username");
$subList = $admin->getSubCodeArray();
Util::adminCheck();
Util::head('Admin Panel');
Util::navbar();
// if post request
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST["genSub"])) {
$admin->getSubCodeGen($username);
}
header("location: sub");
}
?>
<div class="container mt-2">
<div class="row">
<?php Util::adminNavbar(); ?>
<div class="col-12 mt-3">
<div class="rounded p-3 mb-3">
<form method="POST" action="<?php Util::display($_SERVER['PHP_SELF']); ?>">
<button name="genSub" type="submit" class="btn btn-outline-primary btn-sm">
Gen Subscription code
</button>
</form>
</div>
</div>
<div class="col-12 mb-2">
<table class="rounded table">
<thead>
<tr>
<th scope="col">Code</th>
<th scope="col">Created By</th>
</tr>
</thead>
<tbody>
<?php foreach ($subList as $row) : ?>
<tr>
<td><?php Util::display($row->code); ?></td>
<td><?php Util::display($row->createdBy); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php Util::footer(); ?>