<link href="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/ui.theme.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/autocomplete.css" rel="stylesheet">
    <script src="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.min.js"></script>
	
<!--
		 <script src="<?php echo base_url(); ?>assets/autocomplete/jquery.min.js"></script>


 -->

		      <script type="text/javascript">
  
		$(this).ready( function() {  
            $("#mysuppliers").autocomplete({  
 
                minLength: 1,  
                source:   
                function(req, add){  
                    $.ajax({  
                        url: "<?php echo base_url(); ?>Systemusers/customerSaleslookup",  
                        dataType: 'json',  
                        type: 'POST',  
                        data: req,  
                        success:      
                        function(data){  
                            if(data.response =="true"){  
                                add(data.message);  
                                console.log(data);
                            }  
                        },  
                    });  
                },  
                     
            });  
        });

</script>


     
<style type="text/css">
  
  

    #printableArea { display: none; }
#print{  	


    background-repeat: no-repeat;
	font-size;20px;
  
    width:100%; 


}
#alltitle{ font-size: 1em; }
	#mytitle { font-size: 1.5em; }
#sale{  	


    background-repeat: no-repeat;
  
    width:100px; height:50px;


}
    @media print
    {
    	#non-printable { display: none; }
    	#printableArea { display: block; font-size:16; width:100%; }
    }
    </style>




<ul class="nav nav-tabs bordered" id="non-printable">

			
						<li  class="active">
            	<a href="#thirdtab" data-toggle="tab"><i class="entypo-plus-circled"></i>
					Bulk Check-in  
                    	</a></li>
						
						
					
				
						
							<li>
            									 <a href="<?php echo base_url(); ?>admin/viewpallmyplots">Back Home </a>


							</li>
						
						
						
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
		<?php
					echo $this->session->flashdata('deletemsg'); 
					
					  function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}
			   $session_data = $this->session->userdata('logged_in');
		
		 $userid = $session_data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
    $deletebank=$this->usermodel->populatuserpermissionsdataarray('accounting','deletebank',$userid);
    $addpeople=$this->usermodel->populatuserpermissionsdataarray('members','add',$userid);

    $mpesaaction=$this->usermodel->populatuserpermissionsdataarray('accomodation','mpesa',$userid);
	      $chequeaction=$this->usermodel->populatuserpermissionsdataarray('accomodation','cheque',$userid);
 $voucheraction=$this->usermodel->populatuserpermissionsdataarray('accomodation','voucher',$userid);
	      $creditaction=$this->usermodel->populatuserpermissionsdataarray('accomodation','credit',$userid);
		   $pointsaction=$this->usermodel->populatuserpermissionsdataarray('accomodation','points',$userid);
	      $cardaction=$this->usermodel->populatuserpermissionsdataarray('accomodation','card',$userid);
		    $cashpayment=$this->usermodel->populatuserpermissionsdataarray('accomodation','cash',$userid);
   $givediscount=$this->usermodel->populatuserpermissionsdataarray('accomodation','givediscount',$userid);

	 	 	      $changepayment=$this->usermodel->populatuserpermissionsdataarray('accomodation','changepayment',$userid);
	       $checkinroom=$this->usermodel->populatuserpermissionsdataarray('accomodation','checkinroom',$userid);

			?>
            <!----TABLE LISTING STARTS-->
			
			
		
	
<div class="tab-pane box" id="list" style="margin:0">
				
     



