public function postDeleteEditChoice()
 {
     $function = 'editorChoice/delete_editor_choice';
     $authorId = json_decode(Session::get('zeAccessKey'));
     $method = 'POST';
     $dataRequest = array('accessKey' => $authorId->AccessKey, 'editorChoiceId' => Input::get('editorChoiceId'));
     $ZeSocialBusinessModel = new ZeSocialBusinessModel();
     $zeSocialBusinessResult = $ZeSocialBusinessModel->zeSocialRequest($function, $dataRequest, $method);
     return $zeSocialBusinessResult;
 }
 public function postEditBusinessFuc()
 {
     $file = Input::file('logo');
     $cover = Input::file('cover');
     if ($file != null) {
         $fileName = $file->getClientOriginalName();
         $fileData = $file->getPathName();
     }
     if ($cover != null) {
         $coverName = $cover->getClientOriginalName();
         $coverData = $cover->getPathName();
     }
     $functionLocation = 'businessAdmin/update_geo_location';
     $functionBusiness = 'businessAdmin/update_business';
     $functionUpdateLogo = 'businessAdmin/update_logo';
     $functionRemoveCover = 'businessAdmin/remove_cover_image';
     $functionAddCover = 'businessAdmin/add_cover_image';
     $businessTagList = array(Input::get('businessTagList'));
     //return $businessTagList;
     $businessTypeList = Input::get('businessTypeList');
     $businessTypeListArray = '[{"id":"' . $businessTypeList['id'] . '","name":"' . $businessTypeList['name'] . '"}]';
     //  business tag list foreach string
     $strTag = '';
     foreach ($businessTagList as $key) {
         if ($strTag == '') {
             $strTag .= '"' . $key . '"';
         } else {
             $strTag .= ',"' . $key . '"';
         }
     }
     $str = '[' . $strTag . ']';
     //end
     $method = 'POST';
     $dataLocation = array('businessId' => Input::get('businessId'), 'name' => Input::get('locationname'), 'phoneNumber' => Input::get('phoneNumber'), 'address' => Input::get('address'), 'email' => Input::get('email'), 'latitude' => Input::get('latitute'), 'longitude' => Input::get('longitute'));
     if ($businessTagList == [""]) {
         $dataBusiness = array('businessId' => Input::get('businessId'), 'name' => Input::get('businessname'), 'description' => Input::get('description'), 'bussinessType' => $businessTypeListArray);
     } else {
         $dataBusiness = array('businessId' => Input::get('businessId'), 'name' => Input::get('businessname'), 'description' => Input::get('description'), 'listBusinessTag' => $str, 'bussinessType' => $businessTypeListArray);
     }
     //        return $dataBusiness;
     if ($file == null) {
         $dataLogo = array();
     } else {
         $dataLogo = array('businessId' => Input::get('businessId'), 'image' => new \CurlFile($fileData, 'image/jpg', $fileName));
     }
     if ($cover != null) {
         $dataCover = array('businessId' => Input::get('businessId'), 'image' => new \CurlFile($coverData, 'image/jpg', $coverName));
         $dataRemoveCover = array('businessId' => Input::get('businessId'), 'url' => Input::get('oldCover'));
     }
     $ZeSocialBusinessModel = new ZeSocialBusinessModel();
     $zeSocialBusinessResult = $ZeSocialBusinessModel->zeSocialRequest($functionLocation, $dataLocation, $method);
     $zeSocialBusinessResult = $ZeSocialBusinessModel->zeSocialRequest($functionBusiness, $dataBusiness, $method);
     if ($file != null) {
         $zeSocialBusinessResult = $ZeSocialBusinessModel->zeSocialRequest($functionUpdateLogo, $dataLogo, $method);
     }
     if ($cover != null) {
         $zeSocialBusinessResult = $ZeSocialBusinessModel->zeSocialRequest($functionAddCover, $dataCover, $method);
         $zeSocialBusinessResult = $ZeSocialBusinessModel->zeSocialRequest($functionRemoveCover, $dataRemoveCover, $method);
     }
     return $zeSocialBusinessResult;
 }
 public function postLogin()
 {
     // $dataRequest = Input::All();
     // if(Input::get('name') == 'ZeAdmin' && Input::get('Password')== 'ze8899!@'){
     //   Session::put('zelog',json_encode($dataRequest));
     //   return('{"code": 1,"data": [{}],"message": {"code": 1,"description": "Success"}}');
     // }else{
     //   return('{"code": 0,"data": [{}],"message": {"code": 1,"description": "User and Password is incorrect..!"}}');
     // }
     $function = 'adminUser/admin_log';
     $method = 'POST';
     $dataRequest = array('userName' => Input::get('name'), 'password' => Input::get('Password'));
     $ZeSocialBusinessModel = new ZeSocialBusinessModel();
     $zeSocialBusinessResult = $ZeSocialBusinessModel->zeSocialRequest($function, $dataRequest, $method);
     $zeSocialBusinessResult = json_decode($zeSocialBusinessResult);
     $zeAccessKey = array('AccessKey' => $zeSocialBusinessResult->data->accessKey, 'ownerId' => $zeSocialBusinessResult->data->userId);
     // return ($zeSocialBusinessResult);
     return json_encode($zeAccessKey);
 }