public function reviewAction()
 {
     if ($this->request->isPost()) {
         $i = 0;
         $item = $this->request->getPost('item');
         $orderarray = array();
         $order = array();
         foreach ($item as $value) {
             $var = 'quantity' . $value;
             //echo $value;
             $quant = $this->request->getPost($var);
             //echo $quant;
             $result = Menudetails::findFirst(array("(m_id = :mid:)", 'bind' => array('mid' => $value)));
             $order[m_id] = $result->m_id;
             $order[m_name] = $result->m_name;
             $order[m_price] = $result->m_price;
             $order[m_type] = $result->m_type;
             $order[m_subtype] = $result->m_subtype;
             $order[m_category] = $result->m_category;
             $order[quant] = $quant;
             array_push($orderarray, $order);
         }
         $this->view->orderarray = $orderarray;
         //$this->view->orderarray=json_encode($orderarray);
         //echo $orderarray->quant;
         print_r($orderarray);
     }
 }
Ejemplo n.º 2
0
 public function indexAction()
 {
     $vegmenudetails = Menudetails::find(array("m_category = 'Veg'", "order" => "m_type,m_subtype"));
     $this->view->vegmenu = $vegmenudetails;
     $nvegmenudetails = Menudetails::find(array("m_category = 'NonVeg'", "order" => "m_type,m_subtype"));
     $this->view->nvegmenu = $nvegmenudetails;
 }
Ejemplo n.º 3
0
 public function updateAction()
 {
     if ($this->request->isPost()) {
         $mid = $this->request->getPost('mid');
         $mname = $this->request->getPost('name');
         $mprice = $this->request->getPost('price');
         $mtype = $this->request->getPost('type');
         $mstype = $this->request->getPost('stype');
         $category = $this->request->getPost('category');
         $menu = new Menudetails();
         $menu->m_id = $mid;
         $menu->m_name = $mname;
         $menu->m_price = $mprice;
         $menu->m_type = $mtype;
         $menu->m_subtype = $mstype;
         $menu->m_category = $category;
         if ($menu->save() == false) {
             foreach ($menu->getMessages() as $message) {
                 echo $message;
             }
         }
         return $this->response->redirect('menu');
     }
 }