"; //step 2 comment out // Get product and category data $category_name = get_category_name($category_id); /******************************************* * step 2: - get all category names * step 2: - get all product names *******************************************/ $categories = get_categories(); $products = get_products_by_category($category_id); // Display the product list include('product_list.php'); // echo $category_name."
"; //step 2 comment out /***************************************** * step 3: action is delete_product ? *****************************************/ } else if ($action == 'delete_product') { // Get the IDs $product_id = $_POST['product_id']; $category_id = $_POST['category_id']; // Delete the product delete_product($product_id); //update model/product_db.php // Display the Product List page for the current category header("Location: .?category_id=$category_id"); /***************************************** * step 4: action is show_add_form ? *****************************************/ } else if ($action == 'show_add_form') { $categories = get_categories(); //created in step 2, model/category_db.php, used for dropdown list include('product_add.php'); //create in product_manager folder } ?>