 <?php 
$this->db->where('kyc_details_atp_id', $atp->user_id);
$kyc_details = $this->db->get('atp_business_kyc_details')->row();
?>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark"><u><?php echo $atp->user_business_name; ?></u> KYC Details</h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="<?php echo base_url() ?>admin/admin/dashboard">Dashboard</a></li>
              <li class="breadcrumb-item"><a href="#">ATP</a></li>
              <li class="breadcrumb-item active">KYC Details</li>

            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <!-- Info boxes -->
        <div class="card card-default">
          <div class="card-header">
            <h3 class="card-title">Update KYC Details</h3>

            <div class="card-tools">
                Status 
                <?php if(!$kyc_details)
                {
                    echo '<span class="badge badge-danger">Not Set</span>';
                }
                elseif(check_kyc_by_atp_id($atp->user_id) > 7)
                {
                  echo '<span class="badge badge-danger">Reject</span>';
                }
                elseif(check_kyc_by_atp_id($atp->user_id) == 7)
                {
                    echo '<span class="badge badge-success">Approved</span>';
                }
                elseif(check_kyc_by_atp_id($atp->user_id) < 7)
                {
                  echo '<span class="badge badge-warning">Pending</span>';
                } ?>
            </div>
          </div>
          
          <!-- /.card-header -->
          <?php echo form_open_multipart('admin/update_profile/update_user_atp_kyc_details'); ?>
          <div class="card-body">
            <div class="row">
              <div class="col-md-12 text-center page-header">
                 <h4>Personal KYC</h4>
                 <hr/>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Aadhaar Number </label><br/>
                     <h2><?php echo $kyc_details->user_aadhar_no; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group" >
                     <label >Aadhaar Front Image</label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_aadhar_front_image; ?>" height="150px">
                 </div>
              </div>

              <div class="col-md-3">
                 <div class="form-group">
                     <label >Aadhaar Back Image</label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_aadhar_back_image; ?>" height="150px">
                 </div>
              </div>
              <div class="col-md-3">
                <?php if($kyc_details->aadhar_image_status == 0): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'aadhar_image')" class="btn btn-success">Approve</a>
                        <a href="javascript:void(0)" onclick="open_approve_modal('2', 'aadhar_image')" class="btn btn-danger">Reject</a>
                    </div>
                <?php elseif($kyc_details->aadhar_image_status == 2): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'aadhar_image')" class="btn btn-success">Approve</a>
                    </div>
                <?php else: ?>
                    <span class="badge badge-success">Approved</span>
                <?php endif;?>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >PAN Card Number </label><br/>
                     <h2><?php echo $kyc_details->user_pan_card_number; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >PAN Card Image </label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_pan_card_image; ?>" height="150px">
                 </div>
              </div>
              <div class="col-md-3">
              </div>
              <div class="col-md-3">
                 <?php if($kyc_details->pan_card_image_status == 0): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'pan_image')" class="btn btn-success">Approve</a>
                        <a href="javascript:void(0)" onclick="open_approve_modal('2', 'pan_image')" class="btn btn-danger">Reject</a>
                    </div>
                <?php elseif($kyc_details->pan_card_image_status == 2): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'pan_image')" class="btn btn-success">Approve</a>
                    </div>
                <?php else: ?>
                    <span class="badge badge-success">Approved</span>
                <?php endif;?>
              </div>

              <div class="col-md-3">
                 <div class="form-group">
                     <label >Photograph </label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_photo; ?>" height="150px">
                 </div>
              </div>
              <div class="col-md-6"></div>

              <div class="col-md-3">
                 <?php if($kyc_details->user_photo_status == 0): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'user_photo')" class="btn btn-success">Approve</a>
                        <a href="javascript:void(0)" onclick="open_approve_modal('2', 'user_photo')" class="btn btn-danger">Reject</a>
                    </div>
                <?php elseif($kyc_details->user_photo_status == 2): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'user_photo')" class="btn btn-success">Approve</a>
                    </div>
                <?php else: ?>
                    <span class="badge badge-success">Approved</span>
                <?php endif;?>
              </div>

              <div class="col-md-12 text-center page-header">
                <hr/>
                 <h4>Business KYC Details</h4>
                 <hr/>
              </div>
              <div class="col-md-3 text-center">
                 <div class="form-group">
                     <label >Institute Front View Photo </label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_front_image; ?>" height="150px">
                 </div>
                 <div class="form-group">
                     <?php if($kyc_details->user_inst_front_image_status == 0): ?>
                        <div class="form-group" >
                            <a href="javascript:void(0)" onclick="open_approve_modal('1', 'inst_photo')" class="btn btn-success">Approve</a>
                            <a href="javascript:void(0)" onclick="open_approve_modal('2', 'inst_photo')" class="btn btn-danger">Reject</a>
                        </div>
                    <?php elseif($kyc_details->user_inst_front_image_status == 2): ?>
                        <div class="form-group" >
                            <a href="javascript:void(0)" onclick="open_approve_modal('1', 'inst_photo')" class="btn btn-success">Approve</a>
                        </div>
                    <?php else: ?>
                        <span class="badge badge-success">Approved</span>
                    <?php endif;?>
                 </div>
              </div>
              <div class="col-md-3 text-center">
                 <div class="form-group">
                     <label >Registration Doc</label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_registration_doc; ?>" height="150px">
                 </div>
                 <?php if($kyc_details->user_inst_registration_doc_status == 0): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'reg_doc_img')" class="btn btn-success">Approve</a>
                        <a href="javascript:void(0)" onclick="open_approve_modal('2', 'reg_doc_img')" class="btn btn-danger">Reject</a>
                    </div>
                <?php elseif($kyc_details->user_inst_registration_doc_status == 2): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'reg_doc_img')" class="btn btn-success">Approve</a>
                    </div>
                <?php else: ?>
                    <span class="badge badge-success">Approved</span>
                <?php endif;?>
              </div>
              <div class="col-md-3 text-center">
                 <div class="form-group">
                     <label >Business PAN</label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_business_pan_card; ?>" height="150px">
                 </div>
                 <?php if($kyc_details->user_inst_business_pan_card_status == 0): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'business_pan')" class="btn btn-success">Approve</a>
                        <a href="javascript:void(0)" onclick="open_approve_modal('2', 'business_pan')" class="btn btn-danger">Reject</a>
                    </div>
                <?php elseif($kyc_details->user_inst_business_pan_card_status == 2): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'business_pan')" class="btn btn-success">Approve</a>
                    </div>
                <?php else: ?>
                    <span class="badge badge-success">Approved</span>
                <?php endif;?>
              </div>
              <div class="col-md-3 text-center">
                 <div class="form-group">
                     <label >GST Certificate</label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_gst_certificate; ?>" height="150px">
                 </div>
                 <?php if($kyc_details->user_inst_gst_certificate_status == 0): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'gst_certificate')" class="btn btn-success">Approve</a>
                        <a href="javascript:void(0)" onclick="open_approve_modal('2', 'gst_certificate')" class="btn btn-danger">Reject</a>
                    </div>
                <?php elseif($kyc_details->user_inst_gst_certificate_status == 2): ?>
                    <div class="form-group" >
                        <a href="javascript:void(0)" onclick="open_approve_modal('1', 'gst_certificate')" class="btn btn-success">Approve</a>
                    </div>
                <?php else: ?>
                    <span class="badge badge-success">Approved</span>
                <?php endif;?>
              </div>
              <div class="col-md-12 text-center page-header">
                <hr/>
                 <h4>Banking Details</h4>
                 <hr/>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Account Type</label><br/>
                     <h2><?php echo $kyc_details->user_inst_bank_acc_type; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Bank Name</label><br/>
                     <h2><?php echo $kyc_details->user_inst_bank_name; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Account No.</label><br/>
                     <h2><?php echo $kyc_details->user_inst_bank_acc_no; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >IFSC Code</label><br/>
                     <h2><?php echo $kyc_details->user_inst_carpet_area; ?></h2>
                 </div>
              </div>
              <div class="col-md-12 text-center page-header">
                <hr/>
                 <h4>Infrastructure Details</h4>
                 <hr/>
              </div>
              
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Reception Area Photo </label>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_reception_area_photo; ?>" height="150px">
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Owner/Manager Cabin photo </label>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_owner_cabin_photo; ?>" height="150px">
                 </div>
              </div>

              <div class="col-md-3">
                 <div class="form-group">
                     <label >Lecture hall photo</label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_hall_photo; ?>" height="150px">
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group"> 
                     <label >Practical Lab Photo</label><br/>
                     <img src="<?php echo base_url(); ?><?php echo $kyc_details->user_inst_lab_photo; ?>" height="150px">
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Office Carpet Area</label><br/>
                     <h2><?php echo $kyc_details->user_inst_carpet_area; ?></h2>
                 </div>
              </div>

              <div class="col-md-3">
                 <div class="form-group">
                     <label >Number of Desktop</label><br/>
                     <h2><?php echo $kyc_details->user_inst_no_desktop; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Number of Laptop</label><br/>
                     <h2><?php echo $kyc_details->user_inst_no_of_laptop; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Printer</label><br/>
                     <h2><?php echo $kyc_details->user_inst_printer_avl; ?></h2>
                 </div>
              </div>
              <div class="col-md-3">
                 <div class="form-group">
                     <label >Broadband Internet</label><br/>
                     <h2><?php echo $kyc_details->user_inst_brodband; ?></h2>
                 </div>
              </div>
              <div class="col-md-2">
                 <div class="form-group">
                     <label >Projector</label><br/>
                     <h2><?php echo $kyc_details->user_inst_projector; ?></h2>
                 </div>
              </div>
              <div class="col-md-2">
                 <div class="form-group">
                     <label >Smart Board</label><br/>
                     <h2><?php echo $kyc_details->user_inst_smart_board; ?></h2>
                 </div>
              </div>
              <div class="col-md-2">
                 <div class="form-group">
                     <label >LCD Screen</label><br/>
                     <h2><?php echo $kyc_details->user_inst_lcd_screen; ?></h2>
                 </div>
              </div>
              <div class="col-md-2">
                 <div class="form-group">
                     <label >Wash Room</label><br/>
                     <h2><?php echo $kyc_details->user_inst_wash_room; ?></h2>
                 </div>
              </div>
              <div class="col-md-2">
                 <div class="form-group">
                     <label >Teaching staff</label><br/>
                     <h2><?php echo $kyc_details->user_inst_teaching_staff; ?></h2>
                 </div>
              </div>
              <div class="col-md-2">
                 <div class="form-group">
                     <label >Non-teaching staff</label><br/>
                     <h2><?php echo $kyc_details->user_inst_non_teaching_staff; ?></h2>
                 </div>
              </div>

             <!--  <div class="col-md-12">
                <div class="form-group">
                    <?php if($kyc_details->user_kyc_status == 0 && $kyc_details): ?>
                        <a onclick="return confirm('Are you sure? You Want Approve KYC')" href="<?php echo base_url(); ?>admin/atp/approve_kyc/<?php echo $kyc_details->kyc_details_id; ?>" style="float: left" class="btn btn-success">Approved</a>
                        <a onclick="open_rect_modal()" style="float: right" class="btn btn-danger">Reject</a>
                    <?php elseif($kyc_details->user_kyc_status == 1 && $kyc_details):?>
                        <a onclick="open_rect_modal()" style="float: right" class="btn btn-danger">Reject</a>
                    <?php elseif($kyc_details->user_kyc_status == 2 && $kyc_details): ?>
                        <a onclick="return confirm('Are you sure? You Want Approve KYC')" href="<?php echo base_url(); ?>admin/atp/approve_kyc/<?php echo $kyc_details->kyc_details_id; ?>" style="float: left" class="btn btn-success">Approved</a>
                    <?php elseif(!$kyc_details): ?>
                    <?php endif;?>
                </div>
              </div> -->

               <?php echo form_close() ?>
               

              <!-- /.col -->
            </div>
            <!-- /.row -->
          </div>
          <!-- /.card-body -->
        </div>
            <!-- /.row -->
      </div><!--/. container-fluid -->
    </section>
    <!-- /.content -->
  </div>
<script type="text/javascript">
function open_approve_modal(status, doc_id) 
{
    $('#exampleModal').modal('show');
    $('#status').val(status);
    $('#filed_name').val(doc_id)
}
</script>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Comment</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <?php echo form_open(base_url().'admin/atp/update_kyc/'.$kyc_details->kyc_details_id);?>
          <div class="modal-body">
              <div class="form-group">
                <label for="message-text" class="col-form-label">Message</label>
                <textarea class="form-control" id="message-text" name="user_kyc_comment"></textarea>
              </div>
          </div>
          <input type="hidden" name="kyc_status" id="status">
          <input type="hidden" name="filed_name" id="filed_name">
          <div class="modal-footer">
            <button type="submit" class="btn btn-primary">Update</button>
          </div>
        <?php echo form_close();?>
    </div>
  </div>
</div>