Example #1
0
 public function detail($id = NULL)
 {
     $data = array();
     $data['result'] = $this->front_model->getPropertyDetail($id);
     // property_id
     $data['purpose_list'] = $this->misc_model->getPropertyPurposeList();
     $type_list = $this->misc_model->getPropertyTypeList();
     $data['type_list'] = sortedPropertyTypes($type_list);
     $data['cities'] = $this->misc_model->getCities(1);
     // country_id
     $data['featured_properties'] = $this->property_model->getFeaturedProperties();
     $this->render('property', $data);
 }
Example #2
0
 public function index()
 {
     $data = array();
     $data['purpose_list'] = $this->misc_model->getPropertyPurposeList();
     $type_list = $this->misc_model->getPropertyTypeList();
     $data['type_list'] = sortedPropertyTypes($type_list);
     $data['cities'] = $this->misc_model->getCities(1);
     // country_id
     $data['area_units'] = $this->misc_model->getAreaUnits();
     $data['construction_status'] = $this->misc_model->getConstructionStatus();
     $data['agents'] = $this->user_model->fetchAll();
     $data['title'] = "Search";
     $this->render('admin/search', $data);
 }
Example #3
0
 public function quick($id = NULL)
 {
     if ($this->input->post('submit') && $id !== NULL) {
         try {
             $result = $this->property_model->update($id);
             if ($result) {
                 setNotification('success', 'Record updated successfully');
                 redirect(base_url('admin/property/pending'));
             }
         } catch (Exception $e) {
             setNotification('error', 'Error in updating record');
         }
     } else {
         if ($this->input->post('submit') && $id == NULL) {
             try {
                 $PropertyID = $this->property_model->insert();
                 $PostData = $this->input->post();
                 if (array_key_exists('is_client_property', $PostData) && $PostData['is_new_client'] == 'true') {
                     $ClientID = $this->property_model->insertClient();
                     $this->property_model->updateClientIDofProperty($ClientID, $PropertyID);
                 }
                 $this->property_model->insertContactPerson($PropertyID);
                 if ($PropertyID) {
                     $this->uploadPropertyImages($PropertyID);
                     setNotification('success', 'Property added successfully');
                     redirect(base_url('admin/property/pending'));
                 }
             } catch (Exception $e) {
                 setNotification('error', 'Error in adding record');
             }
         }
     }
     $data = array();
     $data['purpose_list'] = $this->misc_model->getPropertyPurposeList();
     $type_list = $this->misc_model->getPropertyTypeList();
     //        foreach ($type_list as $value) {
     //            if($value->parent_property_type_id == NULL) {
     //                $data['type_list'][] = $value;
     //                foreach ($type_list as $value2) {
     //                    if($value2->parent_property_type_id == $value->property_type_id) {
     //                        $data['type_list'][] = $value2;
     //                    }
     //                }
     //            }
     //        }
     $data['type_list'] = sortedPropertyTypes($type_list);
     $data['cities'] = $this->misc_model->getCities(1);
     // country_id
     $data['area_units'] = $this->misc_model->getAreaUnits();
     $data['construction_status'] = $this->misc_model->getConstructionStatus();
     $data['clients'] = $this->misc_model->getClients(getLoginUserId());
     $data['title'] = "Post New Listing";
     $this->render('admin/property/quick', $data);
 }