0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
payment_process
/
[
Home
]
File: cc_confirm_payment.php
<? session_start(); require('../includes/config.php'); $temptable=session_id(); $header_custom="header_".$temptable; $q_temptable_header="select * from $header_custom"; $r_temptable_header=mysql_query($q_temptable_header); $row_th=mysql_fetch_array($r_temptable_header); $customer_email=$row_th['billing_email']; $today=date('Y-m-d'); $totime=date('H:i:s'); $txn_id=$_SESSION['txn_id']; $find="select * from order_header where transaction_id='".$txn_id."'"; $r_find=mysql_query($find); if(mysql_num_rows($r_find)==0) { $q_insert_header="INSERT INTO `order_header` (`order_id`, `payment_process`, `transaction_id`, `order_date`, `customer_login_id`, `billing_name`, `billing_address`, `billing_country`, `billing_state`, `billing_contact`, `billing_email`, `shipping_name`, `shipping_address`, `shipping_country`,`shipping_state`, `shipping_zip`, `shipping_contact`, `special_note`, `total_product_weight`, `total_product_quantity`, `product_price`, `tax`, `delivery_charge`, `final_order_total`, `last_update_date`, `last_update_time`, `ip_address`, `order_status`) VALUES (NULL, 'Credit Card', '".$txn_id."', '".$today."', '".$row_th['customer_login_id']."', '".$row_th['billing_name']."', '".$row_th['billing_address']."', '".$row_th['billing_country']."', '".$row_th['billing_state']."', '".$row_th['billing_contact']."', '".$row_th['billing_email']."', '".$row_th['shipping_name']."', '".$row_th['shipping_address']."', '".$row_th['shipping_country']."', '".$row_th['shipping_state']."', '".$row_th['shipping_zip']."', '".$row_th['shipping_contact']."', '".$row_th['special_note']."', '".$row_th['total_product_weight']."', '".$row_th['total_product_quantity']."', '".$row_th['product_price']."', '".$row_th['tax']."', '".$row_th['delivery_charge']."', '".$row_th['final_order_total']."', '".$today."', '".$totime."', '".$row_th['ip_address']."', 'Pending')"; $r_insert_header=mysql_query($q_insert_header); $q_last_order_no="select * from order_header order by `order_id` DESC limit 1"; $r_last_order_no=mysql_query($q_last_order_no); $row_last_order_no=mysql_fetch_array($r_last_order_no); $o_no=$_SESSION['o_no']=$row_last_order_no['order_id']; $q_temptable="select * from $temptable"; $r_temptable=mysql_query($q_temptable); $ln=0; while($row_temptable=mysql_fetch_array($r_temptable, MYSQL_BOTH)) { $ln++; $q_od2="insert into `order_details` ( `order_id`, `line_no`, `customer_login_id`, `catalog_id`, `product_id`, `quantity`, `per_product_weight`, `total_product_weight`, `rate`, `price`) values( '".$o_no."', '".$ln."', '".$row_th['customer_login_id']."', '".$row_temptable['catalog_id']."', '".$row_temptable['product_id']."', '".$row_temptable['quantity']."', '".$row_temptable['per_product_weight']."', '".$row_temptable['total_product_weight']."', '".$row_temptable['rate']."', '".$row_temptable['price']."')"; $r_od2=mysql_query($q_od2); if(!$r_od2) { echo mysql_error(); } } $q_cc_info="insert into order_cc_info ( cc_info_id, order_id, cc_type, cc_number, cc_validate) values( NULL, '".$o_no."', '".$_SESSION['card_type']."', '".$_SESSION['card_number']."', '".$_SESSION['card_validity']."')"; $r_cc_info=mysql_query($q_cc_info); $_SESSION['transaction']="success"; ?> <script language="JavaScript" type="text/javascript"> window.location='../index.php?page=checkout_completed'; </script> <? $q_drop="drop table $temptable, $header_custom"; $r_drop=mysql_query($q_drop); } else { echo "duplicated transaction"; } ?>