]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
admin
/
Upload FileeE
HOME
<?php include("header.php"); $sel_obj= new config(); include_once('include/ExpressBess.php'); $ship_EXpress_obj = new ExpressBess_config(); /*------- Social Media -------*/ $social = $sel_obj->social(); $facebook = $social['facebook']; $twitter = $social['twitter']; $instagram = $social['instagram']; $linkedin = $social['linkedin']; /*-------------------------*/ if(isset($_POST['submit'])) { $get_order = $ship_EXpress_obj->get_order_details_by_id($_POST['order_id']); if ($get_order['shiprocketODR_id']!='' && $_POST['status']=='Canceled') { $ship_EXpress_obj->cancel_order_Express($get_order['shiprocketODR_id']); } /*------------------------------*/ $status=$sel_obj->validation($_POST['status']); $desc=$sel_obj->validation($_POST['desc']); $order_id=$sel_obj->validation($_POST['order_id']); $uemail=$sel_obj->validation($_POST['email']); $number=$sel_obj->validation($_POST['number']); $customer_name=$sel_obj->validation($_POST['customer_name']); // $invoice=$sel_obj->validation($_POST['invoice']); $transition=$sel_obj->validation($_POST['transition']); $order_date=$sel_obj->validation($_POST['order_date']); $str_address1=$sel_obj->validation($_POST['str_address1']); $town=$sel_obj->validation($_POST['town']); $state=$sel_obj->validation($_POST['state']); $pincode=$sel_obj->validation($_POST['pincode']); $t_price=$sel_obj->validation($_POST['t_price']); /*--------- Expected Date --------*/ $date_now = time(); //current timestamp $date = strtotime($order_date); $delivery_d = strtotime("+5 day", $date); $delivery_date = date('Y-m-d H:i:s', $delivery_d); if ($date_now > $delivery_d) { $deli_d = strtotime("+5 day", $date_now); $expected_delivery = date('d M Y', $deli_d); }else{ $expected_delivery = date('d M Y', strtotime($delivery_date)); } $udate_date=date('Y-m-d H:i:s'); $update_status_date = []; $update = array( 'order_status' => $status, ); if ($status == "Delivered") { $update_status_date = array( 'delivered_date' => $udate_date, ); } if ($status == "Refunded") { $update_status_date = array( 'refunded_date' => $udate_date, ); } if ($status == "Shipped") { $update_status_date = array( 'shipped_date' => $udate_date, ); $ship_EXpress_obj->ExpressOrderPunch($_POST['order_id']); } if ($status == "Out For Delivery") { $update_status_date = array( 'out_for_delivery_date' => $udate_date, ); } if ($status == "Canceled") { $update_status_date = array( 'cancel_date' => $udate_date ); } $update_date = array( 'order_status_date' => $udate_date, ); $where_condition=array( 'order_id'=> $order_id ); if (!empty($update_status_date)) { $update_status_date=$sel_obj->update("orders",$update_status_date,$where_condition); } $update_date=$sel_obj->update("orders",$update_date,$where_condition); $updatequery=$sel_obj->update("orders",$update,$where_condition); if($updatequery==true) { /*--------- Redirect on Pending Status --------*/ if ($status == "Pending") { echo "<script>window.location.href='".$_SERVER['HTTP_REFERER']."'; exit();</script>"; exit(); } /*---------------------------------------------*/ // $sel_obj->order_status_sms_api($number,$customer_name,$order_id,$status); $message .=' <h3>Dear '.$customer_name.'</h3>'; $message .='<h3>Your order has been '.$status.' </h3>'; // $message .='<h3>Your Invoice No is : '.$invoice.' </h3>'; $message .='<h3>Order ID : '.$order_id.' </h3>'; $message .='<h3>Order placed on : '.date("d M Y",strtotime($order_date)).' </h3>'; $send_to_msg = "Your order will be sent to"; $msg_color = "color:#009900"; if ($status == "Out For Delivery") { $message_status .='Expected delivery : Today 9AM - 7PM '; }elseif ($status == "Delivered") { $message_status .='Delivered on : '.$udate_date.' '; $send_to_msg = "Your order has been delivered to"; }elseif ($status == "Canceled") { $status = "Cancelled"; $message_status .='cancelled on : '.$udate_date.' '; $send_to_msg = "Your delivery address"; $msg_color = "color:#f51414"; }elseif ($status == "Refunded") { $message_status .='Refunded on : '.$udate_date.' '; $send_to_msg = "Your delivery address"; $msg_color = "color:#f51414"; }else{ $new_orderData = $ship_EXpress_obj->get_order_details_by_id($_POST['order_id']); $message_status .='<span>Arriving:</span> <br> Expected delivery on : '.$expected_delivery.' '; $message_status .='<p style="margin-bottom:0px;margin-top:0"><a href="https://shipment.xpressbees.com/shipping/tracking/'.$new_orderData['shiprocketODR_id'].'" style="background-color:rgb(41,121,251);color:#fff;padding:0px;border:0px;font-size:17px;display:inline-block;margin-top:0px;border-radius:2px;text-decoration:none;width:160px;text-align:center;line-height:32px;line-height:32px" target="_blank">Track Your Order</a></p><br><br>'; } $message_total = ' <table style="width: 600px;margin: auto; display: block;border: 1px solid #d7d7d7;"> <tbody> <tr> <td class=""> <table id=""> <tbody> <tr> <td> <table style="width:100%"> <tbody> <tr> <td style="display: flex; justify-content: space-between;" > <div class="florj" style="width: 30%; margin-right:20px;"> <img src="https://crystalmiracle.co.in/admin/logo.png" alt="" style="width: 100%;"> </div> <div style="padding-top:4px; width: 70%; text-align: right;"> <a href="https://crystalmiracle.co.in/my_account.php" style="text-decoration: none; color: #12b2ff;">Your Order</a><span> | </span> <a href="https://crystalmiracle.co.in/my_account.php" style="text-decoration: none; color: #12b2ff;">Your Account</a><span> | </span> <a href="https://crystalmiracle.co.in/" style="text-decoration: none; color: #12b2ff;">crystalmiracle.co.in</a> <div style="width:100%; border-bottom:1px solid gray;"></div> </div> </td> </tr> <td style="float: right; margin-top: -20px; line-height:4px;"> <h2> Order '.$status.' </h2> <p>Order ID : #<a href="https://crystalmiracle.co.in/my_account.php" style="text-decoration: none; color: #12b2ff;">'.$order_id.' </a></p> </td> </tbody> </table> </td> </tr> <tr> <td> <table id=""> <tbody> <tr> <td> <h3 style="color: #ff9721;"> Hello '.$customer_name.', </h3> <p> Thank you for your order. Your estimated delivery date is indicated below. If you would like to view the status of your order or make any changes to it, please visit <a href="https://crystalmiracle.co.in/my_account.php" target="_blank" style="text-decoration: none; color: #12b2ff;">Your Orders</a> on crystalmiracle.co.in. </p> </td> </tr> <tr> <td> </td> </tr> </tbody> </table> </td> </tr> <tr> <td> <table style="width:100%" id=""> <tbody> <tr class="" style=" background: #e7e7e7; padding: 10px; display: block; border-top: 3px solid black;"> <td style=" width: 60%;"> <p> <b style="'.$msg_color.'"> '.$message_status.' </b> </p> <p> <span style="color: gray;">Your shipping speed: </span> <br> <b> FREE Delivery on eligible orders </b> </p> <p> <span style="color: gray;">Your delivery preference:</span> <br> <b>Dispatch item(s) as soon as they become available.</b> </p> <br> <button style=" background: #ecb450; padding: 10px; border-radius: 12px;font-size: 15px; margin-top: -15px; border: 2px solid black;"> <a class="" href="'.BASE_URL.'track_order_details.php?m='.$number.'&o='.$order_id.'" target="_blank" style="text-decoration: none; color: black;">View or manage order</a></button> </td> <td> <p> <span style="color: gray;">'.$send_to_msg.':</span> <br><small><b> '.$customer_name.' <br> ' .$str_address1.', '.$town.'<br> '.$state.' - '.$pincode.' </b></small> </p> </td> </tr> </tbody> </table> </td> </tr> <tr> <td style="border-bottom:1px solid #ccc"> <h3 style=" margin-bottom: 2px; color: #ff9721;">Order summary</h3> </td> </tr> <tr> <td> <table id=""> <tbody> <tr> <td> <b> Order ID : #</b><a class="" target="_blank" style="text-decoration: none; color: #12b2ff;">'.$order_id.'</a> <br> <span style="color: gray;">Placed on '.$order_date.'</span> </td> </tr> </tbody> </table> </td> </tr> <tr> <td style="padding-left:2px"> <table style="width:95%" id=""> <tbody> <tr> <td class=""> <strong> Order Total: </strong> ₹'.$t_price.'</td> </tr> </tbody> </table> </td> </tr> <tr> <td> <table id=""> <tbody> <tr> <td> </td> </tr> <tr> <td> <p> To ensure your safety, the Delivery Agent will drop the package at your doorstep, ring the doorbell and then move back to maintain adequate distance while waiting for you to collect your package. </p> </td> </tr> </tbody> </table> </td> </tr> <tr> <td> <table id=""> <tbody> <tr> <td> <p> We hope to see you again soon. <br> <span class=""> <strong style="font-size: 20px;">crystalmiracle.co.in</strong> </span> </p> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table>'; $message_total; $subject = "Your order has been $status, your Order ID is #$order_id"; include_once '../php_mail/class.phpmailer.php'; $mail = new PHPMailer; $mail->Host = "smtp.hostinger.com"; $mail->Port = '587'; $mail->SMTPAuth = true; $mail->Username = 'order@crystalmiracle.co.in'; $mail->Password = 'orderFILE@&88'; $mail->SMTPSecure = 'tls'; $mail->From = "order@crystalmiracle.co.in"; $mail->FromName = "crystalmiracle"; $mail->Mailer = "smtp"; // don't change the quotes! $mail->AddAddress($uemail); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = $subject; $mail->Body = $message_total; if($mail->Send()) { echo "<script>alert('Order status changed');</script>"; echo "<script>window.location.href='".$_SERVER['HTTP_REFERER']."'</script>"; } } else { echo 0; } echo "<script>window.location.href='".$_SERVER['HTTP_REFERER']."'</script>"; } ?>