public function deleteAction()
 {
     $this->view->title = "Delete Cuisine";
     $this->view->headTitle($this->view->title, 'PREPEND');
     if ($this->getRequest()->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Yes') {
             $id = $this->getRequest()->getPost('id');
             $cuisines = new Model_DbTable_Cuisines();
             $cuisines->deleteCuisine($id);
         }
         $this->_redirect('/cuisine');
     } else {
         $id = $this->_getParam('id', 0);
         $cuisines = new Model_DbTable_Cuisines();
         $this->view->cuisine = $cuisines->getCuisine($id);
     }
 }
 public function bycuisineAction()
 {
     $id = $this->_getParam('id', 0);
     if ($id > 0) {
         //show food categories from this cuisine id
         $cuisines = new Model_DbTable_Cuisines();
         $itemsRowset = $cuisines->find($id);
         $thisCuisine = $itemsRowset->current();
         $cuisineName = $thisCuisine['name'];
         $this->view->cuisineName = $cuisineName;
         $this->view->title = "{$cuisineName}";
         $this->view->headTitle($this->view->title, 'PREPEND');
         //$select = $fooditems->select() ->order('name DESC');
         $categoriesFound = $thisCuisine->findDependentRowset('Model_DbTable_FoodItems', 'Cuisine');
         //, $select);
         $this->view->categories = $categoriesFound;
     }
 }
Exemple #3
0
 public function detailAction()
 {
     $id = $this->_getParam('id', 0);
     if ($id > 0) {
         //show detailed view of this dish, its rating, and restaurant
         $dishesC = new Model_DbTable_DishesComplete();
         $itemsRowset = $dishesC->find($id);
         $thisDishC = $itemsRowset->current();
         $this->view->dish = $thisDishC;
         $restaurants = new Model_DbTable_Restaurants();
         $itemsRowset = $restaurants->find($thisDishC['rest_id']);
         $thisRest = $itemsRowset->current();
         $this->view->restaurant = $thisRest;
         $dishName = $thisDishC['dish_name'];
         $categoryID = $thisDishC['fooditem_id'];
         $fooditems = new Model_DbTable_FoodItems();
         $itemsRowset = $fooditems->find($categoryID);
         $thisCategory = $itemsRowset->current();
         $cuisineID = $thisCategory['cuisine_id'];
         $cuisines = new Model_DbTable_Cuisines();
         $itemsRowset = $cuisines->find($cuisineID);
         $thisCuisine = $itemsRowset->current();
         $categoryName = $thisCategory['name'];
         $cuisineName = $thisCuisine['name'];
         $this->view->title = "{$cuisineName}: {$categoryName}: {$dishName}";
         $this->view->headTitle("{$dishName}", 'PREPEND');
         $dishes = new Model_DbTable_Dishes();
         $itemsRowset = $dishes->find($id);
         $thisDish = $itemsRowset->current();
         $foundReviews = $thisDish->findDependentRowset('Model_DbTable_ReviewsComplete', 'Dish');
         $this->view->reviews = $foundReviews;
     }
 }