if($_REQUEST['reset']==1){
$GLOBALS['db']->query("delete from ecmpricebooks_ecmproducts_categories_sort where ecmpricebook_id='".$_REQUEST['record']."'");
header("Location: index.php?module=EcmPriceBooks&action=categoryOrder&record=".$_REQUEST['record']);
}
if($_REQUEST['save']){
$b=explode("|",$_REQUEST['sort_order']);
$i=1;
foreach($b as $box){
if(strlen($box)>=1 && $box!="" && $box!=" ")$boxy[]=$box;
}
$GLOBALS['db']->query("delete from ecmpricebooks_ecmproducts_categories_sort where ecmpricebook_id='".$_REQUEST['record']."'");
for($i=1;$i<=count($boxy);$i++){
$z="insert into ecmpricebooks_ecmproducts_categories_sort set id='".create_guid()."',position='".$i."',ecmpricebook_id='".$_REQUEST['record']."',category_id='".$boxy[$i-1]."'";
$GLOBALS['db']->query($z);
//echo $z.'
';;
}
header("Location: index.php?module=EcmPriceBooks&action=productsOrder&record=".$_REQUEST['record']);
}
?>
Set Categories Order: query($z); $r=$GLOBALS['db']->fetchByAssoc($w); print " ".$r['name']; ?> |