
	 <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).ready(function() { 

                
                $("#plotno").change(function(){
                 	var plotnoid = $("#plotno").val();
                     /*dropdown post *///
                      $.ajax({
			 		url:"<?php echo base_url();?>admin/populatehouseid",
			 		
					 data: {plotno: $(this).val()},

                    type: "POST",
                    success:function(data){
                        
                        $("#houseid").html(data);
                    }
                
                    });

               
                });

            });
               $(function () {
        $("#plotno").change(function () {
            if ($(this).val() == "") {
                $("#house").hide();
            } 
            else {
                $("#house").show();
            }
        });
    });
          
        </script>
	
        <script>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
        </script>
                  
			 

<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#add" data-toggle="tab"><i class="entypo-menu"></i> 
						Search Houses
                    	</a></li>
							<li>
            									 <a href="<?php echo base_url(); ?>admin/viewpallmyplots">Back Home </a>


							</li>
			
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
			<?php
					echo $this->session->flashdata('deletemsg'); 

			?>
            <div  class="tab-pane box active" id="list">
				
    
		<div class="panel panel-primary" data-collapsed="0">

<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>
			Advance Search for specific tenant 
            	</div>
            </div>
			<div class="panel-body">





				<?PHP

 $transactionid = 'rand' .rand(100, 9900) . 'trc' . time();
				$date= Date('Y-m-d');
				echo $this->session->flashdata('msg'); 
				
				
				

				$month= Date('Y-m');
			$fromdate=$month."-01";
				$date=$month."-30";
				
				
				
				
		
                 echo form_open('admin/searchatenatllhouse' , 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="inputidno" class="col-sm-2 control-label">Tenant Name</label>
    <div class="col-sm-7">
				    	
			  	<select name="tenantid"  class="chzn-select" required style="width:100%">
<option value="" >---Select tenant for searching---</option>

		<?php 

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

	
if(is_array($mycurrenttenant)) {

   foreach($mycurrenttenant as $mycurrenttenanttrow){

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

   
    <?php

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

if(is_array($tenant)) {

   foreach($tenant as $tenanttrow){

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

   
    <?php

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



?>
	</select>
				

	  <span class="text-danger"><?php echo form_error('tenantid'); ?></span>
	</div>
  </div>	
    
  
  
    
   
  
  
  
  
  
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_tenant"value="tenant" class="btn btn-primary">Search Tenanat</button>

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



<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>
			 Search for  tenant  Statement
            	</div>
            </div>
			<div class="panel-body">





				<?PHP

 $transactionid = 'rand' .rand(100, 9900) . 'trc' . time();
				$date= Date('Y-m-d');
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/searchatenatstatment' , 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="field-2" class="col-sm-2 control-label">Plot Name</label>
		                    <div class="col-sm-7">
		                        <select name="plotno" class="chzn-select"  width="100%"id="plotno"  required>
		                            <option  value="">--Select Plot--</option>
											                            <option  selected value="all">--All houses --</option>

									   <?php
									$plot = $this->accomodationmodel->populateallplots();


if(is_array($plot)) {

   foreach($plot as $plotrow){

    ?>
   <option  value="<?php echo set_value('plotno',$plotrow->id); ?> "><?=$plotrow->id.' '.$plotrow->name;?></option>

   
    <?php

}} else {
    echo 'There is no plot in the system.... Please add plot first.';
}

?>
			                        
			                    </select>
								     <span class="text-danger"><?php echo form_error('plotno'); ?></span>
			                </div>
	</div>
	
 
			
  <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Tenant Name</label>
    <div class="col-sm-7">
				    	
			  	<select name="tenantid"  class="chzn-select" required style="width:100%">
<option value="" >---Select tenant for searching---</option>

		<?php 

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

	
if(is_array($mycurrenttenant)) {

   foreach($mycurrenttenant as $mycurrenttenanttrow){

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

   
    <?php

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

if(is_array($tenant)) {

   foreach($tenant as $tenanttrow){

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

   
    <?php

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



?>
	</select>
				

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

	 <div class="form-group">

	 
    <label for="inputfromdate" class="col-sm-2 control-label">From Date</label>
    <div class="col-sm-7">
		<input type="text" name="fromdate" value="<?php echo set_value('fromdate',$fromdate) ;?>" id="fromdate" class="form-control" required placeholder="From which date">
       <span class="text-danger"><?php echo form_error('fromdate'); ?></span>
   </div>
  </div>

    
	 <div class="form-group">
    <label for="inputtodate" class="col-sm-2 control-label">To Date</label>
    <div class="col-sm-7">
		<input type="text" name="todate" value="<?php echo set_value('todate',$date) ;?>" id="todate" class="form-control" required placeholder="Upto date?">
       <span class="text-danger"><?php echo form_error('todate'); ?></span>
   </div>
  </div>

    <div class="form-group" >
						<label for="field-2" class="col-sm-2 control-label">Display</label>
		                    <div class="col-sm-7">
		                        <select name="paymentstatus" class="form-control"    required>
										 <option  value="invoice">Invoces</option>

								      <option  value="receipt">Payments</option>
		                            <option selected value="all Statement">Both Invoces and payments</option>
								
                 				  <option  value="balances">Existing Balances</option>

			                    </select>
								     <span class="text-danger"><?php echo form_error('display'); ?></span>
			                </div>
	</div>
	
  
  
  
  
  
  
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_tenant"value="tenant" class="btn btn-primary">Search Tenanat</button>

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





			
			
			
			
			</div></div>
			
			
			
			
			
			
			
			





