<ul class="nav nav-tabs bordered">
			<li class="active">
            	<a href="#thirdtab" data-toggle="tab"><i class="entypo-menu"></i> 
					Coparent Approval
                    	</a></li>
						
						<a href="#back" data-toggle="tab"><i class="entypo-menu"></i> 
									 <a href="<?php echo base_url(); ?>admin/newcoparent">	Go back</a>

                    	</a></li>
			
					
					
		</ul>
    	<!------CONTROL TABS END------>
        
		<div class="tab-content">
            <!----TABLE LISTING STARTS-->
    
		
   
   
   <div class="tab-pane box active" id="thirdtab" 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>
				Approve Coparent
            	</div>
            </div>
			<div class="panel-body">





				<?PHP
				
				
							$session_data = $this->session->userdata('adminlogged_in');
$data['username'] = $session_data['username'];
$username = $data['username'];


				
				
				
				
				
				
				
				
				
				
				echo $this->session->flashdata('msg'); 
		 $date = Date('Y-m-d') ;
		 	 $year = Date('Y') ;
		  $month = Date('m') ;
                 echo form_open('addapproval' , 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="inputhouseno" class="col-sm-2 control-label">House Number</label>
    <div class="col-sm-7">
			  		<input type="text"  readonly name="houseno" value="<?php echo set_value('houseno',$tenant[0]['houseno']); ?>"id="Paymentno" class="form-control" required placeholder="Enter Payment number">
  		<input type="hidden" name="action" value="<?php echo set_value('action','update'); ?>"id="action" class="form-control" required >


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

    <label for="inputplotno" class="col-sm-2 control-label">Plot Number</label>
    <div class="col-sm-7">
	<input type="text" name="plotno" readonly value="<?php echo set_value('plotno',$tenant[0]['plotno']); ?>"id="plotno" class="form-control" required placeholder="Enter Payment number">


     <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">
       	<input type="hidden" readonly name="tenantid" value="<?php echo set_value('tenantid',$tenant[0]['tenantid']); ?>" id="idno" class="form-control" required placeholder="Enter Name">
 
		
		<?php 
		$tenantid=$tenant[0]['tenantid'];
		$tenantsdetails = $this->adminusermodel->gettenantbyid($tenantid);
								


if(is_array($tenantsdetails)) {

   foreach($tenantsdetails as $tenantsdetailsrow){

    $names=$tenantsdetailsrow->lastname. " ".$tenantsdetailsrow->firstname ; 
    ?>

	<input type="text" name="mytenantid" value="<?php echo set_value('tenantid',$names); ?>" id="idno" class="form-control" required placeholder="Enter Name">

	<?php

}} else {
  
  
         echo '<div class="alert alert-warning text-center">There is no tenant  found for this house.</div>';


	
}
				 
		
	?>	
		
		<span class="text-danger"><?php echo form_error('tenantid'); ?></span>
	</div>
  </div>
  
   <div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">Amount</label>
    <div class="col-sm-7">
				<input type="text" name="amount" value="<?php echo set_value('amount',$tenant[0]['amount']); ?>" id="amount" class="form-control" required placeholder="Enter amount">
        <span class="text-danger"><?php echo form_error('amount'); ?></span>
	</div>
  </div>
  
  
  
		 		  <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Payment for?:</label>
    <div class="col-sm-7">
				    	
				<input type="text" name="type" value="<?php echo set_value('type',$tenant[0]['type']); ?>" id="type" class="form-control" required placeholder="Enter type">

		(E.g rent)		

	  <span class="text-danger"><?php echo form_error('type'); ?></span>
	</div>
  </div>	
		 
  
  
     <div class="form-group" >
						<label for="field-2" class="col-sm-2 control-label">Request Status</label>
		                    <div class="col-sm-7" id="approval"  >
		                        <select name="approval" required class="form-control"  id="approval"   >
										 <option selected value="<?php echo $tenant[0]['approval']?>"><?php echo $tenant[0]['approval']?></option>

									      <option  value="approved">approved</option>
			                        <option  value="rejected">rejected</option>
									<option  value="new">new</option>
			                    </select>
								
								     <span class="text-danger"><?php echo form_error('approval'); ?></span>
			                </div>
	</div>
  
  
  
  
  
  
  
  
  
  
 <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Approved By:</label>
    <div class="col-sm-7">
					<input type="text" readonly name="id" value="<?php echo set_value('id',$tenant[0]['id']); ?>" id="id" class="form-control" required placeholder="id">

				<input type="hidden" readonly name="approvedby" value="<?php echo set_value('approvedby',$tenant[0]['approvedby']); ?>" id="approvedby" class="form-control" required placeholder="Approved by (Name)">
        <span class="text-danger"><?php echo form_error('year'); ?></span>
	</div>
  </div>  
    <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Month of Payment</label>
    <div class="col-sm-7">
				<input type="text" name="month" value="<?php echo set_value('month',$tenant[0]['month']); ?>" id="idno" class="form-control" required placeholder="Enter month">
        <span class="text-danger"><?php echo form_error('year'); ?></span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputrate" class="col-sm-2 control-label">Intrest Rate (%)</label>
    <div class="col-sm-7">
				<input type="text" name="rate" value="<?php echo set_value('rate','10'); ?>" id="rate" class="form-control" required placeholder="Enter rate">
        <span class="text-danger"><?php echo form_error('rate'); ?></span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputtransactioncode" class="col-sm-2 control-label">Receipt No</label>
    <div class="col-sm-7">
				<input type="text" readonly name="transactioncode" value="<?php echo set_value('transactioncode',$tenant[0]['transactioncode']); ?>" id="transactioncode" class="form-control" required placeholder="Enter transactioncode">
        <span class="text-danger"><?php echo form_error('transactioncode'); ?></span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Year of Payment</label>
    <div class="col-sm-7">
				<input type="text" readonly name="year" value="<?php echo set_value('year',$tenant[0]['year']); ?>" id="idno" class="form-control" required placeholder="Enter year">
        <span class="text-danger"><?php echo form_error('year'); ?></span>
	</div>
  </div>
 <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Application Date</label>
    <div class="col-sm-7">
				<input type="text" readonly name="createdat" value="<?php echo set_value('createdat',$tenant[0]['createdat']); ?>" id="idno" class="form-control" required placeholder="Enter Start Date">
        <span class="text-danger"><?php echo form_error('createdat'); ?></span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Approval Date</label>
    <div class="col-sm-7">
				<input type="text" readonly name="approvaldate" value="<?php echo set_value('approvaldate',$tenant[0]['approvaldate']); ?>" id="idno" class="form-control" required placeholder="Automatic ">
        <span class="text-danger"><?php echo form_error('approvaldate'); ?></span>
	</div>
  </div>
		  <div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">Payment Mode</label>
    <div class="col-sm-7">
				    	
			  	<select name="paymentmode" readonly class="form-control" required>

		<?php 
 $methode = $this->adminusermodel->getpaymentsectionid($tenant[0]['paymentmode']);


if(is_array($methode)) {

   foreach($methode as $methoderow){

    ?>
	    <option  selected="selected" value="<?php echo set_value('mode',$methoderow->id); ?> "><?=$methoderow->name?></option>

   
    <?php

}} else {
    echo 'No payment Mode';
}

?>
	</select>
				

	  <span class="text-danger"><?php echo form_error('paymentmode'); ?></span>
	</div>
  </div>			
  
    	 
	   <div class="form-group">
    <label for="inputpaymentcode" class="col-sm-2 control-label">Payment Code</label>
    <div class="col-sm-7">
				<input type="text" name="paymentcode" value="<?php echo set_value('paymentcode',$tenant[0]['paymentcode']); ?>" id="idno" class="form-control"  placeholder="Enter paymentcode">
        <span class="text-danger"><?php echo form_error('paymentcode'); ?></span>
	</div>
  </div>	 
		 
		 
		 
		 
		 
		 
   <div class="form-group">
    <label for="inputphone3" 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',$tenant[0]['description']); ?></textarea>
    <span class="text-danger"><?php echo form_error('description'); ?></span>
   </div>
  </div>
    
  
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-7">
     
	       <button type="submit" name="btn_addaproval" value="payment" class="btn btn-primary">Approval</button>

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

   </div>
   
   
   
   
   

   </div>
   
</div>




			