-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathOrderTransaction.php
43 lines (33 loc) · 1.59 KB
/
OrderTransaction.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
<?php
class OrderTransaction {
public function getRecordQuery($tran_id)
{
$sql = "select * from orders WHERE transaction_id='" . $tran_id . "'";
return $sql;
}
public function saveTransactionQuery($post_data)
{
//do changes here
$name = $post_data['cus_name'];
$email = $post_data['cus_email'];
$phone = $post_data['cus_phone'];
$transaction_amount = $post_data['total_amount'];
$address = $post_data['cus_add1'];
$transaction_id = $post_data['tran_id'];
$currency = $post_data['currency'];
$invoice_id = $post_data['invoice_id'];
$invoice_date = $post_data['invoice_date'];
$building_name = $post_data['building_name'];
$flat_number = $post_data['flat_number'];
//$sql = "INSERT INTO orders (name, email, phone, amount, address, status, transaction_id,currency)
//VALUES ('$name', '$email', '$phone','$transaction_amount','$address','Pending', '$transaction_id','$currency')";
$sql = "INSERT INTO orders (invoice_id, invoice_date, name, email, phone, amount, address, status, transaction_id, building_name, flat_no,currency)
VALUES ('$invoice_id', '$invoice_date','$name', '$email', '$phone','$transaction_amount','$address','Pending', '$transaction_id', '$building_name', '$flat_number','$currency')";
return $sql;
}
public function updateTransactionQuery($tran_id, $type = 'Success')
{
$sql = "UPDATE orders SET status='$type' WHERE transaction_id='$tran_id'";
return $sql;
}
}