='".$date_paid1."' and DATE(orderdate) <='".$date_paid12."' ";
}
if($_REQUEST['from']!="" && $_REQUEST['to']=="" )
{
$cond9.="and DATE(orderdate) ='".$date_paid1."'";
}
if($_REQUEST['from']!="" && $_REQUEST['to']=="" )
{
$cond9.="and DATE(orderdate) ='".$date_paid12."'";
}
if($_REQUEST['from']!="" && $_REQUEST['to']!="" )
{
$cond9.="and DATE(orderdate) >='".$date_paid1."' and DATE(orderdate) <='".$date_paid12."' ";
}
$table_name="shop_product";
$sort=$_REQUEST['sort'];
/*where company_name='Energy Foods'*/
if($sort==1)
{
$Query = "SELECT a.product_id,a.vstatus,a.product_url,a.name,(SELECT sum(qty) as newqtyy from `tbl_order` where productid=a.product_id and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' ) $cond9) as v from shop_product as a order by v desc
";
}
if($sort==2)
{
$Query = "SELECT a.product_id,a.vstatus,a.product_url,a.name,(SELECT sum(qty) as newqtyy from `tbl_order` where productid=a.product_id and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' ) $cond9) as v from shop_product as a order by v asc
";
}
if($sort=="")
{
$Query = "SELECT * from shop_product $cond12 order by name asc";
}
$namesss=$DB->query($Query);
$nsssss=mysql_num_rows($namesss);
$manssss='0';
$new_price_1=0;
$si=0;
while ($rowsss = mysql_fetch_array($namesss)) {
$product_id=$rowsss['product_id'];
$vstatus=$rowsss['vstatus'];
$com_name=$rowsss['vstatus'];
$Query_v_status = "SELECT * from tbl_company where id='$vstatus' ";
$name_v_status=$DB->query($Query_v_status);
$row_v_status = mysql_fetch_array($name_v_status);
//$status=$rowsss['status'];
//$cat_id=$rowsss['manufacturer_id'];
//SELECT sum(qty) as newqtyy from `tbl_order` where productid='$product_id' $cond9
$no_1=0;
$no=0;
$new_price_0=0;
$Query = "SELECT sum(qty) as newqtyy,sum(totprice) as paraprice from `tbl_order` where productid='$product_id' and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' ) and user_id IN( SELECT user_id from shop_user where new_status='0') $cond9 ";
$name=$DB->query($Query);
$no=mysql_num_rows($name);
$row = mysql_fetch_array($name);
$new_price_0=$row['paraprice'];
$new_price_1 +=$new_price_0;
$nn_ssss="";
$Query_1 = "SELECT sum(qty) as newqtyy from `tbl_order` where productid='$product_id' and freeqty='0' and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' ) and user_id IN( SELECT user_id from shop_user where new_status='1') $cond9 ";
$name_1=$DB->query($Query_1);
$no_1=mysql_num_rows($name_1);
$row_1 = mysql_fetch_array($name_1);
$Query_2 = "SELECT sum(freeqty) as newqtyy from `tbl_order` where productid='$product_id' and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' ) and user_id IN( SELECT user_id from shop_user where new_status='1') $cond9 ";
$name_2=$DB->query($Query_2);
$no_2=mysql_num_rows($name_2);
$row_2 = mysql_fetch_array($name_2);
$Query_3 = "SELECT sum(qty) as newqtyy from `tbl_order` where productid='$product_id' and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' ) and user_id IN( SELECT user_id from shop_user where new_status='1') $cond9 ";
$name_3=$DB->query($Query_3);
$no_3=mysql_num_rows($name_3);
$row_3 = mysql_fetch_array($name_3);
/* totamount
*/
$new_amount=0;
/*$Query_mala_amount = "SELECT sum(qty) as newqtyy, from `tbl_order` where productid='$product_id' and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' and contry='India' ) and user_id IN( SELECT user_id from shop_user where new_status='0') $cond9 ";
$name_mala_amount=$DB->query($Query_mala_amount);
$no_mala_amount=mysql_num_rows($name_mala_amount);
$row_mala_amount = mysql_fetch_array($name_mala_amount);*/
/*$Query_1_ind = "SELECT sum(totprice) as newprice from `tbl_order` where productid='$product_id' and freeqty='0' and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' and contry='India' ) and user_id IN( SELECT user_id from shop_user where new_status='1' ) $cond9 ";
$name_1_ind=$DB->query($Query_1_ind);
$no_1_ind=mysql_num_rows($name_1_ind);
$row_1_ind = mysql_fetch_array($name_1_ind);
$Query_1_ind_1 = "SELECT sum(totprice) as newprice from `tbl_order` where productid='$product_id' and freeqty='0' and orderid IN(SELECT orderid from tbl_confirmorder where company_name='Energy Foods' and contry!='India' and country_id='1' ) and user_id IN( SELECT user_id from shop_user where new_status='1' ) $cond9 ";
$name_1_ind_1=$DB->query($Query_1_ind_1);
$no_1_ind_1=mysql_num_rows($name_1_ind_1);
$row_1_ind_1 = mysql_fetch_array($name_1_ind_1);*/
$new_amount=($row_1_ind['newprice']+$row_1_ind['newprice']);
/*totamount*/
$nn_ssss_3=$row_3['newqtyy'];
$nn_ssss_1=$row_2['newqtyy'];
$nn_ssss=$row_1['newqtyy'];
if($nn_ssss!='')
{
$nn_ssss;
if($vstatus==1)
{
$v_qty=($nn_ssss/2);
}
if($vstatus==7)
{
$v_qty=($nn_ssss/2);
}
if($vstatus==6)
{
$v_qty=($nn_ssss/2);
}
if($vstatus==2)
{
$v_qty=($nn_ssss/50);
}
$v_qty=($v_qty*12);
$x = (int)$v_qty;
}
//sprintf("%02d", $to_hour);
?>
if($product_hide==1)
{
?>
if($new_price_0!="")
{
?>
echo $si=$si+1;?> |
$new_price_0;?> echo $rowsss['name'];?>- echo $rowsss['product_url'];?> |
echo $row_v_status['name'];?> |
echo $new_uu=$row['newqtyy'];?> |
echo $row_3['newqtyy'];
$new_uu_1=($row_3['newqtyy']+$x+$nn_ssss_1);
?> |
echo ($x+$nn_ssss_1);
?> |
echo ($new_uu_1+$new_uu);?> |
Rs echo ($new_price_0);?> |
}
}
?>
if($product_hide=="")
{
?>
echo $si=$si+1;?> |
$new_price_0;?> echo $rowsss['name'];?>- echo $rowsss['product_url'];?> |
echo $row_v_status['name'];?> |
echo $new_uu=$row['newqtyy'];?> |
echo $row_3['newqtyy'];
$new_uu_1=($row_3['newqtyy']+$x+$nn_ssss_1);
?> |
echo ($x+$nn_ssss_1);
?> |
echo ($new_uu_1+$new_uu);?> |
Rs echo ($new_price_0);?> |
}
?>
$x=0;
}
?>
Total |
Rs echo ($new_price_1);?> |