query($Query_pay_date_new); $row_12_123=mysql_fetch_array($name_pay_date_new); $name=$row_12_123['user_id']; $productid=$row_12_123['productid']; $qty=$row_12_123['qty']; $price=$row_12_123['price']; $totprice=$row_12_123['totprice']; $country=$row_12_123['del_country']; $state=$row_12_123['del_state']; $address=$row_12_123['del_address']; $pin=$row_12_123['del_inp']; $mobile=$row_12_123['d_mobile']; if (in_array($state, $professional)) { $no_note = "PROFESSIONAL COURIER"; } elseif($del_state !='Tamilnadu') { $no_note =""; }else{ $no_note=""; } $Query="INSERT INTO shop_user( `name` , `email` , `password` , `phone`, `city`, `postcode` , `country`, `dob`, `address`, `state`, `date`, `gender`, `status`, `skypeid` ) VALUES ('$name','','','$mobile','','$pin','$country','0','$address','$state','$dt2','','1','$mobile')"; $DB->query($Query); $mysql_insert_id= mysql_insert_id(); /*orderid*/ $objcorderid_new ="SELECT * FROM `tbl_confirmorder` WHERE varstatus!='Cash' and company_name='Energy Foods' and `orid` in (select orderid from tbl_order) "; $name_pay_date_123=$DB->query($objcorderid_new); $nosnewcid_new=mysql_num_rows($name_pay_date_123); $nosnewcid_new_1=$nosnewcid_new+11; $orderid_new_s=generate('2',$conn); // $orderid_new_s=HC.$nosnewcid_new_1; //$Fetcorderid_new = mysql_fetch_array($objcorderid_new); if($nosnewcid_new=='0') { $maxcorderid='1'; $maxcorderid1=HC.$maxcorderid; } else { $objmaxcorder_iyya = "SELECT max(orid)+1 as newordid from tbl_confirmorder "; //$Fetmaxcorder = mysql_fetch_array($objmaxcorder); $row_12_123=$DB->query($objmaxcorder_iyya); $Fetmaxcorder=mysql_fetch_array($row_12_123); $maxcorderid=$Fetmaxcorder['newordid']; $maxcorderid1=HC.$maxcorderid; } /*orderid*/ $Query_pay_date_new = "SELECT * from shop_cart_admin_demo_1 where v_id='$v_id_order'"; $name_pay_date_new=$DB->query($Query_pay_date_new); $row_12_123=mysql_fetch_array($name_pay_date_new); $numrows_ma = mysql_num_rows($name_pay_date_new); if($numrows_ma>0) { $date = date_default_timezone_set('Asia/Kolkata'); $dt2=date('Y-m-d H:i:s' ); if($country!="India") { $country_id=1; } else { $country_id=0; } $get_new = mysql_query("select * from tbl_job_new where id='$v_id_order'"); $new_rows=mysql_num_rows($get_new); if($new_rows > 0){ $set_new = mysql_fetch_array($get_new); $dage = $set_new['dage']; $dgender = $set_new['dgender']; }else{ $dage = NULL; $dgender =NULL; } $get_ship = "select * from tbl_job_new where id='$v_id_order'"; $set_ship = $DB->query($get_ship); $swal_ship = mysql_fetch_array($set_ship); $Insert_memberord = "INSERT INTO tbl_confirmorder (`userid`,`intsessionid`,`orderid`,`refid`,`varstatus`,`order_tc_id`,`orderstatus`,`res_id`,`type`,`order_date_time`,`dif_name`,`dif_phone`,`country_id`, `need_shipping`, `custom_charge`, `dage`, `dgender`, `no_note`) VALUES ('$mysql_insert_id','12','$maxcorderid','$orderid_new_s','$courier_status','0','0','0','','$dt2','name','phone','$country_id', '$swal_ship[need_shipping]', '$swal_ship[custom_charge]', '$dage', '$dgender', '$no_note')"; $DB->query($Insert_memberord); $attachmentfileid= mysql_insert_id(); $update_tbl_job = "update tbl_job_new set job_status=1, refid='$orderid_new_s' where `id`='$v_id_order'"; /*new_quert*/ mysql_query($update_tbl_job); $Updatecart = "UPDATE tbl_confirmorder SET `orderid`='$attachmentfileid' where orid='$attachmentfileid' "; $DB->query($Updatecart); /*new_query*/ $objRe_ewq = "SELECT * from shop_cart_admin_demo_1 where v_id='$v_id_order'"; $name_pay_date_new_para=$DB->query($objRe_ewq); $numrows_ma = mysql_num_rows($name_pay_date_new_para); while($Fetchneword = mysql_fetch_array($name_pay_date_new_para)) { $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']; $dif_name=$Fetchneword['dif_name']; $dif_phone=$Fetchneword['dif_phone']; "UPDATE tbl_confirmorder SET `contry`='$del_country',`city`='$del_city',`state`='$del_state',`address`='$del_address',`pin`='$del_inp' where orid='$attachmentfileid' "; $Updatecart = "UPDATE tbl_confirmorder SET `contry`='$del_country',`city`='$del_city',`varstatus`='$courier_status',`state`='$del_state',`address`='$del_address',`pin`='$del_inp',`dif_name`='$name',`dif_phone`='$mobile' where orid='$attachmentfileid' "; $DB->query($Updatecart); $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 ('$mysql_insert_id','0','$productid','$qty' ,'$price' ,'$totprice','$dt2','','12','','$attachmentfileid')"; $DB->query($Insert_member); //$inexe=mysql_query($Insert_member); } $Delete_Question = "DELETE FROM shop_cart_admin_demo_1 WHERE `v_id`='$v_id_order'"; //$Result_Question = mysql_query($Delete_Question); //$Delete_Question_1 = "DELETE FROM tbl_job_new WHERE `id`='$v_id_order'"; //$Result_Question_1 = mysql_query($Delete_Question_1); $update = "update tbl_job_new set job_status=1, refid='$orderid_new_s' where `v_id`='$v_id_order'"; /*new_quert*/ mysql_query($update); // $inexeord=mysql_query($Insert_memberord); //$attachmentfileid = mysql_insert_id(); } $message = "Hi ".$name." Your Order ".$orderid_new_s." confirmed. Once dispatched you will get courier details by SMS. Check order status on our website. ANBUDR"; //enter Your Message $message = urlencode($message); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'http://sms.dial4sms.com/api/v2/SendSMS?SenderId=ANBUDR&Message='.$message.'&MobileNumbers='.$mobile.'&ApiKey=eYfIWFmiAMhbL6JDTfOb3kzGzQr+eimy6prshuD8qLo=&ClientId=b45d4e3d-cb26-4856-8cbf-93a02a7b9eeb', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', )); $response = curl_exec($curl); curl_close($curl); } header('Location view_order.php'); ?>
query($Query); $nsssss=mysql_num_rows($namesss); $si=0; $manssss='0'; $kjjj=0; while ($rowsss = mysql_fetch_array($namesss)) { $discount = $rowsss['discount']; $id=$rowsss['id']; $pundai_order_id=$rowsss['id']; $rowsss['qty_free']; $Query_12_new = "SELECT * from `shop_cart_admin_demo_1` where v_id='$id' "; $name_12_new=$DB->query($Query_12_new); $row_12_new = mysql_fetch_array($name_12_new); $row_12_new['qty_free']; $Query_12_new_price = "SELECT sum(totprice) as new_price from `shop_cart_admin_demo_1` where v_id='$id'"; $name_12_new_price=$DB->query($Query_12_new_price); $row_12_new_price = mysql_fetch_array($name_12_new_price); $session_id = $row_12_new['session_id']; // $new_price= ($row_12_new_price['new_price']+$row_12_new['qty_free']); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://drganbuganapathi.com/superadmin/order-admin/calc_quote_shipping_charges.php?session_id='.$session_id.'&v_id_must='.$id, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', )); $response = curl_exec($curl); $data = json_decode($response); curl_close($curl); if(isset($discount)){ $dis_price = $row_12_new_price['new_price'] * ($discount/100); }else{ $dis_price = 0; } $new_price= ($row_12_new_price['new_price'] + $data->shipping - $dis_price); ?>
S.No. Name Quoted Date Mobile No Country Amount Action Status