} else { $main_category_active_status = 1; } $sql->db_Insert(DB_TABLE_SHOP_MAIN_CATEGORIES, "0,\r\n\t\t'" . $tp->toDB($_POST['main_category_name']) . "',\r\n\t\t'" . $tp->toDB($_POST['main_category_description']) . "',\r\n\t\t'" . $tp->toDB($_POST['main_category_image']) . "',\r\n\t\t'" . $tp->toDB($main_category_active_status) . "',\r\n\t\t1") or die(mysql_error()); header("Location: " . e_SELF); exit; } else { if ($_POST['main_category_dimensions'] == '1') { $sql->db_Update(DB_TABLE_SHOP_PREFERENCES, "categories_per_page='" . $tp->toDB($_POST['categories_per_page']) . "',\r\n\tnum_category_columns='" . $tp->toDB($_POST['num_category_columns']) . "'\r\n\tWHERE\r\n\tstore_id=1"); header("Location: " . e_SELF); exit; } else { if ($_POST['change_main_order'] == '1') { // Change category order for ($x = 0; $x < count($_POST['main_category_order']); $x++) { tokenizeArray($_POST['main_category_order'][$x]); $newCategoryOrderArray[$x] = $tokens; } for ($x = 0; $x < count($newCategoryOrderArray); $x++) { $sql->db_Update(DB_TABLE_SHOP_MAIN_CATEGORIES, "main_category_order=" . $tp->toDB($newCategoryOrderArray[$x][1]) . "\r\n WHERE main_category_id=" . $tp->toDB($newCategoryOrderArray[$x][0])); } // Change category active status $sql->db_Update(DB_TABLE_SHOP_MAIN_CATEGORIES, "main_category_active_status=1"); foreach ($_POST['main_category_active_status'] as $value) { $sql->db_Update(DB_TABLE_SHOP_MAIN_CATEGORIES, "main_category_active_status=2 WHERE main_category_id=" . $tp->toDB($value)); } header("Location: " . e_SELF); exit; } else { if ($_POST['edit_main_category'] == '2') { // Edit Product Category
// Rename the download file name to scrambled file name $scrambled_name = intval(mysql_insert_id()) . $_POST['download_filename']; rename(e_PLUGIN . "easyshop/downloads/" . $_POST['download_filename'], e_PLUGIN . "easyshop/downloads/" . md5($scrambled_name)); } header("Location: " . e_SELF); exit; } else { if ($_POST['item_dimensions'] == '1') { $sql->db_Update(DB_TABLE_SHOP_PREFERENCES, "items_per_page='" . intval($tp->toDB($_POST['items_per_page'])) . "',\n num_item_columns='" . intval($tp->toDB($_POST['num_item_columns'])) . "'\n \t WHERE\n \t store_id='1'"); header("Location: " . e_SELF); exit; } else { if ($_POST['change_order'] == '1') { // Change item order for ($x = 0; $x < count($_POST['item_order']); $x++) { tokenizeArray($_POST['item_order'][$x]); $newItemOrderArray[$x] = $tokens; } for ($x = 0; $x < count($newItemOrderArray); $x++) { $sql->db_Update(DB_TABLE_SHOP_ITEMS, "item_order='" . intval($tp->toDB($newItemOrderArray[$x][1])) . "'\n WHERE item_id='" . intval($tp->toDB($newItemOrderArray[$x][0])) . "'"); } // Change item active status $sql2 = new db(); $sql2->db_Update(DB_TABLE_SHOP_ITEMS, "item_active_status='1'\n\t\t\tWHERE category_id='" . intval($tp->toDB($_POST['category_id'])) . "'"); foreach ($_POST['item_active_status'] as $value) { $sql2->db_Update(DB_TABLE_SHOP_ITEMS, "item_active_status='2'\n\t\t\t\tWHERE item_id='" . intval($tp->toDB($value)) . "'"); } // Change item 'Out Of Stock' status $sql3 = new db(); $sql3->db_Update(DB_TABLE_SHOP_ITEMS, "item_out_of_stock='1'\n\t \t WHERE category_id='" . intval($tp->toDB($_POST['category_id'])) . "'"); foreach ($_POST['item_out_of_stock'] as $value) {