403Webshell
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/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/controllers/MasterController.php
<?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    $Id: DbTable.php 8862 2012-03-16 15:36:00Z thomas $
    * @author     Shobhit Srivastav(shobhit833@gmail.com).
    * Create Date 27-07-2016
    * Update Date 27-07-2016
	* MasterController (It will allow users to add different masters)
*****/

class MasterController extends Zend_Controller_Action
{   
    private $intLoggedinUserId = '';
    private $intLoggedinUserGroupSysId = '0';
    
    private $intLoggedinUserAgencySysId = '0';
    
    private $intLoggedinUserTrxCurrency = '0';
    
    public $baseUrl = '';
    public function init() {
		$request = Zend_Controller_Front::getInstance()->getRequest();
        $this->baseUrl = $request->getScheme() . '://' . $request->getHttpHost();
        $this->view->headScript()->appendFile($this->baseUrl . '/public/assets/js/jquery-ui.js');
        $sessionLogin_user = new Zend_Session_Namespace('sessionLogin_user');
//        Zend_Session::rememberMe(60 * 60 * 24 * 7);
        #get session variable
        $this->intLoggedinUserId            = $sessionLogin_user->intLoggedinUserId;
        $this->intLoggedinUserGroupSysId    = $sessionLogin_user->intLoggedinUserGroupSysId;
        $this->intLoggedinUserAgencySysId   = $sessionLogin_user->intLoggedinUserAgencySysId;
        $this->intLoggedinUserTrxCurrency   = $sessionLogin_user->intLoggedinUserTrxCurrency;
		if(empty($this->intLoggedinUserId)) {
            $this->_redirect('/login/');
        }
		$this->_hotelamentiesObj = new Travel_Model_Master_Amenities();
		$this->_mealtypeObj = new Travel_Model_Master_Mealtype();
		$this->_roomaminityObj = new Travel_Model_Master_RoomAmenity();
		$this->_roominclusionObj = new Travel_Model_Master_RoomInclusion();
		$this->_activitygrouptypeObj = new Travel_Model_Master_ActivityGrouptype();
		$this->_activityinctypeObj = new Travel_Model_Master_ActivityInctype();
		$this->_activitytypeObj = new Travel_Model_Master_Activitytype();
		$this->_hotelamentiescatObj = new Travel_Model_Master_AmenitiesCat();
		
		
    }
    public function indexAction(){
		$this->_helper->layout->disableLayout();
		//echo $this->intLoggedinUserId;
	}
	public function addHotelAmentiesAction() {
		$encodeaminityID = $this->getRequest()->getParam('id'); 
		$editaminityID = base64_decode($encodeaminityID);
		if($editaminityID){
			$getHotelAminityByID = $this->_hotelamentiesObj->GetHotelAminityById($editaminityID);
			$this->view->aminityData = $getHotelAminityByID;
			
			
		}
		$hotelameenitiesCategory = $this->_hotelamentiescatObj->GetHotelAmenitiesCat();
		$this->view->aminityCategory = $hotelameenitiesCategory;
		if(!empty($_FILES['hotelicon']['name'])){
			$upload = new Zend_File_Transfer_Adapter_Http();
			$files = $upload->getFileInfo();
			$size = $upload->getFileSize();
			$imagename = $files['hotelicon']['name'] ? $files['hotelicon']['name'] : 'No File';
			$tmp_name = $files['hotelicon']['tmp_name'];
			$toupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/hotelamenity/'.$files['hotelicon']['name']);
		}
		else
		{
			$imagename = 'No File';
		}
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            
//            $date = new Zend_Date();
            $currentDate = date('Y-m-d H:i:s');
            $amentiesarray = array(
				'CatMask' => '',
                'Title' => $getData['title'],
				'Icon' => $imagename,
				'IsApprove' => 1,
				'ApproveDate' => $currentDate,
				'UpdateDate' => $currentDate,
				'CreateDate' => $currentDate,
				'IsMarkForDel' => 0,
                'IsActive' => $getData['status']
            );
			//echo $editaminityID;
            //Insert/Update agency department
            if($getData['editID']){
				$where = "AminityId = ". $getData['editID'];
				$objDeptRes = $this->_hotelamentiesObj->UpdateHotelAmentiesData($amentiesarray,$where);
			}
			else{
				$objDeptRes = $this->_hotelamentiesObj->addHotelAmenties($amentiesarray);
			}
			
			
            	echo $objDeptRes;
		  // $this->_helper->flashMessenger->addMessage("Hotel Amenities added successfully.");
           $this->_redirect("/master/list");
            
        }
    }
	
	
	
	public function addActivityGroupAction() {
		$encodemealID = $this->getRequest()->getParam('id'); 
		$editmealID = base64_decode($encodemealID);
		if($editmealID){
			$getMealDataByID = $this->_activitygrouptypeObj->GetActivityTypeById($editmealID);
			$this->view->activtyData = $getMealDataByID;
			
			
		}
		$upload = new Zend_File_Transfer_Adapter_Http();
		if(!empty($_FILES['hotelicon']['name'])){
			$files = $upload->getFileInfo();
			$imagename = $files['hotelicon']['name'] ? $files['hotelicon']['name'] : 'No File';
			$tmp_name = $files['hotelicon']['tmp_name'];
			$toupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/Activity/baseimg/'.$files['hotelicon']['name']);
		}
		else
		{
			$imagename = 'No File';
		}
		
		
		if(!empty($_FILES['baseimg']['name'])){
			$basefiles = $upload->getFileInfo();
			$baseimage = $basefiles['baseimg']['name'] ? $_FILES['baseimg']['name'] : 'No File';
			$tmp_name = $basefiles['baseimg']['tmp_name'];
			$tobaseupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/images/Activity/mainimg/'.$basefiles['baseimg']['name']);
		}
		else
		{
			$baseimage = 'No File';
		}
		
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            
//            $date = new Zend_Date();
            $currentDate = date('Y-m-d H:i:s');
            $activitytypearray = array(
                'Title' => $getData['title'],
				'Details' => $getData['Details'],
				'Meta' => $getData['Meta'],
				'Icon' => $imagename,
				'BaseImage' => $baseimage,
                'IsActive' => $getData['status']
            );
			
			//echo $getData['editID'];
			
			
            if($getData['editID']){
				$where = "ActivityGroupType = ". $getData['editID'];
				$objDeptRes = $this->_activitygrouptypeObj->UpdateActivityData($activitytypearray,$where);
			}
			else{
				$objDeptRes = $this->_activitygrouptypeObj->addActivityGroupType($activitytypearray);
			}
           	echo $objDeptRes;
		  // $this->_helper->flashMessenger->addMessage("Hotel Amenities added successfully.");
           $this->_redirect("master/listactivity");
           
        }
    }
	
	
	public function addActivityTypeAction() {
		$encodemealID = $this->getRequest()->getParam('id'); 
		$editmealID = base64_decode($encodemealID);
		if($editmealID){
			$getActivityDataByID = $this->_activitytypeObj->GetActivityById($editmealID);
			$this->view->activtyData = $getActivityDataByID;
		}
		$activitygroup = $this->_activitygrouptypeObj->GetAllActivityType();
		$this->view->activtygroup = $activitygroup;
		
		$upload = new Zend_File_Transfer_Adapter_Http();
		if(!empty($_FILES['hotelicon']['name'])){
			$files = $upload->getFileInfo();
			$imagename = $files['hotelicon']['name'] ? $files['hotelicon']['name'] : 'No File';
			$tmp_name = $files['hotelicon']['tmp_name'];
			$toupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/Activitytype/baseimg/'.$files['hotelicon']['name']);
		}
		else
		{
			$imagename = 'No File';
		}
		
		
		if(!empty($_FILES['baseimg']['name'])){
			$basefiles = $upload->getFileInfo();
			$baseimage = $basefiles['baseimg']['name'] ? $_FILES['baseimg']['name'] : 'No File';
			$tmp_name = $basefiles['baseimg']['tmp_name'];
			$tobaseupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/Activitytype/mainimg/'.$basefiles['baseimg']['name']);
		}
		else
		{
			$baseimage = 'No File';
		}
		
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            
//            $date = new Zend_Date();
            $currentDate = date('Y-m-d H:i:s');
            $activitytypearray = array(
			    'ActivityGroupType' => $getData['activitygrp'],
                'Title' => $getData['title'],
				'Details' => $getData['Details'],
				'Meta' => $getData['Meta'],
				'Icon' => $imagename,
				'BaseImage' => $baseimage,
                'IsActive' => $getData['status']
            );
			
			//echo $getData['editID'];
			
			
            if($getData['editID']){
				$where = "ActivityType = ". $getData['editID'];
				$objDeptRes = $this->_activitytypeObj->UpdateActivityTypeData($activitytypearray,$where);
			}
			else{
				$objDeptRes = $this->_activitytypeObj->addActivityType($activitytypearray);
			}
           	echo $objDeptRes;
		  // $this->_helper->flashMessenger->addMessage("Hotel Amenities added successfully.");
           $this->_redirect("master/listactivitytype");
           
        }
    }
	
	public function listactivitytypeAction(){
		$getallActivitytype = $this->_activitytypeObj->GetAllActivityType();
        $page=$this->_getParam('page',1);
        $paginator = Zend_Paginator::factory($getallActivitytype);      
        $paginator->setCurrentPageNumber($this->getRequest()->getParam('page')); // page number
        $perPage = $paginator->setItemCountPerPage(10); // number of items to show per page
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
                
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
	}
	
	
	
	
	
	
	public function listactivityincAction(){
		$getallActivityinctype = $this->_activityinctypeObj->GetAllActivityIncType();
        $page=$this->_getParam('page',1);
        $paginator = Zend_Paginator::factory($getallActivityinctype);      
        $paginator->setCurrentPageNumber($this->getRequest()->getParam('page')); // page number
        $perPage = $paginator->setItemCountPerPage(10); // number of items to show per page
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
                
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
	}
	
	
	
	public function listactivityAction(){
		$getallActivity = $this->_activitygrouptypeObj->GetAllActivityType();
        $page=$this->_getParam('page',1);
        $paginator = Zend_Paginator::factory($getallActivity);      
        $paginator->setCurrentPageNumber($this->getRequest()->getParam('page')); // page number
        $perPage = $paginator->setItemCountPerPage(10); // number of items to show per page
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
                
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
	}
	
	public function addMealTypeAction() {
		$encodemealID = $this->getRequest()->getParam('id'); 
		$editmealID = base64_decode($encodemealID);
		if($editmealID){
			$getMealDataByID = $this->_mealtypeObj->GetMealTypeById($editmealID);
			$this->view->mealData = $getMealDataByID;
			
			
		}
		if(!empty($_FILES['hotelicon']['name'])){
			$upload = new Zend_File_Transfer_Adapter_Http();
			$files = $upload->getFileInfo();
			$size = $upload->getFileSize();
			$imagename = $files['hotelicon']['name'] ? $files['hotelicon']['name'] : 'No File';
			$tmp_name = $files['hotelicon']['tmp_name'];
			$toupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/mealtype/'.$files['hotelicon']['name']);
		}
		else
		{
			$imagename = 'No File';
		}
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            
//            $date = new Zend_Date();
            $currentDate = date('Y-m-d H:i:s');
            $mealtypearray = array(
                'Title' => $getData['title'],
				'Icon' => $imagename,
				'UpdateDate' => $currentDate,
				'CreateDate' => $currentDate,
				'IsMarkForDel' => 0,
                'IsActive' => $getData['status']
            );
			//echo $editaminityID;
            //Insert/Update agency department
            if($getData['editID']){
				$where = "MealTypeId = ". $getData['editID'];
				$objDeptRes = $this->_mealtypeObj->UpdateMealData($mealtypearray,$where);
			}
			else{
				$objDeptRes = $this->_mealtypeObj->addMealType($mealtypearray);
			}
           	echo $objDeptRes;
		  // $this->_helper->flashMessenger->addMessage("Hotel Amenities added successfully.");
           $this->_redirect("master/listmealtype");
           
        }
    }
	
	
	
	public function addActivityIncAction() {
		$encodeincID = $this->getRequest()->getParam('id'); 
		$editincID = base64_decode($encodeincID);
		if($editincID){
			$getactivityIncByID = $this->_activityinctypeObj->GetActivityIncTypeById($editincID);
			$this->view->incData = $getactivityIncByID;
		}
		if(!empty($_FILES['hotelicon']['name'])){
			$upload = new Zend_File_Transfer_Adapter_Http();
			$files = $upload->getFileInfo();
			$size = $upload->getFileSize();
			$imagename = $files['hotelicon']['name'] ? $files['hotelicon']['name'] : 'No File';
			$tmp_name = $files['hotelicon']['tmp_name'];
			$toupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/activityinc/'.$files['hotelicon']['name']);
		}
		else
		{
			$imagename = 'No File';
		}
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            
//            $date = new Zend_Date();
            $currentDate = date('Y-m-d H:i:s');
            $inctypearray = array(
                'Title' => $getData['title'],
				'Icon' => $imagename,
				'UpdateDate' => $currentDate,
				'CreateDate' => $currentDate,
				'IsMarkForDel' => 0,
                'IsActive' => $getData['status']
            );
			//echo $editaminityID;
            //Insert/Update agency department
            if($getData['editID']){
				$where = "ActivityInclype = ". $getData['editID'];
				$objDeptRes = $this->_activityinctypeObj->UpdateActivityIncData($inctypearray,$where);
			}
			else{
				$objDeptRes = $this->_activityinctypeObj->addActivityIncType($inctypearray);
			}
           	echo $objDeptRes;
		  // $this->_helper->flashMessenger->addMessage("Hotel Amenities added successfully.");
           $this->_redirect("master/listactivityinc");
           
        }
    }
	
	
	
	
	
	public function addRoomAmentiesAction() {
		$encoderoomID = $this->getRequest()->getParam('id'); 
		$editroomID = base64_decode($encoderoomID);
		if($editroomID){
			$getRoomDataByID = $this->_roomaminityObj->GetRoomTypeById($editroomID);
					
			$this->view->mealData = $getRoomDataByID;
			
			
		}
		if(!empty($_FILES['hotelicon']['name'])){
			$upload = new Zend_File_Transfer_Adapter_Http();
			$files = $upload->getFileInfo();
			$size = $upload->getFileSize();
			$imagename = $files['hotelicon']['name'] ? $files['hotelicon']['name'] : 'No File';
			$tmp_name = $files['hotelicon']['tmp_name'];
			$toupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/roomamenity/'.$files['hotelicon']['name']);
		}
		else
		{
			$imagename = 'No File';
		}
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            
//            $date = new Zend_Date();
            $currentDate = date('Y-m-d H:i:s');
            $roomtypearray = array(
                'Title' => $getData['title'],
				'Icon' => $imagename,
				'UpdateDate' => $currentDate,
				'CreateDate' => $currentDate,
				'IsMarkForDel' => 0,
                'IsActive' => $getData['status']
            );
			//echo $editaminityID;
            //Insert/Update agency department
            if($getData['editID']){
				$where = "AminityId = ". $getData['editID'];
				$objDeptRes = $this->_roomaminityObj->UpdateRoomData($roomtypearray,$where);
			}
			else{
				$objDeptRes = $this->_roomaminityObj->addRoomType($roomtypearray);
			}
           	echo $objDeptRes;
		  // $this->_helper->flashMessenger->addMessage("Hotel Amenities added successfully.");
           $this->_redirect("master/listroomtype");
           
        }
    }
	
	public function addRoomInclusionAction() {
		$encoderoominclusionID = $this->getRequest()->getParam('id'); 
		$editroomID = base64_decode($encoderoominclusionID);
		if($editroomID){
			$getRoomDataByID = $this->_roominclusionObj->GetRoomInclusionTypeById($editroomID);
					
			$this->view->roominclusion = $getRoomDataByID;
			
			
		}
		if(!empty($_FILES['hotelicon']['name'])){
			$upload = new Zend_File_Transfer_Adapter_Http();
			$files = $upload->getFileInfo();
			$size = $upload->getFileSize();
			$imagename = $files['hotelicon']['name'] ? $files['hotelicon']['name'] : 'No File';
			$tmp_name = $files['hotelicon']['tmp_name'];
			$toupload = move_uploaded_file($tmp_name,$_SERVER['DOCUMENT_ROOT'] . '/public/assets/images/roominclusion/'.$files['hotelicon']['name']);
		}
		else
		{
			$imagename = 'No File';
		}
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            
//            $date = new Zend_Date();
            $currentDate = date('Y-m-d H:i:s');
            $roominclusionarray = array(
                'Title' => $getData['title'],
				'Icon' => $imagename,
				'UpdateDate' => $currentDate,
				'CreateDate' => $currentDate,
				'IsMarkForDel' => 0,
                'IsActive' => $getData['status']
            );
			//echo $editaminityID;
            //Insert/Update agency department
            if($getData['editID']){
				$where = "InclId = ". $getData['editID'];
				$objDeptRes = $this->_roominclusionObj->UpdateRoomInclusionData($roominclusionarray,$where);
			}
			else{
				$objDeptRes = $this->_roominclusionObj->addRoomInclusionType($roominclusionarray);
			}
           	echo $objDeptRes;
		  // $this->_helper->flashMessenger->addMessage("Hotel Amenities added successfully.");
           $this->_redirect("master/listroominclusion");
           
        }
    }
	
	public function listroominclusionAction(){
		$getroomInclusion = $this->_roominclusionObj->GetAllRoomInclusionType();
        $page=$this->_getParam('page',1);
        $paginator = Zend_Paginator::factory($getroomInclusion);      
        $paginator->setCurrentPageNumber($this->getRequest()->getParam('page')); // page number
        $perPage = $paginator->setItemCountPerPage(10); // number of items to show per page
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
                
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
	}
	
	public function listroomtypeAction(){
		
		$getroomData = $this->_roomaminityObj->GetAllRoomType();
        $page=$this->_getParam('page',1);
        $paginator = Zend_Paginator::factory($getroomData);      
        $paginator->setCurrentPageNumber($this->getRequest()->getParam('page')); // page number
        $perPage = $paginator->setItemCountPerPage(10); // number of items to show per page
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
                
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
		
	}
	
	public function listmealtypeAction(){
		
		$getroomData = $this->_mealtypeObj->GetAllMealType();
        $page=$this->_getParam('page',1);
        $paginator = Zend_Paginator::factory($getroomData);      
        $paginator->setCurrentPageNumber($this->getRequest()->getParam('page')); // page number
        $perPage = $paginator->setItemCountPerPage(10); // number of items to show per page
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
		
	}
	
	
	
	public function listAction()
    {
		$getAminityData = $this->_hotelamentiesObj->GetHotelAmenities();
        $page=$this->_getParam('page',1);
        $paginator = Zend_Paginator::factory($getAminityData);      
        $paginator->setCurrentPageNumber($this->getRequest()->getParam('page')); // page number
        $perPage = $paginator->setItemCountPerPage(10); // number of items to show per page
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
                
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
		   
    }
	/**
     * Deactivate Hotel Amenities Action. 
     */
    public function deactivateHotelAmentiesAction()
    {
        $aminityID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 0,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "AminityId = ". $aminityID;
        $updatehotelAmenties = $this->_hotelamentiesObj->UpdateHotelAmenities($data, $where);        
		$this->_redirect('/master/list');
    }
    
    /**
     * Activate Hotel Amenities Action. 
     */
    public function activateHotelAmentiesAction()
    {
		$aminityID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 1,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "AminityId = ". $aminityID;
        $updatehotelAmenties = $this->_hotelamentiesObj->UpdateHotelAmenities($data, $where);        
		$this->_redirect('/master/list');
	}
	
	public function deactivateMealAmentiesAction()
    {
        $mealtypeID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 0,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "mealtypeID = ". $mealtypeID;
        $updatehotelAmenties = $this->_mealtypeObj->UpdateMealType($data, $where);        
		$this->_redirect('/master/listmealtype');
    }
    
    /**
     * Activate Hotel Amenities Action. 
     */
    public function activateMealAmentiesAction()
    {
		$mealID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 1,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "MealTypeId = ". $mealID;
        $updatehotelAmenties = $this->_mealtypeObj->UpdateMealType($data, $where);        
		$this->_redirect('/master/listmealtype');
	}
	
	
	 public function deactivateRoomTypeAction()
    {
        $roomtypeID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 0,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "AminityId = ". $roomtypeID;
        $updatehotelAmenties = $this->_roomaminityObj->UpdateRoomData($data, $where);        
		$this->_redirect('/master/listroomtype');
    }
    
    
    public function activateRoomTypeAction()
    {
		$roomtypeID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 1,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "AminityId = ". $roomtypeID;
        $updatehotelAmenties = $this->_roomaminityObj->UpdateRoomData($data, $where);        
		$this->_redirect('/master/listroomtype');
	}
	
	
	
	public function deactivateRoomInclusionAction()
    {
        $inclusionID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 0,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "InclId = ". $inclusionID;
        $updatehotelAmenties = $this->_roominclusionObj->UpdateRoomInclusionData($data, $where);        
		$this->_redirect('/master/listroominclusion');
    }
    
    
    public function activateRoomInclusionAction()
    {
		$inclusionID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
					'IsActive' => 1,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "InclId = ". $inclusionID;
        $updatehotelAmenties = $this->_roominclusionObj->UpdateRoomInclusionData($data, $where);        
		$this->_redirect('/master/listroominclusion');
	}
	
	public function deactivateActivityTypeAction()
    {
        $activitygroupID = $this->getRequest()->getParam('id'); 
		$data = array(
					'IsActive' => 0
					
				);
		$where = "ActivityGroupType = ". $activitygroupID;
        $updatehotelAmenties = $this->_activitygrouptypeObj->UpdateActivityData($data, $where);        
		$this->_redirect('/master/listactivity');
    }
    
    
    public function activateActivityTypeAction()
    {
		$activitygroupID = $this->getRequest()->getParam('id'); 
		$data = array(
					'IsActive' => 1
					
				);
		$where = "ActivityGroupType = ". $activitygroupID;
        $updatehotelAmenties = $this->_activitygrouptypeObj->UpdateActivityData($data, $where);        
		$this->_redirect('/master/listactivity');
	}
	
	public function deactivateActivityIncAction()
    {
        $activityincID = $this->getRequest()->getParam('id'); 
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');
		$data = array(
				
					'IsActive' => 0,
					'UpdateDate' => $updatecurrentDate		
					
				);
		$where = "ActivityInclype = ". $activityincID;
        $updatehotelAmenties = $this->_activityinctypeObj->UpdateActivityIncData($data, $where);        
		$this->_redirect('/master/listactivityinc');
    }
    
    
    public function activateActivityIncAction()
    {
		$activityincID = $this->getRequest()->getParam('id');
//		$date = new Zend_Date();
        $updatecurrentDate = date('Y-m-d H:i:s');	
		$data = array(
					'IsActive' => 1,
					'UpdateDate' => $updatecurrentDate
				);
		$where = "ActivityInclype = ". $activityincID;
        $updatehotelAmenties = $this->_activityinctypeObj->UpdateActivityIncData($data, $where);        
		$this->_redirect('/master/listactivityinc');
	}
	
    public function areaMasterAction() {
        $this->view->baseUrl = $this->baseUrl;
        $post = $this->getRequest()->getPost();
        $this->view->startCityName = $startCityName = isset($post['start_city_name']) ? $post['start_city_name'] : '';
        $this->view->startCityId = $startCityId = isset($post['start_city_id']) ? $post['start_city_id'] : '';
        $this->view->area_name = $area_name = isset($post['area_name']) ? $post['area_name'] : '';
        $this->view->area_id = $area_id = isset($post['area_id']) ? $post['area_id'] : '';
        
        $objGen = new Travel_Model_GeneralFunction();
        $where = array();
        $where['IsMarkForDel'] = 0;
        $where['AgencySysId'] = $this->intLoggedinUserAgencySysId;
        if(!empty($startCityId)){
            $where['CityId'] = (int)$startCityId;
        }
        if(!empty($area_id)){
            $where['AreaSysId'] = $area_id;
        }
        
        $areaList = $objGen->getRecordListingWhereWithSearch('TB_Agency_Area_Master',['*'],$where,'AreaSysId','DESC');
        $page = $this->_getParam('page', 1);
        $paginator = Zend_Paginator::factory($areaList);
        $paginator->setItemCountPerPage(25);
        $paginator->setCurrentPageNumber($page);
        //echo "<pre>";print_r($paginator);die;
        $this->view->paginator = $paginator;
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
		$this->view->page = $page;
    }
    public function addAreaAction() {    
        $this->view->baseUrl = $this->baseUrl;
        $TblAgency = new Travel_Model_TblAgency;
        $objGen = new Travel_Model_GeneralFunction();
        $id = $this->getRequest()->getParam('id');
        
        
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            $cityIdName = explode('__',$getData['cityIdName']);
            $cityId = $cityIdName[0];
            $cityName = $cityIdName[1];
            $area = isset($getData['area']) ? $getData['area'] : array(); 
            if($cityId > 0){
                if(isset($id) && $id !=''){
                    $updateData = ['IsMarkForDel' => 1,'IsActive' => 0];
                    $whereM = array('CityId =? ' =>  $cityId, 'AgencySysId =? ' => $this->intLoggedinUserAgencySysId); 
                    $return = $TblAgency->updateData('TB_Agency_Area_Master',$updateData,$whereM);
                }
                
                foreach($area as $key => $value){

                    $valueD = explode('~~',$value);
    //                echo "<pre>";print_r($valueD);die; 
                    if(count($valueD) > 1 && (int)$valueD[0] > 0 ){
                        $saveData = [ 
                            'IsActive'=>$getData['IsActive'],
                            'IsMarkForDel'=>0,
                        ];
                        $where = array('AreaSysId =? '=>  (int)$valueD[0]);
                        $return = $TblAgency->updateData('TB_Agency_Area_Master',$saveData,$where);
                    }else{
                        $checkAreaData = $objGen->getRecordListingWhereWithSearch('TB_Agency_Area_Master',['AreaSysId'],['AgencySysId'=>$this->intLoggedinUserAgencySysId,'Area'=>trim($value),'CityId'=>$cityId],'AreaSysId','DESC');
                        if(isset($checkAreaData[0]['AreaSysId']) && (int)$checkAreaData[0]['AreaSysId'] > 0){
                            $saveData = [  
                                'CreatedDate'=>date('Y-m-d H:i:s'),
                                'IsActive'=>$getData['IsActive'],
                                'IsMarkForDel'=>0,
                            ];
                            $where = array('AreaSysId =? '=>  (int)$checkAreaData[0]['AreaSysId']);
                            $return = $TblAgency->updateData('TB_Agency_Area_Master',$saveData,$where);
                        }else{
                            $saveData = [
                                'AgencySysId'=>$this->intLoggedinUserAgencySysId,
                                'CityName'=>isset($cityName) ? $cityName : '',
                                'CityId'=>isset($cityId) ? $cityId : 0,
                                'CountryId'=>isset($getData['countryId']) ? $getData['countryId'] : 0,
                                'Area'=> trim($value),
                                'CreatedDate'=>date('Y-m-d H:i:s'),
                                'IsActive'=>$getData['IsActive'],
                                'IsMarkForDel'=>0,
                            ];
                            $return = $TblAgency->insertData('TB_Agency_Area_Master',$saveData);
                        }
                        
                    } 
                }
            }
            
             
            $this->_redirect('/master/area-master'); 
        }else{
            if(isset($id) && $id !=''){
                $areaData = array();
                
                $areaCityData = $objGen->getRecordListingWhereWithSearch('TB_Agency_Area_Master',['CityId'],['IsMarkForDel'=>0 ,'AgencySysId'=>$this->intLoggedinUserAgencySysId,'AreaSysId'=>base64_decode($id)],'AreaSysId','DESC');
                if(!empty($areaCityData)){
                    $CityId = $areaCityData[0]['CityId'];
                    $areaData = $objGen->getRecordListingWhereWithSearch('TB_Agency_Area_Master',['*'],['IsMarkForDel'=>0 ,'AgencySysId'=>$this->intLoggedinUserAgencySysId,'CityId'=>$CityId],'CreatedDate','ASC');
                } 
                $this->view->areaData = $areaData;
            }
        }
    }
}  

Youez - 2016 - github.com/yon3zu
LinuXploit