<?php
$this->pagetitle=false;
$funcionarios = Funcionarios::model()->findAll("FUN_PRM_PRIVILEGIO in(2,3,12,15) and FUN_SITUACAO = 'A' and FUN_IDFUNCIONARIO not in (368, 461, 545, 566) order by FUN_NOME");
?>
<div class="clearfix"></div>
<div class="panel-container border-box col-xs-4 col-sm-4 col-md-3 col-lg-4">
    <div class="panel panel-crm">
      <div class="panel-heading"><img src="<?php echo FaHtml::getImgUrl('ico-usuario.png'); ?>"> Equipe</div>
      <div class="panel-body">
      	<ul>
		      <?php foreach($funcionarios as $funcionario) { ?>
        	 <li><a href="<?php echo Yii::app()->createUrl('solicitacoes/alocacao', array('user' => $funcionario->FUN_IDFUNCIONARIO, 'all' => true)); ?>" class="<?php echo ($funcionario->FUN_IDFUNCIONARIO == $user) ? 'selecionado' : 'padrao'; ?>"><?php echo $funcionario->FUN_NOME; ?></a></li>
		      <?php } ?>
      	<ul>
      </div>
    </div>
</div>

<div class="panel-container border-box col-xs-8 col-sm-8 col-md-9 col-lg-8">
    <div class="panel panel-crm">
      <div class="panel-heading">
      	<img src="<?php echo FaHtml::getImgUrl('ico-usuario.png'); ?>"> <?php echo ($model->FUN_NOME) ? $model->FUN_NOME : 'Selecione um funcionário'; ?>
      	<ul class="pull-right text-right"><li>
      	<a class="refresh-button " onclick="reloadFrame()" href="javascript:void(0);">Atualizar <i class="fa fa-refresh"></i></a>
      	</li></ul>
      </div>
      <div class="panel-body">
        <?php
        $events = array();
        if($model->FUN_IDFUNCIONARIO > 0) {
        	$events['url'] = Yii::app()->createUrl('/autocomplete/agenda', array('user' => $user, 'all' => 1));
        }
        $this->widget('Calendar', array('events' => $events)); ?>
      	<ul class="list-inline legend">
      		<li><i class="fa fa-square" style="color:#a24764;"></i> Com atraso</li>
      		<li><i class="fa fa-square" style="color:#257e4a;"></i> Em andamento</li>
      		<li><i class="fa fa-square" style="color:rgb(58, 135, 173);"></i> Futuro</li>
      	</ul>
      </div>
    </div>
</div>
<style type="text/css">
body {
	padding-top: 10px;
}
#page .container #content {
    margin-top: 00px;
}
.selecionado {
	color:  #0088cc;
}
.refresh-button {
	color: #ccc;
	border-radius: 4px;
	padding:  3px 10px;
	line-height: 20px;
	margin-right: 0;
}
.refresh-button:hover,
.refresh-button:focus {
	color: white;
	text-decoration: none;
	background: #4186c3;
}
</style>