DefaultController.php
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Cacic\CommonBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
/**
*
* Tela inicial do CACIC
*/
public function indexAction()
{
$usuario = $this->getUser()->getIdUsuario();
$nivel = $this->getDoctrine()->getRepository('CacicCommonBundle:Usuario' )->nivel($usuario);
$estatisticas = array(
'totalCompMonitorados' => $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->countAll(),
'totalInsucessosInstalacao' => $this->getDoctrine()->getRepository('CacicCommonBundle:InsucessoInstalacao')->countAll(),
'totalCompPorSO' => $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->countPorSO30Dias(),
'totalComp' => $this->getDoctrine()->getRepository('CacicCommonBundle:LogAcesso')->countPorComputador(),
'totalComp7Dias' => $this->getDoctrine()->getRepository('CacicCommonBundle:LogAcesso')->countComputadorDias('0','7'),
'totalComp14Dias' => $this->getDoctrine()->getRepository('CacicCommonBundle:LogAcesso')->countComputadorDias('7','14')
);
return $this->render(
'CacicCommonBundle:Default:index.html.twig',
array(
'estatisticas' => $estatisticas,
'nivel' => $nivel[0]
)
);
}
/*
* Página de download dos agentes
*/
public function downloadsAction() {
return $this->render('CacicCommonBundle:Default:downloads.html.twig');
}
}