<?php
$this->pageTitle='Laporan Hasil Penilaian';
?>


<link rel='stylesheet' href='https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css'>
<link rel='stylesheet' href='https://cdn.datatables.net/buttons/1.2.2/css/buttons.dataTables.min.css'>

<script src='https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js'></script>
<script src='https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js'></script>
<script src='https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js'></script>

<table id="example" class="display nowrap" cellspacing="0" width="100%">
  <thead>
    <tr>
      <!-- <TD>NO.</TD> -->
      <TD>Nama Lengkap</TD>
      <TD>Total Nilai</TD>
      <TD>Rata-Rata</TD>
      <TD>Total Penilaian</TD>
      <TD>Nama Penilai</TD>
    </tr>
  </thead>
  <tbody>
    <?php
    $x=0;
    foreach (Review::model()->getReview($type) as $data) {
      $x++;
      ?>
      <tr>
        <!-- <TD><?php echo $x; ?></TD> -->
        <TD><?php echo $data['fullname'] ?></TD>
        <?php if(Review::model()->getTotalList($data['id_paper'],3)==7){ ?>
          <TD><?php echo Review::model()->getTotalList($data['id_paper'],1); ?></TD>
          <TD><?php echo Review::model()->getTotalList($data['id_paper'],2); ?></TD>
        <?php }else{ ?>
          <TD>Belum Semua Menilai</TD>
          <TD>Belum Semua Menilai</TD>
        <?php } ?>
        <TD><?php echo Review::model()->getTotalList($data['id_paper'],3); ?></TD>
        <TD><?php echo Review::model()->getEvaluator($data['id_paper']); ?></TD>
      </tr>
    <?php } ?>

  </tbody>
</table>
</div>

<script type="text/javascript">
  $(document).ready( function() {
    $('#example').DataTable( {
      "pageLength": 100,
      "order": [[ 2, "desc" ]],
      dom: 'Bfrtip',
      buttons: [ {
        extend: 'excelHtml5',
        customize: function( xlsx ) {
          var sheet = xlsx.xl.worksheets['sheet1.xml'];
          $('row c[r^="C"]', sheet).attr( 's', '2' );
        }
      } ]
    } );
  } );
</script>


