'2022-10-27' order by orid desc"; // $Query = "SELECT * from tbl_confirmorder where orderstatus='25' and varstatus='Cash' and orderid IN(SELECT orderid from tbl_order) order by orid desc"; $namesss=$DB->query($Query); $nsssss=mysql_num_rows($namesss); $manssss='0'; $kjjj=0; while ($rowsss = mysql_fetch_array($namesss)) { $new_orid =$rowsss['orid']; $userid =$rowsss['userid']; $varstatus =$rowsss['varstatus']; $varstatus =$rowsss['varstatus']; $orderid=$rowsss['orderid']; $contry=$rowsss['contry']; $state=$rowsss['state']; $order_tc_id =$rowsss['order_tc_id']; $orderstatus =$rowsss['orderstatus']; if($contry=="India") { $sss="Rs"; } else { $sss="$"; } $Query = "SELECT * from `shop_user` where user_id='$userid' "; $name=$DB->query($Query); $no=mysql_num_rows($name); $row = mysql_fetch_array($name); $new_status=$row['new_status']; /*weight calculation*/ $Query_new = "SELECT * from tbl_order where orderid='$orderid'"; $namesss_new=$DB->query($Query_new); $nsssss_new=mysql_num_rows($namesss_new); $x=0; $qty_new=0; $qty_new1=0; $new_qty_1_1=0; while ($rowsss_new = mysql_fetch_array($namesss_new)) { $product_id_new=$rowsss_new['productid']; $qty_new=$rowsss_new['qty']; $unit_pr_new=$rowsss_new['price']; $tot_price_new=$rowsss_new['totprice']; $Query_12_new = "SELECT * from `shop_product` where product_id='$product_id_new' "; $name_12_new=$DB->query($Query_12_new); $no_new=mysql_num_rows($name_12_new); $row_12_new = mysql_fetch_array($name_12_new); $vstatus=$row_12_new['vstatus']; if($new_status==1) { if($vstatus==1) { $v_qty=($qty_new/2); } if($vstatus==7) { $v_qty=($qty_new/2); } if($vstatus==6) { $v_qty=($qty_new/2); } if($vstatus==2) { $v_qty=($qty_new/4); } $x = (int)$v_qty; } else { $x=0; } $weight=$row_12_new['stock_status_id']; if($weight=='' || $weight==0) { $weight=100; } $qty_new_1=($qty_new+$x); $new_qty=($weight*$qty_new_1); $new_qty_1_1 +=$new_qty; } /*weight calculation*/ $new_qty_1_1; $new_kilo_41=($new_qty_1_1/1000); $new_kilo_5 = explode('.',$new_kilo_41); $new_kilo_6=($new_kilo_5[0]+1); $Query_oo = "SELECT * from `tbl_order` where orderid='$orderid' "; $name_oo=$DB->query($Query_oo); $no_oo=mysql_num_rows($name_oo); $objqrynewsubee = "SELECT SUM(totprice) AS amtTotal FROM tbl_order where orderid='$orderid'"; $name_12_123=$DB->query($objqrynewsubee); $Fetchnewww = mysql_fetch_array($name_12_123); $subtotal_123=$Fetchnewww['amtTotal']; /*shipping*/ $contry; $state; if($contry=="India") { $packing_charges=round((($subtotal_123*10)/100)); if($state=="Puducherry") { $packing_charges=0; } if($state=="Tamilnadu") { $packing_charges=0; } $Query_job_move_courier= "SELECT * from tbl_courier_charges where state='$state' "; $name_12=$DB->query($Query_job_move_courier); $row_job_move_courier= mysql_fetch_array($name_12); $courier_fees=$row_job_move_courier['amount']; $courier_fees_para_1=$row_job_move_courier['amount']; if($courier_fees=='') { $Query_job_move_courier_1= "SELECT * from tbl_courier_charges where state='Others' "; $name_12_w=$DB->query($Query_job_move_courier_1); $row_job_move_courier_1= mysql_fetch_array($name_12_w); $courier_fees=$row_job_move_courier_1['amount']; $subtotal_123; $packing_charges123=round((($subtotal_123*10)/100)); $packing_charges=round((($subtotal*10)/100)); $courier_fees=($courier_fees); } } else { $tot_weight_2_int=$new_qty_1_1; $Query_q= "SELECT * from tbl_courier_charges_country where state='$contry' "; $Query_job_move_courier_country=$DB->query($Query_q); $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_jo= "SELECT * from tbl_courier_charges_country where state='Others' "; $Query_job_move_courier_country=$DB->query($Query_jo); $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; } } $new_courier=(($courier_fees*$new_kilo_6)+$packing_charges); /*shipping*/ if($no_oo>0) { if($orderstatus==0) { $par_status="Placed"; } if($orderstatus==1) { $par_status="Confirmed"; } if($orderstatus==2) { $par_status="Dispatched"; } if($orderstatus==3) { $par_status="Delivered"; } if($orderstatus==4) { $par_status="Refund"; } if($orderstatus==5) { $par_status="Packed"; } //sprintf("%02d", $to_hour); ?>
S.No. Invoice No Date and Time Name State Mobile No Company Courier Company Courier Company Courier No Courier No Amount Amount Amount Amount Qty Time View
Own Delivery Confirmed by Call View