<?php
/* @var $this UserController */
/* @var $model User */


$this->breadcrumbs = array(
    yii::t('default', 'Configurations') => array('/dashboardLayout/configuration'),
    yii::t('default', 'System Configurations') => array('/dashboardLayout/systemConfiguration'),
    yii::t('default', 'Users') => array('index'),
    $model->username,
);

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


<?php

$model = SummaryDashboardPerSegment::model();

	    $segment_names = Segment::getNamesForDropDown();
	    $transaction = Yii::app()->db->beginTransaction();
	    if (!SummaryDashboardPerSegment::BuildDashboardRowModel('Total', null, $error_msg, true)) {
		$transaction->rollback();
		Yii::log(PHP_EOL . "Error : " . $error_msg, 'error', 'system.Scheduler.BuildDashboardByDate');
		return;
	    }
	    if ($segment_names != null) {
		foreach ($segment_names as $id => $segment_name) {
		    if (!SummaryDashboardPerSegment::BuildDashboardRowModel($segment_name, $id, $error_msg, true)) {
			$transaction->rollback();
			Yii::log(PHP_EOL . "Error : " . $error_msg, 'error', 'system.Scheduler.BuildDashboardByDate');
			return;
		    }
		}
	    }
	    if (!SummaryDashboardPerSegment::BuildDashboardRowModel('Multi Segment', null, $error_msg, true)) {
		$transaction->rollback();
		Yii::log(PHP_EOL . "Error : " . $error_msg, 'error', 'system.Scheduler.BuildDashboardByDate');
		return;
	    }
	    if (!SummaryDashboardPerSegment::BuildDashboardRowModel('Non Segment', null, $error_msg, true)) {
		$transaction->rollback();
		Yii::log(PHP_EOL . "Error : " . $error_msg, 'error', 'system.Scheduler.BuildDashboardByDate');
		return;
	    }

	    $transaction->commit();
$this->widget('bootstrap.widgets.TbDetailView', array(
    'type' => 'striped',
    'cssFile' => Yii::app()->request->baseUrl . '/css/general/CDetailView/' . Yii::app()->language . '/styles.css',
    'data' => $model,
    'attributes' => array(
	'type',
	'username',
	'email',
	'role',
	
	array(
	    'name' => 'status',
	    'value' => Yii::t('default', $model->status),
	),
    ),
)); ?>

<br />
<?php echo CHtml::link(Yii::t('default', 'Back'), array('index'), array('class' => 'btn primary')); ?>
&nbsp;
<?php echo CHtml::link(Yii::t('default', 'Edit'), array('update','id'=>$model->id), array('class' => 'btn primary')); ?>
