<?php
/* @var $this SubController */
/* @var $model Sub */

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

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

<span class="visible-xs">

	<?php echo CHtml::link('<i class="mdi mdi-plus"></i>',
		array('create'),
		array('class' => 'btn pull-right btn-primary btn-md'));
		?>

	</span> 


	<span class="hidden-xs">

		<?php echo CHtml::link('Tambah Sub',
			array('create'),
			array('class' => 'btn btn-primary pull-right btn-flat'));
			?>

		</span>	

		<HR>

			<?php $this->widget('zii.widgets.grid.CGridView', array(
				'id'=>'sub-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_sub',
					// 'cluster_id',
					'name',
					// 'status',
					array(
						'class'=>'CButtonColumn',
						'template'=>'{update}',
						'buttons'=>array(
							'update'=>
							array(
								'url'=>'Yii::app()->createUrl("master/sub/update", array("id"=>$data->id_sub))',
								),
							// 'delete'=>
							// array(
							// 	'url'=>'Yii::app()->createUrl("master/sub/delete", array("id"=>$data->id_sub))',
							// 	),
							),
						),

					array(
						'class'=>'CButtonColumn',
						'template'=>'{view}',
						'buttons'=>array(
							'view'=>
							array(
								'url'=>'Yii::app()->createUrl("master/sub/list", array("id"=>$data->id_sub))',
								),
							),
						),
					),
					)); ?>



					<!-- 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>View</strong> Sub</h4>
								</div>
								<!-- Popup Content -->
								<div class="modal-body">
									<p>Details</p>
								</div>
								<!-- Popup Footer -->
								<div class="modal-footer">
									<BR>
										<button type="button" class="btn btn-default waves-effect" data-dismiss="modal">Close</button>
									</div>
								</div>
							</div>
						</div>


