


	 <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>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
        </script>
           <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
		   
        });
		
		
		
    </script>     

      




<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#add" data-toggle="tab"><i class="entypo-menu"></i> 
			View House Details
                    	</a></li>
						
							<li>
            	<a href="#list" data-toggle="tab"><i class="entypo-plus-circled"></i>
			
				 <a href="<?php echo base_url(); ?>/admin/viewalltenant">	Go back</a>
                    	</a></li>
			
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
		<?php
					echo $this->session->flashdata('deletemsg'); 

			?>
            <!----TABLE LISTING STARTS-->
            <div class="tab-pane box active " id="list">
				
     


 <div class="panel panel-primary" data-collapsed="0">
 
<table id="example"  cellspacing="1" class="table  table" width="100%">
             <thead>
			
         <tr>
    
    <th>Room No </th>
	<th>House No</th>
	<th>Floor</th>
	<th>Type</th>
    <th>Status</th>     
    <th>Customer</th>       
	
	<th>Update/Charges</th> 
	<th>Check in</th> 

<td> more</td>
                 </tr>
             </thead>
<?php

		 $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'];	
 $grandtotal=0;
 $this->session->flashdata('msg'); 
 if(!is_array($myhouse)) 

 {



  
    
       echo '<div class="alert alert-warning text-center">There is no House found by now from system..</div>';
   
    }else {
?>
    
             <?php 
   

	  $allplotno;
  	foreach ($myhouse as $c): 

		 

             ?>



             <tr>
                
            <?php 
		 $houseno=$c->houseno;
	 $plotno=$c->plotno;

  $housedata = $this->accomodationmodel->getplothousebyallstatusid($plotno,$houseno);
 $houseid=$housedata[0]['id'];
?>

            <td><?php echo $c->houseno ; ?></td> 
				<td><?php echo $c->plotno ;

$allplotno=$c->plotno;				?></td> 
	<td><?php echo $housedata[0]['floor'] ; ?></td> 
						<td><?php echo $housedata[0]['type'] ; ?></td> 

					<td><?php echo $c->status ; ?></td> 
					
						         <td><?php 
					$tenantavalable = $this->accomodationmodel->tenantavailableonly($plotno,$houseno); 
					  $total=0;
					
					if(is_array($tenantavalable)) {

   foreach($tenantavalable as $tenantavalablerow){
	   $tenantid= $tenantavalablerow->tenantid ; 
				    $tenants = $this->accomodationmodel->gettenantbyid($tenantid);
 if(is_array($tenants)) {
   foreach($tenants as $tenantsrow){

    $names=$tenantsrow->lastname. " ".$tenantsrow->firstname ; 
   
   ?>
   
                     <a class="btn btn-warning"  id="more" href="<?php echo base_url();?>admin/edittenant?randomitemidentifier=<?php   {echo  $tenantid;}  ?>"><?php   {echo  $names;}  ?>  </a>

   
   <?php
    

}
    } else {
 
}

}



} else {
    echo 'vacant.';
}
					
					


?>
				 
				 
		</td>
					
					
					
					
					
					
					
					
					

              
                  
					   <td>

                     <a class="btn btn-primary"  id="more" href="<?php echo base_url();?>admin/editroom?randomitemidentifier=<?php   {echo  $houseid;}  ?>">Update/Charges  </a>
         </td>
                     <td>
                     <a class="btn btn-warning" id="more" href="<?php echo base_url();?>admin/allocate?randomitemidentifier=<?php   {echo  $houseno;}  ?>&randomitemidentifier1=<?php   {echo  $plotno;}  ?>&roomidentifier=<?php   {echo  $houseid;}  ?>">Check In </a>
         </td>
		   
		 
		 
		 
		 
		 
		 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									<?php
										if($usertype=="admin"){
											
											?>
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'   data-plotno='<?php echo  $c->plotno;?>'  data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                        
                                        <!-- teacher DELETION LINK -->
                                        
                                    </ul>
											<?php
										}
										?>
                                </div>
</td>
		 
		 
		 
		 
		 
		 
             </tr>

             <?php endforeach; ?>

              <?php }?>
			 
			 

        </table>


</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 item? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/deletebyid' , 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="house">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/searchhouse">
 <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>
		<!----CREATION FORM STARTS---->
	
</div>




			