Example #1
0
 public static function Page($array)
 {
     $log_user = Tool::getLoginUser();
     if ($array[0] == CREATE) {
         header("Location:../?menu=" . PAGE_FOOD . "&" . VIEW . "=" . CREATE);
     } elseif ($array[0] == EDIT) {
         $food = new Food();
         $food->setId($_GET['id']);
         $food->readDatabase();
         SessionHandlers::saveSession($user, 'edit_food');
         header("Location:../?menu=" . PAGE_FOOD . "&" . VIEW . "=" . EDIT);
     } elseif ($array[0] == SHOWHIDE) {
         header("Location:../?menu=" . PAGE_FOOD . "&cache=" . $_GET['cache']);
     } elseif ($array[0] == REFRESH) {
         header("Location:../?menu=" . PAGE_FOOD);
     } elseif ($array[0] == FRAME) {
         $food = new Food();
         //print_r($food->readDatabaseAll ());
         SessionHandlers::saveSession($food->readDatabaseAll(), 'foodList');
         header("Location:../?menu=" . PAGE_FOOD . "&" . VIEW . "=" . FRAME);
     } else {
         echo "page not found";
     }
     exit;
 }