<?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="col-md-12">
<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> Interview Schedule
</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" class="form-control" name="search" 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">

<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th width="33">S.no.</th>
<th width="33">Job. Id</th>
<th width="58">Position</th>
<th width="109">Location</th>
<th width="98">Candidate Name</th>
<th width="97">Contact no.</th>
<th width="134">Email id</th>
<th width="75">Interview Date</th>
<th width="78">Mode of interview</th>
<th width="88">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['position']?></td>
<td><?= $c['job_location']?></td>
<td><?= $c['name']?></td>
<td><?= $c['phone']?></td>
<td><?= $c['email']?></td>
<td><?= $c['interview_date'].' '.$c['interview_time'] ?></td>
<td><?= $c['interview_mode']?></td>
<td>
            <select name="remark" class="form-control" onchange="set_remark('<?= $c["job_id"]?>','<?= $c["candidate_id"]?>',this.value)">
                <option value="">Remark</option>
                <option value="Reject">Reject</option>
                <option value="Sortlisted">Sortlisted</option>
                <option value="Not Attended">Not Attended</option>
                <option value="Hold">Hold</option>
                <option value="Final Select">Final Select</option>
              </select>
        </td>
</tr>
<?php $i++; }?>

</tbody>
</table>
</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">Joining Info</h4>
        </div>
        <div class="modal-body">
       <form action="<?= base_url('company/joining_info')?>" 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>CTC Offered :</h4>
                        </div>
                    <div class="col-xs-6 text-left">
                        <p>
                          <input type="text" class="form-control" placeholder="CTC Offered" name="ctc_offered" required>
                        </p>
                    </div>
            
            </div>
        <div class="row">
            <div class="col-xs-6">
                <h4>Date OF joining :</h4>
             </div>
            <div class="col-xs-6 text-left">
                <p>
                  <input type="text" name="doj" class=" form-control" id="dtpicker" placeholder="Interview Date" 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">
    function set_remark(jobid,candidate,remark)
    {
            $.ajax({
            type: "POST",
            url: "<?= base_url('company/update_remark')?>",
            data: { job_id: jobid , candidate_id: candidate , remark: remark, status : remark },
            dataType: "json",
                success: function(result)
                {
                     alert(result);
                     location.reload();
                }
            });
    }
</script>
 <script>
  $( function() {
    $( "#dtpicker" ).datepicker({
      dateFormat: "yy-mm-dd"
    });
  } );
  </script>
<script>
      function set_job_candidate(cand='',job='')
  {
    $('#candidate_id').val(cand);
    $('#job_id').val(job);
  }


</script>