<?php
/* @var $this ReviewController */
/* @var $model Review */

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

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


<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id' => 'review-grid',
	'dataProvider' => $model->search(),
	// 'filter'=>$model,
	'itemsCssClass' => 'table-responsive table table-striped table-hover table-vcenter',
	'columns' => array(

		array(
			'header' => 'No',
			'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1',
			'htmlOptions' => array(
				'width' => '10px',
				'style' => 'text-align: center;'
			)
		),

		// 'id_rating',
		// 'created_date',
		// 'created_id',
		// 'update_date',
		// 'update_id',
		// 'created_id',
		// 'update_date',
		// 'update_id',

		array('header' => 'Nama Lengkap', 'value' => 'Users::model()->showFullname($data->Paper->researchers_id)'),
		array('header' => 'Jenis Peserta', 'value' => 'Users::model()->showType($data->Paper->researchers_id)'),
		// array('header'=>'Judul Makalah','value'=>'$data->Paper->paper_name'),
		array('header' => 'Nama Penilai', 'value' => '$data->Evaluator == NULL ? "" : $data->Evaluator->fullname'),
		'created_date',
		array('header' => 'Nilai', 'value' => 'Review::model()->getTotal($data->id_rating,1)'),

		// array('header'=>'Jenjang Penilai','value'=>'$data->Evaluator->description'),
		// 'value_title',
		// 'value_keyword',
		// 'value_background',
		// 'value_goal_benefit',
		// 'value_literature_theory',
		// 'value_methodology',
		// 'value_result',
		// 'value_conclusion',
		// 'value_bibliography',
		// 'value_systematics',
		// 'value_language',
		// 'value_master_material_and_response',
		// 'status',

		array(
			'class' => 'CButtonColumn',
			'template' => '{view}{update}',
			'buttons' => array(
				'view' =>
				array(
					'url' => 'Yii::app()->createUrl("main/review/view", array("id"=>$data->id_rating))',
					'options' => array(
						'ajax' => array(
							'type' => 'POST',
							'url' => "js:$(this).attr('href')",
							'success' => 'function(data) { $("#viewModal .modal-body p").html(data); $("#viewModal").modal(); }'
						),
					),
				),
				'update' =>
				array(
					'url' => 'Yii::app()->createUrl("main/review/update", array("id"=>$data->id_rating))',
				),
			),
		),
	),
)); ?>



<!-- Modal -->
<div class="modal fade" id="viewModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<!-- Popup Header -->
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title"><strong>Detail</strong> Penilaian</h4>
			</div>
			<!-- Popup Content -->
			<div class="modal-body">
				<p>Data</p>
			</div>
		</div>
	</div>
</div>