<?php
/* @var $this TiTypeController */
/* @var $model TiType */

$this->breadcrumbs = array(
    yii::t('default', 'Configurations') => array('/dashboardLayout/configuration'),
    yii::t('default', 'TID Configurations') => array('/dashboardLayout/TIDsConfiguration'),
    yii::t('default', 'TI Types') => array('index'),
);
?>
<?php echo CHtml::link(Yii::t('default', 'Add'), array('create'), array('class' => 'btn btn-primary', 'data-dismiss' => 'modal')); ?>
&nbsp;

<?php echo CHtml::link(Yii::t('default', 'Export'), array('exportToExcel'), array('class' => 'btn btn-success')); ?>
<div id="flash-msg">
    <br>
    <?php $this->widget('bootstrap.widgets.TbAlert'); ?>
</div>


<?php
    $this->widget('yiiwheels.widgets.grid.WhGridView', array(
	'id' => 'ti-type-grid',
	'dataProvider' => $model->search(),
	'filter' => $model,
	'columns' => array(
	    'name',
	    array(
		'name' => 'validity_mode',
		'filter' => TiType::getValidityModeOptions(),
	    ),
	    'validity_days',
	    array(
		'name' => 'status',
		'type' => 'html',
		'value' => 'CHtml::link(CHtml::image(Yii::app()->request->baseUrl."/css/flags/".$data->status.".png", "img")  ,"#",array("rel"=>"tooltip","title"=>Yii::t(\'default\',$data->status)))',
		'filter' => array('Active' => Yii::t('default', 'Active'), 'Inactive' => Yii::t('default', 'Inactive')),
		'htmlOptions' => array('style' => 'text-align:center;'),
	    ),
	    array
		(
		'class' => 'CButtonColumn',
		'template' => '{update} {delete}',
		'htmlOptions' => array('width' => '60'),
		'afterDelete' => 'function(link,success,data){ if(success) $("#flash-msg").html(data); }',
		'buttons' => array(
		),
	    ),
	),
    ));
?>
