hjkhghtjhjjhjhjhjhjjhjhjjhrrtrtoirh
bnmbertsurrttrtrtrtrjhjhjjhjhhjhjhjhf'tdfg
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
Upload FileeE
HOME
<?php session_start(); $checksession = @$_SESSION['uid']; $temp_session_id = session_id(); // include_once("admin/include/config.php"); include_once('admin/include/shiprocket.php'); $sel_obj = new config(); $ship_obj= new shiprocket_config(); $order_date = date('Y-m-d H:i:s'); $date = strtotime($order_date); $delivery_d = strtotime("+5 day", $date); $delivery_date = date('Y-m-d H:i:s', $delivery_d); if(isset($_POST['code'],$_POST['transactionId'],$_POST['providerReferenceId']) and $_POST['code']=="PAYMENT_SUCCESS"){ $amount = $_POST['amount']; $status = 'success'; $txnid = $_POST['transactionId']; $order_Details_data = $sel_obj->all_fetch('orders',array('transction_id'=>$txnid))[0]; $order_table_id = $order_Details_data->id; $order_id = $order_Details_data->id; //order update payment is done $col_val = array('order_date'=>$order_date,'payment_status'=>1); $where = array( 'payment_status'=>0,'transction_id'=>$txnid); $sel_obj->update("orders",$col_val,$where); //order itmes status change $update = array('status'=>0,); $where_condition = array('order_id'=>$order_table_id); $sel_obj->update("temp_cart",$update,$where_condition); //invoice updating $update_invoice = array('invoice'=>$invoice,); $invoice_where_condition = array('payment_status'=>1, 'order_id'=>$order_id); $sel_obj->update("orders",$update_invoice,$invoice_where_condition); //less quantity $f_quantity_array = $sel_obj->all_fetch('temp_cart',array('order_id'=>$order_table_id)); if(is_array($f_quantity_array) || is_object($f_quantity_array)){ foreach($f_quantity_array as $fqa){ $f_product_quntity = $sel_obj->fs('product',array('p_id' =>$fqa->p_id)); if(is_array($f_product_quntity)|| is_object($f_product_quntity)){ $total_left_quantity = ($f_product_quntity->quan_available - $fqa->quantity); $sel_obj->update('product',array('quan_available' => $total_left_quantity ),array('p_id' => $fqa->p_id)); } } } //fetch Order details $fsod = $sel_obj->all_fetch('orders',array('id'=>$order_table_id)); foreach ($fsod as $fsod_2) { } // print_r($fsod_2); $user_id = $fsod_2->user_id; if(!isset($checksession) and empty($checksession)){ if(!empty($user_id)){ $_SESSION['uid'] = $user_id; } } $ct_u_name = $fsod_2->f_name." ".$fsod_2->l_name; $u_c_n = $fsod_2->p_no; $u_email = $fsod_2->e_address; $ct_t = $txnid; $ct_oid = $order_id; $ct_ta = $amount; $total_amount = $fsod_2->t_price; $u_p_pay_type = "Online Payment"; $shipping_price = $fsod_2->shipping_price; $packaging_price = $fsod_2->packaging_price; $offer_discount = $fsod_2->offer_discount; $discount_amount = $fsod_2->discount_amount; $date = strtotime($fsod_2->created_at); $delivery_d = strtotime("+5 day", $date); $delivery_date = date('Y-m-d H:i:s', $delivery_d); $expected_delivery = date('d M Y', strtotime($delivery_date)); /*------ Whatsapp Message ------*/ $campaign = "order_1_sms"; $phone = "+91".$u_c_n; $userName = $ct_u_name; $msessageArr = array($ct_u_name,$order_id,$total_amount); $file = ''; // $sel_obj->sendWhatsappMessage($phone,$userName,$campaign,$file,$msessageArr); /*------ SMS On Mobile No. -----*/ // $sel_obj->order_confirmation($u_c_n,$ct_u_name,$order_id); /*----------------------------------*/ /*--------- Delievry Info --------*/ $str_address1 = $fsod_2->str_address1; $town = $fsod_2->town; $state = $fsod_2->state; $pincode = $fsod_2->pincode; $t_price = $ct_ta; $customer_name = $fsod_2->f_name." ".$fsod_2->l_name; /*================ Product Table ===============*/ $product_table = ' <table class="table" border="1" cellspacing="0" style="margin: 1px; border-color:#ffffff; width:100%;"> <thead> <tr> <th>Image</th> <th>Product Name</th> <th>Qty</th> <th>Price</th> </tr> </thead> <tbody> '; foreach ($f_quantity_array as $best_product) { /*-------- Order-data-------------*/ $totalamount=$best_product->quantity*$best_product->d_price; $sub_total+=$totalamount; $gst = $best_product->gst; $finalgst+=$sel_obj->get_percentage($totalamount,$gst); /*---------- Product Info -------------*/ $where_product = "p_id=" . $best_product->p_id; $product_query = $sel_obj->display_rcd("product", $where_product); foreach($product_query as $product_data) { $product_table .= ' <tr> <td><img class="img-thumbnail" width="75" height="50" src="https://a4paper.in/admin/upload/'.$product_data['p_img'].'"></td> <td style="padding:10px"><span>'.$product_data['p_name'].'</span></td> <td style="padding:10px"><span>'.$best_product->quantity.'</span></td> <td style="padding:10px"><span> ₹'.$product_data['d_price'].'</span></td> </tr> '; } } $product_table .= '</tbody></table>'; $product_table .= ' <table border="1" cellspacing="0" style="border-color:#ffffff; float:right;"><tbody> <tr> <td style="text-align: right; padding:10px; line-height: 10px;"> <p>Subtotal : <b>₹'.$sub_total.'</b></p> <p>GST : <b>₹'.$finalgst.'</b></p> <p>Shipping Charge: : <b>₹'.$shipping_price.'</b></p> <p>Packaging Charge: : <b>₹'.$packaging_price.'</b></p> <p>Offer Discount : <b>₹'.$offer_discount.'</b></p> <p>Coupon Discount : <b>₹'.$discount_amount.'</b></p> <p>Grand Total: : <b>₹'.$ct_ta.'</b></p> </td> </tr> </tbody></table> '; // echo $product_table; exit(); /*=============== Shiprocket API =========================*/ // $send_ship = $ship_obj->send_to_shiprocket($order_id); /*========================================================*/ //send mail // $sel_obj->order_confirmation($u_c_n,$ct_u_name,$order_id); include_once('order_mail_to_user.php'); include_once('order_mail_to_admin.php'); session_regenerate_id(); ?> <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>Payment Successful</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> </head> <script type = "text/javascript"> window.onload = function () { document.onkeydown = function (e) { return (e.which || e.keyCode) != 116; }; } </script> <div class="container thanks"> <div class="row"> <div class="col-md-6 col-md-offset-3" style="margin-top: 10%; border: 2px solid #e0dbdb;border-radius: 10px;"> <h3 class="text-center">Your Payment is Successfull !</h3> <center> <img src="payment-success.gif" class="img-responsive" style="height: 131px;"> </center> <center><p>₹ <?php echo $amount ;?></p> <p>Your order status is <?php echo $status ;?></p> <p>Order id <?php echo $order_id ;?></p> <p>Transaction id <?php echo $txnid ;?></p> <p class="text-center"><b>Thank you for your payment.An automated <br>payment receipt will be sent to your register email</b></p> <p class="text-center"> <a href="index.php" class="btn btn-success">Continue Shopping</a></p> <center> </div> </div> </div> </body> </html> <?php }else{ ?> <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>Payment Error</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="row"> <div class="col-sm-4 col-sm-offset-4"> <div style="padding:5% 0px;margin-top: 25%;border: 2px solid #e0dbdb;border-radius: 10px;"> <p style='text-align:center;'> <img src="payment_failure.png" style="width: 25%;"></p> <h1 style='text-align:center;'>Payment Error</h1> <h3 style='text-align:center;'>Please Payment Again</h3> <p style='text-align:center;'><a href="cart.php" class="btn btn-danger">Payment Try Again</a></p> </div> </div> </div> </div> </body> <?php } ?>