Commit 79eb6e781abc4e789d1d961cb8920247a403f48c
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing
19 changed files
with
571 additions
and
226 deletions
Show diff stats
src/Cacic/CommonBundle/Controller/SoftwareController.php
... | ... | @@ -159,7 +159,7 @@ class SoftwareController extends Controller |
159 | 159 | * Tela de exclusão de Softwares não associados a nenhuma máquina |
160 | 160 | * @param Symfony\Component\HttpFoundation\Request $request |
161 | 161 | */ |
162 | - public function naoUsadosAction( Request $request ) | |
162 | + public function naoUsadosAction( Request $request, $page ) | |
163 | 163 | { |
164 | 164 | if ( $request->isMethod('POST') ) |
165 | 165 | { |
... | ... | @@ -191,7 +191,7 @@ class SoftwareController extends Controller |
191 | 191 | return $this->render( |
192 | 192 | 'CacicCommonBundle:Software:naousados.html.twig', |
193 | 193 | array( |
194 | - 'softwares' => $this->getDoctrine()->getRepository( 'CacicCommonBundle:Software' )->listarNaoUsados() | |
194 | + 'softwares' => $this->getDoctrine()->getRepository( 'CacicCommonBundle:Software' )->listarNaoUsados( $this->get( 'knp_paginator' ), $page ) | |
195 | 195 | ) |
196 | 196 | ); |
197 | 197 | } | ... | ... |
src/Cacic/CommonBundle/Entity/ComputadorRepository.php
... | ... | @@ -358,5 +358,75 @@ class ComputadorRepository extends EntityRepository |
358 | 358 | |
359 | 359 | return $query->getQuery()->execute(); |
360 | 360 | } |
361 | + public function inativosCsv( $dataInicio, $dataFim, $locais ) | |
362 | + { | |
363 | + | |
364 | + // Monta a Consulta básica... | |
365 | + $query = $this->createQueryBuilder('comp') | |
366 | + ->select('loc.nmLocal', 'rede.nmRede', 'rede.teIpRede', 'COUNT(DISTINCT comp.idComputador) as numComp') | |
367 | + ->innerJoin('comp.idRede', 'rede') | |
368 | + ->innerJoin('rede.idLocal', 'loc'); | |
369 | + | |
370 | + /** | |
371 | + * Verifica os filtros que foram parametrizados | |
372 | + */ | |
373 | + | |
374 | + if (empty($dataInicio) && empty($dataFim)) { | |
375 | + // Aqui não preciso filtrar pela data | |
376 | + $query->leftJoin('CacicCommonBundle:LogAcesso', 'log', 'WITH', 'comp.idComputador = log.idComputador'); | |
377 | + } else { | |
378 | + | |
379 | + $query->leftJoin('CacicCommonBundle:LogAcesso', 'log', 'WITH', 'comp.idComputador = log.idComputador AND log.data >= :dtInicio AND log.data <= :dtFim') | |
380 | + ->setParameter('dtInicio', ( $dataInicio.' 00:00:00' )) | |
381 | + ->setParameter('dtFim', ( $dataFim.' 23:59:59' )); | |
382 | + | |
383 | + } | |
384 | + | |
385 | + if ( count($locais) ) | |
386 | + $query->andWhere( 'loc.idLocal IN (:locais)' )->setParameter('locais', $locais); | |
387 | + | |
388 | + | |
389 | + // Filtro que mostra somente máquinas sem coleta | |
390 | + $query->andWhere('log.idComputador IS NULL'); | |
391 | + | |
392 | + // Agrupa todos os campos | |
393 | + $query->groupBy('rede', 'loc.nmLocal', 'loc.sgLocal'); | |
394 | + | |
395 | + return $query->getQuery()->execute(); | |
396 | + } | |
397 | + public function listarInativosCsv( $filtros, $idRede,$dataInicio, $dataFim ) { | |
398 | + | |
399 | + // Monta a Consulta básica... | |
400 | + $query = $this->createQueryBuilder('comp') | |
401 | + | |
402 | + ->select( 'comp.nmComputador', 'comp.teNodeAddress', 'comp.teIpComputador', 'so.sgSo', 'loc.nmLocal', 'rede.nmRede,rede.teIpRede') | |
403 | + ->innerJoin('comp.idSo', 'so') | |
404 | + ->innerJoin('comp.idRede', 'rede') | |
405 | + ->innerJoin('rede.idLocal', 'loc'); | |
406 | + | |
407 | + /** | |
408 | + * Verifica os filtros que foram parametrizados | |
409 | + */ | |
410 | + if (empty($dataInicio) && empty($dataFim)) { | |
411 | + // Aqui não preciso filtrar pela data | |
412 | + $query->leftJoin('CacicCommonBundle:LogAcesso', 'log', 'WITH', 'comp.idComputador = log.idComputador'); | |
413 | + } else { | |
414 | + | |
415 | + $query->leftJoin('CacicCommonBundle:LogAcesso', 'log', 'WITH', 'comp.idComputador = log.idComputador AND log.data >= :dtInicio AND log.data <= :dtFim') | |
416 | + ->setParameter('dtInicio', ( $dataInicio.' 00:00:00' )) | |
417 | + ->setParameter('dtFim', ( $dataFim.' 23:59:59' )); | |
418 | + } | |
419 | + | |
420 | + if ( $idRede ) | |
421 | + $query->andWhere( 'comp.idRede IN (:rede)' )->setParameter('rede', $idRede); | |
422 | + | |
423 | + // Filtro que mostra somente máquinas sem coleta | |
424 | + $query->andWhere('log.idComputador IS NULL'); | |
425 | + | |
426 | + $query->groupBy('rede.idRede', 'rede.nmRede', 'rede.teIpRede', 'loc.nmLocal', 'loc.sgLocal', 'comp.idComputador', 'comp.nmComputador', 'comp.teNodeAddress', 'comp.teIpComputador', 'so.idSo', 'so.inMswindows', 'so.sgSo'); | |
427 | + | |
428 | + | |
429 | + return $query->getQuery()->execute(); | |
430 | + } | |
361 | 431 | |
362 | 432 | } | ... | ... |
src/Cacic/CommonBundle/Entity/LogAcessoRepository.php
... | ... | @@ -102,8 +102,56 @@ class LogAcessoRepository extends EntityRepository |
102 | 102 | ->andWhere( 'log.data >= (current_date() - 30)' ); |
103 | 103 | |
104 | 104 | return $query->getQuery()->execute(); |
105 | + } | |
106 | + public function faturamentoCsv( $dataInicio, $dataFim, $locais ) | |
107 | + { | |
108 | + | |
109 | + // Monta a Consulta básica... | |
110 | + $query = $this->createQueryBuilder('log') | |
111 | + ->select( 'loc.nmLocal', 'rede.nmRede', 'rede.teIpRede', 'COUNT(DISTINCT log.idComputador) as numComp') | |
112 | + ->innerJoin('log.idComputador', 'comp') | |
113 | + ->innerJoin('comp.idRede', 'rede') | |
114 | + ->innerJoin('rede.idLocal', 'loc') | |
115 | + ->groupBy('rede', 'loc.nmLocal', 'loc.sgLocal'); | |
116 | + | |
117 | + /** | |
118 | + * Verifica os filtros que foram parametrizados | |
119 | + */ | |
120 | + if ( $dataInicio ) | |
121 | + $query->andWhere( 'log.data >= :dtInicio' )->setParameter('dtInicio', ( $dataInicio.' 00:00:00' )); | |
122 | + | |
123 | + if ( $dataFim ) | |
124 | + $query->andWhere( 'log.data <= :dtFim' )->setParameter('dtFim', ( $dataFim.' 23:59:59' )); | |
125 | + | |
126 | + if ( count($locais) ) | |
127 | + $query->andWhere( 'loc.idLocal IN (:locais)' )->setParameter('locais', $locais); | |
105 | 128 | |
129 | + | |
130 | + return $query->getQuery()->execute(); | |
106 | 131 | } |
132 | + public function listarCsv( $filtros, $idRede, $dataInicio, $dataFim ) | |
133 | + { | |
134 | + $query = $this->createQueryBuilder('log') | |
135 | + ->select('comp.nmComputador', 'comp.teNodeAddress','comp.teIpComputador', 'so.sgSo', 'local.nmLocal', 'rede.nmRede','max(log.data) AS data') | |
136 | + ->innerJoin('log.idComputador','comp') | |
137 | + ->innerJoin('comp.idSo', 'so') | |
138 | + ->innerJoin('comp.idRede','rede') | |
139 | + ->innerJoin('rede.idLocal', 'local') | |
140 | + ->groupBy( 'comp.idComputador', 'comp.nmComputador', 'comp.teNodeAddress','comp.teIpComputador', 'so.idSo', 'so.inMswindows', 'so.sgSo', 'rede.idRede', 'rede.nmRede', 'rede.teIpRede', 'local.nmLocal', 'local.idLocal'); | |
107 | 141 | |
142 | + /** | |
143 | + * Verifica os filtros que foram parametrizados | |
144 | + */ | |
145 | + if ( $dataInicio ) | |
146 | + $query->andWhere( 'log.data >= :dtInicio' )->setParameter('dtInicio', ( $dataInicio.' 00:00:00' )); | |
147 | + | |
148 | + if ( $dataFim ) | |
149 | + $query->andWhere( 'log.data <= :dtFim' )->setParameter('dtFim', ( $dataFim.' 23:59:59' )); | |
150 | + | |
151 | + if ( count($idRede) ) | |
152 | + $query->andWhere( 'comp.idRede IN (:rede)' )->setParameter('rede', $idRede); | |
153 | + | |
154 | + return $query->getQuery()->execute(); | |
155 | + } | |
108 | 156 | |
109 | 157 | } | ... | ... |
src/Cacic/CommonBundle/Entity/SoftwareRepository.php
... | ... | @@ -77,15 +77,20 @@ class SoftwareRepository extends EntityRepository |
77 | 77 | * |
78 | 78 | * Método de listagem dos Softwares cadastrados que não estão associados a nenhuma máquina |
79 | 79 | */ |
80 | - public function listarNaoUsados() | |
80 | + public function listarNaoUsados( \Knp\Component\Pager\Paginator $paginator, $page = 1) | |
81 | 81 | { |
82 | - $_dql = "SELECT s | |
83 | - FROM CacicCommonBundle:Software s | |
84 | - LEFT JOIN s.estacoes se | |
85 | - WHERE se IS NULL | |
86 | - ORDER BY s.nmSoftware ASC"; | |
82 | + $qb = $this->createQueryBuilder('sw') | |
83 | + ->select('sw.nmSoftware, sw.idSoftware') | |
84 | + ->leftJoin( 'sw.estacoes ','se') | |
85 | + ->where('se is null') | |
86 | + ->groupBy('sw.nmSoftware,sw.idSoftware') | |
87 | + ->orderBy('sw.nmSoftware','ASC'); | |
87 | 88 | |
88 | - return $this->getEntityManager()->createQuery( $_dql )->getArrayResult(); | |
89 | + return $paginator->paginate( | |
90 | + $qb->getQuery()->execute(), | |
91 | + $page, | |
92 | + 10 | |
93 | + ); | |
89 | 94 | } |
90 | 95 | |
91 | 96 | /** | ... | ... |
src/Cacic/CommonBundle/Form/Type/SoftwareEstacaoType.php
... | ... | @@ -4,6 +4,7 @@ namespace Cacic\CommonBundle\Form\Type; |
4 | 4 | |
5 | 5 | use Symfony\Component\Form\AbstractType; |
6 | 6 | use Symfony\Component\Form\FormBuilderInterface; |
7 | +use Cacic\CommonBundle\Entity\SoftwareRepository; | |
7 | 8 | |
8 | 9 | /** |
9 | 10 | * |
... | ... | @@ -18,10 +19,20 @@ class SoftwareEstacaoType extends AbstractType |
18 | 19 | { |
19 | 20 | $builder->add( |
20 | 21 | 'idSoftware', |
21 | - null, | |
22 | + 'entity', | |
22 | 23 | array( |
24 | + 'class' => 'CacicCommonBundle:Software', | |
25 | + 'query_builder' => function(SoftwareRepository $er) { | |
26 | + return $er->createQueryBuilder('sw') | |
27 | + ->select('sw') | |
28 | + ->innerJoin('CacicCommonBundle:PropriedadeSoftware', 'prop', 'WITH', 'sw.idSoftware = prop.software') | |
29 | + ->innerJoin('CacicCommonBundle:ClassProperty', 'class','WITH', 'prop.classProperty = class.idClassProperty') | |
30 | + ->groupBy('class.idClassProperty, class.nmPropertyName, sw') | |
31 | + ->orderBy('sw.nmSoftware'); | |
32 | + }, | |
23 | 33 | 'property' => 'nmSoftware', |
24 | 34 | 'empty_value' => 'Selecione', |
35 | + 'max_length'=>100, | |
25 | 36 | 'label'=>'Software' ) |
26 | 37 | ); |
27 | 38 | ... | ... |
src/Cacic/CommonBundle/Form/Type/UsbDeviceType.php
src/Cacic/CommonBundle/Resources/config/routing.yml
... | ... | @@ -233,8 +233,10 @@ cacic_software_naoclassificados: |
233 | 233 | page: \d+ |
234 | 234 | |
235 | 235 | cacic_software_naousados: |
236 | - pattern: /software/naousados | |
237 | - defaults: { _controller: CacicCommonBundle:Software:naoUsados} | |
236 | + pattern: /software/naousados/{page} | |
237 | + defaults: { _controller: CacicCommonBundle:Software:naoUsados, page:1} | |
238 | + requirements: | |
239 | + page: \d+ | |
238 | 240 | |
239 | 241 | cacic_configuracao_padrao: |
240 | 242 | pattern: /configuracao/padrao | ... | ... |
src/Cacic/CommonBundle/Resources/views/Rede/index.html.twig
1 | 1 | {% extends 'CacicCommonBundle::base.html.twig' %} |
2 | 2 | |
3 | 3 | {% block breadcrumb %} |
4 | - <li class="active">{{ "Subredes"|trans }}</li> | |
4 | + <li class="active">{{ "Sub-redes"|trans }}</li> | |
5 | 5 | {% endblock %} |
6 | 6 | |
7 | 7 | {% block body %} |
... | ... | @@ -10,19 +10,19 @@ |
10 | 10 | <div class="span12"> |
11 | 11 | <div class="box grad_colour_black"> |
12 | 12 | |
13 | - <h2 class="box_head round_top"><i class="icon-sitemap"></i> {{ "Subredes"|trans }}</h2> | |
13 | + <h2 class="box_head round_top"><i class="icon-sitemap"></i> {{ "Sub-redes"|trans }}</h2> | |
14 | 14 | |
15 | 15 | <div class="block box_content round_bottom padding_10"> |
16 | 16 | |
17 | - <h3>{{ "Lista de Subredes cadastrados"|trans }}</h3> | |
18 | - <p>{{ "Neste módulo deverão ser cadastrados as Subredes do sistema"|trans }}</p> | |
17 | + <h3>{{ "Lista de Sub-redes cadastrados"|trans }}</h3> | |
18 | + <p>{{ "Neste módulo deverão ser cadastrados as Sub-redes do sistema"|trans }}</p> | |
19 | 19 | <br /> |
20 | 20 | |
21 | 21 | <table class="table table-striped table-bordered"> |
22 | 22 | <thead> |
23 | 23 | <tr> |
24 | 24 | <th width="10%">{{ "Endereço"|trans }}<br />{{ "Máscara"|trans }}</th> |
25 | - <th width="20%">{{ "Subrede"|trans }}</th> | |
25 | + <th width="20%">{{ "Sub-rede"|trans }}</th> | |
26 | 26 | <th width="10%" style="text-align: center">{{ "Local"|trans }}</th> |
27 | 27 | <th width="5%" style="text-align: center">{{ "Máquinas"|trans }}</th> |
28 | 28 | <th width="10%" style="text-align: center">{{ "Autenticação"|trans }}</th> | ... | ... |
src/Cacic/CommonBundle/Resources/views/Software/naousados.html.twig
... | ... | @@ -49,7 +49,11 @@ |
49 | 49 | |
50 | 50 | </tbody> |
51 | 51 | </table> |
52 | - | |
52 | + | |
53 | + {# display navigation #} | |
54 | + <div class="navigation"> | |
55 | + {{ knp_pagination_render(softwares) }} | |
56 | + </div> | |
53 | 57 | <div class="control-group" align="right"> |
54 | 58 | <div class="controls"> |
55 | 59 | <button type="reset" class="btn"> | ... | ... |
src/Cacic/CommonBundle/Resources/views/UsbDevice/index.html.twig
... | ... | @@ -33,11 +33,11 @@ |
33 | 33 | |
34 | 34 | {% for UsbDevice in UsbDevice %} |
35 | 35 | |
36 | - <tr id="item_{{ UsbDevice[0].idUsbDevice }}" class="{{ cycle(['row0', 'row1'], loop.index) }}"> | |
37 | - <td style="text-align: center" id="item_desc_{{ UsbDevice[0].idUsbDevice }}">{{ UsbDevice[0].idUsbDevice }}-{{ UsbDevice[0].nmUsbDevice }}</td> | |
38 | - <td style="text-align: center" ">{{ UsbDevice.idUsbVendor }}-{{ UsbDevice.nmUsbVendor }}</td> | |
36 | + <tr id="item_{{ UsbDevice['idUsbDevice'] }}" class="{{ cycle(['row0', 'row1'], loop.index) }}"> | |
37 | + <td style="text-align: center" id="item_desc_{{ UsbDevice['idUsbDevice'] }}">{{ UsbDevice['idUsbDevice'] }}-{{ UsbDevice['nmUsbDevice'] }}</td> | |
38 | + <td style="text-align: center" >{{ UsbDevice.idUsbVendor }}-{{ UsbDevice.nmUsbVendor }}</td> | |
39 | 39 | <td style="text-align: center" class="td-actions"> |
40 | - <a href="{{ path('cacic_usbdevice_editar', {'idUsbDevice': UsbDevice[0].idUsbDevice }) }}" class="btn btn-small" title="{{ "Editar Item"|trans }}"> | |
40 | + <a href="{{ path('cacic_usbdevice_editar', {'idUsbDevice': UsbDevice['idUsbDevice'] }) }}" class="btn btn-small" title="{{ "Editar Item"|trans }}"> | |
41 | 41 | <i class="btn-icon-only icon-edit icon-large"></i> |
42 | 42 | </a> |
43 | 43 | ... | ... |
src/Cacic/CommonBundle/Resources/views/base.html.twig
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | <ul> |
48 | 48 | <li><a href="{{ path('cacic_local_index') }}">{{ "Locais"|trans }}</a></li> |
49 | 49 | <li><a href="{{ path('cacic_servidorautenticacao_index') }}">{{ "Servidores Autenticação"|trans }}</a></li> |
50 | - <li><a href="{{ path('cacic_subrede_index') }}">{{ "Subredes"|trans }}</a></li> | |
50 | + <li><a href="{{ path('cacic_subrede_index') }}">{{ "Sub-redes"|trans }}</a></li> | |
51 | 51 | <li><a href="{{ path('cacic_aplicativo_index') }}">{{ "Aplicativo"|trans }}</a></li> |
52 | 52 | <li><a href="{{ path('cacic_usuario_index') }}">{{ "Usuários"|trans }}</a></li> |
53 | 53 | <li><a href="{{ path('cacic_grupo_usuario_index') }}">{{ "Grupo de Usuários"|trans }}</a></li> |
... | ... | @@ -139,7 +139,7 @@ |
139 | 139 | </li> |
140 | 140 | <li><a class="round_top" href="{{ path('cacic_relatorio_autorizacoes') }}">{{ "Autorizações"|trans }}</a></li> |
141 | 141 | <li><a class="round_top" href="{{ path('cacic_relatorio_faturamento') }}">{{ "Faturamento"|trans }}</a></li> |
142 | - <li><a class="round_top" href="{{ path('cacic_relatorio_inativos') }}">{{ "Inativos"|trans }}</a></li> | |
142 | + <li><a class="round_top" href="{{ path('cacic_relatorio_inativos') }}">{{ "Sem Coleta"|trans }}</a></li> | |
143 | 143 | <li><a class="round_top" href="{{ path('cacic_relatorio_patrimonio') }}">{{ "Patrimônio"|trans }}</a></li> |
144 | 144 | </ul> |
145 | 145 | </li> | ... | ... |
src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
... | ... | @@ -3,22 +3,28 @@ |
3 | 3 | namespace Cacic\RelatorioBundle\Controller; |
4 | 4 | |
5 | 5 | use Cacic\CommonBundle\Entity\ComputadorColetaRepository; |
6 | + use Ddeboer\DataImport\ValueConverter\ArrayValueConverterMap; | |
7 | + use Ddeboer\DataImport\ValueConverter\CharsetValueConverter; | |
6 | 8 | use Doctrine\Common\Util\Debug; |
7 | 9 | use Symfony\Component\HttpFoundation\Request; |
8 | 10 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
9 | 11 | use Cacic\CommonBundle\Form\Type\LogPesquisaType; |
12 | + use Ddeboer\DataImport\Workflow; | |
13 | + use Ddeboer\DataImport\Reader\ArrayReader; | |
14 | + use Ddeboer\DataImport\Writer\CsvWriter; | |
15 | + use Ddeboer\DataImport\ValueConverter\CallbackValueConverter; | |
16 | + use Symfony\Component\HttpFoundation\BinaryFileResponse; | |
10 | 17 | |
11 | 18 | |
12 | 19 | class FaturamentoController extends Controller { |
13 | 20 | |
14 | 21 | |
15 | - public function indexAction(Request $request) { | |
22 | + public function faturamentoAction(Request $request) { | |
16 | 23 | |
17 | 24 | $locale = $request->getLocale(); |
18 | 25 | |
19 | 26 | $form = $this->createForm( new LogPesquisaType() ); |
20 | - | |
21 | - return $this->render( 'CacicRelatorioBundle:Faturamento:index.html.twig', | |
27 | + return $this->render( 'CacicRelatorioBundle:Faturamento:faturamento.html.twig', | |
22 | 28 | array( |
23 | 29 | 'locale'=> $locale, |
24 | 30 | 'form' => $form->createView() |
... | ... | @@ -27,6 +33,7 @@ |
27 | 33 | } |
28 | 34 | |
29 | 35 | public function faturamentoRelatorioAction(Request $request){ |
36 | + | |
30 | 37 | $locale = $request->getLocale(); |
31 | 38 | $form = $this->createForm( new LogPesquisaType() ); |
32 | 39 | if ( $request->isMethod('POST') ) |
... | ... | @@ -43,7 +50,7 @@ |
43 | 50 | ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); |
44 | 51 | } |
45 | 52 | |
46 | - return $this->render( 'CacicRelatorioBundle:Faturamento:acessoResultado.html.twig', | |
53 | + return $this->render( 'CacicRelatorioBundle:Faturamento:faturamentoResultado.html.twig', | |
47 | 54 | array( |
48 | 55 | 'idioma'=> $locale, |
49 | 56 | 'form' => $form->createView(), |
... | ... | @@ -74,7 +81,44 @@ |
74 | 81 | ) |
75 | 82 | ); |
76 | 83 | } |
84 | + public function listarCsvAction( Request $request) { | |
85 | + | |
86 | + | |
87 | + $dataInicio = $request->get('dtAcaoInicio'); | |
88 | + $dataFim = $request->get('dtAcaoFim'); | |
89 | + $idRede = $request->get('idRede'); | |
90 | + | |
91 | + $printers = $this->getDoctrine() | |
92 | + ->getRepository('CacicCommonBundle:LogAcesso') | |
93 | + ->listarCsv($filtros = array(), $idRede, $dataInicio, $dataFim); | |
77 | 94 | |
95 | + | |
96 | + // Gera CSV | |
97 | + $reader = new ArrayReader($printers); | |
98 | + | |
99 | + // Create the workflow from the reader | |
100 | + $workflow = new Workflow($reader); | |
101 | + | |
102 | + $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); | |
103 | + | |
104 | + // Add the writer to the workflow | |
105 | + $tmpfile = tempnam(sys_get_temp_dir(), 'Faturamento'); | |
106 | + $file = new \SplFileObject($tmpfile, 'w'); | |
107 | + $writer = new CsvWriter($file); | |
108 | + $writer->writeItem(array('Computador', 'Mac Address','Endereço IP','Sistema Operacional','Local','Subrede','Data/Hora da Última Coleta')); | |
109 | + $workflow->addWriter($writer); | |
110 | + | |
111 | + // Process the workflow | |
112 | + $workflow->process(); | |
113 | + | |
114 | + // Retorna o arquivo | |
115 | + $response = new BinaryFileResponse($tmpfile); | |
116 | + $response->headers->set('Content-Type', 'text/csv'); | |
117 | + $response->headers->set('Content-Disposition', 'attachment; filename="Faturamento.csv"'); | |
118 | + $response->headers->set('Content-Transfer-Encoding', 'binary'); | |
119 | + | |
120 | + return $response; | |
121 | + } | |
78 | 122 | public function inativosAction(Request $request) { |
79 | 123 | |
80 | 124 | $locale = $request->getLocale(); |
... | ... | @@ -141,6 +185,128 @@ |
141 | 185 | ) |
142 | 186 | ); |
143 | 187 | } |
188 | + public function listarInativosCsvAction( Request $request) { | |
189 | + | |
190 | + | |
191 | + $dataInicio = $request->get('dtAcaoInicio'); | |
192 | + $dataFim = $request->get('dtAcaoFim'); | |
193 | + $idRede = $request->get('idRede'); | |
194 | + | |
195 | + $printers = $this->getDoctrine() | |
196 | + ->getRepository('CacicCommonBundle:Computador') | |
197 | + ->listarInativosCsv($filtros = array(),$idRede, $dataInicio, $dataFim); | |
198 | + | |
199 | + | |
200 | + // Gera CSV | |
201 | + $reader = new ArrayReader($printers); | |
202 | + | |
203 | + // Create the workflow from the reader | |
204 | + $workflow = new Workflow($reader); | |
205 | + | |
206 | + $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); | |
207 | + | |
208 | + // Add the writer to the workflow | |
209 | + $tmpfile = tempnam(sys_get_temp_dir(), 'Maquinas Sem Coletas'); | |
210 | + $file = new \SplFileObject($tmpfile, 'w'); | |
211 | + $writer = new CsvWriter($file); | |
212 | + $writer->writeItem(array('Computador', 'Mac Address','Endereço IP','Sistema Operacional','Local','Subrede','Range IP')); | |
213 | + $workflow->addWriter($writer); | |
214 | + | |
215 | + // Process the workflow | |
216 | + $workflow->process(); | |
217 | + | |
218 | + // Retorna o arquivo | |
219 | + $response = new BinaryFileResponse($tmpfile); | |
220 | + $response->headers->set('Content-Type', 'text/csv'); | |
221 | + $response->headers->set('Content-Disposition', 'attachment; filename="Máquinas Sem Coletas.csv"'); | |
222 | + $response->headers->set('Content-Transfer-Encoding', 'binary'); | |
223 | + | |
224 | + return $response; | |
225 | + } | |
226 | + | |
227 | + public function faturamentoCsvAction(Request $request) | |
228 | + { | |
229 | + $em = $this->getDoctrine()->getManager(); | |
144 | 230 | |
231 | + $form = $this->createForm( new LogPesquisaType() ); | |
232 | + | |
233 | + $form->bind( $request ); | |
234 | + $data = $form->getData(); | |
235 | + $filtroLocais = array(); // Inicializa array com locais a pesquisar | |
236 | + foreach ( $data['idLocal'] as $locais ) { | |
237 | + array_push( $filtroLocais, $locais->getIdLocal() ); | |
238 | + } | |
239 | + | |
240 | + $printers = $em->getRepository( 'CacicCommonBundle:LogAcesso') | |
241 | + ->faturamentoCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); | |
242 | + | |
243 | + // Gera CSV | |
244 | + $reader = new ArrayReader($printers); | |
245 | + | |
246 | + // Create the workflow from the reader | |
247 | + $workflow = new Workflow($reader); | |
248 | + | |
249 | + $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); | |
250 | + | |
251 | + // Add the writer to the workflow | |
252 | + $tmpfile = tempnam(sys_get_temp_dir(), 'Faturamento'); | |
253 | + $file = new \SplFileObject($tmpfile, 'w'); | |
254 | + $writer = new CsvWriter($file); | |
255 | + $writer->writeItem(array('Local', 'Subrede','Endereço IP','Estações')); | |
256 | + $workflow->addWriter($writer); | |
257 | + | |
258 | + // Process the workflow | |
259 | + $workflow->process(); | |
260 | + | |
261 | + // Retorna o arquivo | |
262 | + $response = new BinaryFileResponse($tmpfile); | |
263 | + $response->headers->set('Content-Type', 'text/csv'); | |
264 | + $response->headers->set('Content-Disposition', 'attachment; filename="Faturamento.csv"'); | |
265 | + $response->headers->set('Content-Transfer-Encoding', 'binary'); | |
266 | + | |
267 | + return $response; | |
268 | + } | |
269 | + public function inativosCsvAction(Request $request) | |
270 | + { | |
271 | + $em = $this->getDoctrine()->getManager(); | |
272 | + | |
273 | + $form = $this->createForm( new LogPesquisaType() ); | |
274 | + | |
275 | + $form->bind( $request ); | |
276 | + $data = $form->getData(); | |
277 | + $filtroLocais = array(); // Inicializa array com locais a pesquisar | |
278 | + foreach ( $data['idLocal'] as $locais ) { | |
279 | + array_push( $filtroLocais, $locais->getIdLocal() ); | |
280 | + } | |
281 | + | |
282 | + $printers = $em->getRepository( 'CacicCommonBundle:Computador') | |
283 | + ->inativosCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); | |
284 | + | |
285 | + // Gera CSV | |
286 | + $reader = new ArrayReader($printers); | |
287 | + | |
288 | + // Create the workflow from the reader | |
289 | + $workflow = new Workflow($reader); | |
290 | + | |
291 | + $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); | |
292 | + | |
293 | + // Add the writer to the workflow | |
294 | + $tmpfile = tempnam(sys_get_temp_dir(), 'Não_Coletada'); | |
295 | + $file = new \SplFileObject($tmpfile, 'w'); | |
296 | + $writer = new CsvWriter($file); | |
297 | + $writer->writeItem(array('Local', 'Subrede','Endereço IP','Estações')); | |
298 | + $workflow->addWriter($writer); | |
299 | + | |
300 | + // Process the workflow | |
301 | + $workflow->process(); | |
302 | + | |
303 | + // Retorna o arquivo | |
304 | + $response = new BinaryFileResponse($tmpfile); | |
305 | + $response->headers->set('Content-Type', 'text/csv'); | |
306 | + $response->headers->set('Content-Disposition', 'attachment; filename="Não Coletadas.csv"'); | |
307 | + $response->headers->set('Content-Transfer-Encoding', 'binary'); | |
308 | + | |
309 | + return $response; | |
310 | + } | |
145 | 311 | |
146 | 312 | } | ... | ... |
src/Cacic/RelatorioBundle/Resources/config/routing.yml
... | ... | @@ -4,7 +4,7 @@ cacic_relatorio_autorizacoes: |
4 | 4 | |
5 | 5 | cacic_relatorio_faturamento: |
6 | 6 | pattern: /faturamento |
7 | - defaults: { _controller: CacicRelatorioBundle:Faturamento:index } | |
7 | + defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamento } | |
8 | 8 | requirements: |
9 | 9 | _method: GET |
10 | 10 | |
... | ... | @@ -144,3 +144,26 @@ cacic_relatorio_inativos_listar: |
144 | 144 | requirements: |
145 | 145 | idRede: \d+ |
146 | 146 | |
147 | +cacic_faturamento_csv: | |
148 | + pattern: /faturamento/csv | |
149 | + defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamentoCsv } | |
150 | + requirements: | |
151 | + _method: POST | |
152 | + | |
153 | +cacic_inativos_csv: | |
154 | + pattern: /inativos/csv | |
155 | + defaults: { _controller: CacicRelatorioBundle:Faturamento:inativosCsv } | |
156 | + requirements: | |
157 | + _method: POST | |
158 | + | |
159 | +cacic_faturamento_listar_csv: | |
160 | + pattern: /faturamento/listar/csv/{idRede}/{dtAcaoInicio}/{dtAcaoFim} | |
161 | + defaults: { _controller: CacicRelatorioBundle:Faturamento:listarCsv, idRede: null, dtAcaoInicio: null, dtAcaoFim: null } | |
162 | + requirements: | |
163 | + idRede: \d+ | |
164 | + | |
165 | +cacic_inativos_listar_csv: | |
166 | + pattern: /inativos/listar/csv/{idRede}/{dtAcaoInicio}/{dtAcaoFim} | |
167 | + defaults: { _controller: CacicRelatorioBundle:Faturamento:listarInativosCsv, idRede: null, dtAcaoInicio: null, dtAcaoFim: null } | |
168 | + requirements: | |
169 | + idRede: \d+ | |
147 | 170 | \ No newline at end of file | ... | ... |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/acessoResultado.html.twig
... | ... | @@ -1,68 +0,0 @@ |
1 | -{% extends 'CacicRelatorioBundle::base.html.twig' %} | |
2 | - | |
3 | -{% block body %} | |
4 | - | |
5 | -<div class="row-fluid"> | |
6 | - <div class="span12"> | |
7 | - <div class="box grad_colour_black"> | |
8 | - <h2 class="box_head round_top"><i class="icon-list"></i> {{'Resultado do Faturamento' |trans }}</h2> | |
9 | - <div class="block box_content round_bottom padding_10"> | |
10 | - | |
11 | - <h2 class="">{{ 'Relatório de Faturamento'|trans }}</h2> | |
12 | - <h5>{{ 'Relatório gerado em'|trans }} {% if idioma == 'pt_BR' %}{{ "now"|date("d/m/Y H\\hi") }}{% else %}{{ "now"|date("m/d/Y H\\hi") }}{% endif %}</h5> | |
13 | - | |
14 | - <hr /> | |
15 | - | |
16 | - <form id="faturamento" class="form-horizontal" method="post" > | |
17 | - | |
18 | - <table class="table table-striped table-bordered"> | |
19 | - <thead> | |
20 | - <tr> | |
21 | - <th width="10%" style="text-align: center"></th> | |
22 | - <th width="20%">{{ "Local"|trans }}</th> | |
23 | - <th width="30%" style="text-align: center">{{ "Rede"|trans }}</th> | |
24 | - <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th> | |
25 | - <th width="20%" style="text-align: center">{{ "Estações"|trans }}</th> | |
26 | - <th style="text-align: center"> | |
27 | - | |
28 | - </th> | |
29 | - </tr> | |
30 | - </thead> | |
31 | - | |
32 | - <tbody> | |
33 | - {% for log in logs %} | |
34 | - | |
35 | - <tr> | |
36 | - <td style="text-align: center">{{ loop.index }}</td> | |
37 | - <td> | |
38 | - <b><a href="{{ path('cacic_relatorio_faturamento_listar') }}/{{ log['idRede'] }}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank"> | |
39 | - {{ log['nmLocal'] }}</a></b> | |
40 | - </td> | |
41 | - <td>{{ log['nmRede'] }}</td> | |
42 | - <td>{{ log['teIpRede'] }}</td> | |
43 | - <td>{{ log['numComp'] }}</td> | |
44 | - <td> | |
45 | - <a class="btn" href="{{ path('cacic_relatorio_faturamento_listar') }}/{{log['idRede'] }}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank"> | |
46 | - <i class="icon-search"></i> | |
47 | - </a> | |
48 | - </td> | |
49 | - </tr> | |
50 | - | |
51 | - {% else %} | |
52 | - <tr> | |
53 | - <td style="text-align: center;" colspan="4"><b>{{ "NENHUM REGISTRO ENCONTRADO!"|trans }}</b></td> | |
54 | - </tr> | |
55 | - {% endfor %} | |
56 | - | |
57 | - </tbody> | |
58 | - </table> | |
59 | - | |
60 | - | |
61 | - </form> | |
62 | - | |
63 | - </div> <!-- /block --> | |
64 | - </div> <!-- /box --> | |
65 | - </div> <!-- /span --> | |
66 | -</div> <!-- /row --> | |
67 | - | |
68 | -{% endblock %} | |
69 | 0 | \ No newline at end of file |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamento.html.twig
0 → 100644
... | ... | @@ -0,0 +1,121 @@ |
1 | +{% extends 'CacicCommonBundle::base.html.twig' %} | |
2 | + | |
3 | +{% block breadcrumb %} | |
4 | + <li class="active">{{ 'Faturamento'|trans }}</li> | |
5 | +{% endblock %} | |
6 | + | |
7 | +{% block body %} | |
8 | + | |
9 | + <div class="row-fluid"> | |
10 | + | |
11 | + <div class="span8"> | |
12 | + <div class="box grad_colour_black"> | |
13 | + | |
14 | + <h2 class="box_head round_top"><i class="icon-search"></i> {{'Faturamento mensal' |trans }}</h2> | |
15 | + | |
16 | + <div class="block box_content round_bottom padding_10"> | |
17 | + | |
18 | + <h4>{{ "Filtros para faturamento mensal"|trans }}</h4><br /> | |
19 | + | |
20 | + <form id="{{ 'formFaturamento'|trans }}" action="{{ path('cacic_relatorio_faturamento') }}" class="form-horizontal" method="POST" target="_blank"> | |
21 | + | |
22 | + <div class="control-group"> | |
23 | + <label for="log_acesso_periodo" class="control-label">{{ 'Período'|trans }}</label> | |
24 | + <div class="controls"> | |
25 | + {{ form_widget(form.dtAcaoInicio, { 'attr': {'class': 'datepicker_on'} }) }} a {{ form_widget(form.dtAcaoFim, { 'attr': {'class': 'datepicker_on'} }) }} | |
26 | + <p class="help-block">{{ "Informe o período no qual deseja realizar a faturar."|trans }}</p> | |
27 | + </div> | |
28 | + </div> | |
29 | + | |
30 | + <div class="control-group _cad_block_opcao"> | |
31 | + | |
32 | + <div class="controls"> | |
33 | + | |
34 | + <label ><b>{{ 'Local:'|trans }}</b></label> | |
35 | + <div style="height: 200px; overflow: auto;"> | |
36 | + | |
37 | + <div class="modulo-opt-block"> | |
38 | + {{ form_widget(form.idLocal, {'form_type': 'horizontal'}) }} | |
39 | + </div> | |
40 | + </div> | |
41 | + </div> | |
42 | + | |
43 | + </div> | |
44 | + | |
45 | + <div class="control-group"> | |
46 | + <div class="controls"> | |
47 | + <button type="reset" class="btn"> | |
48 | + <i class="icon-refresh"></i> | |
49 | + {{ "Resetar Valores"|trans }} | |
50 | + </button> | |
51 | + <button type="submit" class="btn btn-primary"> | |
52 | + <i class="icon-search"></i> | |
53 | + {{ 'Gerar relatório'|trans }} | |
54 | + </button> | |
55 | + <button type="submit" class="btn btn-success" formaction="{{ path('cacic_faturamento_csv') }}"> | |
56 | + <i class="icon-download-alt"></i> | |
57 | + {{'Gerar CSV'|trans }} | |
58 | + </button> | |
59 | + </div> | |
60 | + </div> | |
61 | + | |
62 | + </form> | |
63 | + </div> <!-- /block --> | |
64 | + </div> <!-- /box --> | |
65 | + </div> <!-- /span8 --> | |
66 | + | |
67 | + <div class="span4"> | |
68 | + <div class="box grad_colour_black"> | |
69 | + | |
70 | + <h2 class="box_head round_top"><i class="icon-info-sign"></i> {{ "Informações Adicionais"|trans }}</h2> | |
71 | + | |
72 | + <div class="block box_content round_bottom padding_10"> | |
73 | + <p> | |
74 | + {{ "Faturamento"|trans }}. | |
75 | + </p> | |
76 | + <p> | |
77 | + {{ "O período é obrigatório"|trans }}. | |
78 | + </p> | |
79 | + <p> | |
80 | + {{ "Não selecionar nenhum valor em determinado critério é o mesmo que selecionar todos"|trans }}. | |
81 | + </p> | |
82 | + </div> <!-- /block --> | |
83 | + </div> <!-- /box --> | |
84 | + </div> <!-- span4 --> | |
85 | + | |
86 | + </div> <!-- /row --> | |
87 | + | |
88 | +{% endblock %} | |
89 | + | |
90 | +{% block javascripts %} | |
91 | + | |
92 | + <script type="text/javascript"> | |
93 | + function mostraDetalhes(elm) { | |
94 | + var detalhes = document.getElementById('_detalhes'); | |
95 | + if (elm.checked == false) { | |
96 | + detalhes.style = ''; | |
97 | + } else { | |
98 | + detalhes.style = 'display: none;'; | |
99 | + } | |
100 | + } | |
101 | + </script> | |
102 | + | |
103 | + {{ parent() }} | |
104 | + {% if locale == 'pt_BR' %} | |
105 | + <script src="{{ asset('bundles/caciccommon/js/jquery.ui.datepicker-pt-BR.js') }}"></script> | |
106 | + | |
107 | + <script type="text/javascript"> | |
108 | + | |
109 | + $(".datepicker_on").datepicker({ altFormat: "dd/mm/yy" }).mask('99/99/9999'); | |
110 | + | |
111 | + </script> | |
112 | + {% else %} | |
113 | + <script src="{{ asset('bundles/caciccommon/js/jquery.ui.datepicker-en-US.js') }}"></script> | |
114 | + | |
115 | + <script type="text/javascript"> | |
116 | + | |
117 | + $(".datepicker_on").datepicker({ altFormat: "mm/dd/yy" }).mask('99/99/9999'); | |
118 | + | |
119 | + </script> | |
120 | + {% endif %} | |
121 | +{% endblock %} | |
0 | 122 | \ No newline at end of file | ... | ... |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamentoResultado.html.twig
0 → 100644
... | ... | @@ -0,0 +1,74 @@ |
1 | +{% extends 'CacicRelatorioBundle::base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + | |
5 | +<div class="row-fluid"> | |
6 | + <div class="span12"> | |
7 | + <div class="box grad_colour_black"> | |
8 | + <h2 class="box_head round_top"><i class="icon-list"></i> {{'Resultado do Faturamento' |trans }}</h2> | |
9 | + <div class="block box_content round_bottom padding_10"> | |
10 | + | |
11 | + <h2 class="">{{ 'Relatório de Faturamento'|trans }}</h2> | |
12 | + <h5>{{ 'Relatório gerado em'|trans }} {% if idioma == 'pt_BR' %}{{ "now"|date("d/m/Y H\\hi") }}{% else %}{{ "now"|date("m/d/Y H\\hi") }}{% endif %}</h5> | |
13 | + | |
14 | + <hr /> | |
15 | + | |
16 | + <form id="faturamento" class="form-horizontal" method="post" > | |
17 | + | |
18 | + <table class="table table-striped table-bordered"> | |
19 | + <thead> | |
20 | + <tr> | |
21 | + <th width="10%" style="text-align: center"></th> | |
22 | + <th width="20%">{{ "Local"|trans }}</th> | |
23 | + <th width="30%" style="text-align: center">{{ "Rede"|trans }}</th> | |
24 | + <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th> | |
25 | + <th width="20%" style="text-align: center">{{ "Estações"|trans }}</th> | |
26 | + <th style="text-align: center"> | |
27 | + {% if logs|length > 0 %} | |
28 | + {% cont++ %} | |
29 | + <a class="btn btn-success" href="{{ path('cacic_faturamento_listar_csv') }}/ | |
30 | + {% for log in logs %}{{logs[{% cont %}]['idRede']}}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}{% endfor %}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank"> | |
31 | + <i class="icon-download-alt"></i> | |
32 | + </a> | |
33 | + {% endif %} | |
34 | + </th> | |
35 | + </tr> | |
36 | + </thead> | |
37 | + | |
38 | + <tbody> | |
39 | + {% for log in logs %} | |
40 | + | |
41 | + <tr> | |
42 | + <td style="text-align: center">{{ loop.index }}</td> | |
43 | + <td> | |
44 | + <b><a href="{{ path('cacic_relatorio_faturamento_listar') }}/{{ log['idRede'] }}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}" title="{{ "Máquinas faturadas"|trans }}" target="_blank"> | |
45 | + {{ log['nmLocal'] }}</a></b> | |
46 | + </td> | |
47 | + <td>{{ log['nmRede'] }}</td> | |
48 | + <td>{{ log['teIpRede'] }}</td> | |
49 | + <td>{{ log['numComp'] }}</td> | |
50 | + <td> | |
51 | + <a class="btn" href="{{ path('cacic_relatorio_faturamento_listar') }}/{{log['idRede'] }}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank"> | |
52 | + <i class="icon-search"></i> | |
53 | + </a> | |
54 | + </td> | |
55 | + </tr> | |
56 | + | |
57 | + {% else %} | |
58 | + <tr> | |
59 | + <td style="text-align: center;" colspan="4"><b>{{ "NENHUM REGISTRO ENCONTRADO!"|trans }}</b></td> | |
60 | + </tr> | |
61 | + {% endfor %} | |
62 | + | |
63 | + </tbody> | |
64 | + </table> | |
65 | + | |
66 | + | |
67 | + </form> | |
68 | + | |
69 | + </div> <!-- /block --> | |
70 | + </div> <!-- /box --> | |
71 | + </div> <!-- /span --> | |
72 | +</div> <!-- /row --> | |
73 | + | |
74 | +{% endblock %} | |
0 | 75 | \ No newline at end of file | ... | ... |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativos.html.twig
1 | 1 | {% extends 'CacicCommonBundle::base.html.twig' %} |
2 | 2 | |
3 | 3 | {% block breadcrumb %} |
4 | - <li class="active">{{ 'Inativos'|trans }}</li> | |
4 | + <li class="active">{{ 'Não Coletada'|trans }}</li> | |
5 | 5 | {% endblock %} |
6 | 6 | |
7 | 7 | {% block body %} |
... | ... | @@ -11,19 +11,19 @@ |
11 | 11 | <div class="span8"> |
12 | 12 | <div class="box grad_colour_black"> |
13 | 13 | |
14 | - <h2 class="box_head round_top"><i class="icon-search"></i> {{'Computadores Inativos' |trans }}</h2> | |
14 | + <h2 class="box_head round_top"><i class="icon-search"></i> {{'Computadores sem coletas' |trans }}</h2> | |
15 | 15 | |
16 | 16 | <div class="block box_content round_bottom padding_10"> |
17 | 17 | |
18 | - <h4>{{ "Período para verificação de computadores inativos"|trans }}</h4><br /> | |
18 | + <h4>{{ "Período para verificação de computadores sem coletas"|trans }}</h4><br /> | |
19 | 19 | |
20 | - <form id={{ 'formFaturamento'|trans }} class="form-horizontal" method="post" target="_blank"> | |
20 | + <form id="{{ 'formFaturamento'|trans }}" action="{{ path('cacic_relatorio_inativos') }}" class="form-horizontal" method="post" target="_blank"> | |
21 | 21 | |
22 | 22 | <div class="control-group"> |
23 | 23 | <label for="log_acesso_periodo" class="control-label">{{ 'Período'|trans }}</label> |
24 | 24 | <div class="controls"> |
25 | 25 | {{ form_widget(form.dtAcaoInicio, { 'attr': {'class': 'datepicker_on'} }) }} a {{ form_widget(form.dtAcaoFim, { 'attr': {'class': 'datepicker_on'} }) }} |
26 | - <p class="help-block">{{ "Informe o período no qual deseja realizar a faturar."|trans }}</p> | |
26 | + <p class="help-block">{{ "Informe o período no qual deseja realizar a consulta de máquinas sem coletas."|trans }}</p> | |
27 | 27 | </div> |
28 | 28 | </div> |
29 | 29 | |
... | ... | @@ -52,6 +52,10 @@ |
52 | 52 | <i class="icon-search"></i> |
53 | 53 | {{ 'Gerar relatório'|trans }} |
54 | 54 | </button> |
55 | + <button type="submit" class="btn btn-success" formaction="{{ path('cacic_inativos_csv') }}"> | |
56 | + <i class="icon-download-alt"></i> | |
57 | + {{'Gerar CSV'|trans }} | |
58 | + </button> | |
55 | 59 | </div> |
56 | 60 | </div> |
57 | 61 | |
... | ... | @@ -67,7 +71,7 @@ |
67 | 71 | |
68 | 72 | <div class="block box_content round_bottom padding_10"> |
69 | 73 | <p> |
70 | - {{ "Faturamento"|trans }}. | |
74 | + {{ "Sem coletas"|trans }}. | |
71 | 75 | </p> |
72 | 76 | <p> |
73 | 77 | {{ "O período é obrigatório"|trans }}. | ... | ... |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativosResultado.html.twig
... | ... | @@ -5,27 +5,29 @@ |
5 | 5 | <div class="row-fluid"> |
6 | 6 | <div class="span12"> |
7 | 7 | <div class="box grad_colour_black"> |
8 | - <h2 class="box_head round_top"><i class="icon-list"></i> {{'Total de estações inativas' |trans }}</h2> | |
8 | + <h2 class="box_head round_top"><i class="icon-list"></i> {{'Total de estações sem coletas' |trans }}</h2> | |
9 | 9 | <div class="block box_content round_bottom padding_10"> |
10 | 10 | |
11 | - <h2 class="">{{ 'Relatório sem Coletas'|trans }}</h2> | |
11 | + <h2 class="">{{ 'Relatório com total de máquinas sem Coletas por subredes'|trans }}</h2> | |
12 | 12 | <h5>{{ 'Relatório gerado em'|trans }} {% if idioma == 'pt_BR' %}{{ "now"|date("d/m/Y H\\hi") }}{% else %}{{ "now"|date("m/d/Y H\\hi") }}{% endif %}</h5> |
13 | 13 | |
14 | 14 | <hr /> |
15 | 15 | |
16 | 16 | |
17 | - <form id="faturamento" class="form-horizontal" method="post" > | |
17 | + <form id="inativas" class="form-horizontal" method="post" > | |
18 | 18 | |
19 | 19 | <table class="table table-striped table-bordered"> |
20 | 20 | <thead> |
21 | 21 | <tr> |
22 | 22 | <th width="10%" style="text-align: center"></th> |
23 | 23 | <th width="20%">{{ "Local"|trans }}</th> |
24 | - <th width="30%" style="text-align: center">{{ "Rede"|trans }}</th> | |
24 | + <th width="30%" style="text-align: center">{{ "Subrede"|trans }}</th> | |
25 | 25 | <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th> |
26 | 26 | <th width="20%" style="text-align: center">{{ "Estações"|trans }}</th> |
27 | 27 | <th style="text-align: center"> |
28 | - | |
28 | + <a class="btn btn-success" href="{{ path('cacic_inativos_listar_csv') }}/{{ logs[0]['idRede'] }}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}" title="{{ "Máquinas sem Coletas"|trans }}" target="_blank"> | |
29 | + <i class="icon-download-alt"></i> | |
30 | + </a> | |
29 | 31 | </th> |
30 | 32 | </tr> |
31 | 33 | </thead> | ... | ... |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/index.html.twig
... | ... | @@ -1,117 +0,0 @@ |
1 | -{% extends 'CacicCommonBundle::base.html.twig' %} | |
2 | - | |
3 | -{% block breadcrumb %} | |
4 | - <li class="active">{{ 'Faturamento'|trans }}</li> | |
5 | -{% endblock %} | |
6 | - | |
7 | -{% block body %} | |
8 | - | |
9 | - <div class="row-fluid"> | |
10 | - | |
11 | - <div class="span8"> | |
12 | - <div class="box grad_colour_black"> | |
13 | - | |
14 | - <h2 class="box_head round_top"><i class="icon-search"></i> {{'Faturamento mensal' |trans }}</h2> | |
15 | - | |
16 | - <div class="block box_content round_bottom padding_10"> | |
17 | - | |
18 | - <h4>{{ "Filtros para faturamento mensal"|trans }}</h4><br /> | |
19 | - | |
20 | - <form id={{ 'formFaturamento'|trans }} class="form-horizontal" method="post" target="_blank"> | |
21 | - | |
22 | - <div class="control-group"> | |
23 | - <label for="log_acesso_periodo" class="control-label">{{ 'Período'|trans }}</label> | |
24 | - <div class="controls"> | |
25 | - {{ form_widget(form.dtAcaoInicio, { 'attr': {'class': 'datepicker_on'} }) }} a {{ form_widget(form.dtAcaoFim, { 'attr': {'class': 'datepicker_on'} }) }} | |
26 | - <p class="help-block">{{ "Informe o período no qual deseja realizar a faturar."|trans }}</p> | |
27 | - </div> | |
28 | - </div> | |
29 | - | |
30 | - <div class="control-group _cad_block_opcao"> | |
31 | - | |
32 | - <div class="controls"> | |
33 | - | |
34 | - <label ><b>{{ 'Local:'|trans }}</b></label> | |
35 | - <div style="height: 200px; overflow: auto;"> | |
36 | - | |
37 | - <div class="modulo-opt-block"> | |
38 | - {{ form_widget(form.idLocal, {'form_type': 'horizontal'}) }} | |
39 | - </div> | |
40 | - </div> | |
41 | - </div> | |
42 | - | |
43 | - </div> | |
44 | - | |
45 | - <div class="control-group"> | |
46 | - <div class="controls"> | |
47 | - <button type="reset" class="btn"> | |
48 | - <i class="icon-refresh"></i> | |
49 | - {{ "Resetar Valores"|trans }} | |
50 | - </button> | |
51 | - <button type="submit" class="btn btn-primary"> | |
52 | - <i class="icon-search"></i> | |
53 | - {{ 'Faturar'|trans }} | |
54 | - </button> | |
55 | - </div> | |
56 | - </div> | |
57 | - | |
58 | - </form> | |
59 | - </div> <!-- /block --> | |
60 | - </div> <!-- /box --> | |
61 | - </div> <!-- /span8 --> | |
62 | - | |
63 | - <div class="span4"> | |
64 | - <div class="box grad_colour_black"> | |
65 | - | |
66 | - <h2 class="box_head round_top"><i class="icon-info-sign"></i> {{ "Informações Adicionais"|trans }}</h2> | |
67 | - | |
68 | - <div class="block box_content round_bottom padding_10"> | |
69 | - <p> | |
70 | - {{ "Faturamento"|trans }}. | |
71 | - </p> | |
72 | - <p> | |
73 | - {{ "O período é obrigatório"|trans }}. | |
74 | - </p> | |
75 | - <p> | |
76 | - {{ "Não selecionar nenhum valor em determinado critério é o mesmo que selecionar todos"|trans }}. | |
77 | - </p> | |
78 | - </div> <!-- /block --> | |
79 | - </div> <!-- /box --> | |
80 | - </div> <!-- span4 --> | |
81 | - | |
82 | - </div> <!-- /row --> | |
83 | - | |
84 | -{% endblock %} | |
85 | - | |
86 | -{% block javascripts %} | |
87 | - | |
88 | - <script type="text/javascript"> | |
89 | - function mostraDetalhes(elm) { | |
90 | - var detalhes = document.getElementById('_detalhes'); | |
91 | - if (elm.checked == false) { | |
92 | - detalhes.style = ''; | |
93 | - } else { | |
94 | - detalhes.style = 'display: none;'; | |
95 | - } | |
96 | - } | |
97 | - </script> | |
98 | - | |
99 | - {{ parent() }} | |
100 | - {% if locale == 'pt_BR' %} | |
101 | - <script src="{{ asset('bundles/caciccommon/js/jquery.ui.datepicker-pt-BR.js') }}"></script> | |
102 | - | |
103 | - <script type="text/javascript"> | |
104 | - | |
105 | - $(".datepicker_on").datepicker({ altFormat: "dd/mm/yy" }).mask('99/99/9999'); | |
106 | - | |
107 | - </script> | |
108 | - {% else %} | |
109 | - <script src="{{ asset('bundles/caciccommon/js/jquery.ui.datepicker-en-US.js') }}"></script> | |
110 | - | |
111 | - <script type="text/javascript"> | |
112 | - | |
113 | - $(".datepicker_on").datepicker({ altFormat: "mm/dd/yy" }).mask('99/99/9999'); | |
114 | - | |
115 | - </script> | |
116 | - {% endif %} | |
117 | -{% endblock %} | |
118 | 0 | \ No newline at end of file |