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 %s", $db->mySQLSafe($_GET['cat_id'])); // query database $results = $db->select($query, 15, $_GET['page']); $pagination = paginate($db->numrows($query), 15, $_GET['page'], "page"); $excluded = array("add" => 1, "remove" => 1); $currentPage = currentPage($excluded); ?> <?php echo $lang['admin']['products_title_extraCats'];?>

-

Remove Add