<?php
/* @var $this ScheduleController */
/* @var $model Schedule */


$this->breadcrumbs = array(
    yii::t('default', 'POS') => array('/dashboard/poss'),
    yii::t('default', 'Schedules') => array('index'),
);




echo CHtml::link(Yii::t('default', 'Add'), array('create'), array('class' => 'btn btn-primary', 'data-dismiss' => 'modal'));
?>

<div id="flash-msg">
    <br>
<?php $this->widget('bootstrap.widgets.TbAlert'); ?>
</div>

<?php
$this->widget('ext.bootstrap.widgets.TbGridView', array(
    'id' => 'schedule-grid',
    'type' => 'striped',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'name',
        array(
            'name' => 'start_time',
            'value' => '$data->start_time',
        ),
        array(
            'name' => 'end_time',
            'value' => '$data->end_time',
        ),
        array(
            'name' => 'days',
            'value' => '$data->getDays()',
            'filter' => '',
        ),
        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;', 'width' => '100'),
        ),
        array(
            'class' => 'CButtonColumn',
            'htmlOptions' => array('width' => '60'),
            'afterDelete' => 'function(link,success,data){ if(success) $("#flash-msg").html(data); }',
        ),
    ),
));
?>
