0){ $totprice1=0; $need_shipping = 0; $custom_charge = 0; $new_kilo_41=$weight; $new_kilo_5 = explode('.',$new_kilo_41); $new_kilo_6=$new_kilo_5[0]; $new_state; $new_state= $user_met['state']; $packing_charges=round((($subtotal*$pundai)/100)); if($new_state=="Puducherry") { $packing_charges=0; } if($new_state=="Tamilnadu") { $packing_charges=0; } $Query_job_move_courier= mysqli_query($conn, "SELECT * from tbl_courier_charges where state='$new_state'"); $row_job_move_courier= mysqli_fetch_array($Query_job_move_courier, MYSQLI_ASSOC); $courier_fees=$row_job_move_courier['amount']; if($courier_fees=='') { $Query_job_move_courier_1= mysqlI_query($conn,"SELECT * from tbl_courier_charges where state='Others' "); $row_job_move_courier_1= mysqli_fetch_array($Query_job_move_courier_1); $courier_fees=$row_job_move_courier_1['amount']; $courier_fees=($courier_fees); } $packing_charges; // include shipping if($need_shipping == 0){ if($country=="India") { $new_kilo_4=((($new_kilo_6+1)*$courier_fees)+$packing_charges); } else { $tot_weight_2_int=$tot_weight_2; $Query_job_move_courier_country= mysqli_query($conn, "SELECT * from tbl_courier_charges_country where state='$country'"); $row_job_move_courier_country= mysqli_fetch_array($Query_job_move_courier_country); $num_max_ship_int=mysqli_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_job_move_courier_country= mysqli_query($conn,"SELECT * from tbl_courier_charges_country where state='Others' "); $row_job_move_courier_country= mysqli_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; } 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); } } }elseif($need_shipping == 2){ $new_kilo_4=($custom_charge); }else{ $new_kilo_4 = 0; } }else{ $new_kilo_4 = 0; } }else{ $new_kilo_4 = 0; $need_shipping = 0; $custom_charge = 0; if($need_shipping == 0){ if($weight!=0){ $new_date = date('Y-m-d'); $get_adc = mysqli_query($conn, "select * from tbl_adc_courier_charges where '$new_date' >= date(start_date) and '$new_date'<=date(end_date)"); $set_adc = mysqli_fetch_array($get_adc, MYSQLI_ASSOC); $get_ship = mysqli_query($conn, "select * from shipping_charges where chart_id='".$set_adc['id']."'"); while($sel_ship = mysqli_fetch_array($get_ship, MYSQLI_ASSOC)){ if($weight <= $sel_ship['weight']){ $new_kilo_4 = $sel_ship['total']; break; } } }else{ $new_kilo_4 = 0; } }elseif($need_shipping == 1){ $new_kilo_4 = 0; }elseif($need_shipping == 2){ $new_kilo_4 = $custom_charge; } } $arr = array('shipping'=>$new_kilo_4, 'grand'=>($subtotal + $new_kilo_4), 'weight'=>$weight); echo json_encode($arr); ?> 0) { foreach($prod_met as $Fetitem) { $objitems = mysqli_query($conn, "SELECT * from shop_user where user_id='".$user_met['user_id']."'"); $item = mysqli_fetch_array($objitems); $new_sataus=$item['new_status']; $menuid=$Fetitem['id']; $menuid_d_s=$Fetitem['productid']; $si=$si+1; $qty=$Fetitem['qty']; $country = $Fetitem['del_country']; $pu_user_id=$_REQUEST['name']; $pu_session_id=$Fetitem['id']; $pu_productid=$Fetitem['productid']; $pu_qty=$Fetitem['qty']; $pu_price=$Fetitem['price']; $pu_totprice=$Fetitem['totprice']; date_default_timezone_set('Asia/Kolkata'); $date = date('Y-m-d H:i:s ', time()); $pu_country=$Fetitem['del_country']; $pu_state=$Fetitem['del_state']; $pu_address=$Fetitem['del_address']; $pu_pin=$Fetitem['del_inp']; $pu_city=$Fetitem['del_city']; $objmenu=mysqli_query($conn, "SELECT * from shop_product where product_id='$menuid_d_s'"); $resmenu=mysqli_fetch_array($objmenu); $menuname=$resmenu['name']; $productprice=$resmenu['price']; $productprice_int=$resmenu['points']; $totprice=($qty*$pu_price); $totprice_int=($qty*$resmenu['points']); $new_price +=$totprice_int; $country=addslashes($_REQUEST['country']); $name=addslashes($_REQUEST['name']); $state=addslashes($_REQUEST['state']); $pincode=addslashes($_REQUEST['pincode']); $mobileno=addslashes($_REQUEST['mobileno']); $address=addslashes($_REQUEST['address']); $name=addslashes($_REQUEST['name']); $vstatus=$resmenu['vstatus']; $weight=$resmenu['stock_status_id']; if($weight=='' || $weight==0) { $weight=100; } if($new_status==1) { if($vstatus==1) { $v_qty=($qty/2); } if($vstatus==6) { $v_qty=($qty/2); } if($vstatus==7) { $v_qty=($qty/2); } if($vstatus==2) { $v_qty=($qty/4); } $x = (int)$v_qty; } else { $x=0; } $x; $new_qty=($weight*($qty+$x)); $new_kilo=($new_qty/1000); $new_kilo_1 = explode('.',$new_kilo); $new_kilo_2=$new_kilo_1[0]; // Before the Decimal point $new_kilo_3 +=$new_kilo_2; $totprice1 +=$totprice; $tot_weight_2 +=$new_qty; $Query_job_move_product = mysqli_query($conn, "SELECT * from shop_product_image where product_id='$menuid_d_s' order by product_id asc "); $row_job_move_product_id = mysqli_fetch_array($Query_job_move_product); } } return number_format((float)$totprice1, 2, '.', ''); } ?>