public function actionHome() { if (Yii::app()->params['debug']) { Y::metodos(); } if (!Yii::app()->user->isGuest) { $online = Yii::app()->db->createCommand($sql = ' SELECT usuario.nome, usuario.matricula, usuario.email, usuario.telefone, orgao.id, orgao.nome AS "Órgão" FROM usuario AS usuario INNER JOIN sic_orgao AS orgao ON usuario.orgao_id = orgao.id AND usuario.online = 1; ')->queryAll(); switch (Yii::app()->user->perfil) { case 'agencia': $this->redirect(array('marketing/mkrBriefing/index')); //Yii::app()->setTheme(''); break; case 'Jornalismo': $this->redirect(array('subscritores/')); break; case 'Disparador': $this->redirect(array('subscritores/index')); break; case 'sic': $this->redirect(array('sic/')); break; } $ocorrenciasPendentes = Yii::app()->db->createCommand($sql = ' select * from ocorrencia WHERE tramitacao = 0 ORDER BY prioridade DESC; ')->queryAll(); $this->render('dashboard', array('online' => $online, 'ocorrenciasPendentes' => $ocorrenciasPendentes)); } else { $this->render('login'); } }