| 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_TblAirline {
private $db = NULL;
public $intId = NULL;
public $strAlineCode = NULL;
public $searchArr = [];
public $recordLimit = '';
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 getAirlineList() {
$sql =" SELECT ";
if(!empty($this->recordLimit)){
$sql .=" TOP ".$this->recordLimit;
}
$sql .=" a.AirlineSysId,a.Code, a.LangType, a.Title, a.AirlineLogo, a.IsActive, TB_Master_Lang.TitleEng"
. " from TB_Master_Airline as a LEFT JOIN TB_Master_Lang on TB_Master_Lang.LangSysId = a.LangType WHERE a.IsMarkForDelete='0' ";
//echo "<pre>"; print_r($this->searchArr); die;
if (isset($this->searchArr['Title']) && $this->searchArr['Title'] !='') {
$Title = $this->searchArr['Title'];
$sql .= " AND ( a.Title = '$Title' OR a.Title LIKE '$Title%' )";
}
if (isset($this->searchArr['Code']) && $this->searchArr['Code'] !='') {
$Code = $this->searchArr['Code'];
$sql .= " AND ( a.Code = '$Code' OR a.Code LIKE '$Code%' )";
}
if (isset($this->searchArr['LangType']) && $this->searchArr['LangType'] !='') {
$LangType = $this->searchArr['LangType'];
$sql .= " AND ( a.LangType = '$LangType' )";
}
if (isset($this->searchArr['filter1']) && $this->searchArr['filter1'] !='') {
$filter1 = $this->searchArr['filter1'];
$sql .= " AND ( a.IsActive = '$filter1' )";
}
if(!empty($this->strAlineCode)){
$sql .=" AND a.Code = '".$this->strAlineCode."' ";
}
if(!empty($this->strCondition)){
$sql .= $this->strCondition;
}
$sql .=" ORDER BY a.Title ";
return $this->db->query($sql)->fetchAll();
}
public function getAirlineAutoSearchList($strAirline) {
$sql = "Select AirlineSysId, Code, Title as label, Title AS value From TB_Master_Airline where 1 = 1 AND IsActive='1' " ;
if(!empty($strAirline)) {
$sql .= " AND Title LIKE '$strAirline%' ";
}
$sql .= " ORDER BY Title ";
return $this->db->query($sql)->fetchAll();
}
//Added By Pardeep Panchal...
public function getAirlineIdsAndCodeList() {
$arrAirLine = array('AirlineSysId','Code');
$select = $this->db->select();
$select->from(array("t1" => "TB_Master_Airline"),$arrAirLine);
$select->where("IsActive = ?", 1);
$select->where("IsMarkForDelete = ?", 0);
$select->order("Title");
//echo $select; exit;
$result = $this->db->fetchAll($select);
$arrAirline = array();
if(count($result) > 0){
foreach ($result as $res){
$arrAirline[trim($res['Code'])] = trim($res['AirlineSysId']);
}
}
return $arrAirline;
}
//Added By Pardeep Panchal ends...
}