<?php
/* @var $this BadgeAssignmentRuleController */
/* @var $model BadgeAssignmentRule */

$this->breadcrumbs = array(
    yii::t('default', 'Configurations') => array('/dashboard/configuration'),
    yii::t('default', 'Badge Assignment Rules') => array('index'),
    $model->personType->name . " - " . $model->badgeType->name,
);

$this->widget('bootstrap.widgets.TbAlert');
?>


<?php
$this->widget('ext.bootstrap.widgets.TbDetailView', array(
    'type' => 'striped',
    'cssFile' => Yii::app()->request->baseUrl . '/css/general/CDetailView/' . Yii::app()->language . '/styles.css',
    'data' => $model,
    'attributes' => array(
        array(
            'type' => 'raw',
            'name' => 'person_type_id',
            'value' => CHtml::link($model->personType->name, array('personType/view', 'id' => $model->person_type_id))
        ),
        array(
            'type' => 'raw',
            'name' => 'badge_type_id',
            'value' => CHtml::link($model->badgeType->name, array('badgeType/view', 'id' => $model->badge_type_id))
        ),
        array(
            'type' => 'raw',
            'name' => 'Assign To',
            'value' => ($model->only_manager == 1 && $model->only_food_manager == 1) ? Yii::t('default', 'Manager, Food Manager') : (($model->only_manager == 1) ? Yii::t('default', 'Manager') : (($model->only_food_manager == 1) ? Yii::t('default', 'Food Manager') : Yii::t('default', 'Any Person'))),
        ),
        array(
            'type' => 'raw',
            'name' => 'no_limit_on_badges_number',
            'value' => ($model->no_limit_on_badges_number == 0) ? Yii::t('default', 'Yes') : Yii::t('default', 'No'),
        ),
        'max_badges_allowed',
    ),
));
?>

<br />
<?php echo CHtml::link(Yii::t('default', 'Back'), array('index'), array('class' => 'btn primary')); ?>
