This repository was archived by the owner on Jan 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-interface.php
More file actions
145 lines (113 loc) · 4.59 KB
/
admin-interface.php
File metadata and controls
145 lines (113 loc) · 4.59 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
require_once('DbController.php');
if (!empty($_GET['action'])){
switch($_GET['action']){
case "accept":
$accept = $pdo->prepare("UPDATE `fundraiser` SET `verifiedStatus` = ? WHERE `fundraiserId` = ?");
$accept->execute(array('verified', $_GET['fundraiderId']));
break;
case "reject":
$reject = $pdo->prepare("UPDATE `fundraiser` SET `verifiedStatus` = ? WHERE `fundraiserId` = ?");
$reject->execute(array('rejected', $_GET['fundraiderId']));
break;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS CDN -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link href = "./css/admin-interface.css" type = "text/css" rel = "stylesheet">
<title>Admin Interface</title>
</head>
<body>
<div class="content">
<?php include "head.php"?>
<!--Fundraiser Status Buttons -->
<nav class="navbar navbar-expand-sm navbar-light mt-3">
<div class="container">
<p class = "mt-3 fw-bold">Fundraiser Status: </p>
<button class="navbar-toggler" type = "button" data-bs-toggle = "collapse" data-bs-target = "#status">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id = "status">
<ul class="navbar-nav flex-row ">
<li class="nav-item mx-2">
<a href="#" class="nav-link">
<button type="button" class="btn btn-outline-success">
Pending
</button>
</a>
</li>
<li class="nav-item mx-2">
<a href="#" class="nav-link">
<button type="button" class="btn btn-outline-success">
Accepted
</button>
</a>
</li>
<li class="nav-item mx-2">
<a href="#" class="nav-link">
<button type="button" class="btn btn-outline-success">
Rejected
</button>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!--End Of Fundraiser Status Buttons -->
<?php
$query = "SELECT * FROM fundraiser";
$result = $pdo->query($query);
foreach($result as $row){
$fundId = $row['fundraiserId'];
$userId = $row['userId'];
$ssm = $row['ssmRegNo'];
$phoneNum = $row['phoneNumber'];
$bankNum = $row['bankNumber'];
$accName = $row['acc_holder_name'];
$bankName = $row['bank_name'];
$verify = $row['verifiedStatus'];
$profImg = $row['profileImage'];
/* Fundraiser Description */
echo <<<_END
<div class="container-md mt-3 d-flex">
<img src="./resources/img/placeholder.png" alt="image" class = "fundraiser ">
<div class = "my-auto">
<ul>
<ol>Fundraiser ID: $fundId </ol>
<ol>Fundraiser User ID: $userID </ol>
<ol>SSM Registration Number: $ssm </ol>
<ol>Phone Number: $phoneNum </ol>
<ol>Bank Number: $bankNum </ol>
<ol>Account Holder's Name: $accName </ol>
<ol>Bank Name: $bankName </ol>
<ol>Current Status: <span class = "fw-bold">$verify</span> </ol>
</ul>
</div>
<div class="d-flex flex-column my-auto mx-auto">
<form method = "GET">
<p class = "fw-bold text-decoration-underline text-center">Change Status</p>
<button type="button" class="btn btn-outline-success mb-2" onclick = "location.href = 'admin-interface.php?action=accept&fundraiderId=$fundId';"> Accept </button>
<button type="button" class="btn btn-outline-success mb-2" onclick = "location.href = 'admin-interface.php?action=reject&fundraiderId=$fundId';"> Reject </button>
</form>
</div>
</div>
_END;
/* End of Fundraiser Description */
}
?>
<div class = "foot">
<?php include "foot.php"?>
</div>
<!-- Bootstrap JS CDN -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
</div>
</body>
</html>