} //olc_redirect(olc_href_link(FILENAME_CATEGORIES, $cPath_parameter)); $action0 = EMPTY_STRING; break; case 'delete_product_confirm': $product_id = olc_db_prepare_input($_POST[$products_id_text]); if ($product_id) { $product_categories = $_POST['product_categories']; if (is_array($product_categories)) { for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) { olc_db_query(DELETE_FROM . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = " . $product_id . " and categories_id = " . $product_categories[$i]); } $product_categories_query = olc_db_query(SELECT_COUNT . "as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_id . APOS); $product_categories = olc_db_fetch_array($product_categories_query); if ($product_categories['total'] == '0') { olc_remove_product($product_id); } } } //olc_redirect(olc_href_link(FILENAME_CATEGORIES, $cPath_parameter)); $action0 = EMPTY_STRING; break; case 'move_category_confirm': $categories_id = $_POST[$categories_id_text]; if ($categories_id && $categories_id != $_POST['move_to_category_id']) { $categories_id = olc_db_prepare_input($categories_id); $new_parent_id = olc_db_prepare_input($_POST['move_to_category_id']); olc_db_query(SQL_UPDATE . TABLE_CATEGORIES . " set parent_id = " . olc_db_input($new_parent_id) . ", last_modified = now() where categories_id = " . olc_db_input($categories_id)); } //olc_redirect(olc_href_link(FILENAME_CATEGORIES, $cPath_text . $new_parent_id . $cID_text . $categories_id)); $cPath = $new_parent_id;
$manufacturers_id = $mID; $manufacturers_id_sql = " where manufacturers_id = '" . olc_db_input($manufacturers_id) . APOS; if ($_POST['delete_image'] == 'on') { $manufacturer_query = olc_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . $manufacturers_id_sql); $manufacturer = olc_db_fetch_array($manufacturer_query); $image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_IMAGES . $manufacturer['manufacturers_image']; if (file_exists($image_location)) { @unlink($image_location); } } olc_db_query(DELETE_FROM . TABLE_MANUFACTURERS . $manufacturers_id_sql); olc_db_query(DELETE_FROM . TABLE_MANUFACTURERS_INFO . $manufacturers_id_sql); if ($_POST['delete_products'] == 'on') { $products_query = olc_db_query("select products_id from " . TABLE_PRODUCTS . $manufacturers_id_sql); while ($products = olc_db_fetch_array($products_query)) { olc_remove_product($products['products_id']); } } else { olc_db_query(SQL_UPDATE . TABLE_PRODUCTS . " set manufacturers_id = ''" . $manufacturers_id_sql); } if (USE_CACHE == TRUE_STRING_S) { olc_reset_cache_block('manufacturers'); } //olc_redirect(olc_href_link(FILENAME_MANUFACTURERS, $page_parameter)); $mID = EMPTY_STRING; break; } require DIR_WS_INCLUDES . 'header.php'; ?> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr>
function ProductsErase() { global $_POST; $ProdID = olc_db_prepare_input($_POST['prodid']); if (isset($ProdID)) { // ProductsToCategieries loeschen bei denen die products_id = ... ist $res1 = olc_db_query(DELETE_FROM . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id='" . $ProdID . "'"); // Product loeschen olc_remove_product($ProdID); $code = 0; $message = 'OK'; } else { $code = 99; $message = 'FAILED'; } print_xml_status(0, $_POST['action'], 'OK', '', 'SQL_RES1', $res1); }