0) { $cache = new cache(); $cache->clearCache(); $record['cat_id'] = $db->mySQLSafe($_GET['add']); $record['productId'] = $db->mySQLSafe($_GET['productId']); $insert = $db->insert($glob['dbprefix']."CubeCart_cats_idx", $record); unset($record); if($insert == TRUE) { $msg = "
".$lang['admin']['products_prod_added_to_cat']."
"; // set category +1 $db->categoryNos($_GET['add'], "+"); } else { $msg = "".$lang['admin']['products_prod_not_added_to_cat']."
"; } } elseif(isset($_GET['remove']) && $_GET['remove']>0) { $cache = new cache(); $cache->clearCache(); $where = "cat_id=".$db->mySQLSafe($_GET['remove'])." AND productId=".$db->mySQLSafe($_GET["productId"]); $delete = $db->delete($glob['dbprefix']."CubeCart_cats_idx", $where); if ($delete) { $msg = "".$lang['admin']['products_prod_removed_from_cat']."
"; // set category - 1 $db->categoryNos($_GET['remove'], '-'); } else { $msg = "".$lang['admin']['products_prod_not_removed_from_cat']."
"; } } // get array of existing categories product relation ships $query = sprintf("SELECT * FROM ".$glob['dbprefix']."CubeCart_cats_idx WHERE productId= %s", $db->mySQLSafe($_GET['productId'])); $assocArray = $db->select($query); for ($i=0; $i-
| Remove Add |