
	 <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>
                 
			 


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

		<?PHP
				
		 echo $this->session->flashdata('deletemsg'); 
	 $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'];	
	 
	 
				$data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];



				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;?>
					
	 <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>

	
	    <option  selected="selected" value="<?php echo set_value('landlordid',$plot[0]['category']); ?> "><?=$plot[0]['category']?></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="hidden" name="action" value="<?php echo set_value('action','update'); ?>"id="action" class="form-control" required >

		<input type="hidden" name="id" value="<?php echo set_value('id',$plot[0]['id']); ?>"id="bookingno" class="form-control" required placeholder="Enter booking number">

		<input type="text" name="name" value="<?php echo set_value('name',$plot[0]['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',$plot[0]['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">Agent Name</label>
    <div class="col-sm-7">
				    	
			  	<select name="agentid"  class="chzn-select" required>
<option value="" >---Select Agent for plot---</option>

	
		
	
					<?php $agentid=$plot[0]['agentid'];
	
$agent = $this->accomodationmodel->getagentid($agentid);
								


if(is_array($agent)) {

   foreach($agent as $agentrow){

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

	
	<?php

}} else {
    ?>
	    <option   value="<?php echo set_value('agentid',$agentid); ?> "><?=$agentid?></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('agentid'); ?></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 plot---</option>

	
		
	
					<?php $landlordid=$plot[0]['landlordid'];
	
$landlords = $this->accomodationmodel->getlandlordid($landlordid);
								


if(is_array($landlords)) {

   foreach($landlords as $landlordsrow){

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

	
	<?php

}} else {
    ?>
	    <option   value="<?php echo set_value('landlordid',$landlordid); ?> "><?=$landlordid?></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('agentid'); ?></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',$plot[0]['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">

								  
								 
								  	<?php
									
									
												
 $countryid= $plot[0]['country'];
$country = $this->accomodationmodel->getcountrybyid($countryid);


if(is_array($country)) {

   foreach($country as $countryrow){

    ?>
	    <option 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.';
}
								
$country = $this->accomodationmodel->populateallcountries();


if(is_array($country)) {

   foreach($country as $countryrow){

    ?>
	    <option 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.';
}

?>
			  
		                            <option value="">--Select Country--</option>
			                        
			                    </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="bank" name="bank" value="<?php echo set_value('bank',$plot[0]['bank']); ?>" id="bank" class="form-control"  placeholder="Enter 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="branch" name="branch" value="<?php echo set_value('branch',$plot[0]['branch']); ?>" id="bank" class="form-control"  placeholder="Enter 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',$plot[0]['accountname']); ?>" id="accountname" 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',$plot[0]['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">Commission(%) </label>
    <div class="col-sm-7">
				<input type="commission" name="commission" value="<?php echo set_value('commission',$plot[0]['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',$plot[0]['tax']); ?>" id="tax" class="form-control"  placeholder="Enter  tax (%)">
    <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  selected="selected" value="<?php echo set_value('taxtype',$plot[0]['taxtype']); ?> "><?=$plot[0]['taxtype']?></option>

	<option value=""  >---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="<?php echo set_value('vat2',$plot[0]['vat2']); ?>" 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>
	    <option  selected="selected" value="<?php echo set_value('penaltytype',$plot[0]['penaltytype']); ?> "><?=$plot[0]['penaltytype']?></option>

	

	
	</select>
				

	  <span class="text-danger"><?php echo form_error('penaltytype'); ?></span>
	</div>
  
  	</div>
	
	
	
	
	
					  <div class="form-group">
    <label for="inputsupplier" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-7">
				<?php
			$mybranchid=	$plot[0]['branchid']
				?>
				
				<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter-</option>

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


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="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',$plot[0]['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="inputareas" class="col-sm-2 control-label">Display arreas?</label>
    <div class="col-sm-7">
	
	<select class="form-control" name="areas" >
	<option value="<?php echo $plot[0]['areas']; ?>"  selected="selected" ><?php echo $plot[0]['areas']; ?></option>
	<option value=""  >---Do you want to display arreas?---</option>
	<option value="yes"  >yes</option>
		<option value="no"  >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="<?php echo $plot[0]['power']; ?>"  selected="selected" ><?php echo $plot[0]['power']; ?></option>

	<option value=""   >---Do you want to Power arreas?---</option>
	<option value="yes"  >yes</option>
		<option value="no"   >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="<?php echo $plot[0]['coparent']; ?>"  selected="selected" ><?php echo $plot[0]['coparent']; ?></option>
	<option value=""  >---Do you want to display coparent?---</option>
	<option value="yes"  >yes</option>
		<option value="no"  >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="<?php echo $plot[0]['showpenalty']; ?>"  selected="selected" ><?php echo $plot[0]['showpenalty']; ?></option>
	<option value=""  >---Do you want to display coparent?---</option>
	<option value="yes"  >yes</option>
		<option value="no"  >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('penalty'); ?>
		
		</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="<?php echo $plot[0]['water']; ?>"  selected="selected" ><?php echo $plot[0]['water']; ?></option>
	<option value=""  >---Do you want to display water?---</option>
	<option value="yes"  >yes</option>
		<option value="no"  >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="<?php echo $plot[0]['garbage']; ?>"  selected="selected" ><?php echo $plot[0]['garbage']; ?></option>
	<option value=""  >---Do you want to display garbage?---</option>
	<option value="yes"  >yes</option>
		<option value="no"  >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="<?php echo $plot[0]['partial']; ?>"  selected="selected" ><?php echo $plot[0]['partial']; ?></option>

	<option value="" >---Do you want to display partial payments?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('partial'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  <div class="form-group">
      <label for="inputservicedeposit" class="col-sm-2 control-label">Display service deposite?</label>

    <div class="col-sm-7">
	
	<select class="form-control" name="servicedeposit" >
	
			<option value="<?php echo $plot[0]['servicedeposit']; ?>"  selected="selected" ><?php echo $plot[0]['servicedeposit']; ?></option>

	<option value="" >---Do you want to display service charge servicedeposit?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('servicedeposit'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  <div class="form-group">
      <label for="inputservice" class="col-sm-2 control-label">Display service charge?</label>

    <div class="col-sm-7">
	
	<select class="form-control" name="service" >
	
			<option value="<?php echo $plot[0]['service']; ?>"  selected="selected" ><?php echo $plot[0]['service']; ?></option>

	<option value="" >---Do you want to display service charge?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('service'); ?>
		
		</span>
	</div>
  </div>
  
  
  <div class="form-group">
      <label for="inputlease" class="col-sm-2 control-label">Display Lease Agreement?</label>

    <div class="col-sm-7">
	
	<select class="form-control" name="lease" >
	
			<option value="<?php echo $plot[0]['lease']; ?>"  selected="selected" ><?php echo $plot[0]['lease']; ?></option>

	<option value="" >---Do you want to display Lease Agreement?---</option>
	<option value="yes"   >yes</option>
		<option value="no"   >no</option>
	</select>		 
				
		<span class="text-danger"> <?php echo form_error('lease'); ?>
		
		</span>
	</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"><?php echo set_value('description',$plot[0]['description']); ?></textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
    
          <div class="form-group">
    <label for="inputinvoicedate" class="col-sm-2 control-label">Automatic Invoice Date</label>
    <div class="col-sm-7">
				<input type="text" maxlength="2" name="invoicedate" value="<?php echo set_value('invoicedate',$plot[0]['invoicedate']); ?>" 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 Penalty Date</label>
    <div class="col-sm-7">
				<input type="text" maxlength="2" name="penaltydate" value="<?php echo set_value('penaltydate',$plot[0]['penaltydate']); ?>" 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"><?php echo set_value('invoicesms',$plot[0]['invoicesms']); ?></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="receiptsms" rows="2" placeholder="Enter automatic payment/receipt feedback sms here " class="form-control"><?php echo set_value('receiptsms',$plot[0]['receiptsms']); ?></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="<?php echo $plot[0]['utility']; ?>"  selected="selected" ><?php echo $plot[0]['utility']; ?></option>

	<option value="" >---Do people pay other utility apart from rent?---</option>
	<option value="yes"   >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">Update Plot</button>

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





