<?php
/* @var $this CompanyController */
/* @var $model Company */

//$this->breadcrumbs=array(
//	'Companies'=>array('index'),
//	$model->name,
//);
//$this->menu=array(
//	array('label'=>'List Company', 'url'=>array('index')),
//	array('label'=>'Create Company', 'url'=>array('create')),
//	array('label'=>'Update Company', 'url'=>array('update', 'id'=>$model->id)),
//	array('label'=>'Delete Company', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
//	array('label'=>'Manage Company', 'url'=>array('admin')),
//);
?>

<h3>Details of <?php echo $model->name; ?></h3>

<?php
$this->widget('zii.widgets.CDetailView', array(
    'data' => $model,
    'attributes' => array(
//		'id',
//		'user_id',
        'name',
        'adress',
        'phone',
        'city',
        'state',
        'zip',
        'contacts',
        'notes',
    ),
));
?>
<div class="clear"></div>
<h3>Details of Owner <?php //$model->owner->ownername;     ?></h3>
<?php
echo '<table id="yw0" class="detail-view">';
echo '<tbody>';
echo '<tr class="odd">';
echo '<th>First Name</th>';
echo '<td class=\'span4 left\'>' . $model->owner->firstname . '</td>';
echo '</tr>';
//echo last name
echo '<tr class="even">';
echo '<th>Last Name</th>';
echo '<td class=\'span4 left\'>' . $model->owner->lastname . '</td>';
echo '</tr>';
//echo last name
echo '<tr class="odd">';
echo '<th>Position</th>';
echo '<td class=\'span4 left\'>' . $model->owner->position . '</td>';
echo '</tr>';
//echo date
echo '<tr class="even">';
echo '<th>E-Mail</th>';
echo '<td class=\'span4 left\'>' . $model->owner->email . '</td>';
echo '</tr>';
//echo date
echo '<tr class="odd">';
echo '<th>Date of Birth</th>';
echo '<td class=\'span4 left\'>' . $model->owner->dob . '</td>';
echo '</tr>';
//echo phone
echo '<tr class="even">';
echo '<th>Phone</th>';
echo '<td class=\'span4 left\'>' . $model->owner->phone . '</td>';
echo '</tr>';
echo '<tr class="odd">';
echo '<th>Notes</th>';
echo '<td class=\'span4 left\'>' . $model->owner->notes . '</td>';
echo '</tr>';


echo '</tbody>';
echo '</table>';

echo '<br>';
//

$userStatus = Yii::app()->user->getState('__statusAdmin');
if ($userStatus == 'Admin') {
    echo CHtml::submitButton('Back', array('submit' => array('/company/admin/'), 'class' => 'btn btn-secondary'));
} else {
    echo CHtml::submitButton('Back', array('submit' => array('/company/useradmin/' . Yii::app()->user->getState('__userid')), 'class' => 'btn btn-secondary'));
}
?>