<?php
/* @var $this ReviewController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'Reviews',
);

$this->pageTitle='Penilaian Peserta';
?>

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.js"></script>

<table id="reportTable" class="display" cellspacing="0" width="100%">
  <thead>
    <tr>
        <th>Nama Lengkap</th>
        <th>Jenis Peserta</th>
        <th>Kategori Peserta</th>
        <th>Tanggal Penilai</th>
        <th>Nama Penilai</th>
        <th>Skor</th>
        <th>Nilai</th>
        <th>Action</th>
    </tr>
</thead>
<tbody>
    <?php foreach ($dataProvider->getData() as $data) { ?>
        <tr>
            <td><?php echo Users::model()->showFullname($data->Paper == NULL ? "-" : $data->Paper->researchers_id); ?></td>
            <td><?php echo Users::model()->showType($data->Paper == NULL ? "-" : $data->Paper->researchers_id); ?></td>
            <td><?php echo Users::model()->showTypeMember($data->Paper == NULL ? "-" : $data->Paper->researchers_id); ?></td>
            <td><?php echo $data->created_date; ?></td>
            <td><?php echo $data->Evaluator==NULL ? "-" : $data->Evaluator->fullname; ?></td>
            <td><?php echo $data->value_skor; ?></td>
            <td><?php echo $data->value_total; ?></td>
            <td>
                <a href='<?php echo YII::app()->baseUrl; ?>/main/review/view/id/<?php echo $data->id_rating; ?>'/><img src='<?php echo YII::app()->baseUrl; ?>/image/setting/view.png'/></a>
                <a href='<?php echo YII::app()->baseUrl; ?>/main/review/update/id/<?php echo $data->id_rating; ?>'/><img src='<?php echo YII::app()->baseUrl; ?>/image/setting/update.png'/></a>
            </td>
        </tr>
    <?php } ?>

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

<script type="text/javascript">
    $(function() {
        var reportTable = $('#reportTable').DataTable({
            "pageLength": 25,
            "order": [[ 2, "desc" ]],
        });
    });
</script>
