


	 <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		   
		   		   <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>

				   
	
         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		
		
		
		
			 $(document).on("click", "#managebtndelete2", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid2").val(itemid); 
		  
		  
		   
        });
		
		
		
		
		
		
		
		
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
		
			
		  $(document).on("click", "#editbtn", function()
        {
          var mychargeid = $(this).data('id');
		  $("#mychargeid").val(mychargeid); 
		   
   var status = $(this).data('status');
		   $("#status").val(status); 
		    var name = $(this).data('name');
		   $("#names").val(name); 
		   
		     var cost = $(this).data('cost');
		   $("#costs").val(cost); 
		 
		 
		  var chargeid = $(this).data('chargeid');
		   $("#chargeid").val(chargeid); 
		  
		  
		   
        });
		
		
		
		
		
		  $(document).on("click", "#editbed", function()
        {
        
   var status = $(this).data('status');
		   $("#bedstatus").val(status); 
		    var name = $(this).data('name');
		   $("#bedname").val(name); 
		   
		        var description = $(this).data('description');
		   $("#beddescription").val(description); 
		   
		 
		  var id = $(this).data('id');
		   $("#bedid").val(id); 
		  
		  
		   
        });
		
		
		
		
		
		
		
		
		
        </script>
                  



<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#list" data-toggle="tab"><i class="entypo-menu"></i> 
					Update this room
                    	</a></li>
						
							<li>
						<a href="#back" data-toggle="tab"><i class="entypo-menu"></i> 
<a href="<?php echo base_url(); ?>admin/viewpallmyplots" class="btn-primary">Go back	</a></a>

                    	</li>
						
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
            <div class="tab-pane box active" id="list">
				
     


		
<div class="row">

	<div class="col-md-12">
		<div class="panel panel-primary" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" >
            		<i class="entypo-plus-circled"></i>
				Transfer/Update  House/Room Details
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
				
		 echo $this->session->flashdata('deletemsg'); 
	 $session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	 
	 
				$data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];


		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];
	 			      $updateroom=$this->usermodel->populatuserpermissionsdataarray('accomodation','updateroom',$userid);
	 			      $addcharges=$this->usermodel->populatuserpermissionsdataarray('accomodation','addcharges',$userid);
	 			      $updatecharges=$this->usermodel->populatuserpermissionsdataarray('accomodation','updatecharges',$userid);

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/updatelatestroomdetails' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
			
			  		<input type="hidden" name="randomid" value="<?php echo set_value('randomid',$randomid); ?>"id="oldplotno" class="form-control"  readonly placeholder="Enter plot randomid">
			  		<input type="hidden" name="transactioncode" value="<?php echo set_value('transactioncode',$transactioncode); ?>"id="oldplotno" class="form-control"  readonly placeholder="Enter plot transactioncode">
			  		<input type="hidden" name="type" value="<?php echo set_value('type',$allsalesdetails[0]['paymentmode']); ?>"id="oldplotno" class="form-control"  readonly placeholder="Enter plot type">
			  		<input type="hidden" name="tenantid" value="<?php echo set_value('tenantid',$allsalesdetails[0]['tenantid']); ?>"id="oldplotno" class="form-control"  readonly placeholder="Enter plot type">

		
  <div class="form-group">
    <label for="inputroomtype" class="col-md-2 control-label">Room type?:</label>
    <div class="col-md-7">
				    	
			  	<select name="roomtype" id="roomtype2" onchange="getdays()" class="form-control" required>
<option value="" >---Select charges type---</option>

<?php
if($allsalesdetails[0]['plotno'] == "Group"){
	?>
<option value="Group" >Group</option>
<option value="Service Only" >Service Only</option>

		<?php 
}else{
      $mycharges = $this->usermodel->populateall('charges','id', $allsalesdetails[0]['chargeid']);


if(is_array($mycharges)) {

   foreach($mycharges as $chargesrow1){


//
$roomdata1=($allsalesdetails[0]['roomtype']/$allsalesdetails[0]['number'])."==".$allsalesdetails[0]['chargeid'];
  
   ?>
   
	    <option  selected value="<?php echo $roomdata1; ?> "><?=$chargesrow1->type.":" .($allsalesdetails[0]['roomtype']/$allsalesdetails[0]['number']); ?></option>

   
    <?php   



   
   
  

}} else {
    echo 'There is no any  charges for this house.... PLease add charges first.';
}

?>




	<?php 

//$nation = $this->nationmodel->populatenation();


if(is_array($charges)) {

   foreach($charges as $chargesrow){

  

      $chargename = $this->usermodel->populateallarray('charges','id', $chargesrow->chargeid);

	 $chargename=$chargename[0]['type'];
//
$roomdata=$chargesrow->cost."==".$chargesrow->chargeid;
  
   ?>
   
	    <option   value="<?php echo $roomdata; ?> "><?=$chargename."(" .$chargesrow->name.":" .$chargesrow->cost.")"; ?></option>

   
    <?php   


   
   
  

}} else {
    echo 'There is no any  charges for this house.... PLease add charges first.';
}
}
?>









