| 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_AddonsModel {
protected $db = NULL;
public $intId = NULL;
public $intAccomSysId = NULL;
public $intLoggedinUserAgencySysId = '';
public $orderBy = 'DESC';
/* * ************************************ */
public function __construct() {
$request = Zend_Controller_Front::getInstance()->getRequest();
$this->db = Zend_Db_Table::getDefaultAdapter();
}
public function __destruct() {
$this->db->closeConnection();
}
public function init() {
// parent::init();
$request = Zend_Controller_Front::getInstance()->getRequest();
}
public function getAddons($hotel_id, $AgencySysId,$order = 'DESC') {
$select = $this->db->select();
$supplarray = array('SupplierName');
$select->from(array('tb1' => "TB_MP_Inventory_Accom_ExtraServices"));
$select->joinLeft(array('tb2' => "TB_IC_Supplier"), "tb1.SupplierSysId = tb2.SupplierSysId", $supplarray);
$select->where("tb1.AccomSysId =?", $hotel_id);
$select->where("tb1.AgencySysId =?", $AgencySysId);
//$select->where("tb1.IsActive =?", 1);
$select->where("tb1.IsMarkForDel =?", 0);
$select->order(array('ExtraServiceSysId '.$order));
$result = $this->db->fetchAll($select);
return $result;
}
public function addAddonsService($data) {
try {
$insert = $this->db->insert('TB_IC_Accomdation_Room', $data);
return $this->db->lastInsertId('TB_IC_Accomdation_Room');
} catch (Exception $e) {
die('There has been an error. ' . $e->getMessage());
}
return 0;
}
public function UpdateInventoryExist($InvnItemSysId, $data) {
try {
return $this->db->update('TB_MP_Inventory_Accom', $data, array('InvnItemSysId = ?' => $InvnItemSysId));
} catch (Exception $e) {
die('There has been an error. ' . $e->getMessage());
}
return 0;
}
public function getTripjackCityData() {
$select = $this->db->select();
$select->from(array('tb1' => "TripJack_City"));
$select->where("tb1.TripJackCountryId != ?", 0);
$select->where("tb1.IsFatched =?", 0);
$select->where("tb1.Id =?", 77011);
$select->LIMIT(100);
//echo $select;exit;
$result = $this->db->fetchAll($select);
return $result;
}
public function updateTripJackCity($cityId) {
$data = array("IsFatched" => 1);
$where = array('CityId = ? ' => $cityId);
$update = $this->db->update('TripJack_City', $data, $where);
return $update;
}
}