/** *JSON DATA FUNCTION TO LOAD LOCATIONS DATA ON PAGE LOAD */ public function locationsBdm($request) { try { $action = $request->perform; $data = array(); $postData = $request->data; if (isset($postData)) { foreach ($postData as $value) { $data[$value['name']] = $value['value']; } } $locationMapper = new Application_Model_LocationboundariesMapper(); switch ($action) { case 'getData': $result['data'] = array(); $result['data'] = $locationMapper->getLocationsBdm(); $country_bdMapper = new Application_Model_CountrybdMapper(); $country_data = $country_bdMapper->getCountries(); $result['country_data'] = $country_data; return $result; break; case "update": $status = $locationMapper->updateLocation($data); return $status; break; case "append": $code = $data['code']; $isloc = $locationMapper->verifyCode($code, 0); if ($isloc) { $status = $locationMapper->addLocation($data); return $status; } else { return 'f'; } break; } } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }
/** * Returns form for restaurant **/ public function getRestaurantForm() { try { $form = new Restaurant_Form_Restaurantdetails(); $timezone_bdMapper = new Application_Model_TimezonebdMapper(); $country_bdMapper = new Application_Model_CountrybdMapper(); $restaurant_type_bdMapper = new Application_Model_RestaurantTypebdMapper(); $form->restimezone->addMultiOptions($timezone_bdMapper->getAll()); $form->rescountry_id->addMultiOptions($country_bdMapper->getCountries()); $restaurant_dining_style_bdMapper = new Application_Model_RestaurantDiningStylebdMapper(); $diningStyleList = $restaurant_dining_style_bdMapper->getDinningStyle(); $cuisineList = $restaurant_type_bdMapper->getCusines(); $form->restype_id->addMultiOptions($cuisineList); $form->resdining_style->addMultiOptions($diningStyleList); $form->reslocation_id->addMultiOptions(array(array('key' => 0, 'value' => "Select"))); $form->rescity_id->addMultiOptions(array(array('key' => 0, 'value' => "Select"))); return $form; } catch (Exception $ex) { Rdine_Logger_FileLogger::info($ex->getMessage()); throw new Exception($ex->getMessage()); } }