</div>
		<!----CREATION FORM STARTS---->
		
   <div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/deleteallbyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="invoice">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/invoice?randomitemidentifier=">
  <input type="hidden" id="view2"name="view2" class="view2" placeholder="view" value="&randomitemidentifier1=">
 <input type="hidden" id="houseno1"name="houseno" class="houseno" placeholder="houseno" value=""><br>

 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
          <input type="hidden" id="plotno1"name="plotno" class="form-control" placeholder="plotno"  value="">
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>
  
  
  
  <div id="deleteModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Cancel Payment</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to Cancel  this Payment? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/deleteallbyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="receipt">

 
 
  <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/receivepayment?randomitemidentifier=">
  <input type="hidden" id="view2"name="view2" class="view2" placeholder="view" value="&randomitemidentifier1=">
 
 
 
 
 
 
 <input type="hidden" id="houseno2"name="houseno" class="houseno" placeholder="houseno" value=""><br>

 <input type="hidden" id="itemid2"name="itemid" class="itemid" placeholder="itemid" value=""><br>
          <input type="hidden" id="plotno2"name="plotno" class="form-control" placeholder="plotno"  value="">
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Cancel Payment  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>
   <div  class="tab-pane box active"  id="thirdtab" style="padding: 5px">
			
			



		
<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>
		BULK RESERVATION
            	</div>
            </div>
			<div class="panel-body">






				<?PHP
				 if (isset($_GET['myoriginalamount'])){

        $paymentid=$_GET['paymentid'];
      $originalamount=$_GET['myoriginalamount'];
    }else if(isset($originalamount)) {
	    $paymentid=$paymentid;
		$originalamount= $originalamount;
	}
				
				$customerpaymentdetails="";
				
				echo $this->session->flashdata('msg'); 
		 $date = Date('Y-m-d') ;
		 	 $year = Date('Y') ;
		  $month = Date('m') ;
		  
		 
						                  //echo form_open('admin/viewpallmyplots' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
			                  echo form_open('admin/savebulkreservation' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));

  
		  
		     $from=date("Y-m-d");

    $mydate=date("Y-m-d H:i:s");
	
	$next_date = date('Y-m-d', strtotime(' +1 day'));
    $closedatedate=($next_date);

				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>

<div class="col-md-8">


 <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Company Name</label>
    <div class="col-sm-7">
<select name="tenantid"  class="chzn-select" style="width:50%" required>
<option value="" >---Select customer for advance--</option>

		<?php 

//$nation = $this->nationmodel->populatenation();
	 					$mytenant = $this->usermodel->populateall('people', 'companyid',$companyid);


if(is_array($mytenant)) {

   foreach($mytenant as $mytenantrow){

    ?>
	    <option value="<?php echo set_value('tenant',$mytenantrow->id); ?> "><?=$mytenantrow->company." ".$mytenantrow->firstname." IDNO ".$mytenantrow->idno."  ".$mytenantrow->phone;?></option>

   
    <?php

}} else {
    echo 'There is no customer.';
}

?>
	</select>
		  <?php

 if( $addpeople==true){
 ?>
						<a data-toggle='modal' data-target='#addModal' class="btn btn-warning">New Profile/Business </a>

 
<?php	
}
  ?>
	  

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

    <label for="inputgroup" class="col-sm-2 control-label">Group Name</label>
    <div class="col-sm-3">
	<input type="text" name="group"  value="<?php if(isset($group)) {echo   $group; }?>"id="group" class="form-control" required placeholder="Enter group name">


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

    <label for="inputttrooms" class="col-sm-2 control-label">No of Rooms</label>
    <div class="col-sm-2">
			  		<input type="text"  name="ttrooms" value="<?php if(isset($ttrooms)) {echo   $ttrooms; }?>"id="ttrooms" class="form-control" required placeholder="Enter total No of rooms ">
  		<input type="hidden" name="action" value="<?php echo set_value('action','insert'); ?>"id="action" class="form-control" required >


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

    <div class="form-group">
    
 
   <label for="inputidno" class="col-md-2  control-label">Check In</label>
    <div class="col-md-2">
				<input type="date"  id="checkin" onchange="getdays()" name="checkin" value="<?php echo set_value('createdat',$date); ?>"  class="tcal" required placeholder="Enter Check in Date">
        <span class="text-danger"><?php echo form_error('createdat'); ?></span>
	</div>
  
	 <label for="inputidno" class="col-md-2 control-label">Check Out  </BR>  	</label>
    <div class="col-md-3">
				<input type="date"  onchange="getdays()" id="checkout" name="checkout" value="<?php echo set_value('checkoutdate',$closedatedate); ?>" class="tcal" required placeholder="Enter Check Out  Date">
        <span class="text-danger"><?php echo form_error('checkoutdate'); ?></span>
	
	
	</div>
	
  </div>
   

 <div class="form-group">
    <label for="inputoriginalamount" class="col-sm-2 control-label">Status</label>
    <div class="col-sm-3">


  <select name="paymentstatus" class="form-control" id="section_selector_holder">

			                         <option selected value="Cleared">Cleared</option>
									   <option value="Not Cleared">Not Cleared</option>

			                    </select>        <span class="text-danger"><?php echo form_error('originalamount'); ?></span>
	</div>

    <label for="inputidno" class="col-sm-2 control-label">Payment Mode</label>
    <div class="col-sm-2">
				    	
						
						

			  	<select name="paymentmode" class="form-control" >
