Пример #1
0
 public function updateRestaurantStatus($request)
 {
     try {
         $restaurantMapper = new Restaurant_Model_RestaurantMapper();
         $value = $request->getPost('data');
         $toUpdate;
         $returnStatus;
         if ($value == 1) {
             $toUpdate = 2;
         } else {
             $toUpdate = 1;
         }
         $data = array("res_status" => $toUpdate);
         $resid = $request->getPost("updateId");
         $result = $restaurantMapper->updateRestaurantDetails($data, $resid);
         if ($result == 1) {
             return $toUpdate;
         } else {
             return false;
         }
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }
Пример #2
0
 /**
  *Firm edit ajax
  **/
 public function editAjax($request)
 {
     try {
         $resmapper = new Restaurant_Model_RestaurantMapper();
         $cusineMapper = new Restaurant_Model_RestaurantCusineDataMapper();
         $rwtMapper = new Restaurant_Model_RestaurantWorkingTimingsMapper();
         $postData = $request->getPost();
         $data = $postData['data'];
         $resid = $postData['resid'];
         if ($request->getPost('type') == "time") {
             return $rwtMapper->updateRWT($resid, $data);
         } else {
             if ($request->getPost('type') == "timeRemove") {
                 return $rwtMapper->removeRWT($data);
             } else {
                 $arr = array();
                 foreach ($data as $key => $value) {
                     if ($value['name'] !== "restype_id[]") {
                         $arr[$value['name']] = $value['value'];
                     } else {
                         $cusineMapper->updateCusineData($resid, $value['value']);
                     }
                 }
                 return $resmapper->updateRestaurantDetails($arr, $resid);
             }
         }
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }