<?php

  
/*
   * CSE 154
   * Mowgli's Cafe Part 1 Web Service: Starter PHP
   */

  
include "common.php";

  
# Part 3: Implement menu.php?list=items|categories
  #         - 1. menu.php?list=items
  #         - 2. menu.php?list=categories
  # Part 4: Error-handling with JSON (change functions in common.php)
  #         - 1. 400 error with JSON if invalid list value
  #         - 2. 503 error with JSON for any PDO connection errors 
  #              (in get_PDO() and around any PDO code
  # Part 5: Implement menu.php request (when no list parameter is passed)


  /**
   * TODO: Handle GET parameters (build on this as you work through Parts 3-5)
   */


  /**
   * Part 3: Implement menu.php?list=<listtype>
   *
   * This function should take a string value "items" or "category" and
   * return an alphabetically sorted array of strings such that:
   *   - if $listtype === "items", the strings are all item names in the menu
   *   - if $listtype === "categories", the strings are all category 
   *     names in the menu
   *
   * Part 4: If any database connection error occurs, a 503 JSON error should be returned.
   */ 
  
function get_list_data($listtype) {
    
# TODO
  
}

  
/**
   * Part 5: Implement menu.php
   *
   * This function should return an associtaive array of information 
   * for categories, subcategories, and item data. See slides for expected format.
   * If any database connection error occurs, a 503 JSON error should be returned.
   */
  
function get_menu() {
    
# TODO
  
}

  
?>