fetchByAssoc($GLOBALS['db']->query("select name,id from ecmpricekopias where id='".$_REQUEST['pricebook_id']."'")); $pricebook_name=$r['name']; $pricebook_id=$r['id']; $r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name,exchange_rate_id from ecmpricekopias where id='".$_COOKIE['pricebook_id']."'")); $name=$r['name']; $exchange_rate_id=$r['exchange_rate_id']; $t=array(" ",$mod_strings['LBL_PRODUCT_NAME'],$mod_strings['LBL_INDEX'],$mod_strings['LBL_PRICEBOOK_NAME'], $mod_strings['LBL_UNIT_PRICE'],$mod_strings['LBL_MARGIN'],$mod_strings['LBL_LIST_PRICE_ADD']); $sorder=$_REQUEST['sorder']; print ''; print '
'; print ''; print ''; print ''; print ''; print '

'; print ''; for($i=0;$i'.$t[$i].''; } print ''; if($_REQUEST['name'])$arr[]="ecmproducts.name like '%".$_REQUEST['name']."%'"; if($_REQUEST['code'])$arr[]="ecmproducts.code like '%".$_REQUEST['code']."%'"; if($_REQUEST['purchase_price'])$arr[]="ecmproducts.purchase_price='".$_REQUEST['purchase_price']."'"; if($_REQUEST['product_category'])$arr[]="ecmproducts.product_category_id='".$_REQUEST['product_category']."'"; if($_REQUEST['manufacturer'])$arr[]="ecmproducts.manufacturer_id='".$_REQUEST['manufacturer']."'"; $arr[]="ecmproducts.deleted='0'"; $w=$GLOBALS['db']->query("select ecmproduct_id from ecmpricekopias_ecmproducts where deleted='0' and ecmpricekopia_id='".$_REQUEST['pricebook_id']."'"); while($r=$GLOBALS['db']->fetchByAssoc($w))$arr[]="ecmproducts.id!='".$r['ecmproduct_id']."'"; $where=implode(" and ",$arr); $z="select ecmproducts.name as name,ecmproducts.code as code,ecmproducts.id as id,ecmproducts.purchase_price as purchase_price from ecmproducts where ".$where." order by ecmproducts.name"; //print $z; $result = $GLOBALS['db']->query($z); print mysql_error(); $i=0; while($row=$GLOBALS['db']->fetchByAssoc($result)) { print ''; print ''; print ''; print ''; print ''; print ''; print ''; $r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select price from ecmpricekopias_ecmproducts where ecmpricekopia_id='".$_REQUEST['pricebook_id']."' and ecmproduct_id='".$row['id']."'")); //print ''; print ' '; print ''; print ''; $i++; } print '
'.$row['name'].''.$row['code'].''.$pricebook_name.''.number_format($row['purchase_price'],2,",",".").''.number_format($r['price'],2,",",".").'
'; print '
'; print '
'; ?>