public function getTab1Content() { $contentArray = array(); $location = new Location($this->_posting->locId); $contentArray[] = array('head' => 'Location:', 'value' => $location->getLocationString(), 'cssClass' => ''); $categoryTable = new Refcategory(); $contentArray[] = array('head' => 'Property Type:', 'value' => $categoryTable->getCatNameById($this->_posting->cat3), 'cssClass' => ''); $contentArray[] = array('head' => 'Bedrooms:', 'value' => Tag::getUnitsAmount($this->_pstCategory->rooms), 'cssClass' => ''); $contentArray[] = array('head' => 'Bathrooms:', 'value' => Tag::getUnitsAmount($this->_pstCategory->baths), 'cssClass' => ''); $contentArray[] = array('head' => 'Parking:', 'value' => Tag::getUnitsAmount($this->_pstCategory->parking), 'cssClass' => ''); if (!empty($this->_pstCategory->buildingArea)) { $contentArray[] = array('head' => 'Building Area:', 'value' => $this->_pstCategory->buildingArea . 'm²', 'cssClass' => ''); } if (!empty($this->_pstCategory->landArea)) { $contentArray[] = array('head' => 'Land Area:', 'value' => $this->_pstCategory->landArea . 'm²', 'cssClass' => ''); } $contentArray[] = array('head' => 'Property Age:', 'value' => Tag::getAges($this->_pstCategory->age), 'cssClass' => ''); $contentArray[] = array('head' => 'Morning Sun Dir:', 'value' => $this->_pstCategory->sunDirection, 'cssClass' => ''); $contentArray[] = array('head' => 'Views of:', 'value' => $this->_pstCategory->views, 'cssClass' => ''); $contentArray[] = array('head' => 'Levels in Building:', 'value' => $this->_pstCategory->buildingLevel, 'cssClass' => ''); $contentArray[] = array('head' => 'Property is on floor:', 'value' => $this->_pstCategory->level, 'cssClass' => ''); if (!empty($this->_pstCategory->strataRate)) { $contentArray[] = array('head' => 'Strata Rate:', 'value' => $location->getCurrencySymbol() . $this->_pstCategory->strataRate . ' per quarter', 'cssClass' => ''); } if (!empty($this->_pstCategory->councilRate)) { $contentArray[] = array('head' => 'Council Rate:', 'value' => $location->getCurrencySymbol() . $this->_pstCategory->councilRate . ' per quarter', 'cssClass' => ''); } if (!empty($this->_pstCategory->waterRate)) { $contentArray[] = array('head' => 'Water Rate:', 'value' => $location->getCurrencySymbol() . $this->_pstCategory->waterRate . ' per quarter', 'cssClass' => ''); } $contentArray[] = array('head' => 'Best Features:', 'value' => $this->_pstCategory->bestFeatures, 'cssClass' => ''); $this->printTable($contentArray, true); /* echo '<table>'; echo '<tr>'; echo '<th> </th>'; echo '<td>' . $this->getCatsString() . '</td>'; echo '</tr>'; echo '<tr>'; echo '<th>Location: </th>'; echo '<td>' . $location->getLocationString() . '</td>'; echo '</tr>'; echo '<tr>'; echo '<th>Salary Info: </th>'; echo '<td>' . $this->_pstCategory->priceInfo . '</td>'; echo '</tr>'; echo '<tr>'; echo '<th>Requried Skills: </th>'; echo '<td>' . $this->_pstCategory->skills . '</td>'; echo '</tr>'; echo '</table>'; */ }
protected function _getCat3($cat2 = null) { $refcat3 = new Refcategory(); $select = $refcat3->select(); $select->where('SubPrimCatId = (select CONCAT( PrimID, SetID) from ref_category_en where id = ?)', $cat2); return $this->_cat3 = $refcat3->fetchAll($select); }
protected function _getCat2($cat1 = null) { if (empty($this->_cat2)) { $refcat2 = new Refcategory(); return $this->_cat2 = $refcat2->getAllCatsBySubPrimIdBusinessTypeId(1, $this->_busTypeId); } else { return $this->_cat2; } }
protected function _getCat2($cat1 = null) { if (empty($this->_cat2)) { $refcat2 = new Refcategory(); return $this->_cat2 = $refcat2->getAllCat2OfSpecificCategory($this->_busTypeId); } else { return $this->_cat2; } }
protected function buildRefineUri($businessType, $formData) { if (strtolower($formData['cat2']) == strtolower('Any')) { $formData['cat2name'] = 'Any'; } else { $refcat2 = new Refcategory(); $formData['cat2name'] = $refcat2->getCatNameById($formData['cat2']); } return parent::buildRefineUri($businessType, $formData); }
protected function _getCat3($cat2 = null) { $refcat3 = new Refcategory(); $select = $refcat3->select(); if ($cat2 == 'Any' || $cat2 == 'All') { $select->where('busPostTypeId = ? and SubPrimCatId is not null', $this->_busTypeId); } else { $select->where('SubPrimCatId = (select CONCAT( PrimID, SetID) from ref_category_en where id = ?)', $cat2); } logfire('car cat3 ', $select); return $this->_cat3 = $refcat3->fetchAll($select); }
protected function getSearchSelect($limit, $offset = 0, $countryid, $stateid, $cityid, $regionid, $suburbid, $title = null, $cat1 = null, $cat2 = null, $cat3 = null, $cat4 = null, $cat5 = null, $addtionalData = null) { try { $pstitleTable = new Pstposting(); $select = $pstitleTable->select()->setIntegrityCheck(false); $psttitle = new Psttitle(); $reflocTable = new Refloc(); $refcat1Table = new Refcat1(); $refcategoryTable = new Refcategory(); $select->from(array('a' => $pstitleTable->getTableName()))->join(array('b' => $psttitle->getTableName()), 'a.id = b.id', array('a.*', 'b.title', 'postingid' => 'b.id'))->join(array('c' => $reflocTable->getTableName()), 'a.locId = c.id')->joinLeft(array('d' => $refcat1Table->getTableName()), 'a.cat1 = d.cat1Id', array('cat1name' => 'catName'))->joinLeft(array('e' => $refcategoryTable->getTableName()), 'a.cat2 = e.id', array('cat2name' => 'name'))->joinLeft(array('f' => $refcategoryTable->getTableName()), 'a.cat3 = f.id', array('cat3name' => 'name'))->joinLeft(array('g' => $refcategoryTable->getTableName()), 'a.cat4 = g.id', array('cat4name' => 'name'))->joinLeft(array('h' => $refcategoryTable->getTableName()), 'a.cat5 = h.id', array('cat5name' => 'name')); $select = $this->extraJoin($select); $select = $select->where('status = ?', 1)->order('lastUPdateDate Desc'); if (!empty($title)) { //$select->where('match (title) against(?)', $title); $title = str_replace(' ', '%', $title); $select->where('title like ? or a.id = ?', '%' . $title . '%'); } if (!empty($stateid)) { $select->where('stateid = ?', $stateid); } if (!empty($cityid)) { $select->where('cityid = ?', $cityid); } if (!empty($countryid)) { $select->where('countryid = ?', $countryid); } if (!empty($regionid)) { $select->where('regionid = ?', $regionid); } if (!empty($suburbid)) { $select->where('suburbid = ?', $suburbid); } logfire('cat1', $cat1); if (!empty($cat1) && $cat1 != 'ALL' && $cat1 != 'Any') { $select->where('cat1 = ?', $cat1); } if (!empty($cat2) && $cat2 != 'ALL' && $cat2 != 'Any') { $select->where('cat2 = ?', $cat2); } if (!empty($cat3) && $cat3 != 'ALL' && $cat3 != 'Any') { $select->where('cat3 = ?', $cat3); } if (!empty($cat4) && $cat4 != 'ALL' && $cat4 != 'Any') { $select->where('cat4 = ?', $cat4); } if (!empty($cat5) && $cat5 != 'ALL' && $cat5 != 'Any') { $select->where('cat5 = ?', $cat5); } logfire('searchselect', $select->__toString()); return $select; /* $postings = $this->fetchAll($select); if (empty($postings)) { return null; } else { return $postings; } */ } catch (Exception $e) { logError('Pst_posting failed!', $e); throw $e; } }
public function getCatsString($showCat1 = true) { $retString = ''; if (!empty($this->_posting->cat1) && $showCat1) { $refcat1 = new Refcat1(); $retString = $refcat1->getCatNameById($this->_posting->cat1); } if (!empty($this->_posting->cat2)) { $refcat = new Refcategory(); $cat = $refcat->getCatNameById($this->_posting->cat2); if (empty($retString)) { $retString = $cat; } else { $retString .= ', ' . $cat; } } if (!empty($this->_posting->cat3)) { $refcat = new Refcategory(); $cat = $refcat->getCatNameById($this->_posting->cat3); if (empty($retString)) { $retString = $cat; } else { $retString .= ', ' . $cat; } } if (!empty($this->_posting->cat4)) { $refcat = new Refcategory(); $cat = $refcat->getCatNameById($this->_posting->cat4); if (empty($retString)) { $retString = $cat; } else { $retString .= ', ' . $cat; } } if (!empty($this->_posting->cat5)) { $refcat = new Refcategory(); $cat = $refcat->getCatNameById($this->_posting->cat5); if (empty($retString)) { $retString = $cat; } else { $retString .= ', ' . $cat; } } return $retString; }
public function getTitle() { $title = ""; $cat2 = ""; $cat3 = ""; $catTables = new Refcategory(); if (!empty($this->_posting->cat2)) { $cat2 = $catTables->getCatNameById($this->_posting->cat2); } if (!empty($this->_posting->cat3)) { $cat3 = $catTables->getCatNameById($this->_posting->cat3); } $title .= $this->_pstCategory->makeYear . ' ' . $cat2 . ' ' . $cat3; $location = new Location($this->_posting->locId); $suburb = $location->getSuburb(); $title .= '<br /><span class="titlesecond">'; $cat1Table = new Refcat1(); $title .= $cat1Table->getCatNameById($this->_posting->cat1) . ' - ' . $this->_posting->priceDisplay . '<span class="titleend"> (' . $suburb . ")</span>" . "</span>"; return $title; }
protected function _getCat3($cat2 = null) { $refcat3 = new Refcategory(); return $this->_cat3 = $refcat3->getAllCat3OfSpecificCat2($cat2, $this->_busTypeId); }