<?php
/* @var $this CategoryController */
/* @var $model Category */

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

$this->pageTitle='Manage Category';
?>

<section class="col-xs-12">

	<?php echo CHtml::link('+ Kategori',
		array('create'),
		array('class' => 'btn btn-success'));
		?>

		<HR>

		<?php $this->widget('zii.widgets.grid.CGridView', array(
			'id'=>'category-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;')),

				'name',
				array(
					'header' => 'Status',
					'htmlOptions' => array('nowrap' => 'nowrap'),
					'class' => 'CButtonColumn',
					'template' => '{aktif}{nonaktif}',
					'buttons' => array(
						'aktif' => array(
							'label' => 'Non Aktif',
							'visible' => '$data->status==0',
							'url' => 'Yii::app()->createUrl("category/enable", array("id" => $data["id_category"],))',
						),
						'nonaktif' => array(
							'visible' => '$data->status==1',
							'label' => 'Aktif',
							'url' => 'Yii::app()->createUrl("category/disable", array("id" => $data["id_category"],))',
						),
					),
				),
				array(
					'header'=>'Action',
					'template'=>'{view}{update}',
					'class'=>'CButtonColumn',
					'htmlOptions'=>array('width'=>'100px',
						'style' => 'text-align: center;'),
				),
			),
		)); ?>

	</section>