<?php

/** @var SectionController $this */
$this->breadcrumbs = array (
    'Sections' => array (
        'index' 
    ),
    'Manage' 
);

$this->printMenuSimple ( "Operations", array (
    t ( 'Create Section' ) => "section/create",
    t ( 'Matrix' ) => "section/matrix" 
) );

?>

<h1><?php echo(t('Manage Sections')); ?></h1>

<?php

$this->widget ( 'bootstrap.widgets.TbGridView', array (
    'id' => 'section-grid',
    'template' => '{items}{summary}{pager}',
    'dataProvider' => $model->search (),
    'columns' => array (
        array (
            'name' => 'id_gate_start',
            'type' => 'raw',
            'value' => 'SystemInfoHelper::getGateCoolName($data->id_gate_start,true,true,true,true)' 
        ),
        array (
            'name' => 'id_gate_end',
            'type' => 'raw',
            'value' => 'SystemInfoHelper::getGateCoolName($data->id_gate_end,true,true,true,true)' 
        ),
        array (
            'name' => 'enabled',
            'type' => 'raw',
            'value' => 'SystemInfoHelper::getFullSwitchButtonLabel("section", "switchEnabled", $data->id, $data->enabled, "Yes","No","green","red",app()->controller->getAbsoluteUrl(),"icon-off")' 
        ),
        'filter_gate_start',
        'filter_gate_end',
        array (
            'name' => 'road_length',
            'type' => 'raw',
            'value' => '$data->road_length." ".($data->road_speed_limit_unit=="km/h" ? "km" : "mi")' 
        ),
        array (
            'name' => 'road_speed_limit',
            'type' => 'raw',
            'value' => '$data->road_speed_limit." ".$data->road_speed_limit_unit' 
        ),
        array (
            'name' => 'road_speed_threshold',
            'type' => 'raw',
            'value' => '$data->road_speed_threshold." ".$data->road_speed_limit_unit' 
        ),
        array (
            'header' => t ( 'Tolerance' ),
            'type' => 'raw',
            'value' => '$data->Tolerance." %"' 
        ),
        array (
            'header' => t ( 'Limits for class' ),
            'type' => 'raw',
            'value' => '$data->limitsCount' 
        ),	    
		/*
    'discard_delta',
		'final_discard_delta',
		'last_event_time',
		'last_event_id',
		'epoch',
		*/
		array (
            'class' => 'bootstrap.widgets.TbButtonColumn' 
        ) 
    ) 
) );
?>
