      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Loan Application
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">Loans</a></li>
            <li class="active">Loan Application</li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
           <div class="row">         
           
           	 <div class="col-md-12">
              <div class="box box-primary">
                <div class="box-header with-border">
                  <div class="col-md-6 pull-right">
                   <div class="col-md-6">
                        <button type="submit" class="btn btn-info btn-label-left btn-block btn-header">
                            Loan Details
                        </button>
                    </div>                          
                    <div class="col-md-6">
                        <button type="submit" class="btn btn-primary btn-label-left btn-block btn-header">
                            Add Guarantor(s)
                        </button>
                    </div>                      
				</div>                  
                </div><!-- /.box-header -->  
                <div class="box-body">
                
                            	
                   <div class="row">
                   	<div class="col-md-12">
                  		<form role="form">
                           <div class="col-md-3">
                                <label>Principal</label>
                                <input type="text" class="form-control" name="principal" value="50000" readonly />
                            </div>                          
                            <div class="col-md-3">
                               <label>Member Shares</label>
                               <input type="text" class="form-control" name="member_shares" value="20000" readonly />
                            </div>
                             <div class="col-md-3">
                               <label>Guarantors</label>
                               <input type="text" class="form-control" name="guarantors" value="20000" readonly />
                            </div>
                            <div class="col-md-3">
                               <label>Security Required</label>
                               <input type="text" class="form-control" name="security_required" value="10000" readonly />
                            </div>                    
                          </form>    
                  	</div>
                  </div> 
                  
                      
              	<div class="spacer"></div>
                
                
                <div class="col-md-12">
              	 <div class="box">
                     <div class="box-header">
                      <h3 class="box-title blue">Guarantors For Loan</h3>
                     </div><!-- /.box-header -->  
                    <div class="box-body">                    
                    
                             <!--dataTable to dispaly gurantors for the particular loan if any-->
                            <div  class="col-md-12">
                            <div class="box-content no-padding">
                            <table id="guarantors_table" class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <th>Member No.</th>
                                        <th>National Id No.</th>
                                        <th>Amount Offered</th>
                                        <th>Status</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <?php
                                $x=0;
                                if($guarantors == NULL){?>
                                
                                <tr>
                                        <td colspan="4">Currently there are no guarantors for the loan.</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                </tr>
                                <?php } else{
                                foreach($guarantors as $row){$x++;
                                ?>
                                <!-- Start: list_row -->
                                    <tr>
                                        <td><?php echo $row->guarantor_member_no;?></td>
                                        <td><?php echo $row->guarantor_id_no;?></td>
                                        <td><?php echo $row->amount;?></td>
                                        <td><?php echo $row->status;?></td>
                                    </tr>
                                  <?php  }} ?>
                                
                                <!-- End: list_row -->
                                </tbody>
                                
                            </table>
                            </div>
                            </div> 
                		
                      </div><!-- /closing guarantors For loan --> 
                </div><!-- /.box -->   
           	  </div>                
                
                
              <div class="col-md-12">
              	 <div class="box box-success">
                     <div class="box-header with-border">
                      <h3 class="box-title purple">Add Another Guarantor</h3>
                     </div><!-- /.box-header -->  
                    <div class="box-body">                    
                    
                      <form class="form-inline" method="post" action="<?php echo site_url();?>loans/insert_guarantor">
                      <div class="box-body">
                           <div class="col-md-3">
                                <label>Member No.</label>
                                 <?php echo form_error('guarantor_member_no'); ?> <br/>
                                <input type="text" class="form-control" id="guarantor_member_no" name="guarantor_member_no" value="<?php echo set_value('guarantor_member_no'); ?>" />
                            </div>                          
                            <div class="col-md-3">
                               <label>National Id No.</label>
                                <?php echo form_error('national_id_no'); ?> <br/>
                               <input type="text" class="form-control" id="national_id_no" name="national_id_no" value="<?php echo set_value('national_id_no'); ?>" />
                            </div>
                            <div class="col-md-3">
                               <label>Amount Offered</label>
                                <?php echo form_error('amount_offered'); ?> <br/>
                               <input type="text" class="form-control" name="amount_offered" value="<?php echo set_value('amount_offered'); ?>" />
                            </div>
                            <div class="col-md-3">
                               <label>Existence Status</label>
                                <?php echo form_error('existence_status'); ?> <br/>
                               <input type="text" class="form-control" id="existence_status" name="existence_status" value="Not Confirmed" readonly />
                            </div>
                           </div><!-- /.box-body -->

                      <div class="box-footer">
                      	<div class="row">
                        <div class="col-md-12">                        
                         <div class="col-md-6">
                              <button class="btn btn-primary btn-label-left  btn-block" onclick="ajaxConfirmGuarantorExistence();">
                                 Confirm Guarantor
                              </button>
                          </div>                            
                          <div class="col-md-6">
                              <button type="submit" class="btn btn-success btn-label-left btn-block">
                                  Submit
                              </button>
                          </div>
                        </div><!--closing footer col-md-12-->
                        </div>
                      </div>                   
                      </form>    
                		
                      </div><!-- /closing guarantors  --> 
                </div><!-- /.box -->   
           	  </div>            
            
             
                  
                </div><!-- /closing outer box --> 
                </div><!-- /.box -->   
           	</div>
          </div>   <!-- /.row -->

        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->