protected function _getCat3($cat2 = null) { if (empty($this->_cat3)) { $refcat3 = new Refcat1(); return $this->_cat3 = $refcat3->getAllCat1OfSpecificCategory($this->_busTypeId); } else { return $this->_cat3; } }
protected function buildRefineUri($businessType, $formData) { if (strtolower($formData['cat2']) == strtolower('Any')) { $formData['cat2name'] = 'Any'; } else { $refcat2 = new Refcategory(); $formData['cat2name'] = $refcat2->getCatNameById($formData['cat2']); } if (strtolower($formData['cat3']) == 26) { $formData['cat3name'] = 'Any'; } else { $refcat3 = new Refcat1(); $formData['cat3name'] = $refcat3->getCatNameById($formData['cat3']); } return parent::buildRefineUri($businessType, $formData); }
public function getTitle() { $title = $this->_pstCategory->address; $location = new Location($this->_posting->locId); $suburb = $location->getSuburb(); if (!empty($suburb)) { $title .= ' <span class="titleend">(' . $suburb . ')</span>'; } if ($this->_posting->cat2 == 630) { $type = 'For Sale'; } else { if ($this->_posting->cat2 == 638) { $type = 'For Lease'; } else { if ($this->_posting->cat2 == 645) { $type = 'For Share'; } } } $title .= '<br /><span class="titlesecond">' . $type; $cat1Table = new Refcat1(); $title .= ' by ' . $cat1Table->getCatNameById($this->_posting->cat1) . ' - ' . $this->_posting->priceDisplay . ' - ' . ' Bed: ' . Tag::getUnitsAmount($this->_pstCategory->rooms) . ', Bath: ' . Tag::getUnitsAmount($this->_pstCategory->baths) . ', Cars: ' . Tag::getUnitsAmount($this->_pstCategory->parking) . "</span>"; return $title; }
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 buildRefineUri($businessType, $formData) { try { echo str_replace(' ', '', strtolower($businessType)) . 'basicrefine'; if (array_key_exists('cat1', $formData) && !empty($formData['cat1']) && strtolower($formData['cat1']) != strtolower('ALL') && strtolower($formData['cat1']) != strtolower('Any')) { $refcat1 = new Refcat1(); $formData['cat1name'] = $refcat1->getCatNameById($formData['cat1']); } /* if (strtolower($formData['cat2']) == strtolower('ALL')) { $formData['cat2name'] = 'ALL'; } else{ $refcat2 = new Refcategory(); $formData['cat2name'] = $refcat2->getCatNameById($formData['cat2']); } if (strtolower($formData['cat3']) == strtolower('ALL')) { $formData['cat3name'] = 'ALL'; } else{ $refcat3 = new Refcategory(); $formData['cat3name'] = $refcat3->getCatNameById($formData['cat3']); } */ if (array_key_exists('suburbid', $formData) && !empty($formData['suburbid']) && strtolower($formData['suburbid']) != strtolower('ALL')) { $locationid = $formData['suburbid']; } elseif (array_key_exists('regionid', $formData) && !empty($formData['regionid']) && strtolower($formData['regionid']) != strtolower('ALL')) { $locationid = $formData['regionid']; } elseif (array_key_exists('cityid', $formData) && !empty($formData['cityid']) && strtolower($formData['cityid']) != strtolower('ALL')) { $locationid = $formData['cityid']; } elseif (array_key_exists('stateid', $formData) && !empty($formData['stateid']) && strtolower($formData['stateid']) != strtolower('ALL')) { $locationid = $formData['stateid']; } $location = new Location($locationid); $formData['country'] = $location->getCountry(); $formData['city'] = $location->getUriCity(); $formData['state'] = $location->getUriState(); $formData['locationid'] = $locationid; logfire('city', $formData['city']); logfire('state', $formData['state']); //logfire('cat3name', $formData['cat3name']); echo 'sss' . '1'; $formData = Common::encodeUriParams($formData); return Tag::url(str_replace(' ', '', strtolower($businessType)) . 'basicrefine', Common::arrayToStdClass($formData)); } catch (Exception $e) { echo $e; } }