<option value="" >---Select Payment Mode---</option>

<option value="Cash" selected="selected">Cash</option>
<option value="Invoice">Invoice/Credit</option>
<option value="Mpesa">Mpesa</option>
<option value="Card">Card</option>

<option value="Bank">Bank</option>
<option value="Voucher">Voucher/Complimentary</option>
<option value="Points">Bonga Points</option>

	</select>
				

	</div>
  </div>	
<div class="form-group">
  
  <?php
  
   if( $givediscount==true){
	 ?>
 
    <label for="inputdiscount" class="col-md-2 control-label">Discount</label>
    <div class="col-md-7">
	
		<select class="form-control" name="discount" >
	
	<option value=""   >---Select Discount---</option>
	<option value="0:=Amount" selected="selected"  >0 (No discount)</option>

			<?php
			$getalldiscounts = $this->usermodel->populatealldatanoarray('discount', 'companyid',$companyid,'id >',0);

 		
				
	

	
if(is_array($getalldiscounts)) {

   foreach($getalldiscounts as $getalldiscountsrow){

   //echo $courserow->coursename;
    ?>
						<option  value="<?=  $getalldiscountsrow->discount.":=".$getalldiscountsrow->type;   ?>"><?=  $getalldiscountsrow->discount." (".$getalldiscountsrow->name.":".$getalldiscountsrow->type.")";?></option>




	<?php

}} else {
    echo 'No user available.';
}
	
?>
</select>
		
	
	
	
	
	
	
	
	
	
	
	
	
	
	

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


	 	<?php	
		//z

 }else{
	 ?>
	 
	 
	 	<input type="hidden" name="discount" value="0" id="discount" class="form-control"  placeholder="Enter discount">

	 	<?php
	 
 }
  ?>
      </div>
 
  
  
     <div class="form-group">
    <label for="inputpaymentcode" class="col-sm-2 control-label">Payment Code</label>
    <div class="col-sm-7">
				<input type="text" name="paymentcode" value="<?php if(isset($paymentcode)) {echo   $paymentcode; }?>" id="paymentcode" class="form-control"  placeholder="Enter paymentcode">
        <span class="text-danger"><?php echo form_error('paymentcode'); ?></span>
	</div>
  </div>
		  <div class="form-group">
    <label for="inputoriginalamount" class="col-sm-2 control-label">Expected Amount</label>
    <div class="col-sm-7">


				<input type="text" name="originalamount" value="<?php if(isset($originalamount)) {echo   $originalamount; }?> " id="originalamount" class="form-control" required placeholder="Enter amount">
        <span class="text-danger"><?php echo form_error('originalamount'); ?></span>
	</div>
		</div> 
 
  
  <div class="form-group">
  	<?php
 if( $cashpayment==true){
	 ?>
   
   
     <label for="inputamount" class="col-md-2 control-label">Cash Paid</label>
    <div class="col-md-7">
				<input type="text" name="amount" value="0" id="cash" class="form-control" required placeholder="Enter amount">
        <span class="text-danger"><?php echo form_error('amount'); ?></span>
	</div>
	
	
   
	 
	 	 
	 	<?php	
		}else{
?>
				<input type="hidden" name="amount" value="0" id="cash" class="form-control" required placeholder="Enter amount">


<?php

		}
  ?>
  
    </div>
  
  
  
  				  	<?php
 if( $creditaction==true){
	 ?>
   
     <div class="form-group">
    <label for="inputcredit" class="col-md-2 control-label">Credit Amount</label>
    <div class="col-md-7">
				<input type="text" name="credit" value="0" id="credit" class="form-control" required placeholder="Enter credit amount">
        <span class="text-danger"><?php echo form_error('credit'); ?></span>
	</div>
   </div>
	 	 
		 
	 	<?php	
		}else{
		?>

				<input type="hidden" name="credit" value="0" id="credit" class="form-control" required placeholder="Enter credit amount">

<?php

}
  ?>
  
  
  
  
  

  
  
  			  	<?php
 if( $mpesaaction==true){
	 ?>
   
	 	  <div class="form-group">
   <label for="inputmpesa" class="col-md-2 control-label">Mpesa Paid</label>
    <div class="col-md-7">
				<input type="text" name="mpesa" value="0" id="mpesa" class="form-control" required placeholder="Enter Mpesa">
        <span class="text-danger"><?php echo form_error('mpesa'); ?></span>
	</div>
  </div>
		  <div class="form-group">
   <label for="inputmpesa" class="col-md-2 control-label">Phone</label>

	 <div class="col-sm-7">
	 

	 	
				<input type="text" name="phone" value="2547" id="phone" class="form-control" required placeholder="Enter phone">



	 
	</div>
  </div>
	 	<?php	
		}else{
		?>
				<input type="hidden" name="mpesa" value="0" id="mpesa" class="form-control" required placeholder="Enter Mpesa">
				<input type="hidden" name="phone" value="2547" id="phone" class="form-control" required placeholder="Enter phone">


<?php

}
  ?>
  
  
  
  		
    
    <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
 
	       <button type="submit" name="btn_bulksavereservation" value="reservation" class="btn btn-primary">Save  Bulk Resevation</button>
            									 <a class="btn btn-info" href="<?php echo base_url(); ?>admin/bukreservation">Refresh </a>
												  <select name="receipt" class="form-control2" >

									   <option value="No">No Receipt (Reserve)</option>
								 <option selected value="Next">Next(Checkin)</option>


			                    </select>

    </div>
  </div>
        
