<!-- DataTables -->
<link rel="stylesheet" href="<?= base_url('assets/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css'); ?>">

<div class="row">
<div class="col-xs-12">
    <div class="box box-primary">
        <div class="box-header">
            <h3 class="box-title">Nilai Tes dan Wawancara</h3>
            <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
                <i class="fa fa-minus"></i></button>
                <button type="button" class="btn btn-box-tool" onclick="location.reload()" title="Refresh">
                <i class="fa fa-refresh"></i></button>
            </div>
        </div>
        <div class="box-body">
            <form id="myform" method="post" onsubmit="return false">
                <div class="row" style="margin-bottom: 10px">
                    <div class="col-xs-6 col-md-6">                      
                        <button type="button" class="btn btn-success btn-flat" data-toggle="modal" data-target="#myModalImport">
                            <i class="fas fa-upload"></i><span class="hidden-xs">&nbsp; Import Nilai Tes dan Wawancara</span>
                        </button> 
                    </div>
                    <div class="col-xs-6 col-md-6 text-right">

                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-bordered table-striped" id="mytable" style="width:100%">
                        <thead>
                            <tr>
                                <th width="10px">No</th>
                                <th>No Pendaftaran</th>
                                <th>Nama Peserta</th>
                                <th>Nilai Tes</th>
                                <th>Nilai Wawancara</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php 
                            $no = 1;
                            foreach ($tesdanwawancara as $data):
                                // $id=$data->id_peserta;
                                // $id_peserta=$data->id_peserta;
                            ?>    
                            <tr>
                                <td style="text-align: center"><?php echo $no++;?></td>
                                <td><?php echo $data->no_pendaftaran;?></td>
                                <td><?php echo $data->nama_peserta;?></td>        
                                <td><?php echo $data->nilai_tes;?></td>        
                                <td><?php echo $data->nilai_wawancara;?></td>        
                            </tr>
                            <?php endforeach;?>                                          
                        </tbody>
                    </table>
                </div>
            </form>
        </div>
    </div>
</div>
</div>

<!-- Modal Import-->
<div class="modal fade" id="myModalImport" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header <?= $this->config->item('header')?>">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><i class="fas fa-clipboard-list"></i>&nbsp; Import Nilai Tes dan Wawancara</h4>
      </div>
      <div class="modal-body">
        <div class="row">            
            <form action="upload_nilaitesdanwawancara" method="post" enctype="multipart/form-data">
                <div class="col-xs-12 col-md-12">
                    <div class="form-group">
                        <?php echo anchor(site_url('peserta/formatnilaitesdanwawancara'), '<i class="fa fa-download"></i><span class="hidden-xs">&nbsp;&nbsp;Format Nilai Tes dan Wawancara</span>', 'class="btn btn-info btn-flat"'); ?>
                    </div>
                    <div class="form-group">
                        <label>File Nilai Tes dan Wawancara</label>
                        <input type="file" id="file" name="file" class="form-control">
                        <p class="help-block">format file (xls, xlsx), max 10000 kb.</p>
                    </div>
                    <div class="form-group">    
                        <button type="submit" class="<?= $this->config->item('botton')?>">Import File</button>
                        <!-- <a href="<?php echo site_url('sekolah') ?>" class="btn btn-default btn-flat">Batal</a> -->
                    </div>
                </div>
            </form>
        </div>                    
      </div>
    </div>
  </div>
</div>

<!-- DataTables -->
<script src="<?= base_url('assets/bower_components/jquery/dist/jquery.min.js');?>"></script>  
<script src="<?= base_url('assets/bower_components/datatables.net/js/jquery.dataTables.min.js');?>"></script>
<script src="<?= base_url('assets/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js');?>"></script>  

<script type="text/javascript">
  $(document).ready(function() {
    $('#mytable').DataTable();
  });
</script>