<?php
/* @var $this LogController */
/* @var $model Log */

$this->breadcrumbs = array(
     yii::t('default', 'Configurations') => array('/dashboardLayout/configuration'),
    yii::t('default', 'System Configurations') => array('/dashboardLayout/systemConfiguration'),
    yii::t('default', 'Audit Trail') => array('index'),
);
?>

<?php
echo CHtml::link(Yii::t('default', 'Export'), array('/auditTrail/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' => 'log-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'fixedHeader' => false,
    'headerOffset' => 40, // 40px is the height of the main navigation at bootstrap    
    'columns' => array(
	array(
	    'name' => 'user_id',
	    'value' => '($data->user_id != 0) ? $data->user->username : "System"',
	),
	'model',
	'model_id',
	'action',
	'field',
	'old_value',
	'new_value',
        array(
	    'name' => 'stamp',
	    'value' => 'date("Y-m-d", strtotime($data->stamp))',
	),
    ),
));
?>