
	 <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() { 
                      // $("#charges").hide();

                
                $("#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 () {
        $("#paymentstatus").change(function () {
            if ($(this).val() == "utilities") {
         
				 $("#charges").show();
            }else if ($(this).val() == "receiptutility") {
         
				 $("#charges").show();
            } 
            else {
                       $("#charges").hide();
            }
        });
    });
	
	
			
               $(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>
                  
			 <?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'];	
	 
				
				$config['base_url'] = base_url('Systemusers/salesfollowups');
				
?>

<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#add" data-toggle="tab"><i class="entypo-menu"></i> 
						View Payemt for Houses
                    	</a></li>
						
						
			
			
			
						
						
						
									 <li> <a id="non-printable"  class="btn btn-info" href="<?php echo base_url(); ?>admin/viewpallmyplots">Back to home</a></li>
									 <?php
								
				if($usertype=="admin"){
?>

							   <a data-toggle='modal' data-target='#updatemyModal' class="btn btn-info">Update Balances  </a>


<?php
				}
				
			 
			 ?>
								
						 <li> 
						 
						 
						 </li>


			
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
            <div  class="tab-pane box active" id="list">
				
    
		<div class="panel panel-primary" data-collapsed="0">


	

            <!----TABLE LISTING ENDS--->
            
            
			<!----CREATION FORM STARTS---->
				

			
		

			
			
			

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





				<?PHP
		


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

				$month= Date('Y-m');
			$fromdate=$month."-01";
				$date=$month."-30";
				
								//$date= Date('Y-m-d');

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/searchplotpayment' , 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"  style="width:100%" id="plotno"  required>
		                            <option selected value="">--Select Plot--</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">
	 <input type="hidden" name="status" value="<?php echo set_value('status','receipt'); ?>" id="idno" class="form-control" required placeholder="none">

	 
    <label for="inputfromdate" class="col-sm-2 control-label">From Date</label>
    <div class="col-sm-7">
		<input type="date" 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="date" 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">Report type</label>
		                    <div class="col-sm-7">
		                        <select name="display" class="form-control"    required>
		                            <option selected value="all">Display Both payments and Invoces</option>
								      <option  value="payment">Display Only Payments</option>
                 
			                    </select>
								     <span class="text-danger"><?php echo form_error('display'); ?></span>
			                </div>
	</div>
	
	
	
	 <div class="form-group" >
						<label for="field-2" class="col-sm-2 control-label">Display type</label>
		                    <div class="col-sm-7">
		                        <select name="displaytype" class="form-control"    required>
		                            <option selected value="all">Display everything</option>
								      <option  value="no">Dont Display Other Collections</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_searchstatement"value="statemet" class="btn btn-primary">View statemet </button>
		   <!--
	       <button type="submit" name="btn_downloadstatement"value="statemet" class="btn btn-info">Download  Sataement</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>
			Summary reports
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
		


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

				$month= Date('Y-m');
			$fromdate=$month."-01";
				$date=$month."-30";
				
								//$date= Date('Y-m-d');

		
                 echo form_open('admin/searchforrentgeneralreport' , 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"  style="width:100%"id="plotno"  required>
		                            <option  value="">--Select Plot--</option>
											                            <option selected value="all">--All Plots--</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="field-2" class="col-sm-2 control-label">Display</label>
		                    <div class="col-sm-7">
		                        <select name="paymentstatus" class="form-control"   id="paymentstatus"  required>
								                 				  <option  value="utilities">View utilities</option>

		                          <option  value="invoice">Invoces</option>

								      <option  value="receipt">Payments(Receipts /Summary)</option>
									  
								      <option  value="receiptutility">Utility Payments(Detailed) </option>
		                            <option selected value="all Statement">Summary Invoces and payments</option>
								
                 				  <option  value="balances">Existing Balances</option>
                 				  <option  value="deposit">Existing deposits</option>
								   <option  value="overpayment">Existing Overpayment </option>


			                    </select>
								     <span class="text-danger"><?php echo form_error('display'); ?></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="date" 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="date" 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="inputclosebalancetodate" class="col-sm-2 control-label">Closing Bal. Date</label>
    <div class="col-sm-7">
		<input type="date" name="closebalancetodate" 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"  id="charges">
						<label for="field-2" class="col-sm-2 control-label">Utility type</label>
		                    <div class="col-sm-7">
		                        <select name="charges" class="chzn-select"  style="width:100%"id="plotno"  required>
		                            <option  value="">--Select Utility--</option>
									 <option selected value="all">--All Utilities--</option>

									   <?php
								$charges = $this->usermodel->populateall('charges','companyid', $companyid);


if(is_array($charges)) {

   foreach($charges as $chargesrow){

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

   
    <?php

}} else {
    echo 'There is no charge 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="field-2" class="col-sm-2 control-label">Status</label>
		                    <div class="col-sm-7">
		                        <select name="status" class="form-control"    required>
		                            <option selected value="all">-All tenants-</option>
								      <option  value="active">Active tenants Only</option>
                 								      <option  value="inactive">In Active tenants</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_searchstatement"value="statemet" class="btn btn-primary">View statemet </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>
			Deposits Refunds Summary reports
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
		


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

				$month= Date('Y-m');
			$fromdate=$month."-01";
				$date=$month."-30";
				
								//$date= Date('Y-m-d');

		
                 echo form_open('admin/searchfordepositreport' , 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"  style="width:100%"id="plotno"  required>
		                            <option  value="">--Select Plot--</option>
											                            <option selected value="all">--All Plots--</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="field-2" class="col-sm-2 control-label">Display type</label>
		                    <div class="col-sm-7">
		                        <select name="paymenttype" class="form-control"   id="paymenttype"  required>
								 
                 				  <option  value="deposit">Deposits Refunds</option>
							


			                    </select>
								     <span class="text-danger"><?php echo form_error('paymenttype'); ?></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="date" 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="date" 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">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_searchstatement"value="statemet" class="btn btn-primary">View Deposits Refunds </button>

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














<div id="updatemyModal" 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">Update balances</h4>
		
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
		  $new_date=date("Y-m-d H:i:00");		
		  $new_date2=date("Y-m-30");		

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

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('admin/updaterentalbalances' , 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="type" value="product"id="type" class="form-control" required placeholder="Enter type">
				<input type="hidden" name="view" value="user/viewloyality"id="view" class="form-control" required placeholder="Enter view">
	
	


	 <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">Balance  start Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="fromdate" value="<?php echo set_value('fromdate',$frm); ?>" class="form-control" required placeholder="Enter start 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">Balance  End  Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="todate" value="<?php echo set_value('todate',$new_date2); ?>" class="form-control" required placeholder="Enter end date">
		 
				
		<span class="text-danger"> <?php echo form_error('enddate'); ?>
		
		</span>
	</div>
  </div>
		
  
  
   <div class="form-group">
    <label for="inputaction" class="col-sm-2 control-label">Action</label>
    <div class="col-sm-10">
	<select class="form-control" name="action" required>
	
		<option value="update"  >Update balances</option>

	

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

	</div>
  </div>
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="loyatity" name="btn_addrentalupload" class="btn btn-primary"> Update Balance   </button>

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

    

				</div>

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

	


























			
			
			
			
			</div></div>
			
			
			
			
			
			
				   	 <script type="text/javascript">
        		
		
		
			 $(document).ready(function() { 
		             $("#charges").hide();

					});
					
			 </script>
			





