

	 <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 printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

     //document.body.innerHTML = printContents.fontsize(16);
     window.print();

	 if( window.print()) {
         window.location.href = "../admin/viewallplots";
		alert(" printing...........");
    }else {

	
		      return      window.location.href = "../admin/viewallplots";

		    // document.body.innerHTML = originalContents;

	}
}
	</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> 
						Add  Business Details
                    	</a></li>
			<li>
            	<a href="#list" data-toggle="tab"><i class="entypo-plus-circled"></i>
				 All Business
                    	</a></li>
						
						
							<li>
            									 <a href="<?php echo base_url(); ?>admin/viewpallmyplots">Back </a>


							</li>
						
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
			  <div class="tab-pane box " id="uploadhouse">
			
					
<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>
				Upload house for this plot only
				
				
            	</div>
				

            </div>
			<div class="panel-body">

				 <a href="<?php echo base_url();?>downloads/houses.csv" class="btn btn-success">Download  Houses  template </a>	 




				<?PHP
		
   

				$session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];

 $data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];
 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
				echo $this->session->flashdata('msg'); 
                 echo form_open('admin/uploadhouse' , 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="inputfile" class="col-sm-2 control-label">Upload file</label>
    <div class="col-sm-7">
		  		<input type="file" name="file" value="<?php echo set_value('file'); ?>"id="file" class="form-control" required placeholder="Enter Country Name">
     <span class="text-danger"><?php echo form_error('file'); ?></span>
   </div>
  </div>
   			 <div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Category</label>
    <div class="col-sm-7">
				    	
			  	<select name="category"  class="form-control" required>
<option value="" >---Select category of plot---</option>
<option value="rental" >rental</option>
<option value="accommodation" >accommodation</option>

	

	
	</select>
				

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


  	
             <?php 
   

	
  	//echo $plotno;
  	//echo  $houseno;
		 

             ?>
    
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_uploadhouse"value="house" class="btn btn-primary">Upload list of Houses</button>

    </div>
  </div>
                    
                <?php echo form_close();?>
            </div>
        </div>
    </div>
</div>
			
			
			
			
			</div>
			
			
			
			
			
			
			
			  <div class="tab-pane box " id="uploadinvoices">
			
					
<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>
				Upload house opening balances
            	</div>
            </div>
			<div class="panel-body">
				 <a href="<?php echo base_url();?>downloads/housesbalances.csv" class="btn btn-success">Download  Houses  template </a>	 





				<?PHP
		
   

				echo $this->session->flashdata('msg'); $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'];	
                 echo form_open('admin/uploadhousebalances' , 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="inputfile" class="col-sm-2 control-label">Upload file</label>
    <div class="col-sm-7">
		  		<input type="file" name="file" value="<?php echo set_value('file'); ?>"id="file" class="form-control" required placeholder="Enter Country Name">
     <span class="text-danger"><?php echo form_error('file'); ?></span>
   </div>
  </div>
   			
  	
             <?php 
   

	
  	//echo $plotno;
  	//echo  $houseno;
		 

             ?>
    
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_uploadbalances"value="house" class="btn btn-primary">Upload opening balances<button>

    </div>
  </div>
                    
                <?php echo form_close();?>
            </div>
        </div>
    </div>
</div>
			
			
			
			
			</div>
			
			
			<div class="tab-pane box " id="uploadsales">
			
					
<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>
				Upload sales
            	</div>
            </div>
			<div class="panel-body">
				 <a href="<?php echo base_url();?>downloads/housesales.csv" class="btn btn-success">Download  sales  template </a>	 





				<?PHP
		
   

				echo $this->session->flashdata('msg'); $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'];	
                 echo form_open('admin/uploadhousesales' , 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="inputfile" class="col-sm-2 control-label">Upload file</label>
    <div class="col-sm-7">
		  		<input type="file" name="file" value="<?php echo set_value('file'); ?>"id="file" class="form-control"  placeholder="Enter Country Name">
     <span class="text-danger"><?php echo form_error('file'); ?></span>
   </div>
  </div>
   			
  	
             <?php 
   

	
  	//echo $plotno;
  	//echo  $houseno;
		 

             ?>
    
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_uploadsales"value="house" class="btn btn-primary">Upload Now<button>

    </div>
  </div>
                    
                <?php echo form_close();?>
            </div>
        </div>
    </div>
</div>
			
			
			
			
			</div>
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			  <div class="tab-pane box " id="upload">
			
					
<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 Upload of plots  only
            	</div>
            </div>
			<div class="panel-body">





				<?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'];	
				echo $this->session->flashdata('msg'); 
                 echo form_open('admin/uploadplot' , 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">
			  		<input type="hidden" name="plotno" value=""id="plotno" class="form-control" required placeholder="Enter plot no">

    <label for="inputfile" class="col-sm-2 control-label">Upload file</label>
    <div class="col-sm-7">
		  		<input type="file" name="file" value="<?php echo set_value('file'); ?>"id="file" class="form-control" required placeholder="Enter Country Name">
     <span class="text-danger"><?php echo form_error('file'); ?></span>
   </div>
  </div>
   			
  	
             <?php 
   

	
  	//echo $plotno;
  	//echo  $houseno;
		 

             ?>
    
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_uploadplots"value="plots" class="btn btn-primary">Upload plots</button>

    </div>
  </div>
                    
                <?php echo form_close();?>
            </div>
        </div>
    </div>
</div>
			
			
			
			
			</div>
			
            <div class="tab-pane box" id="list">
	

 <div class="panel panel-primary" data-collapsed="0">

 	<div class="col-md-12">
        <?php 
		// echo $this->session->flashdata('msg'); 
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("admin/searchallplots", $attr);?>
            <div class="form-group">
			
                <div class="col-md-8">
                    <input class="form-control" id="searchterm" name="searchterm" placeholder="Search for plots/building by name or number.." type="text" value="<?php echo set_value('searchterm'); ?>" />
                </div>
                <div class="col-md-4">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-success" value="Search" />
                    <a href="<?php echo base_url(). "admin/viewallplots"; ?>" class="btn btn-primary">Refresh</a>
                </div>
				 
            </div>
        <?php echo form_close(); ?>
		
		 <div class="pull-right" id="non-printable"  >
<form name="print" method="post" action="">
 <input type="submit" id="print"  accesskey="p" class="btn btn-primary"  name="print"onclick="printDiv('example')" value="Print!" />
                   
 
 </form>

 </div>
        </div>
  <table cellpadding="0" cellspacing="0" border="0" class="table  table-striped" id="example" style="border-color:#CCCCCC; width:100%;"  >
             <thead>
		 
         <tr>
    
    <th> Code </th>
	<th> Name</th>
	<th>User</th>

    <th>Status</th>         
	<th>Paid</th> 
	<th>Bal</th> 
	<th>Exp Total</th> 
			<th>Meters</th> 
	<th>Vac.</th> 

	<th>Occp.</th> 

	<th id="non-printable">Manage Meters</th> 


<th id="non-printable">More</th> 

                 </tr>
             </thead>
<?php
$year = Date('Y') ;
		  $month = Date('m') ;
echo $this->session->flashdata('msg'); 
	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;
					}
 if(!is_array($plots)) 

 {


   
    
       echo '<div class="alert alert-warning text-center">There is no Plot found by now from system..</div>';
   
    }else {
?>
    
             <?php 
  $paid=0;
  	foreach ($plots as $c): 

		 

             ?>



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

?>

             <td><?php  $c->id ; ?>
			 
				   <a class="btn btn-primary" id="more" href="<?php echo base_url();?>admin/editplot?randomitemidentifier=<?php   {echo  $id;}  ?>"><?php echo $c->id?> </a>
 
			 
			 </td> 
				<td><?php echo $c->name ; ?></td> 

				<td><?php  $landlordid=  $c->landlordid ; 
							    $landlords = $this->accomodationmodel->getlandlordid($landlordid);
							


if(is_array($landlords)) {

   foreach($landlords as $landlordsrow){

  $names= $landlordsrow->firstname ; 
    
   ?>
   
                     <a class="active"  id="more" href="<?php echo base_url();?>admin/editlandlord?randomitemidentifier=<?php   {echo  $landlordid;}  ?>"><?php   {echo  $names;}  ?>  </a>

   
   <?php
}} else {
    echo $c->landlordid;
}
	
				
				?></td> 
				
				
					<td> <b><?php 
					
					
					
							$allpaymentinvoice = $this->accomodationmodel->getallplotinvoice($plotno,$month,$year); 
					  $total=0;
					  $paid=0;
					  $balance=0;
					if(is_array($allpaymentinvoice)) {

   foreach($allpaymentinvoice as $allpaymentinvoicerow){

    $total=$total + $allpaymentinvoicerow->amount ; 
    $paid=$paid + $allpaymentinvoicerow->paid ; 

}

  $total;
 //$grandtotal= $grandtotal+$total;

} else {
   $total=0;
}


			
$paymentstatus=0;

	if($total==0){
		//echo "no value";
	
	 $paymentstatus=0;
	}else{
 $paymentstatus=((($paid)/$total)*100);
		//echo $total;
		
	}
	
	$balance=$total-$paid;

				if($paymentstatus>=100){
			
			?>
			<div style="background-color:green">
			<?php  echo formatMoney($paymentstatus, true);	?>
			</div>
			<?php
			}else if(($paymentstatus>=50)&& ($paymentstatus<100)){
		?>
			<div style="background-color:orange">
			<?php  //echo $paymentstatus; 
echo formatMoney($paymentstatus, true);

			?>
			</div>
			<?php
			
			}else if($paymentstatus<50){
			?>
			<div style="background-color:red">
			<?php  echo formatMoney($paymentstatus, true); 	?>
			</div>
			<?php
			}
					
					
	?></b></td>			
					
					
					
					
			          <td><?php echo $paid; ?></td>		
					
					          <td><?php echo $balance ; ?></td>
					
					          <td><?php echo $total ; ?></td>
					
					
					
					
				

                 <td><?php echo $c->totalhouse ; ?></td>
                     <td><?php 
					 
					 $vacanthouse = $this->accomodationmodel->displayvacant($id);
					 if($vacanthouse==FALSE){
						 
						 echo "0";
					 }else{
						 
						//echo $vacanthouse; 
											?>
							   <a class="btn btn-warning" id="more" href="<?php echo base_url();?>admin/viewplot?randomitemidentifier=<?php   {echo  $id;}  ?>&status=vacant&category=<?php   {echo  $c->category ;}  ?>"><?php   {echo  $vacanthouse;}  ?> </a>

					 
					 <?php 
					 }
					 
				
					 
					 
					 ?></td> 
					 
					    <td><?php 
					 
					 $occupiedhouse = $this->accomodationmodel->displayoccupied($id);
					 if($occupiedhouse==FALSE){
						 
						 echo "0";
					 }else{
						 
						//echo $occupiedhouse; 
						?>
							   <a class="btn btn-success" id="more" href="<?php echo base_url();?>admin/viewplot?randomitemidentifier=<?php   {echo  $id;}  ?>&status=occupied&category=<?php   {echo  $c->category ;}  ?>"><?php   {echo  $occupiedhouse;}  ?> </a>

					 
					 <?php 
					 
					 }
					 
				
					 
					 
					 ?></td> 

		      					 
                     <td id="non-printable">
	   <a class="btn btn-primary" id="more" href="<?php echo base_url();?>admin/viewplot?randomitemidentifier=<?php   {echo  $id;}  ?>&category=<?php   {echo  $c->category ;}  ?>"> Meters </a>
         </td>
		       
		 <td id="non-printable">
		
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
										 
										
										
                                    
                                      	  <li> 

   <a class="btn btn-success" id="more" href="<?php echo base_url();?>admin/plotcharges?randomitemidentifier=<?php   {echo  $id;}  ?>">
                                                <i class="glyphicon glyphicon-pencil"></i>
																Activate Charges
                                                </a>
                                                        </li>
														  <li class="divider"></li>
										
										  	  <li> 

	   <a class="btn btn-primary" id="more" href="<?php echo base_url();?>admin/rentinvoice?randomitemidentifier1=<?php   {echo  $id;}  ?>">

                                                <i class="glyphicon glyphicon-pencil"></i>
																Bulk Utilities Invoice 
                                                </a>
                                                        </li>
										
																
                                       <li class="divider"></li>
										
										<li> 

	   <a class="btn btn-primary" id="more" href="<?php echo base_url();?>admin/coparentinvoice?randomitemidentifier1=<?php   {echo  $id;}  ?>">

                                                <i class="glyphicon glyphicon-pencil"></i>
																Bulk Coparent 
                                                </a>
                                                        </li>
										                                       <li class="divider"></li>

                                    
                                      	  <li> 

	   <a class="btn btn-primary" id="more" href="<?php echo base_url();?>admin/penaltyinvoice?randomitemidentifier1=<?php   {echo  $id;}  ?>">

                                                <i class="glyphicon glyphicon-pencil"></i>
																Bulk Penalty Invoice
                                                </a>
                                                        </li>
														
														
														
                                       <li class="divider"></li>
											<?php
										if($usertype=="admin"){
											
											?>
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'     data-toggle='modal' data-target='#myModal<?php  $c->id; ?>'>	 


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

             <?php endforeach; ?>

              <?php }?>

        </table>
   <div class="col-md-12 text-center">    <?php echo $links; ?>
					   		<span style="color:red; font-size:20px"><?php  echo $total_rows. "   plots. " ;?>   </span>

        
        </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 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="plot">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="admin/viewallplots">
 <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 class="tab-pane box active" id="add" 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>
				Add new Plot
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
				echo $this->session->flashdata('msg'); 
		
                 echo form_open('addplot' , 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="action" value="<?php echo set_value('action','insert'); ?>"id="action" class="form-control" required >



	 <div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Category</label>
    <div class="col-sm-7">
				    	
			  	<select name="category"  class="form-control" required>
<option value="" >---Select category of plot---</option>
<option value="rental" >rental</option>
<option value="accommodation" >accommodation</option>

	

	
	</select>
				

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







    <div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">Plot Name</label>
    <div class="col-sm-7">
		<input type="text" name="name" value="<?php echo set_value('name') ;?>" id="name" class="form-control" required placeholder="Enter name">
       <span class="text-danger"><?php echo form_error('name'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <label for="inputlocation" class="col-sm-2 control-label">Location</label>
    <div class="col-sm-7">
				<input type="text" name="location" value="<?php echo set_value('location') ;?>" id="exampleInputlocation" class="form-control" required placeholder="Enter  location">
    <span class="text-danger"><?php echo form_error('location'); ?></span>
	</div>
  </div>
 
  
  <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">landlord Name</label>
    <div class="col-sm-7">
				    	
			  	<select name="landlordid" class="chzn-select" required>
<option value="" >---Select landlord for this plot---</option>

		<?php 

$landlord = $this->accomodationmodel->populatealllandlord();


if(is_array($landlord)) {

   foreach($landlord as $landlordrow){

    ?>
	    <option value="<?php echo set_value('landlord',$landlordrow->id); ?> "><?=$landlordrow->lastname." ".$landlordrow->firstname;?></option>

   
    <?php

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

?>
	</select>
				

	  <span class="text-danger"><?php echo form_error('landlordid'); ?></span>
	</div>
  </div>		
<div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Agent Name</label>
    <div class="col-sm-7">
				    	
			  	<select name="agentid" class="chzn-select" required >
<option value="" >---Select Agent for this plot---</option>

		<?php 

$allagents = $this->accomodationmodel->populateallagent();


if(is_array($allagents)) {

   foreach($allagents as $agentrow){

    ?>
	    <option value="<?php echo set_value('agentid',$agentrow->id); ?> "><?=$agentrow->lastname." ".$agentrow->firstname;?></option>

   
    <?php

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

?>
	</select>
				

	  <span class="text-danger"><?php echo form_error('landlordid'); ?></span>
	</div>
  </div>			
   <div class="form-group">
    <label for="inputphone3" class="col-sm-2 control-label">Total Houses </label>
    <div class="col-sm-7">
				<input type="phone" name="totalhouse" value="<?php echo set_value('totalhouse'); ?>" id="totalhouse" class="form-control" required placeholder="Enter total house">
    <span class="text-danger"><?php echo form_error('totalhouse'); ?></span>
   </div>
  </div>
  <div class="form-group">
						<label for="field-2" class="col-sm-2 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="inputbank" class="col-sm-2 control-label">Bank Name</label>
    <div class="col-sm-7">
				<input type="text" name="bank" value="<?php echo set_value('bank'); ?>" id="bank" class="form-control"  placeholder="Enter your  bank">
    <span class="text-danger"><?php echo form_error('bank'); ?></span>
   </div>
  </div>
    <div class="form-group">
    <label for="inputbranch" class="col-sm-2 control-label">Branch Name</label>
    <div class="col-sm-7">
				<input type="text" name="branch" value="<?php echo set_value('branch'); ?>" id="branch" class="form-control"  placeholder="Enter bank branch name">
    <span class="text-danger"><?php echo form_error('branch'); ?></span>
   </div>
  </div>
  					
     <div class="form-group">
    <label for="inputaccountname" class="col-sm-2 control-label">Account Name</label>
    <div class="col-sm-7">
				<input type="accountname" name="accountname" value="<?php echo set_value('accountname'); ?>" id="idno" class="form-control"  placeholder="Enter account name">
    <span class="text-danger"><?php echo form_error('accountname'); ?></span>
   </div>
  </div>
    
   <div class="form-group">
    <label for="inputaccountno" class="col-sm-2 control-label">Account Number</label>
    <div class="col-sm-7">
				<input type="accountno" name="accountno" value="<?php echo set_value('accountno'); ?>" id="idno" class="form-control"  placeholder="Enter  account number">
    <span class="text-danger"><?php echo form_error('accountno'); ?></span>
   </div>
  </div>
  
       <div class="form-group">
    <label for="inputcommission" class="col-sm-2 control-label">Managent fee/ Commission(%) </label>
    <div class="col-sm-7">
				<input type="commission" name="commission" value="<?php echo set_value('commission'); ?>" id="idno" class="form-control"  placeholder="Enter  commission (%)">
    <span class="text-danger"><?php echo form_error('commission'); ?></span>
   </div>
  </div>
  
      <div class="form-group">
    <label for="inputtax" class="col-sm-2 control-label">Tax(%) </label>
    <div class="col-sm-7">
				<input type="tax" name="tax" value="<?php echo set_value('tax'); ?>" id="tax" class="form-control"  placeholder="Enter  Tax chargable (%)">
    <span class="text-danger"><?php echo form_error('tax'); ?></span>
   </div>
  </div>
  
    <div class="form-group">
    <label for="inputtaxtype" class="col-sm-2 control-label">Activate Tax?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="taxtype" required >
	<option value=""  selected="selected" >---Which tax do you want to activate?---</option>
	<option value="Landlord"   >Landlord tax ONLY</option>
	
		<option value="Agent"   >Agent tax ONLY</option>
	<option value="Both"   >Both Landlord and Agent tax</option>

	
		<option value="No"   >No tax</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('taxtype'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
          <div class="form-group">
    <label for="inputvat" class="col-sm-2 control-label">Tax2(Levy)</label>
    <div class="col-sm-7">
				<input type="text" name="vat2" value="" id="vat2" class="form-control"  placeholder="Enter vat2">
        <span class="text-danger"><?php echo form_error('vat2'); ?></span>
	</div>
  </div>
	
	 <div class="form-group">
    <label for="inputpenaltytype" class="col-sm-2 control-label">Penalty type</label>
    <div class="col-sm-7">
				    	
			  	<select name="penaltytype"  class="form-control" required>
<option value="" >---Select penalty type of the plot---</option>
<option value="percentage" >percentage</option>
<option value="amount" >amount</option>

	

	
	</select>
				

	  <span class="text-danger"><?php echo form_error('penaltytype'); ?></span>
	</div>
  
  	</div>
    <div class="form-group">
    <label for="inputpenalty" class="col-sm-2 control-label">Penalty Charges(%) </label>
    <div class="col-sm-7">
				<input type="penalty" name="penalty" value="<?php echo set_value('penalty'); ?>" id="penalty" class="form-control"  placeholder="Enter  penalty for late payment (%)">
    <span class="text-danger">Enter amount or percentage e.g 10 or 500<?php echo form_error('penalty'); ?></span>
   </div>
  </div>
  
 
   <div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-7">
				
				
				<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter --</option>

									
								
<?php
	     $mybranch=$this->usermodel->populateall('branch','id',$branchid);


if(is_array($mybranch)) {

   foreach($mybranch as $branchrow){

   ?>
					<option selected="selected" value="<?=  $branchrow->id;   ?>"><?=  $branchrow->name; ?></option>




	<?php

}} else {
    echo 'No Branch available.';
}
	
?>
	
	
	
	
	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $maincategoryrow->id;   ?>"><?=  $maincategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
				
		</div>
  </div>
					
				
  
  
   <div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">Description </label>
    <div class="col-sm-7">
	<textarea name="description" id="ttt" rows="5" placeholder="add Description" class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
    
  	
		<div class="form-group">
    <label for="inputareas" class="col-sm-2 control-label">Display arreas?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="areas" >
	<option value=""   >---Do you want to display arreas?---</option>
	<option value="yes"  >yes</option>
		<option value="no"  selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('areas'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  <div class="form-group">
    <label for="inputpower" class="col-sm-2 control-label">Power ?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="power" >
	<option value=""   >---Do you want to Power arreas?---</option>
	<option value="yes"  >yes</option>
		<option value="no"  selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('power'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  
  
  
  
			<div class="form-group">
    <label for="inputcoparent" class="col-sm-2 control-label">Display Coparent?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="coparent" >
	<option value=""  >---Do you want to display coparent?---</option>
	<option value="yes"  >yes</option>
		<option value="no"   selected="selected">no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('coparent'); ?>
		
		</span>
	</div>
  </div>
			<div class="form-group">
    <label for="inputshowpenalty" class="col-sm-2 control-label">Display Penalty?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="showpenalty" >
	<option value="" >---Do you want to display coparent?---</option>
	<option value="yes"  >yes</option>
		<option value="no"   selected="selected">no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('showpenalty'); ?>
		
		</span>
	</div>
  </div>
			
  
  		<div class="form-group">
    <label for="inputwater" class="col-sm-2 control-label">Display water?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="water" >
	<option value=""    >---Do you want to display water?---</option>
	<option value="yes"  >yes</option>
		<option value="no" selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('water'); ?>
		
		</span>
	</div>
  </div>
	
	  
  		<div class="form-group">
    <label for="inputgarbage" class="col-sm-2 control-label">Display garbage?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="garbage" >
	<option value="" >---Do you want to display garbage?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('garbage'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
   
  
  <div class="form-group">
    <label for="inputpartial" class="col-sm-2 control-label">Display Partial?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="partial" >
	<option value="" >---Do you want to display partial?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('partial'); ?>
		
		</span>
	</div>
  </div>
  
  
    
  
    <label for="inputservicedeposit" class="col-sm-2 control-label">Display service deposit?</label>
  <div class="form-group">
    <div class="col-sm-7">
	
	<select class="form-control" name="servicedeposit" >
	<option value="" >---Do you want to display service charge deposit?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('servicedeposit'); ?>
		
		</span>
	</div>
  </div>
  
    
  

  
  
    <label for="inputservice" class="col-sm-2 control-label">Display service charge?</label>
  <div class="form-group">
    <div class="col-sm-7">
	
	<select class="form-control" name="service" >
	<option value="" >---Do you want to display service charge?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('service'); ?>
		
		</span>
	</div>
  </div>
  
  
  
      <label for="inputlease" class="col-sm-2 control-label">Display lease agreement?</label>
  <div class="form-group">
    <div class="col-sm-7">
	
	<select class="form-control" name="lease" >
	<option value="" >---Do you want to display lease agreement?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   selected="selected" >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('lease'); ?>
		
		</span>
	</div>
  </div>
  
           <div class="form-group">
    <label for="inputinvoicedate" class="col-sm-2 control-label">Automatic Monthly Invoice Date</label>
    <div class="col-sm-7">
				<input type="number" maxlength="2" name="invoicedate" value="<?php echo set_value('invoicedate',"01"); ?>" id="invoicedate" class="form-control" required placeholder="Enter invoicedate">
        <span class="text-danger"><?php echo form_error('invoicedate'); ?></span>
	</div>
  </div>
 
           <div class="form-group">
    <label for="inputpenaltydate" class="col-sm-2 control-label">Automatic Monthly Penalty Date</label>
    <div class="col-sm-7">
				<input type="number" maxlength="2" name="penaltydate" value="<?php echo set_value('penaltydate',10); ?>" id="invoicedate" class="form-control" required placeholder="Enter invoicedate">
        <span class="text-danger"><?php echo form_error('penaltydate'); ?></span>
	</div>
  </div>
  
  
  
  
  

              
 
   <div class="form-group">
    <label for="inputinvoicesms" class="col-sm-2 control-label">Invoice Sms </label>
    <div class="col-sm-7">
	<textarea name="invoicesms" id="invoicesms" rows="2" placeholder="Enter automatic invoice sms here " class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('invoicesms'); ?></span>
   </div>
  </div>
    
   <div class="form-group">
    <label for="inputreceiptsms" class="col-sm-2 control-label">Receipt/Payment Sms </label>
    <div class="col-sm-7">
	<textarea name="receiptsms" id="ttt" rows="2" placeholder="Enter automatic payment/receipt feedback sms here " class="form-control"></textarea>
    <span class="text-danger"><?php echo form_error('receiptsms'); ?></span>
   </div>
  </div>
    

      
  <div class="form-group">
    <label for="inpututility" class="col-sm-2 control-label">Other Utility?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="utility" >

	<option value="" >---Do people pay other utility apart from rent?---</option>
	<option value="yes" selected="selected"  >yes</option>
		<option value="no"   >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('utility'); ?>
		
		</span>
	</div>
  </div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_plot"value="plot" class="btn btn-primary">Add Plot</button>

    </div>
  </div>

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


</div></div>


		
			
			
			
			
			