<!--<option value="all" >---ALL ---</option>-->

	</select>

	  <span class="text-danger"><?php echo form_error('roomtype'); ?></span>
	</div>
    </div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	   <div class="form-group">
    
 
   <label for="inputidno" class="col-md-2  control-label">Check In</label>
    <div class="col-md-4">
				<input type="text"  id="checkin" onchange="getdays()" name="createdat" value="<?php echo set_value('createdat',date("Y-m-d",strtotime($allsalesdetails[0]['createdat']))); ?>"  class="tcal" required placeholder="Enter Check in Date">
        <span class="text-danger"><?php echo form_error('createdat'); ?></span>
	</div>
	
	  <div class="col-md-3">
				<input type="text"  id="checkintime"  name="checkintime" value="<?php echo set_value('createdat',date("H:s:i",strtotime($allsalesdetails[0]['createdat']))); ?> "  class="form-control" required placeholder="Enter Check in time">
        <span class="text-danger"><?php echo form_error('checkintime'); ?></span>
	</div>
	

	
    </div>
   <div class="form-group">
	 <label for="inputidno" class="col-md-2 control-label">Check Out  </BR>  </label>
    <div class="col-md-4">
				<input type="text"  onchange="getdays()" id="checkout" name="checkoutdate" value="<?php echo set_value('checkoutdate',date("Y-m-d",strtotime($allsalesdetails[0]['checkoutdate']))); ?>" class="tcal" required placeholder="Enter Check Out  Date">
        <span class="text-danger"><?php echo form_error('checkoutdate'); ?></span>
	

	
	</div>
	  <div class="col-md-3">
				<input type="text"  id="checkouttime"  name="checkouttime" value="<?php echo set_value('checkoutdate',date("H:s:i",strtotime($allsalesdetails[0]['checkoutdate']))); ?> ""  class="form-control" required placeholder="Enter Check out time">
        <span class="text-danger"><?php echo form_error('checkouttime'); ?></span>
	</div>
	
  </div>
  
	
	
	
	
	
	
	
	
	
	
	
	<div class="form-group">
    <label for="inputcash" class="col-sm-2 control-label">	TT MONEY EXPECTED <span style="color:red;">*</span></label>
    <div class="col-sm-7">
	<input  type="number"   name="total" id="total" readonly value="<?php echo set_value('total',$allsalesdetails[0]['total']); ?>" class="form-control" required placeholder="Enter total e.g 500">
		
										
		 
				
		<span class="text-danger"> <?php echo form_error('total'); ?>
		
		</span>
	</div>
  </div>


	
	

		
  	
	

	
	       <div class="form-group" style="display:none">
    <label for="inputbeds" class="col-sm-2 control-label"> Bed No </label>
    <div class="col-sm-7">
				<input type="text" name="beds" value="<?php echo set_value('beds'); ?>" id="cost" class="form-control"  placeholder="Enter beds">
        <span class="text-danger"><?php echo form_error('beds'); ?></span>
	</div>
  </div>
	
	
	
	
	
 
	
	
    
  <div class="form-group">

    <label for="inputoldhouseno" class="col-sm-2 control-label"> Room No</label>
    <div class="col-sm-7">

			  		<input type="text"  readonly  name="oldhouseno" value="<?php echo set_value('oldhouseno',$housno); ?>"id="oldhouseno" class="form-control"  placeholder="Enter building number">


     <span class="text-danger"><?php echo form_error('oldhouseno'); ?></span>
   </div>
  </div>
  
  
        
  <div class="form-group">

    <label for="inputoldplotno" class="col-sm-2 control-label"> Buiding / Plot No</label>
    <div class="col-sm-7">

			  		<input type="text" name="oldplotno" value="<?php echo set_value('oldplotno',$plotno); ?>"id="oldplotno" class="form-control"  readonly placeholder="Enter plot number">


     <span class="text-danger"><?php echo form_error('oldplotno'); ?></span>
   </div>
  </div>
  
  
     
  
  
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     

		   
		   		<?php
									

									 if( $updateroom==true){
											
											?>
	       <button type="submit" name="btn_updateroomdetails" value="updateroom" class="btn btn-primary">Update Room</button>

										<?php
										}else{
										
										}
										?>
		   
		   
		   
		   
		   
		   
    </div>
  </div>
                    
                <?php echo form_close();?>
            </div>
        </div>
		
		
		
	  </div>
		
   
	
	
</div>



















  </div>

   </div>
 



			