| 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/modules/restaturants/models/ |
Upload File : |
<?php
/* Zend Framework
* @category Zend
* @package Zend_Controller_Action
* @copyright Copyright (c) 2008-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version 1.0
* @author Ranvir singh <ranvir@catpl.co.in>
* Create Date 11-08-2016
* Update Date 25-10-2016
* *************************************************************
*/
class Restaturants_Model_Restaturants extends Zend_Db_Table_Abstract {
public $searchArr = NULL;
function __construct() {
$this->db = Zend_Db_Table::getDefaultAdapter();
}
public function __destruct() {
$this->db->closeConnection();
}
public function updateTable($table, $editData, $where) {
$dbtable = new Zend_Db_Table("$table");
return $dbtable->update($editData, $where);
}
public function insertTable($table, $data) {
$dbtable = new Zend_Db_Table("$table");
return $dbtable->insert($data);
}
public function getRestaturants($AgencySysId) {
$select = $this->db->select()
->from(array("t1" => "TB_Agency_Restaurant_Master"), array('RestaurantSysId', 'RestaurantName', 'IsPreferred', 'Address','AreaSysId'))
->joinLeft(array('t3' => "TB_Master_Geo_City"), "t1.CityId = t3.CityId", array("Title as CityName"))
->joinLeft(array('t2' => "TB_Master_Geo_Country"), "t3.ContSysId = t2.ContId", array("Title as CountryName"))
->joinLeft(array('t5' => "TB_IC_Supplier"), "t1.SupplierSysId = t5.SupplierSysId", array('SupplierName'))
->where("t1.AgencySysId = (?)", $AgencySysId)
->where("t1.IsActive = 1")
->where("t1.IsMarkForDel = 0")
->order("t1.RestaurantSysId DESC");
$result = $this->db->fetchAll($select);
return $result;
}
public function getRestaturantsDetails($RestaturantId, $AgencySysId) {
$select = $this->db->select()
->from(array("t1" => "TB_Agency_Restaurant_Master"), array('RestaurantSysId', 'RestaurantName', 'IsPreferred', 'Address', 'CountrySysId', 'CityId', 'SupplierSysId', 'FirstName', 'LastName', 'Salutation', 'SupplierSysId', 'CountryCode', 'ContactNumber', 'ContactEmailId','AreaSysId'))
->joinLeft(array('t2' => "TB_Agency_Restaurant_Meal_Rate"), "t1.RestaurantSysId = t2.RestaurantSysId AND t2.IsActive = 1 AND t2.IsMarkForDel = 0 ")
->joinLeft(array('t3' => "TB_Master_Geo_City"), "t1.CityId = t3.CityId", array("Title as CityName"))
->joinLeft(array('t4' => "TB_Master_Geo_Country"), "t1.CountrySysId = t4.ContId", array("Title as CountryName"))
->joinLeft(array('t5' => "TB_IC_Supplier"), "t1.SupplierSysId = t5.SupplierSysId", array('SupplierName'))
->where("t1.RestaurantSysId = (?)", $RestaturantId)
->where("t1.AgencySysId = (?)", $AgencySysId)
->where("t1.IsActive = 1")
->where("t1.IsMarkForDel = 0");
// ->where("t2.IsActive = 1")
// ->where("t2.IsMarkForDel = 0");
$result = $this->db->fetchAll($select);
return $result;
}
public function getRestaturantsDetailsByMealSysId($AgencySysId,$RestaurantMealSysId) {
$select = $this->db->select()
->from(array("t1" => "TB_Agency_Restaurant_Master"), array('RestaurantSysId', 'RestaurantName', 'IsPreferred', 'Address', 'CountrySysId', 'CityId', 'SupplierSysId', 'FirstName', 'LastName', 'Salutation', 'SupplierSysId', 'CountryCode', 'ContactNumber', 'ContactEmailId','AreaSysId'))
->joinLeft(array('t2' => "TB_Agency_Restaurant_Meal_Rate"), "t1.RestaurantSysId = t2.RestaurantSysId")
->joinLeft(array('t5' => "TB_IC_Supplier"), "t1.SupplierSysId = t5.SupplierSysId", array('SupplierName'))
->where("t2.RestaurantMealSysId = (?)", $RestaurantMealSysId)
->where("t2.AgencySysId = (?)", $AgencySysId)
->where("t1.IsActive = 1")
->where("t1.IsMarkForDel = 0")
->where("t2.IsActive = 1")
->where("t2.IsMarkForDel = 0");
$result = $this->db->fetchRow($select);
return $result;
}
}
# end of class Insurance_Model_Insurance