<?php
$user_id = Yii::app()->user->getState('__userid');
$userStatus = Yii::app()->user->getState('__statusAdmin');
//if ($userStatus == 'Admin') {
//    $this->menu = array(
//        array('label' => 'Create Company', 'url' => array('/company/create/')),
//        array('label' => 'Manage Companies', 'url' => array('/company/admin/')),
//    );
//} else {
//
//    $this->menu = array(
//        array('label' => 'Create Company', 'url' => array('/company/createusercompany/', 'id' => $user_id)),
//        array('label' => 'Manage Companies', 'url' => array('/company/useradmin/', 'id' => $user_id)),
//    );
//}
?>
<div class="clear"></div>
<div id="user-grid" class="grid-view">
<?php
//unable to include detail view css so include this but not good ap
$this->widget('zii.widgets.CDetailView', array(
    'data' => $modelCompany,
    'attributes' => array(
//        'id',
//        'username',
//        'password',
//        'phone',
//        'email',
//        'created_at',
//        'lastvisit_at',
//        'superuser',
//        'status',
    ),
));


$count = 1;
if (!empty($modelCompany)) {
    foreach ($modelCompany as $value) {
        print '<div class="row">';
        print '<div class="span6">';
        print '<table id="yw0" class="detail-view">';
        print '<tbody>';
        print '<h4>Company # ' . $count . '</h4>';
        //print compnay name
        print '<tr class="even">';
        print '<td class="setfone span2">Name</td>';
        print '<td class="setfone span3">' . $value->name . '</td>';
        print '</tr>';
        //print compnay adres
        print '<tr class="odd">';
        print '<td class="setfone span2">Address</td>';
        print '<td class="setfone span3">' . $value->adress . '</td>';
        print '</tr>';
        //print company phoen
        print '<tr class="even">';
        print '<td class="setfone span2">Phone</td>';
        print '<td class="setfone span3">' . $value->phone . '</td>';
        print '</tr>';
        //print company city
        print '<tr class="odd">';
        print '<td class="setfone span2">City</td>';
        print '<td class="setfone span3">' . $value->city . '</td>';
        print '</tr>';
        //print company state
        print '<tr class="even">';
        print '<td class="setfone span2">State</td>';
        print '<td class="setfone span3">' . $value->state . '</td>';
        print '</tr>';
        //print company zip
        print '<tr class="odd">';
        print '<td class="setfone span2">Zip</td>';
        print '<td class="setfone span3">' . $value->zip . '</td>';
        print '</tr>';
        //print company zip
        print '<tr class="even">';
        print '<td class="setfone span2">Contacts</td>';
        print '<td class="setfone span3">' . $value->contacts . '</td>';
        print '</tr>';
        print '<tr class="odd">';
        print '<td class="setfone span2">Notes</td>';
        print '<td class="setfone span3">' . $value->notes . '</td>';
        print '</tr>';
        print '</tbody>';
        print '</table>';
        print '</div>'; //end span8
        print '</div>'; //end rwo
        print '<br>';
        $count++;
    }
} else {
    print '<div class="erros alert-error" style="color: red;"><h5>Record Not Found</h5></div>';
}
?>
    <?php echo CHtml::submitButton('Back', array('submit' => array('/company/useradmin/' . Yii::app()->user->getState('__userid')), 'class' => 'btn btn-secondary')); ?>
</div>
<script type="text/javascript">
    function ref() {

        var var1 = document.getElementById('mapsearch').value;
        location.href = location.href + '?var1=' + var1;
//        location.href = location.href + '?var1=' + var1 + '&var2=' + var2;
    }
</script>
<style>
    .setfone{
        font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
        font-size: 1.1em;
        color: #222222;
    }


</style>