Exemplo n.º 1
0
 public function execute()
 {
     $request = $_GET;
     $data = array();
     if (empty($request['uid'])) {
         throw new Exception('Missing Uid');
     }
     $Models_Basedata = new Models_Basedata();
     $result = $Models_Basedata->myBids($request['uid'], self::PERIOD_BIDS);
     $this->return = array('result' => $result);
 }
Exemplo n.º 2
0
 public function execute()
 {
     $request = $_REQUEST;
     /*
     $data = array();
     if (empty($request['uid'])) {
       throw new Exception('Missing Uid');
     }
     if (empty($request['city_id'])) {
       throw new Exception('Missing City ID');
     }
     if (empty($request['title'])) {
       throw new Exception('Missing title');
     }
     if (empty($request['description'])) {
       throw new Exception('Missing description');
     }
     if (empty($request['categories'])) {
       throw new Exception('Missing category');
     }
     $base_id = guid();
     $data['base_id'] = $base_id;
     $data['uid'] = !empty($request['uid']) ? $request['uid'] : '';
     $data['city_id'] = !empty($request['city_id']) ? $request['city_id'] : '';
     $data['title'] = !empty($request['title']) ? $request['title'] : '';
     $data['description'] = !empty($request['description']) ? $request['description'] : '';
     $data['base_lat'] = !empty($request['lat']) ? $request['lat'] : '';
     $data['base_lng'] = !empty($request['lng']) ? $request['lng'] : '';
     $data['base_address'] = !empty($request['address']) ? $request['address'] : '';
     $data['showAddress'] = !empty($request['showAddress']) ? $request['showAddress'] : '';
     $data['contactbyphone'] = !empty($request['contactbyphone']) ? $request['contactbyphone'] : '';
     $data['contactbytext'] = !empty($request['contactbytext']) ? $request['contactbytext'] : '';
     $data['phonenumber'] = !empty($request['phonenumber']) ? $request['phonenumber'] : '';
     $data['contactname'] = !empty($request['contactname']) ? $request['contactname'] : '';
     
     $data['base_created_dt'] = date('Y-m-d H:i:s');
     $data['base_status'] = !empty($request['status']) ? $request['status'] : '1';
     $Models_Basedata = new Models_Basedata();
     $Models_Basedata->add($data);
     */
     $Models_Basedata = new Models_Basedata();
     $data = $this->baseDataCheck($request);
     $personalData = array();
     $personalData['personal_id'] = guid();
     $personalData['base_id'] = $data['base_id'];
     $personalData['age'] = !empty($request['age']) ? $request['age'] : '';
     $personalData['other_details'] = !empty($request['other_details']) ? json_encode($request['other_details']) : '';
     $Models_Basedata->personals_add($personalData);
     $this->return = array('confirm' => 'New posting created successfully', 'personal_id' => $personalData['personal_id']);
 }
Exemplo n.º 3
0
 public function execute()
 {
     $request = $_GET;
     $data = array();
     $category = '';
     if (!empty($request['category'])) {
         $cat = explode(',', $request['category']);
         $cat = array_filter($cat);
         $category = "'" . implode("', '", $cat) . "'";
     }
     $city_ids = '';
     if (!empty($request['city_id'])) {
         $city_ids = $request['city_id'];
     }
     $Models_Basedata = new Models_Basedata();
     $data = $Models_Basedata->personals_view($category, $city_ids);
     $this->return = $data;
 }
