| 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 Hotel Amenity Category Model
* Description This model class contains the functions needed for manipulation of Hotel Amenity Category.
* @name HotelAmenityCategory Model
* @author Shailender Joshi
* @editor Shailender Joshi <shailender@catpl.co.in>
* @version 1.0
* @copyright Catabatic Technologies Pvt Ltd
*
*/
class Travel_Model_TblHotelAmenityCategory {
public $intContSysId = NULL;
protected $db = NULL;
public $imageServerUrl = NULL;
public $baseUrl = NULL;
/* Common to all models */
public $strCondition = NULL;
public $deleted = 'N';
public $status = '1';
public $strSelectedView = '';
public $intQueryOffset = 0;
public $intListPerPage = 10;
public $strOrderBy = 'TB_Master_Accom_Aminity_Cat.Title' ;
public $intLoginUserId = NULL;
public $intLoginAgentId = NULL;
public $strImageFlag = NULL;
/***************************************/
public function __construct(){
#initialize db adapter
$this->db = Zend_Db_Table::getDefaultAdapter();
}
public function __destruct() {
$this->db->closeConnection();
}
# Start : functions added by Shailender Joshi on 28 Sep 2016
public function insertTable($table, $data)
{
$dbtable = new Zend_Db_Table("$table");
return $dbtable->insert($data);
}
/**
* updateTable() method is used to update data on table primary key basis
* @param table name, data array, where condition
* @return object
*/
public function updateTable($table, $editData, $where)
{
$dbtable = new Zend_Db_Table("$table");
return $dbtable->update($editData, $where);
}
/**
* getDetailsByUniqueId() method is used to get details on primary key
* @param table name, key name, key value
* @return object
*/
public function getDetailsByUniqueId($table, $columnArray, $uniqueId, $uniqueIdVal)
{
$select = $this->db->select()
->from("$table", $columnArray)
->where("$uniqueId =?", $uniqueIdVal);
$result = $this->db->fetchRow($select);
return $result;
} # getDetailsByUniqueId
// $where = array('column'=>value,'column'=>'value',.......);
// $columnArray = array('column1','column2','column3',...........);
public function getRecordListingWhere($table, $columnArray, $where, $orderby='', $order="ASC")
{
$select = $this->db->select()->from($table, $columnArray);
foreach($where as $col=>$val)
{
$select->where("$col =?", $val);
}
if(!empty($orderby))
$select->order("$orderby $order");
$result = $this->db->fetchAll($select);
return $result;
}
public function getHotelAmenityCategoryListingRecord()
{
$sql = " SELECT AAc.AminityCatId, AAC.Title, AAC.Icon, AAC.IsApprove, AAC.IsActive, AAC.CreateDate, AAC.UpdateDate FROM TB_Master_Accom_Aminity_Cat as AAC WHERE AAC.IsMarkForDel =0 " ;
if(!empty($this->searchArr)) {
//echo "<pre>"; print_r($this->searchArr); die;
if($this->searchArr['dateFrom']!='' && $this->searchArr['dateTo']!='')
{
$sql .= " AND AAC.CreateDate >= '".$this->searchArr['dateFrom']."' AND AAC.CreateDate <= '".$this->searchArr['dateTo']."' ";
}
if($this->searchArr['Title']!='')
{
$sql .= " AND AAC.Title LIKE '%".$this->searchArr['Title']."%' ";
}
if($this->searchArr['filter1']!='All' && $this->searchArr['filter1']!='')
{
$sql .= " AND AAC.IsActive = '".$this->searchArr['filter1']."' ";
}
if($this->searchArr['filter2']!='All' && $this->searchArr['filter2']!='')
{
$sql .= " AND AAC.IsApprove = '".$this->searchArr['filter2']."' ";
}
}
$sql .= " ORDER BY AAC.AminityCatId DESC ";
//echo $sql; //die();
$rowset = $this->db->query($sql)->fetchAll();
return $rowset;
}
# End : functions added by Shailender Joshi on 28 Sep 2016
}