Reports

Dealer    Patient     All
='".$date_paid1."' and DATE(order_date_time) <='".$date_paid12."' "; } if($_REQUEST['from']!="" && $_REQUEST['to']=="" ) { $cond9.="and DATE(order_date_time) ='".$date_paid1."'"; } if($_REQUEST['from']!="" && $_REQUEST['to']=="" ) { $cond9.="and DATE(order_date_time) ='".$date_paid12."'"; } if($_REQUEST['from']!="" && $_REQUEST['to']!="" ) { $cond9.="and DATE(order_date_time) >='".$date_paid1."' and DATE(order_date_time) <='".$date_paid12."' "; } if($_REQUEST['type']==1) { $cond9.="and userid IN (SELECT user_id from shop_user where new_status=0) "; } else if($_REQUEST['type']==2) { $cond9.="and userid IN (SELECT user_id from shop_user where new_status=1) "; }else{ $cond9.="and userid IN (SELECT user_id from shop_user where new_status in (0,1)) "; } $table_name="tbl_confirmorder"; $Query = "SELECT * from tbl_confirmorder where orderstatus!='4' and varstatus !='cash' and company_name='Energy Foods' and refid not like '%CO%' and orderid IN(SELECT orderid from tbl_order where totprice!=0) $cond9 order by orid asc"; $namesss=$DB->query($Query); $nsssss=mysql_num_rows($namesss); $manssss='0'; $siii=1; $paypalamount=0; $kjjj=0; while ($rowsss = mysql_fetch_array($namesss)) { $pundai_order_id=$rowsss['orid']; if($pundai_order_id>495) { $kudhi=0; } else { $kudhi=10; } $new_orid =$rowsss['orid']; $dif_name = $rowsss['dif_name']; $userid =$rowsss['userid']; $paypalamount =$rowsss['paypalamount']; $country_id =$rowsss['country_id']; $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_shift+= $weight; } /*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); $myquery = "select contry,offer from tbl_confirmorder where orderid = '$orderid'"; $exec = $DB->query($myquery); $exec_query = mysql_fetch_array($exec); if($exec_query['offer'] == 0){ $subtotal_123=$Fetchnewww['amtTotal']; }else{ $discount_percent = number_format((float)($exec_query['offer']/100), 2, '.', ''); $calc_discount = ($Fetchnewww['amtTotal'] * $discount_percent); //$subtotal_123 = number_format((float)($Fetchnewww['amtTotal'] - $calc_discount), 2, '.', ''); $subtotal_123 = round($Fetchnewww['amtTotal'] - $calc_discount); } /*shipping*/ $contry; $state; if($contry=="India") { $packing_charges=round((($subtotal_123*$kudhi)/100)); if($state=="Puducherry") { $packing_charges=0; } if($state=="Tamilnadu") { $packing_charges=0; } $new_date_mal =$rowsss['order_date_time']; $new_date_mal_1 = date("Y-m-d",strtotime($new_date_mal)); date_default_timezone_set('Asia/Kolkata'); $date_mal_1 = date('2020-09-20', time()); $curdate_mal_1 = strtotime($new_date_mal_1); $curdate_mal_2 = strtotime($date_mal_1); $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($pundai_order_id>495) { $courier_fees=$row_job_move_courier['amount']; $courier_fees_para_1=$row_job_move_courier['amount']; } else { if($curdate_mal_1<$curdate_mal_2) { $courier_fees=$row_job_move_courier['amount']; $courier_fees_para_1=$row_job_move_courier['amount']; if($state=="Puducherry") { $courier_fees=60; $courier_fees_para_1=60; } if($state=="Tamilnadu") { $courier_fees=40; $courier_fees_para_1=40; } if($state=="Andhra Pradesh") { $courier_fees=150; $courier_fees_para_1=150; } if($state=="Karnataka") { $courier_fees=150; $courier_fees_para_1=150; } if($state=="Kerala") { $courier_fees=150; $courier_fees_para_1=150; } if($state=="Telangana") { $courier_fees=150; $courier_fees_para_1=150; } } else { $courier_fees=$row_job_move_courier['amount']; $courier_fees_para_1=$row_job_move_courier['amount']; if($state=="Puducherry") { $courier_fees=60; $courier_fees_para_1=60; } if($state=="Tamilnadu") { $courier_fees=40; $courier_fees_para_1=40; } if($state=="Andhra Pradesh") { $courier_fees=100; $courier_fees_para_1=100; } if($state=="Karnataka") { $courier_fees=100; $courier_fees_para_1=100; } if($state=="Kerala") { $courier_fees=100; $courier_fees_para_1=100; } if($state=="Telangana") { $courier_fees=100; $courier_fees_para_1=100; } } } 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); $new_date_mal =$rowsss['order_date_time']; $new_date_mal_1 = date("Y-m-d",strtotime($new_date_mal)); date_default_timezone_set('Asia/Kolkata'); $date_mal_1 = date('2020-10-06', time()); $curdate_mal_1 = strtotime($new_date_mal_1); $curdate_mal_2 = strtotime($date_mal_1); if($curdate_mal_1<$curdate_mal_2) { $courier_fees=300; } else { $courier_fees=$row_job_move_courier_1['amount']; } $subtotal_123; $packing_charges123=round((($subtotal_123*$kudhi)/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; } $int_weight=($tot_weight_2_int/1000); $no_of_parcels = ceil($int_weight/3.5); $adc_charges = $no_of_parcels * 3200; $calc_ship = ceil($int_weight / 0.5) * 500; $tot_ship = $adc_charges + $calc_ship; // echo 'print here'. $tot_ship.'
'; } $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 Type Courier Company Courier Company Payment Mode Payment Mode Courier No Courier No Amount Shipping We Paid Amount Amount Amount Qty Time
              Patient  
              Dealer  
              Total