0) { $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){ $where = "cat_id=".$db->mySQLSafe($_GET['remove'])." AND productId=".$db->mySQLSafe($_GET["productId"]); $delete = $db->delete($glob['dbprefix']."CubeCart_cats_idx", $where); if($delete == TRUE){ $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 = $db->paginate($db->numrows($query), 15, $_GET['page'], "page"); $currentPage = currentPage(); // rip out add and remove vars $currentPage = str_replace("&add=".$_GET['add'],"",$currentPage); $currentPage = str_replace("&remove=".$_GET['remove'],"",$currentPage); ?> <?php echo $lang['admin']['products']['title_extraCats'];?>

-

Category Action
Remove Add