Exemplo n.º 4
0
 protected function baseDataCheck($request)
 {
     $data = array();
     if (empty($request['uid'])) {
         throw new Exception('Missing Uid');
     }
     if (empty($request['city_id'])) {
         throw new Exception('Missing City ID');
     }
     if (empty($request['title'])) {
         throw new Exception('Missing title');
     }
     if (empty($request['description'])) {
         throw new Exception('Missing description');
     }
     if (empty($request['categories'])) {
         throw new Exception('Missing category');
     }
     $data['base_id'] = guid();
     $data['uid'] = !empty($request['uid']) ? $request['uid'] : '';
     $data['city_id'] = !empty($request['city_id']) ? $request['city_id'] : '';
     $data['title'] = !empty($request['title']) ? $request['title'] : '';
     $data['description'] = !empty($request['description']) ? $request['description'] : '';
     $data['base_lat'] = !empty($request['lat']) ? $request['lat'] : '';
     $data['base_lng'] = !empty($request['lng']) ? $request['lng'] : '';
     $data['base_address'] = !empty($request['address']) ? $request['address'] : '';
     $data['showAddress'] = !empty($request['showAddress']) ? $request['showAddress'] : '';
     $data['contactbyphone'] = !empty($request['contactbyphone']) ? $request['contactbyphone'] : '';
     $data['contactbytext'] = !empty($request['contactbytext']) ? $request['contactbytext'] : '';
     $data['phonenumber'] = !empty($request['phonenumber']) ? $request['phonenumber'] : '';
     $data['contactname'] = !empty($request['contactname']) ? $request['contactname'] : '';
     $data['images'] = !empty($request['images']) ? json_encode($request['images']) : '';
     $data['base_created_dt'] = date('Y-m-d H:i:s');
     $data['base_status'] = !empty($request['status']) ? $request['status'] : '1';
     $Models_Basedata = new Models_Basedata();
     $Models_Basedata->add($data);
     $arr = array();
     $arr['base_id'] = $data['base_id'];
     $arr['category'] = $request['categories'];
     $arr['category_id'] = guid();
     $Models_Basedata->add_category($arr);
     $data['cat_id'] = $arr['category_id'];
     return $data;
 }
Exemplo n.º 5
0
 public function execute()
 {
     $request = $_REQUEST;
     /*$data = array();
       if (empty($request['uid'])) {
         throw new Exception('Missing Uid');
       }
       if (empty($request['city_id'])) {
         throw new Exception('Missing City ID');
       }
       if (empty($request['title'])) {
         throw new Exception('Missing title');
       }
       if (empty($request['description'])) {
         throw new Exception('Missing description');
       }
       if (empty($request['categories'])) {
         throw new Exception('Missing category');
       }
       $base_id = guid();
       $data['base_id'] = $base_id;
       $data['uid'] = !empty($request['uid']) ? $request['uid'] : '';
       $data['city_id'] = !empty($request['city_id']) ? $request['city_id'] : '';
       $data['title'] = !empty($request['title']) ? $request['title'] : '';
       $data['description'] = !empty($request['description']) ? $request['description'] : '';
       $data['base_lat'] = !empty($request['lat']) ? $request['lat'] : '';
       $data['base_lng'] = !empty($request['lng']) ? $request['lng'] : '';
       $data['base_address'] = !empty($request['address']) ? $request['address'] : '';
       $data['showAddress'] = !empty($request['showAddress']) ? $request['showAddress'] : '';
       $data['contactbyphone'] = !empty($request['contactbyphone']) ? $request['contactbyphone'] : '';
       $data['contactbytext'] = !empty($request['contactbytext']) ? $request['contactbytext'] : '';
       $data['phonenumber'] = !empty($request['phonenumber']) ? $request['phonenumber'] : '';
       $data['contactname'] = !empty($request['contactname']) ? $request['contactname'] : '';*/
     $Models_Basedata = new Models_Basedata();
     $data = $this->baseDataCheck($request);
     $communityData = array();
     $communityData['community_id'] = guid();
     $communityData['base_id'] = $data['base_id'];
     $Models_Basedata->community_add($communityData);
     $this->return = array('confirm' => 'New posting created successfully', 'community_id' => $communityData['community_id']);
 }
Exemplo n.º 6
0
 public function execute()
 {
     $request = $_GET;
     $data = array();
     if (empty($request['uid'])) {
         throw new Exception('Missing Uid');
     }
     if (empty($request['state'])) {
         throw new Exception('Missing state');
     }
     if (empty($request['bid'])) {
         throw new Exception('Missing bid amount');
     }
     $data['location_id'] = !empty($request['state']) ? $request['state'] : '';
     $data['owner_id'] = !empty($request['uid']) ? $request['uid'] : '';
     $data['location_type'] = 'State';
     $data['period_bids'] = self::PERIOD_BIDS;
     $data['bid_amount'] = !empty($request['bid']) ? $request['bid'] : '';
     $Models_Basedata = new Models_Basedata();
     $Models_Basedata->addBid($data);
     $this->return = array('confirm' => 'New bid created successfully');
 }