if(isset($_POST['submit']))
{
if ($_REQUEST["form_action"] == "Update") {
$category=trim(addslashes($_REQUEST['invoice']));
$id=$_REQUEST['id'];
$Query="UPDATE `tbl_confirmorder` SET `type`='" .$category. "' WHERE `orid`='".$_REQUEST['id']."'";
$DB->query($Query);
$flag="sucess";
//header("location:order_details.php?id=".$id);
header("location:view_order.php");
}
}
?>
if(isset($_POST['submit1']))
{
if ($_REQUEST["form_action"] == "Update") {
$id=$_REQUEST['id'];
echo $status=trim(addslashes($_REQUEST['status']));
if($status=="")
{
date_default_timezone_set('Asia/Kolkata');
//$date_ss = date('Y-m-d H:i:s ', time());
$Query="UPDATE `tbl_confirmorder` SET `orderstatus`='0' WHERE `orid`='".$_REQUEST['id']."'";
$DB->query($Query);
$ids=$_REQUEST['ids'];
header("location:view_order.php?ids=".$ids);
}
if($status=="Confirmed")
{
date_default_timezone_set('Asia/Kolkata');
$date_ss = date('Y-m-d H:i:s ', time());
$Query="UPDATE `tbl_confirmorder` SET `deliverydate`='" .$date_ss. "',`orderstatus`='1' WHERE `orid`='".$_REQUEST['id']."'";
$DB->query($Query);
$ids=$_REQUEST['ids'];
header("location:view_order.php?ids=".$ids);
}
if($status=="Dispatched")
{
$date_ss = date('Y-m-d H:i:s ', time());
$courier_no=trim(addslashes($_REQUEST['courier_no']));
$courier_status=trim(addslashes($_REQUEST['courier_status']));
$Query="UPDATE `tbl_confirmorder` SET `deliverytime`='" .$date_ss. "',`couriername`='" .$courier_status. "',`courier_no`='" .$courier_no. "' ,`orderstatus`='2' WHERE `orid`='".$_REQUEST['id']."'";
$DB->query($Query);
$ids=$_REQUEST['ids'];
header("location:view_order.php?ids=".$ids);
}
if($status=="Delivered")
{
$date_ss = date('Y-m-d H:i:s ', time());
$courier_no=trim(addslashes($_REQUEST['courier_no']));
$courier_status=trim(addslashes($_REQUEST['courier_status']));
$Query="UPDATE `tbl_confirmorder` SET `delivery_time1`='" .$date_ss. "',`order_afterdate_time`='" .$date_ss. "',`orderstatus`='3',`couriername`='" .$courier_status. "',`courier_no`='" .$courier_no. "' WHERE `orid`='".$_REQUEST['id']."'";
$DB->query($Query);
$ids=$_REQUEST['ids'];
header("location:view_order.php?ids=".$ids);
}
if($status=="Refund")
{
$date_ss = date('Y-m-d H:i:s ', time());
$Query="UPDATE `tbl_confirmorder` SET `refund_time`='" .$date_ss. "',`orderstatus`='4' WHERE `orid`='".$_REQUEST['id']."'";
$DB->query($Query);
$ids=$_REQUEST['ids'];
header("location:view_order.php?ids=".$ids);
}
$flag="sucess";
// header("location:order_details.php?id=".$id);
}
}
?>
Invoice No : echo $rows_order['type'];?>
From:
echo $row['name'];?>
echo nl2br($rows_order['address']);?>
echo $rows_order['city'];?>, echo $rows_order['state'];?>- echo $rows_order['pin'];?>.
Mobile: echo $row['phone'];?>
To:
ANBU CLINIC
No. 10 CEE DEE YES Park View Aprtments,
Velachery Main Road,Velachery,
Chennai Tamilnadu-600042
Phone: 044-22551987
Order Date: echo $rows_order['order_date_time'];?>
S.No |
Product Name |
Quantity |
Unit Price |
Total Price |
$table_name="tbl_order";
$Query = "SELECT * from tbl_order where orderid='$orderid'";
$namesss=$DB->query($Query);
$nsssss=mysql_num_rows($namesss);
$manssss='0';
$si=0;
while ($rowsss = mysql_fetch_array($namesss)) {
$product_id=$rowsss['productid'];
$qty=$rowsss['qty'];
$unit_pr=$rowsss['price'];
$tot_price=$rowsss['totprice'];
if($contry=="India")
{
$sym="Rs";
}
else
{
$sym="$";
}
$qty=$rowsss['qty'];
$Query_12 = "SELECT * from `shop_product` where product_id='$product_id' ";
$name_12=$DB->query($Query_12);
$no=mysql_num_rows($name_12);
$row_12 = mysql_fetch_array($name_12);
$vstatus=$row_12['vstatus'];
if($new_status==1)
{
if($vstatus==1)
{
$v_qty=($qty/2);
}
if($vstatus==2)
{
$v_qty=($qty/4);
}
$x = (int)$v_qty;
}
else
{
$x=0;
}
$weight=$row_12['stock_status_id'];
if($weight=='' || $weight==0)
{
$weight=100;
}
$new_qty=($weight*$qty);
$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;
$tot_weight_2 +=$new_qty;
$new_weight_2 +=($new_qty)
?>
echo $si=$si+1;?>
|
echo $row_12['name'];?>
|
if($new_status==1)
{
?>
if($x>0) { ?>
echo ($qty+$x); ?>( echo $qty;?>+ echo $x;?> Free)
}
else
{
?>
echo $qty; ?>
|
} ?>
}
else
{
?>
echo $rowsss['qty'];?> |
}
?>
echo $sym;?> echo $unit_pr;?> |
echo $sym;?> echo $tot_price;?> |
}
?>
$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'];
?>
$new_kilo_41=($tot_weight_2/1000);
$new_kilo_5 = explode('.',$new_kilo_41);
$new_kilo_6=$new_kilo_5[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+$packing_charges);
}
$courier_fees;
if($contry=="India")
{
$new_kilo_4=(($new_kilo_6+1)*$courier_fees);
}
else
{
$tot_weight_2_int=$new_weight_2;
$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;
}
}
$full_total_cm_ar=($subtotal+$new_kilo_4);
?>
Weight : |
echo $new_kilo_41;?> |
Sub Total : |
echo $sym;?> echo $Fetchnewww['amtTotal'];?> |
Shipping : |
echo $sym;?>
if($contry=="India")
{
?>
$id;
if($id == 36)
{
echo $new_kilo_4=80;
}
else
{
?>
if($id == 37)
{
echo $new_kilo_4=120;
}
else
{
?>
echo $new_kilo_4=(($new_kilo_6+1)*$courier_fees);?>
}
}
}
else
{
?>
echo $new_kilo_4;?>
}
?>
|
if($courier_fees_para_1=='')
{
?>
Packing Charges : |
$idsss=$_REQUEST['id'];
?>
echo $sym;?>
if($idsss==106)
{
?>
echo $packing_charges123=1446;?>
}
else
{
echo $packing_charges123;
}
?> |
}
?>
TOTAL : ( Inclusive of GST ) |
echo $sym;?> echo ($Fetchnewww['amtTotal']+$new_kilo_4+$packing_charges123);?> |