$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'];
$Query_12_company = "SELECT * from `tbl_company` where id='$vstatus' ";
$name_12_company=$DB->query($Query_12_company);
$no_company=mysql_num_rows($name_12_company);
$row_12_company = mysql_fetch_array($name_12_company);
$new_comp_name=$row_12_company['name'];
if($new_comp_name=="Siddhayoga Pharma")
{
$new_price=(($unit_pr*100)/(100+18));
$sg=number_format((float)$new_price, 2, '.', '');
$n_g="12";
//GST Inclusive Price * GST Rate /(100 + GST Rate Percentage)
// Outputs -> 105.00
//GST Inclusive Price * GST Rate /(100 + GST Rate Percentage)
}
if($new_comp_name=="Energy Foods")
{
$n_g="18";
//$new_price=(($tot_price*18)/100);
$new_price=(($unit_pr*100)/(100+18));
$sg=number_format((float)$new_price, 2, '.', ''); // Outputs -> 105.00
}
if($new_comp_name=="Siddha Sastric")
{
$n_g="5";
//$new_price=(($tot_price*18)/100);
$new_price=(($unit_pr*100)/(100+18));
$sg=number_format((float)$new_price, 2, '.', ''); // Outputs -> 105.00
}
if($new_comp_name=="Adv. Siddhayoga Research")
{
$n_g="12";
//$new_price=(($tot_price*18)/100);
$new_price=(($unit_pr*100)/(100+18));
$sg=number_format((float)$new_price, 2, '.', ''); // Outputs -> 105.00
}
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'];?>
|
echo $row_12['product_url'];?>
|
echo $sym;?> $massss=($sg);?>
echo $sgxxx=number_format($massss, 2, '.', '');?>
|
if($new_status==1)
{
?>
if($x>0) { ?>
echo ($qty+$x); ?>( echo $qty;?>+ echo $x;?> Free)
}
else
{
?>
echo $qty; ?>
|
} ?>
}
else
{
?>
echo $rowsss['qty'];?> |
}
?>
echo $sym;?> $new_sg;?> $tot_new_price=($sg*$qty);
echo $tot_new_price=number_format($tot_new_price, 2, '.', '');
$mas_price_1 +=$tot_new_price;
?> |
$tot_new_price;
$gst=($tot_price-$tot_new_price);
$new_gst=($gst/2);
$tot_new_price_1=number_format($new_gst, 2, '.', '');
$mas_price_2 +=$tot_new_price_1;
?>
echo $n_g;?>% |
echo $sym;?> $new_sg;?> echo $tot_new_price_1;?> |
echo $sym;?> echo $tot_new_price_1;?> $unit_pr;?> |
echo $sym;?> echo $tot_price=number_format((float)$tot_price, 2, '.', '');?> |
}
?>
$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'];
$objqrynewsubee_qty = "SELECT SUM(qty) AS qty FROM tbl_order where orderid='$orderid'";
$name_12_123_qty=$DB->query($objqrynewsubee_qty);
$Fetchnewww_qty = mysql_fetch_array($name_12_123_qty);
$subtotal_123_qty=$Fetchnewww_qty['qty'];
?>
|
|
|
Total |
echo $subtotal_123_qty;?> |
echo $sym;?> echo $mas_price_1;?> |
|
echo $sym;?> echo $mas_price_2;?> |
echo $sym;?> echo $mas_price_2;?> |
echo $sym;?> echo $subtotal_123_4=number_format((float)$subtotal_123, 2, '.', '');?> |