-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadminCon.php
40 lines (34 loc) · 1.48 KB
/
adminCon.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
<?php
session_start();
include_once 'config.php';
$req=$_GET['req'];
?>
<?php
$firstSql="Select * From requestseller WHERE requestNo=".$req;
$result=$conn->query($firstSql);
if($result->num_rows>0){
while($row = $result->fetch_assoc()){
if ($row['status']=='Pending'){
$sql="UPDATE `requestseller` SET `status`='Accepted' WHERE requestNo=".$req;
mysqli_query($conn,$sql);
header("Refresh:0.1;adminDashboard.php");
echo "<script>alert('Seller request accepted')</script>";
}
else if($row['status']=='Accepted') {
$sql="UPDATE `requestseller` SET `status`='Declined' WHERE requestNo=".$req;
mysqli_query($conn,$sql);
header("Refresh:0.1;adminDashboard.php");
echo "<script>alert('Seller request Declined')</script>";
}
else{
$sql="UPDATE `requestseller` SET `status`='Pending' WHERE requestNo=".$req;
mysqli_query($conn,$sql);
header("Refresh: 0.1;adminDashboard.php");
echo "<script>alert('Seller request status changed to pending')</script>";
}
}
}
else{
echo "Empty Row";
}
?>