<?php $this->load->view('admin/common/header'); ?>
<div class="dashborder-content">

<div class="container-fluid">
<div class="row">
<?php $this->load->view('admin/common/sidebar'); ?>

<div class="col-md-10">
<div class="row">


<div class="row">

<div class="col-md-12 full-table">
<div class="panel panel-bd lobidrag lobipanel lobipanel-sortable " data-inner-id="6lbDiPQUBj" data-index="0">
<div class="panel-heading ui-sortable-handle">
<div class="panel-title" style="max-width: calc(100% - 180px);">

<div class="row">

<div class="col-md-6" style="padding-top: 4px;"><h4> Shortlisted For Interview</h4></div>
<div class="col-md-6" style="text-align:right;">
<form class="form-inline" >


<div class="input-group" style="width:100% !important;">

<input type="text" name="search" class="form-control" placeholder="Search Here" style="font-size:12px;">
<div class="input-group-addon btn"><i class="fa fa-search"></i>
</div>
</div>


</form>

</div>

</div>
</div>
</div>
<div class="panel-body">
<?php if($this->session->flashdata('msg')){ ?>
  <div class="alert alert-success alert-dismissible">
  <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
  <?= $this->session->flashdata('msg');?>
</div>
<?php }?>
<div class="table-responsive">

<table class="table table-bordered table-hover">
<thead>
<tr>
<th>S.no.</th>
<th>JobId</th>
<th>Submission Date</th>
<th>Position</th>
<th>Job Location</th>
<th>Candidate name</th>
<th>Contact no.</th>
<th>Email id</th>
<th>Experience</th>
<th>Current CTC</th>
<th>Expected CTC</th>
<th>Notice Period</th>
<th>Current company</th>
<th>Status</th>
<th>Remark</th>
</tr>
</thead>
<tbody>

 <?php $i=1; foreach($candidate as $c){?>       
<tr>
<td><?= $i; ?></td>
<td><a href="#" data-toggle="modal" onclick="set_job_candidate('<?= $c["candidate_id"]?>','<?= $c["job_id"]?>')" data-target="#myModal"><?= $c['job_id']?></a></td>
<td><?= $c['date']?></td>
<td><?= $c['position']?></td>
<td><?= $c['job_location']?></td>

<td><?= $c['name']?></td>
<td><?= $c['phone']?></td>
<td><?= $c['email']?></td>
<td><?= $c['experiance']?></td>
<td><?= $c['ctc']?></td>
<td><?= $c['expected_ctc']?></td>
<td><?= $c['notice_period']?></td>
<td><?= $c['current_company']?></td>
<td><?= $c['status']?></td>
<td></td>
</tr>
<?php $i++;}?>
</tbody>
</table>
<?= $links; ?>
</div>
</div>
</div>
</div>



</div>


</div>




</div>


</div>
</div>

<!-- quick enquiry model popup -->
<div class="modal fade" id="myModal" 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">Interview Details</h4>
        </div>
        <div class="modal-body">
       <form action="<?= base_url('company/schedule_interview')?>" method="post">
        <input type="hidden" name="candidate_id" id="candidate_id">
        <input type="hidden" name="job_id" id="job_id">
        <div class="row">
            <div class="col-xs-6">
                <h4>Interview Date :</h4>
             </div>
            <div class="col-xs-6 text-left">
                <p>
                  <input type="text" name="interview_date" class=" form-control" id="dtpicker" placeholder="Interview Date" required>
                </p>
            </div>
         </div>
           <div class="row">
                <div class="col-xs-6">
                        <h4>Interview Time :</h4>
                        </div>
                    <div class="col-xs-6 text-left">
                        <p>
                          <input type="text" class="form-control" name="interview_time" id="tmpicker" placeholder="Interview Time" required>
                        </p>
                    </div>
           </div>
           <div class="row">
                <div class="col-xs-6">
                        <h4>Mode Of Interview :</h4>
                        </div>
                    <div class="col-xs-6 text-left">
                        <p>
                          <input type="text" class="form-control" placeholder="Mode Of Interview" name="interview_mode" required>
                        </p>
                    </div>
            
            </div>
            <div class="row">
                <div class="col-sm-12 text-center">
                    <button type="submit" class="btn btn-primary">Submit</button>
                </div>
            </div>
       </form>
        </div>
        
        </div>
        
      
        </div>
        </div>
    <!-- model cosed         -->
<?php $this->load->view('admin/common/footer'); ?>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script type="text/javascript" src="<?= base_url('public/')?>js/jquery.timepicker.js"></script>
  <link rel="stylesheet" type="text/css" href="<?= base_url('public/')?>css/jquery.timepicker.css" />
  <script>
  $( function() {
    $( "#dtpicker" ).datepicker({
      dateFormat: "yy-mm-dd"
    });
  } );
  </script>
<script type="text/javascript">


  $('#job_id').bind("input",function() { 
    var xx=$(this).val();
    $.ajax({
      url: "<?= base_url('company/get_job')?>",
      data: { job_id : xx },
      type: 'post',
      dataType: "json",
      success: function(data) {
        $('#submission_date').val(data.date);
        $('#position').val(data.position);
        $('#location').val(data.location);
         $('#submission_date').attr('readonly', true);
        $('#position').attr('readonly', true);
        $('#location').attr('readonly', true);
      }
    });
  });

  function set_job_candidate(cand='',job='')
  {
    $('#candidate_id').val(cand);
    $('#job_id').val(job);
  }


</script>

<script>
$(function() {
  $('#tmpicker').timepicker();
});
</script>