$query = "DELETE FROM subcontractors_assign WHERE property_id = " . $_GET['id']; $reports_obj->customExecuteQuery($query); $query = "DELETE FROM properties WHERE id = " . $_GET['id']; $reports_obj->customExecuteQuery($query); $delete_success = true; } //$propertyObj->searchProperty($search="Arnold"); ?> <?php $listProperties = array(); if ($propertyObj) { if ($_SESSION['user_type'] == 5) { $listProperties = $propertyObj->getPropertiesSubContractors(false); } else { $listProperties = $propertyObj->getProperties(false); } } $propertyArray = $user_properties_obj->getAll("WHERE user_id = " . $_SESSION["user_id"]); if (count($propertyArray) > 0) { $propertyIdsArray = array(); for ($i = 0; $i < count($propertyArray); $i++) { $propertyIdsArray[] = $propertyArray[$i]["property_id"]; } $listPropertiesContainer = array(); for ($i = 0; $i < count($listProperties); $i++) { if (in_array($listProperties[$i]["id"], $propertyIdsArray)) { $listPropertiesContainer[] = $listProperties[$i]; } } $listProperties = $listPropertiesContainer;
public function propertyListAction() { global $mySession; $db = new Db(); $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $propertyModel = new Property(); $responseData['output'] = 'false'; if ($this->getRequest()->isPost()) { $post = $this->getRequest()->getPost(); $filterArr = array(); $filterArr['property_type'] = $post['accomodation_type']; $filterArr['country_id'] = $post['country_id']; $filterArr['state_id'] = $post['state_id']; $filterArr['city_id'] = $post['city_id']; $filterArr['sub_area_id'] = $post['sub_area']; $filterArr['local_area_id'] = $post['local_area']; $filterArr['zipcode'] = $post['zipcode']; $filterArr['xml_subscriber_id'] = $post['supplier']; $filterArr['bedrooms'] = $post['no_of_bedroom']; $propertyList = $propertyModel->getProperties($filterArr); $responseData['data'] = $propertyList; $responseData['output'] = true; } $this->_helper->json($responseData, true); }