-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacceptpayments.php
executable file
·35 lines (29 loc) · 1.02 KB
/
acceptpayments.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
<?php
include('functions2.php');
$id = $_GET['id'];
$query = "SELECT * FROM `partialpayments` WHERE `id` = '$id';";
if(count(fetchAll($query)) > 0){
foreach(fetchAll($query) as $row){
$phone = $row['phone'];
$service = $row['service'];
$mpesa = $row['mpesa'];
$amount = $row['amount'];
$date = $row['date'];
$query = "INSERT INTO `approvedpayments` (`phone`, `service`, `mpesa`, `amount`, `date`) VALUES ('$phone', '$service', '$mpesa', '$amount', '$date');";
}
if(performQuery($query)){
echo "Success <br> <br>";
}else{
echo "An error has occured";
}
$query = "DELETE FROM `partialpayments` WHERE `partialpayments`.`id` = '$id';";
if(performQuery($query)){
echo "The Payment Approval Was Successful, Thankyou For Staying With MAfundi Services. <br> <br>";
}else{
echo "An error has occured";
}
}else{
echo "An Error Occured";
}
?>
<a href="pendingpayments.php">Back</a>