<?php
/* @var $this CompanyController */
/* @var $dataProvider CActiveDataProvider */
//$this->breadcrumbs=array(
//	'Companies',
//);
//$user_id  =  $this->setState('__userid', $user->id);
$user_id = Yii::app()->user->getState('__userid');
$userStatus = Yii::app()->user->getState('__statusAdmin');
$myusername = Yii::app()->user->getState('__name');
if ($userStatus == 'Admin') {
//    $this->menu = array(
//        array('label' => 'Create Company', 'url' => array('create')),
//        array('label' => 'Manage Company', 'url' => array('admin')),
//    );
} else {
//    $this->menu = array(
//        array('label' => 'Create Company', 'url' => array('create')),
//        array('label' => 'Manage Company', 'url' => array('/company/useradmin/', 'id' => $user_id)),
//    );
}
?>
<h4><?php echo $myusername; ?>Companies</h4>
<?php
$this->widget('zii.widgets.CListView', array(
    'dataProvider' => $dataProvider,
    'itemView' => '_view',
));
?>
<?php
$userStatus = Yii::app()->user->getState('__statusAdmin');
if ($userStatus == 'Admin') {
    echo '<br>';
    echo CHtml::submitButton('Back', array('submit' => array('/company/admin/'), 'class' => 'btn btn-secondary'));
}
?>
