Exemplo n.º 1
0
 public function updateDiningBdm($request)
 {
     try {
         $action = $request->perform;
         $data = array();
         foreach ($request->data as $value) {
             $data[$value['name']] = $value['value'];
         }
         $diningMapper = new Application_Model_RestaurantDiningStylebdMapper();
         switch ($action) {
             case "append":
                 $code = $data['code'];
                 $isdine = $diningMapper->verifyCode($code, 0);
                 if ($isdine) {
                     $status = $diningMapper->addDining($data);
                     return $status;
                 } else {
                     return 'f';
                 }
                 break;
             case "update":
                 $status = $diningMapper->updateDine($data);
                 return $status;
                 break;
         }
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }
Exemplo n.º 2
0
 /**
  *Returns filter values in json format
  **/
 public function getFiltersJson($request)
 {
     try {
         $cusineMapper = new Application_Model_RestaurantTypebdMapper();
         $cusineData = $cusineMapper->getCusinesFilter();
         $jsonData = array();
         $restaurant_dining_style_bdMapper = new Application_Model_RestaurantDiningStylebdMapper();
         $diningStyleList = $restaurant_dining_style_bdMapper->getDinningStyle();
         $pricebdMapper = new Application_Model_PriceMapper();
         $placeId = $request->getPost('placeId');
         $locationbdMapper = new Application_Model_LocationboundariesMapper();
         $country_id = $locationbdMapper->getCountryId($placeId);
         $pricebdData = $pricebdMapper->getPriceFilter($country_id);
         $jsonData['data'] = array();
         $jsonData['data']['diningStyle'] = $diningStyleList;
         $jsonData['data']['cusine'] = $cusineData;
         $jsonData['data']['costfor2'] = $pricebdData;
         return json_encode($jsonData);
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }