| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/application/models/ |
Upload File : |
<?php
class Travel_Model_TblPlace {
private $db = NULL;
public $intId = NULL;
public $strAlineCode = NULL;
public $strCondition = '';
public function __construct(){
$request = Zend_Controller_Front::getInstance()->getRequest();
$this->baseUrl = $request->getScheme() . '://' . $request->getHttpHost();
$this->db = Zend_Db_Table::getDefaultAdapter();
}
public function __destruct() {
$this->db->closeConnection();
}
public function getPlaceList() {
$sql =" SELECT * from TB_Master_Place WHERE IsActive='1' ";
if(!empty($this->strAlineCode)){
$sql .=" AND Code = '".$this->strAlineCode."' ";
}
if(!empty($this->strCondition)){
$sql .= $this->strCondition;
}
$sql .=" ORDER BY Title ";
return $this->db->query($sql)->fetchAll();
}
public function getPlaceAutoSearchList($strPlace) {
$sql = "Select PlaceSysId, Code, Title as label, Title AS value From TB_Master_Place where 1 = 1 AND IsActive='1' " ;
if(!empty($strPlace)) {
$sql .= " AND Title LIKE '$strPlace%' ";
}
$sql .= " ORDER BY Title ";
return $this->db->query($sql)->fetchAll();
}
public function getPlaceListingRecord()
{
$sql = " SELECT Place.PlaceSysId, Place.PinCode, Place.ShortCode, Place.Title, Place.IsActive, TB_Master_Geo_Country.Title as Countryname,"
. " TB_Master_Geo_Zone.Title as zoneName FROM TB_Master_Place as Place "
. "LEFT JOIN TB_Master_Geo_Country ON TB_Master_Geo_Country.ContId = Place.ContSysId "
. " LEFT JOIN TB_Master_Geo_Zone ON TB_Master_Geo_Zone.ZoneId = Place.ZoneSysId WHERE Place.IsMarkForDel = 0 " ;
if(!empty($this->searchArr)) {
//echo "<pre>"; print_r($this->searchArr); die;
if($this->searchArr['Title']!='')
{
$sql .= " AND Place.Title LIKE '%".$this->searchArr['Title']."%' ";
}
if($this->searchArr['country']!='')
{
$sql .= " AND Place.ContSysId = '".$this->searchArr['country']."' ";
}
if($this->searchArr['Zone']!='')
{
$sql .= " AND Place.ZoneSysId = '".$this->searchArr['Zone']."' ";
}
if($this->searchArr['filter1']!='All' && $this->searchArr['filter1']!='')
{
$sql .= " AND Place.IsActive = '".$this->searchArr['filter1']."' ";
}
}
$sql .= " ORDER BY Place.PlaceSysId DESC ";
$rowset = $this->db->query($sql)->fetchAll();
return $rowset;
}
# End : functions added by Shailender Joshi on 14 Oct 2016
}