</div>
  
<div class="col-md-4">
  
  		  

  			  	<?php
 if( $cardaction==true){
	 ?>
   
	 	    <div class="form-group">
    <label for="inputcard" class="col-md-3 control-label">Visa/Master Card</label>
    <div class="col-md-9">
				<input type="text" name="card" value="0" id="card" class="form-control" required placeholder="Enter card amount">
        <span class="text-danger"><?php echo form_error('card'); ?></span>
	</div>
  </div>
  
		 
	 	<?php	
		}else{
		?>
				<input type="hidden" name="card" value="0" id="card" class="form-control" required placeholder="Enter card amount">


<?php

}
  ?>
  
  
  				  
				  	<?php
 if( $chequeaction==true){
	 ?>
      <div class="form-group">
    <label for="inputcheque" class="col-md-3 control-label">Cheque/Bank</label>
    <div class="col-md-9">
				<input type="text" name="cheque" value="0" id="cheque" class="form-control" required placeholder="Enter cheque amount">
        <span class="text-danger"><?php echo form_error('cheque'); ?></span>
	</div>
   </div>
	 	 
		 
	 	<?php	
		}else{
		?>
				<input type="hidden" name="cheque" value="0" id="cheque" class="form-control" required placeholder="Enter cheque amount">


<?php

}
  ?>

		  


				  
				  	<?php
 if( $pointsaction==true){
	 ?>
   
	 	   <div class="form-group">
    <label for="inputpoints" class="col-md-3 control-label">L Points</label>
    <div class="col-md-9">
				<input type="text" name="points" value="0" id="points" class="form-control" required placeholder="Enter points amount">
        <span class="text-danger"><?php echo form_error('points'); ?></span>
	</div>
  </div> 
		 
	 	<?php	
		}else{
		?>
				<input type="hidden" name="points" value="0" id="points" class="form-control" required placeholder="Enter points amount">


<?php

}
  ?>

  
  
  
				  	<?php
 if( $voucheraction==true){
	 ?>
   
	 	 
	   <div class="form-group">
    <label for="inputvoucher" class="col-md-3 control-label">Complimentary</label>
    <div class="col-md-9">
				<input type="text" name="voucher" value="0" id="voucher" class="form-control" required placeholder="Enter voucher/Complimentary amount">
        <span class="text-danger"><?php echo form_error('voucher'); ?></span>
	</div>
 
  
  
    </div>
	 
	 	<?php	
		}else{
		?>

				<input type="hidden" name="voucher" value="0" id="voucher" class="form-control" required placeholder="Enter voucher/Complimentary amount">

<?php

}
  ?>
  
  
 
    <div class="form-group">
    <label for="inputphone3" class="col-sm-3 control-label">Description </label>
    <div class="col-sm-9">
	<textarea name="description" id="ttt" rows="2" placeholder="add Description" class="form-control"><?php if(isset($description)) {echo   $description; }else { echo $customerpaymentdetails; }?>   </textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
   
    	
   
	
	  </div>




	<?php echo form_close();?>


		  


  
  
            </div>
        </div>
    </div>
