//Calculate response hash to verify
$keyString = $key.'|'.$txnid.'|'.$amount1.'|'.$productInfo.'|'.$firstname.'|'.$email.'|||||'.$udf5.'|||||';
$keyArray = explode("|",$keyString);
$reverseKeyArray = array_reverse($keyArray);
$reverseKeyString = implode("|",$reverseKeyArray);
$CalcHashString = strtolower(hash('sha512', $salt.'|'.$status.'|'.$reverseKeyString));
if ($status == 'success' && $resphash == $CalcHashString) {
$msg = '
Transaction Successful and Hash Verified...
';
//Do success order processing here...
}
else {
//tampered or failed
$msg = 'Payment failed for Hasn not verified...
';
}
}
?>
0)
{
//$Updatecart = "UPDATE shop_user SET `email`='$email',`phone`='$phone',`state`='$state',`country`='$country',`postcode`='$pin',`city`='$city',`address`='$address',`name`='$name' WHERE `user_id`='$sessionid_free' ";
}
$objcorderid = mysql_query("SELECT * from tbl_confirmorder ");
$nosnewcid=mysql_num_rows($objcorderid);
$Fetcorderid = mysql_fetch_array($objcorderid);
if($nosnewcid=='0')
{
$maxcorderid='1';
$maxcorderid1=HC.$maxcorderid;
}
else
{
$objmaxcorder = mysql_query("SELECT max(orid)+1 as newordid from tbl_confirmorder ");
$Fetmaxcorder = mysql_fetch_array($objmaxcorder);
$maxcorderid=$Fetmaxcorder['newordid'];
$maxcorderid1=HC.$maxcorderid;
}
if($numrows>0)
{
$date = date_default_timezone_set('Asia/Kolkata');
$dt2=date('Y-m-d H:i:s' );
//$Insert_memberord = "INSERT INTO tbl_confirmorder (`userid`,`intsessionid`,`orderid`,`refid`,`varstatus`,`order_tc_id`,`orderstatus`,`res_id`,`type`,`order_date_time`) VALUES ('$sessionid_free','$browsessionid','$maxcorderid','$maxcorderid1','0','0','0','0','','$dt2')";
$inexeord=mysql_query($Insert_memberord);
$attachmentfileid = mysql_insert_id();
//$sessionid_free= addslashes($_POST['sessionid_free']);
//$Updatecart = mysql_query("UPDATE tbl_confirmorder SET `orderid`='$attachmentfileid' where orid='$attachmentfileid' ");
$objRe = mysql_query("SELECT * from shop_cart where session_id='19");
$numrows_ma = mysql_num_rows($objRe);
while($Fetchneword = mysql_fetch_array($objRe))
{
$del_country=$Fetchneword['del_country'];
$del_city=$Fetchneword['del_city'];
$del_state=$Fetchneword['del_state'];
$del_address=$Fetchneword['del_address'];
$del_inp=$Fetchneword['del_inp'];
"UPDATE tbl_confirmorder SET `contry`='$del_country',`city`='$del_city',`state`='$del_state',`address`='$del_address',`pin`='$del_inp' where orid='$attachmentfileid' ";
//$Updatecart = mysql_query("UPDATE tbl_confirmorder SET `contry`='$del_country',`city`='$del_city',`state`='$del_state',`address`='$del_address',`pin`='$del_inp' where orid='$attachmentfileid' ");
$productid= $Fetchneword['productid'];
$qty= $Fetchneword['qty'];
$price= $Fetchneword['price'];
$totprice= $Fetchneword['totprice'];
$date = date_default_timezone_set('Asia/Kolkata');
$dt2=date('Y-m-d H:i:s' );
//$Insert_member = "INSERT INTO tbl_order(`user_id`,`res_id`,`productid`,`qty`, `price`,`totprice`,`orderdate`,`type`,`session_id`,`ordertime`,`orderid`) VALUES ('$sessionid_free','0','$productid','$qty' ,'$price' ,'$totprice','$dt2','','$browsessionid','','$attachmentfileid')";
$inexe=mysql_query($Insert_member);
}
//$Delete_Question = "DELETE FROM shop_cart WHERE `session_id`='$browsessionid'";
//$Result_Question = mysql_query($Delete_Question);
"SELECT * from shop_user where user_id='$sessionid_free_123' ";
$objcorderid_n_user = mysql_query("SELECT * from shop_user where user_id='$sessionid_free_123' ");
$nosnewcid_n_user=mysql_num_rows($objcorderid_n_user);
$Fetcorderid_n_user = mysql_fetch_array($objcorderid_n_user);
$new_status=$Fetcorderid_n_user['new_status'];
$new_user_name=$Fetcorderid_n_user['email'];
$objcorderid = mysql_query("SELECT * from tbl_confirmorder where orid='19' ");
$nosnewcid=mysql_num_rows($objcorderid);
$Fetcorderid = mysql_fetch_array($objcorderid);
$new_order_id=$Fetcorderid['orderid'];
$new_order_id=$Fetcorderid['orderid'];
$userid_new_userid=$Fetcorderid['userid'];
$orderdate=$Fetcorderid['order_date_time'];
$order_id=$Fetcorderid['refid'];
$contry=$Fetcorderid['contry'];
if($contry=="India")
{
$sym="Rs";
}
else
{
$sym="$";
}
$city=$Fetchneword['city'];
$state=$Fetcorderid['state'];
$address=$Fetchneword['address'];
$pin=$Fetchneword['pin'];
$Msg1.='
New Order Recived-Order Details.
Order Details |
Order ID:'.$new_order_id.'
Date Added:'.$orderdate.'
Payment Method: Onlinepayment
|
Name: '.$Fetcorderid_n_user['name'].'
Phone: '.$Fetcorderid_n_user['phone'].'
Email: '.$Fetcorderid_n_user['email'].'
Address: '.$Fetcorderid_n_user['address'].'
|
Shipping Address:
Address: '.$Fetcorderid['address'].'
City: '.$Fetcorderid['city'].'
State: '.$Fetcorderid['state'].'
Country: '.$Fetcorderid['contry'].'
Pin: '.$Fetcorderid['pin'].'
|
Product |
Quantity |
Price |
Total |
';?>
$new_price_1=0;
$order="SELECT * from tbl_order where orderid='$new_order_id'";
$resorder=mysql_query($order);
$rows=mysql_num_rows($resorder);
while($fetchorder=mysql_fetch_array($resorder))
{
$productid=$fetchorder['productid'];
$price1=$fetchorder['price'];
$price2=$fetchorder['totprice'];
$qty=$fetchorder['qty'];
$new_status;
"SELECT * from shop_product where product_id='$productid' ";
$objproduct = mysql_query("SELECT * from shop_product where product_id='$productid' ");
$Fetproduct = mysql_fetch_array($objproduct);
$new_price=$fetchorder['price'];
$weight=$Fetproduct['stock_status_id'];
$vstatus=$fetchorder['vstatus'];
if($weight=='' || $weight==0)
{
$weight=100;
}
$new_weignt_1=($qty*$weight);
$new_weight_2 +=$new_weignt_1;
if($new_status==1)
{
if($vstatus==1)
{
$v_qty=($qty/2);
}
if($vstatus==2)
{
$v_qty=($qty/4);
}
$x = (int)$v_qty;
}
else
{
$x=0;
}
$new_qty=($weight*($qty+$x));
$new_kilo=($new_qty/1000);
$new_kilo_1 = explode('.',$new_kilo);
$new_kilo_2=$new_kilo_1[0]; // Before the Decimal point
$new_kilo_3 +=$new_kilo_2;
$subtotal_cm += $new_price;
$tot_weight_2 +=$new_qty;
?>
'.$Fetproduct['name'].' |
';?>
if($x>0) {
?>
}
else
{
?>
}
?>
| '.$sym.' '.$price1.' |
'.$sym.' '.$price2.' |
';
}
?>
$objqrynewsubee = "SELECT SUM(totprice) AS amtTotal FROM tbl_order where orderid='$new_order_id'";
$objResultnewsubee = mysql_query($objqrynewsubee);
$Fetchnewww = mysql_fetch_array($objResultnewsubee);
$subtotal=$Fetchnewww['amtTotal'];
$dis_amount=0;
$full_total_cm_ar=($subtotal-$dis_amount);
$new_kilo_444=($tot_weight_2/1000);
$new_kilo_5 = explode('.',$new_kilo_444);
$new_kilo_6=$new_kilo_5[0];
$new_state;
$Query_job_move_courier= mysql_query("SELECT * from tbl_courier_charges where state='$state' ");
$row_job_move_courier= mysql_fetch_array($Query_job_move_courier);
$courier_fees=$row_job_move_courier['amount'];
if($courier_fees=='')
{
$Query_job_move_courier_1= mysql_query("SELECT * from tbl_courier_charges where state='Others' ");
$row_job_move_courier_1= mysql_fetch_array($Query_job_move_courier_1);
$courier_fees=$row_job_move_courier_1['amount'];
$packing_charges=round((($subtotal*10)/100));
$courier_fees=($courier_fees+$packing_charges);
}
$courier_fees;
if($contry=="India")
{
$new_kilo_4=(($new_kilo_6+1)*$courier_fees);
}
else
{
$tot_weight_2_int=$new_weight_2;
$Query_job_move_courier_country= mysql_query("SELECT * from tbl_courier_charges_country where state='$contry' ");
$row_job_move_courier_country= mysql_fetch_array($Query_job_move_courier_country);
$num_max_ship_int=mysql_num_rows($Query_job_move_courier_country);
if($num_max_ship_int>0)
{
$courier_fees_country=$row_job_move_courier_country['amount'];
$courier_fees_country_extra=$row_job_move_courier_country['additional_amount'];
}
else
{
$Query_job_move_courier_country= mysql_query("SELECT * from tbl_courier_charges_country where state='Others' ");
$row_job_move_courier_country= mysql_fetch_array($Query_job_move_courier_country);
$courier_fees_country=$row_job_move_courier_country['amount'];
$courier_fees_country_extra=$row_job_move_courier_country['additional_amount'];
}
if($tot_weight_2_int<=500)
{
$courier_fees_country_1=$courier_fees_country;
$new_kilo_4=$courier_fees_country_1;
}
else
{
$tot_weight_2_int_1=($tot_weight_2_int-500);
$tot_weight_2_int_1_2=($tot_weight_2_int_1/250);
$new_kilo_5_int = explode('.',$tot_weight_2_int_1_2);
$new_kilo_6_int=$new_kilo_5_int[0];
$new_kilo_6_int_7=($new_kilo_6_int+1);
$new_kilo_6_int_7_8=($courier_fees_country_extra*$new_kilo_6_int_7);
$courier_fees_country_1=($courier_fees_country+$new_kilo_6_int_7_8);
$new_kilo_4=$courier_fees_country_1;
}
}
$full_total_cm_ar=($subtotal+$new_kilo_4);
$Msg1.='
Sub Total: |
'.$sym.' '.$subtotal.' |
Shipping: |
'.$sym.' '.$new_kilo_4.' |
Total:( Inclusive of GST ) |
'.$sym.' '.$full_total_cm_ar.' |
';
echo $Msg1;
if($numrows_ma>0)
{
$job_name14357="New Order Received";
$Subjectnew = "$job_name14357-$order_id";
$useremail="drganbuganapathi@gmail.com";
$headers1 = "From: dranbuganapathi.com\r\n"."Content-Type: text/html; charset=iso-8859-1\r\n";
//$headers = "From: dranbuganapathi@gmail.com\r\n"."Content-Type: text/html; charset=iso-8859-1\r\n";
//@mail($useremail,$Subjectnew,$Msg1,$headers1);
//@mail($new_user_name,$Subjectnew,$Msg1,$headers1);
}
}
//$Recart = mysql_query($Updatecart);
exit();
?>
Merchant Check Out Page
Please do not refresh this page...