-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathback.php
More file actions
24 lines (22 loc) · 882 Bytes
/
back.php
File metadata and controls
24 lines (22 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
session_start();
error_reporting(0);
// include('includes/config.php');
$filepath = realpath(dirname(__FILE__));
include_once ($filepath.'/lib/Database.php');
$db = new Database();
$transquery = "SELECT * FROM tbl_transactions WHERE tx_ref = '".$_GET['tx_ref']."'";
$result = $db->select($transquery);
$orderId = array();
while($value = $result->fetch_assoc()){
$orderId[] = $value['order_id'];
}
$idsorder = implode(",",$orderId);
if(strtoupper($_GET['status']) == 'SUCCESSFUL'){
$db->update("UPDATE tbl_transactions SET status = '".$_GET['status']."',transaction_id='".$_GET['transaction_id']."' where tx_ref='".$_GET['tx_ref']."'");
$db->update("UPDATE tbl_order SET status='1' WHERE id in ($idsorder)");
}
else{
$db->update("UPDATE tbl_transactions SET status = '".$_GET['status']."' where tx_ref='".$_GET['tx_ref']."'");
}
header('Location: index.php');