<?php
/* @var $this PaperController */
/* @var $model Paper */

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

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

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id' => 'paper-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_paper',
		// 'created_date',
		// 'created_id',
		// 'update_date',
		// 'update_id',
		array('name' => 'researchers_id', 'value' => '$data->Researchers->fullname', 'filter' => CHtml::listData(Users::model()->findAllByAttributes(array('level' => 3)), 'id_user', 'fullname'),),
		array('header' => 'Jenjang Peneliti', 'value' => '$data->Researchers->description'),
		array('header' => 'Unit Kerja', 'value' => 'Department::model()->getName($data->Researchers->division)'),
		// 'researchers_id',
		'paper_name',
		// 'paper_image',
		// 'paper_file',
		// 'status',

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



<!-- 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> Makalah</h4>
			</div>
			<!-- Popup Content -->
			<div class="modal-body">
				<p>Data</p>
			</div>
		</div>
	</div>
</div>