</div>







		
		<div id="addModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new Profile/ Company /Group</h4>
      </div>
      <div class="modal-body">
      
	  	


		
				  		
	

				<?PHP

 $transactionid = 'rand' .rand(100, 9900) . 'trc' . time();
		 $imgid = rand(100, 990000).time();

 
		 $date=date("Y-m-d");

                 echo form_open('addtenant' , 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;?>
					
  <div class="form-group">

    <label for="inputfirstname" class="col-md-3 control-label">Company Name</label>
    <div class="col-sm-7">
	
	
	
					 <input type="hidden" name="type"    value="tenant"  class="form-control">
					 <input type="hidden" name="view"    value="admin/bukreservation"  class="form-control">

	
				 <input type="hidden" name="img_id"    value="<?php echo set_value('img_id', $imgid); ?>"  class="form-control">

	<input type="hidden" name="action" value="<?php echo set_value('action','insert'); ?>"id="action" class="form-control" required placeholder="Enter action">
	<input type="hidden" name="transactionid" value="<?php echo set_value('transactionid'); ?>"id="transactionid" class="form-control" required placeholder="Enter transactionid">
		  		<input type="hidden" name="firstname" value="<?php echo set_value('firstname'); ?>"id="firstname" class="form-control" required placeholder="Enter customer name">

		  		<input type="text" name="company"  id="mysuppliers" value="<?php echo set_value('company'); ?>"id="company" class="form-control" required placeholder="Enter company name">
     <span class="text-danger"><?php echo form_error('company'); ?></span>
   </div>
  </div>
    <div class="form-group" style="display:none">
    <label for="inputlastname" class="col-md-3 control-label">Last Name</label>
    <div class="col-sm-7">
		<input type="text" name="lastname" value="<?php echo set_value('lastname') ;?>" id="lastname" class="form-control"  placeholder="Enter lastname">
       <span class="text-danger"><?php echo form_error('lastname'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <label for="inputphone3" class="col-md-3 control-label">Company PIN   </label>
    <div class="col-sm-7">
				<input type="phone" name="idno" value="<?php echo set_value('idno'); ?>" id="idno" class="form-control"  placeholder="Enter PIN / ID">
    <span class="text-danger"><?php echo form_error('idno'); ?></span>
   </div>
  </div>
  
	
   
		
 
  <div class="form-group">
    <label for="inputphone" class="col-md-3 control-label">Phone Number</label>
    <div class="col-sm-7">
				<input type="text" name="phone" value="<?php echo set_value('phone'); ?>" id="phone" class="form-control"  placeholder="Enter Your phone">
        <span class="text-danger"><?php echo form_error('phone'); ?></span>
	</div>
  </div>
  <div class="form-group">
						<label for="field-2" class="col-md-3 control-label">Country</label>
		                    <div class="col-sm-7">
		                        <select name="country" class="form-control" id="section_selector_holder">
		                            <option value="">--Select Country--</option>
									   <?php
									$country = $this->accomodationmodel->populateallcountries();


if(is_array($country)) {

   foreach($country as $countryrow){

    ?>
	    <option selected value="<?php echo set_value('country',$countryrow->id); ?> "><?=$countryrow->name;?></option>

   
    <?php

}} else {
    echo 'There is no other  country for this house.... Please add country first.';
}

?>
			                        
			                    </select>
								     <span class="text-danger"><?php echo form_error('country'); ?></span>
			                </div>
	</div>
	
   <div class="form-group">
						<label for="field-2" class="col-md-3 control-label">County</label>
		                    <div class="col-sm-7">
		                        <select name="county" class="form-control" id="section_selector_holder">
		                            <option selected="select" value="">--Select County--</option>
									   <?php
									$county = $this->accomodationmodel->populateallallacounties();


if(is_array($county)) {

   foreach($county as $countyrow){

    ?>
	    <option selected value="<?php echo set_value('county',$countyrow->id); ?> "><?=$countyrow->name;?></option>

   
    <?php

}} else {
    echo 'There is no other  county for this house.... Please add county first.';
}

?>
			                        
			                    </select>
								     <span class="text-danger"><?php echo form_error('county'); ?></span>
			                </div>
	</div>
	
	
  	 		
     <div class="form-group"  style="display:none" >
    <label for="inputlocation" class="col-md-3 control-label">Company</label>
    <div class="col-sm-7">
				<input type="text" name="location" value="<?php echo set_value('location') ;?>" id="exampleInputlocation" class="form-control"  placeholder="Enter Your company/business name">
    <span class="text-danger"><?php echo form_error('location'); ?></span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputEmail" class="col-md-3 control-label">Email</label>
    <div class="col-sm-7">
				<input type="email" name="email" value="<?php echo set_value('email') ;?>" id="exampleInputEmail" class="form-control"  placeholder="Enter Your email">
    <span class="text-danger"><?php echo form_error('email'); ?></span>
	</div>
  </div>

 
 <div class="form-group" style="display:none"  >
						<label for="field-2" class="col-md-3 control-label">Gender</label>
		                    <div class="col-sm-7">
		                        <select name="gender"  class="form-control" id="section_selector_holder">
		                            <option value="" selected>--Select Gender--</option>
			                         <option value="Male">Male</option>
									   <option value="Female">Female</option>
			                    </select>
							 <span class="text-danger"><?php echo form_error('gender'); ?></span>

			                </div>
	</div>	
	
	
		
			
	
	
	
	
	
		
		
		
		
		
	   <div class="form-group" >
    <label for="inputphone3" class="col-md-3 control-label">Entry Date </label>
    <div class="col-sm-7">
				<input type="phone" name="entrydate" value="<?php echo set_value('entrydate',$date); ?>" id="idno" class="form-control"  placeholder="Enter Entry date">
    <span class="text-danger"><?php echo form_error('entrydate'); ?></span>
   </div>
  </div>
  	  <div class="form-group" style="display:none">
						<label for="field-2" class="col-md-3 control-label">House Status</label>
		                    <div class="col-sm-7">
		                        <select name="status" required class="form-control" id="section_selector_holder">
		                            <option value="" >--Select Status--</option>
			                         <option selected="selected"value="active">active</option>
									   <option value="inactive">inactive</option>
			                    </select>
							 <span class="text-danger"><?php echo form_error('gender'); ?></span>

			                </div>
	</div>
	
	 <div class="form-group" style="display:none">
						<label for="field-2" class="col-md-3 control-label"> photo</label>
		                    <div class="col-sm-7">
		                      		<input type="file" name="photo" width="400"  value="<?php echo set_value('photo') ;?>" placeholder="Select Image"  class="form-control"  >

							 <span class="text-danger"><?php echo form_error('photo'); ?></span>

			                </div>
	</div>
	
	
	

   <div class="form-group" style="display:none">
    <label for="inputphone3" class="col-md-3 control-label">Comments </label>
    <div class="col-sm-7">
	<textarea name="description" id="ttt" rows="5" placeholder="Add any description/comment" class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
    
  
  

	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	       <button type="submit" name="btn_tenant"value="tenant" class="btn btn-primary">Save</button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>

	
			         <div id="Checkout" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Post Shares</h4>
      </div>
      <div class="modal-body">
        <h4>Are you sure you want to post Shares to this member Account? </h4>
    
    
	  	

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

		   $closedatedate=date("Y-m-d 10:01:01");
                 echo form_open('admin/updatadvancepayment' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>  								  	

 <input type="hidden" id="table"name="table" class="table"  value="advancepayment">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/viewalltenant">
 <input type="hidden" id="itemid2"name="itemid"  value=""><br>

   <div class="form-group">
    <label for="inputshares" class="col-sm-2 control-label">Total shares</label>
    <div class="col-sm-10">
				<input type="text" name="shares"  readonly value="<?php echo set_value('shares'); ?>" id="shares" class="form-control"  placeholder="Enter total shares">
        <span class="text-danger"><?php echo form_error('shares'); ?></span>
	</div>
  </div>
  
  <div class="form-group">
    <label for="inputcertificateno" class="col-sm-2 control-label">Certificate</label>
    <div class="col-sm-10">
				<input type="text" name="certificateno" readonly value="<?php echo set_value('certificateno'); ?>" id="certificateno" class="form-control" required placeholder="Enter certificateno">
        <span class="text-danger"><?php echo form_error('certificateno'); ?></span>
	</div>
  </div>
     <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Date Posted</label>
    <div class="col-sm-10">
				<input type="text" name="amount" value="<?php echo set_value('amount',$closedatedate); ?>" id="idno" class="form-control" required placeholder="Enter amount">
        <span class="text-danger"><?php echo form_error('amount'); ?></span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">No of Shares</label>
    <div class="col-sm-10">
				<input type="text" name="amount" value="<?php echo set_value('amount'); ?>" id="idno" class="form-control" required placeholder="Enter No of shares">
        <span class="text-danger"><?php echo form_error('amount'); ?></span>
	</div>
  </div>
  

 
 
 
 <div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Remarks </label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter remarks"></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
  
  	  <div class="form-group">
						<label for="field-2" class="col-sm-2 control-label">Status</label>
		                    <div class="col-sm-10">
		                        <select name="status" id="status" class="form-control" >

			                         <option value="active">active</option>
									   	 <option value="inactive">inactive</option>

			                    </select>
							 <span class="text-danger"><?php echo form_error('status'); ?></span>

			                </div>
	</div>	
		
   </div>
   <div class="modal-footer">
 
 		   		  	         <button type="submit" name="updateadvance" value="advance" class="btn btn-success"> Yes(Post payment)  </button>

 <button type="button" class="btn btn-danger" data-dismiss="modal">No</button>


	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>
		








 <div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this invoice/receipt? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('admin/deletestudentdocuments' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>

          <input type="hidden" id="documentname1"name="documentname" class="form-control" placeholder="Full Name"  value="">
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletestudentdocuments" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>






   </div>
</div>




			