Commit 1e7f63a495942ad44cb8522fe5d475c1db3ed466

Authored by Bruno Menezes
2 parents 83904ebe 64a21495
Exists in master and in 1 other branch 3.1

Merge remote-tracking branch 'origin/master'

src/Cacic/CommonBundle/Entity/ComputadorRepository.php
... ... @@ -463,7 +463,7 @@ class ComputadorRepository extends EntityRepository
463 463 // Monta a Consulta básica...
464 464 $query = $this->createQueryBuilder('comp')
465 465  
466   - ->select( 'comp.nmComputador', 'comp.teNodeAddress', 'comp.teIpComputador', 'so.sgSo', 'loc.nmLocal', 'rede.nmRede,rede.teIpRede')
  466 + ->select( 'comp.nmComputador', 'comp.teNodeAddress', 'comp.teIpComputador', 'so.sgSo', 'loc.nmLocal', 'rede.nmRede','rede.teIpRede')
467 467 ->innerJoin('comp.idSo', 'so')
468 468 ->innerJoin('comp.idRede', 'rede')
469 469 ->innerJoin('rede.idLocal', 'loc');
... ...
src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
... ... @@ -17,7 +17,7 @@
17 17  
18 18 class FaturamentoController extends Controller {
19 19  
20   -
  20 + //Página inicial faturamento
21 21 public function faturamentoAction(Request $request) {
22 22  
23 23 $locale = $request->getLocale();
... ... @@ -31,10 +31,12 @@
31 31 );
32 32 }
33 33  
  34 + //Página que exibe todas as regionais faturamento
34 35 public function faturamentoRelatorioAction(Request $request){
35 36  
36 37 $locale = $request->getLocale();
37 38 $form = $this->createForm( new LogPesquisaType() );
  39 +
38 40 if ( $request->isMethod('POST') )
39 41 {
40 42 $form->bind( $request );
... ... @@ -67,8 +69,53 @@
67 69 );
68 70 }
69 71  
70   - public function listarAction( Request $request, $idRede) {
  72 + //botão csv de todas faturamento
  73 + public function faturamentoCsvAction(Request $request)
  74 + {
  75 + $em = $this->getDoctrine()->getManager();
  76 +
  77 + $form = $this->createForm( new LogPesquisaType() );
71 78  
  79 + $form->bind( $request );
  80 + $data = $form->getData();
  81 + $filtroLocais = array(); // Inicializa array com locais a pesquisar
  82 + foreach ( $data['idLocal'] as $locais ) {
  83 + array_push( $filtroLocais, $locais->getIdLocal() );
  84 + }
  85 +
  86 + $printers = $em->getRepository( 'CacicCommonBundle:LogAcesso')
  87 + ->faturamentoCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);
  88 +
  89 + // Gera CSV
  90 + $reader = new ArrayReader($printers);
  91 +
  92 + // Create the workflow from the reader
  93 + $workflow = new Workflow($reader);
  94 +
  95 + $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader));
  96 +
  97 + // Add the writer to the workflow
  98 + $tmpfile = tempnam(sys_get_temp_dir(), 'Faturamento');
  99 + $file = new \SplFileObject($tmpfile, 'w');
  100 + $writer = new CsvWriter($file);
  101 + $writer->writeItem(array('Local', 'Subrede','Endereço IP','Estações'));
  102 + $workflow->addWriter($writer);
  103 +
  104 + // Process the workflow
  105 + $workflow->process();
  106 +
  107 + // Retorna o arquivo
  108 + $response = new BinaryFileResponse($tmpfile);
  109 + $response->headers->set('Content-Type', 'text/csv');
  110 + $response->headers->set('Content-Disposition', 'attachment; filename="Faturamento.csv"');
  111 + $response->headers->set('Content-Transfer-Encoding', 'binary');
  112 +
  113 +
  114 + return $response;
  115 + }
  116 +
  117 + //Página que exibe cada regional faturamento
  118 + public function listarAction( Request $request, $idRede) {
72 119  
73 120 $dataInicio = $request->get('dtAcaoInicio');
74 121 $dataFim = $request->get('dtAcaoFim');
... ... @@ -77,19 +124,25 @@
77 124 $locale = $request->getLocale();
78 125 $dados = $this->getDoctrine()
79 126 ->getRepository('CacicCommonBundle:LogAcesso')
80   - ->gerarRelatorioRede($filtros = array(),$idRede, $dataInicio, $dataFim);
  127 + ->gerarRelatorioRede($filtros = array(),$idRede, $dataInicio, $dataFim);
  128 +
81 129  
82 130 return $this->render(
83 131 'CacicRelatorioBundle:Faturamento:listar.html.twig',
84 132 array(
85 133 'rede'=> $dados[0]['nmRede'],
86 134 'idioma'=> $locale,
87   - 'dados' => $dados
  135 + 'dados' => ( isset( $dados ) ? $dados : null ),
  136 + 'idRede' => $idRede,
  137 + 'dtAcaoInicio' => $dataInicio,
  138 + 'dtAcaoFim' => $dataFim
  139 +
88 140 )
89 141 );
90 142 }
91   - public function listarCsvAction( Request $request) {
92 143  
  144 + //Botão csv cada faturamento
  145 + public function listarCsvAction( Request $request) {
93 146  
94 147 $dataInicio = $request->get('dtAcaoInicio');
95 148 $dataFim = $request->get('dtAcaoFim');
... ... @@ -97,7 +150,7 @@
97 150  
98 151 $printers = $this->getDoctrine()
99 152 ->getRepository('CacicCommonBundle:LogAcesso')
100   - ->listarCsv($filtros = array(), $idRede, $dataInicio, $dataFim);
  153 + ->listarCsv($filtros = array(),$idRede, $dataInicio , $dataFim);
101 154  
102 155  
103 156 // Gera CSV
... ... @@ -106,11 +159,6 @@
106 159 // Create the workflow from the reader
107 160 $workflow = new Workflow($reader);
108 161  
109   -
110   -
111   - // Create the workflow from the reader
112   - $workflow = new Workflow($reader);
113   -
114 162 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader));
115 163  
116 164 // Add the writer to the workflow
... ... @@ -126,11 +174,15 @@
126 174 // Retorna o arquivo
127 175 $response = new BinaryFileResponse($tmpfile);
128 176 $response->headers->set('Content-Type', 'text/csv');
129   - $response->headers->set('Content-Disposition', 'attachment; filename="Faturamento.csv"');
  177 + $response->headers->set('Content-Disposition', 'attachment; filename="Faturamento_subrede.csv"');
130 178 $response->headers->set('Content-Transfer-Encoding', 'binary');
131 179  
132 180 return $response;
  181 +
133 182 }
  183 +
  184 +
  185 + //Página inicial inativos
134 186 public function inativosAction(Request $request) {
135 187  
136 188 $locale = $request->getLocale();
... ... @@ -145,21 +197,20 @@
145 197 );
146 198 }
147 199  
  200 + //Página que exibe todas as regionais inativos
148 201 public function inativosRelatorioAction(Request $request){
149   - $locale = $request->getLocale();
150 202  
  203 + $locale = $request->getLocale();
151 204 $form = $this->createForm( new LogPesquisaType() );
152 205  
153   -
154 206 if ( $request->isMethod('POST') )
155 207 {
156 208 $form->bind( $request );
157 209 $data = $form->getData();
158 210 $filtroLocais = array(); // Inicializa array com locais a pesquisar
159   - foreach ( $data['idLocal'] as $locais ) {
160   - array_push( $filtroLocais, $locais->getIdLocal() );
161   - }
162   -
  211 + foreach ( $data['idLocal'] as $locais ) {
  212 + array_push( $filtroLocais, $locais->getIdLocal() );
  213 + }
163 214  
164 215 $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Computador')
165 216 ->pesquisarInativos( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);
... ... @@ -171,6 +222,7 @@
171 222 }
172 223 }
173 224  
  225 +
174 226 return $this->render( 'CacicRelatorioBundle:Faturamento:inativosResultado.html.twig',
175 227 array(
176 228 'idioma'=> $locale,
... ... @@ -182,6 +234,7 @@
182 234 );
183 235 }
184 236  
  237 + //Página que exibe cada regional inativos
185 238 public function listarInativosAction( Request $request, $idRede) {
186 239  
187 240  
... ... @@ -194,97 +247,62 @@
194 247 ->getRepository('CacicCommonBundle:Computador')
195 248 ->gerarRelatorioRede($filtros = array(),$idRede, $dataInicio, $dataFim);
196 249  
197   - return $this->render(
198   - 'CacicRelatorioBundle:Faturamento:listarInativos.html.twig',
  250 +
  251 + return $this->render( 'CacicRelatorioBundle:Faturamento:listarInativos.html.twig',
199 252 array(
200 253 'rede'=> $dados[0]['nmRede'],
201 254 'idioma'=> $locale,
202   - 'dados' => $dados
  255 + 'dados' => ( isset( $dados ) ? $dados : null ),
  256 + 'idRede' => $idRede,
  257 + 'dtAcaoInicio' => $dataInicio,
  258 + 'dtAcaoFim' => $dataFim
  259 +
203 260 )
204 261 );
205 262 }
206   - public function listarInativosCsvAction( Request $request) {
207 263  
  264 + //botão csv de cada inativos
  265 + public function listarInativosCsvAction ( Request $request) {
208 266  
209 267 $dataInicio = $request->get('dtAcaoInicio');
210 268 $dataFim = $request->get('dtAcaoFim');
211 269 $idRede = $request->get('idRede');
212 270  
213 271 $printers = $this->getDoctrine()
214   - ->getRepository('CacicCommonBundle:Computador')
215   - ->listarInativosCsv($filtros = array(),$idRede, $dataInicio, $dataFim);
  272 + ->getRepository('CacicCommonBundle:Computador')
  273 + ->listarInativosCsv($filtros = array(),$idRede, $dataInicio, $dataFim);
216 274  
217 275  
218   - // Gera CSV
  276 + // Gera CSV
219 277 $reader = new ArrayReader($printers);
220 278  
221   - // Create the workflow from the reader
  279 + // Create the workflow from the reader
222 280 $workflow = new Workflow($reader);
223 281  
224 282 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader));
225 283  
226   - // Add the writer to the workflow
227   - $tmpfile = tempnam(sys_get_temp_dir(), 'Maquinas Sem Coletas');
  284 + // Add the writer to the workflow
  285 + $tmpfile = tempnam(sys_get_temp_dir(), 'Máquinas sem Coletas');
228 286 $file = new \SplFileObject($tmpfile, 'w');
229 287 $writer = new CsvWriter($file);
230   - $writer->writeItem(array('Computador', 'Mac Address','Endereço IP','Sistema Operacional','Local','Subrede','Range IP'));
  288 + $writer->writeItem(array('Computador', 'Mac Address','Endereço IP','Sistema Operacional','Local','Subrede'));
231 289 $workflow->addWriter($writer);
232 290  
233   - // Process the workflow
  291 + // Process the workflow
234 292 $workflow->process();
235 293  
236   - // Retorna o arquivo
  294 + // Retorna o arquivo
237 295 $response = new BinaryFileResponse($tmpfile);
238 296 $response->headers->set('Content-Type', 'text/csv');
239   - $response->headers->set('Content-Disposition', 'attachment; filename="Máquinas Sem Coletas.csv"');
  297 + $response->headers->set('Content-Disposition', 'attachment; filename="Não_Coletadas_subrede.csv"');
240 298 $response->headers->set('Content-Transfer-Encoding', 'binary');
241 299  
242 300 return $response;
243   - }
244   -
245   - public function faturamentoCsvAction(Request $request)
246   - {
247   - $em = $this->getDoctrine()->getManager();
248   -
249   - $form = $this->createForm( new LogPesquisaType() );
250   -
251   - $form->bind( $request );
252   - $data = $form->getData();
253   - $filtroLocais = array(); // Inicializa array com locais a pesquisar
254   - foreach ( $data['idLocal'] as $locais ) {
255   - array_push( $filtroLocais, $locais->getIdLocal() );
256   - }
257   -
258   - $printers = $em->getRepository( 'CacicCommonBundle:LogAcesso')
259   - ->faturamentoCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);
260   -
261   - // Gera CSV
262   - $reader = new ArrayReader($printers);
263   -
264   - // Create the workflow from the reader
265   - $workflow = new Workflow($reader);
266   -
267   - $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader));
268   -
269   - // Add the writer to the workflow
270   - $tmpfile = tempnam(sys_get_temp_dir(), 'Faturamento');
271   - $file = new \SplFileObject($tmpfile, 'w');
272   - $writer = new CsvWriter($file);
273   - $writer->writeItem(array('Local', 'Subrede','Endereço IP','Estações'));
274   - $workflow->addWriter($writer);
275   -
276   - // Process the workflow
277   - $workflow->process();
  301 + }
278 302  
279   - // Retorna o arquivo
280   - $response = new BinaryFileResponse($tmpfile);
281   - $response->headers->set('Content-Type', 'text/csv');
282   - $response->headers->set('Content-Disposition', 'attachment; filename="Faturamento.csv"');
283   - $response->headers->set('Content-Transfer-Encoding', 'binary');
284 303  
285   - return $response;
286   - }
287   - public function inativosCsvAction(Request $request)
  304 + // botão csv todos inativo
  305 + public function inativosCsvAction (Request $request)
288 306 {
289 307 $em = $this->getDoctrine()->getManager();
290 308  
... ... @@ -309,7 +327,7 @@
309 327 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader));
310 328  
311 329 // Add the writer to the workflow
312   - $tmpfile = tempnam(sys_get_temp_dir(), 'Não_Coletada');
  330 + $tmpfile = tempnam(sys_get_temp_dir(), 'Máquinas sem Coletas');
313 331 $file = new \SplFileObject($tmpfile, 'w');
314 332 $writer = new CsvWriter($file);
315 333 $writer->writeItem(array('Local', 'Subrede','Endereço IP','Estações'));
... ... @@ -321,9 +339,12 @@
321 339 // Retorna o arquivo
322 340 $response = new BinaryFileResponse($tmpfile);
323 341 $response->headers->set('Content-Type', 'text/csv');
324   - $response->headers->set('Content-Disposition', 'attachment; filename="Não Coletadas.csv"');
  342 + $response->headers->set('Content-Disposition', 'attachment; filename="Não_Coletadas.csv"');
325 343 $response->headers->set('Content-Transfer-Encoding', 'binary');
326   -}
  344 +
  345 + return $response;
  346 + }
  347 +
327 348  
328 349 /**
329 350 * Search computer with params
... ...
src/Cacic/RelatorioBundle/Resources/config/routing.yml
... ... @@ -118,7 +118,6 @@ cacic_relatorio_hardware_wmi_rel:
118 118 requirements:
119 119 _method: POST
120 120  
121   -#teste git
122 121 cacic_relatorio_software_lista:
123 122 pattern: /software/inventariados/{nmSoftware}/{nmLocal}/{idRede}
124 123 defaults: { _controller: CacicRelatorioBundle:Software:lista, nmSoftware:null, nmLocal:null, idRede:null }
... ... @@ -140,7 +139,7 @@ cacic_relatorio_inativos_rel:
140 139 _method: POST
141 140  
142 141 cacic_relatorio_inativos_listar:
143   - pattern: /inativos/{idRede}/{dtAcaoInicio}/{dtAcaoFim}
  142 + pattern: software/inativos/{idRede}/{dtAcaoInicio}/{dtAcaoFim}
144 143 defaults: { _controller: CacicRelatorioBundle:Faturamento:listarInativos, idRede: null, dtAcaoInicio: null, dtAcaoFim: null }
145 144 requirements:
146 145 idRede: \d+
... ... @@ -149,14 +148,26 @@ cacic_faturamento_csv:
149 148 pattern: /faturamento/csv
150 149 defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamentoCsv }
151 150 requirements:
152   - _method: POST
  151 + _method: GET
153 152  
154 153 cacic_inativos_csv:
155 154 pattern: /inativos/csv
156 155 defaults: { _controller: CacicRelatorioBundle:Faturamento:inativosCsv }
157 156 requirements:
  157 + _method: GET
  158 +
  159 +cacic_faturamento_csv_inicial:
  160 + pattern: /faturamento/csv
  161 + defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamentoCsv }
  162 + requirements:
158 163 _method: POST
159 164  
  165 +cacic_inativos_csv_inicial:
  166 + pattern: /inativos/csv
  167 + defaults: { _controller: CacicRelatorioBundle:Faturamento:inativosCsv }
  168 + requirements:
  169 + _method: POST
  170 +
160 171 cacic_faturamento_listar_csv:
161 172 pattern: /faturamento/listar/csv/{idRede}/{dtAcaoInicio}/{dtAcaoFim}
162 173 defaults: { _controller: CacicRelatorioBundle:Faturamento:listarCsv, idRede: null, dtAcaoInicio: null, dtAcaoFim: null }
... ... @@ -177,6 +188,8 @@ cacic_relatorio_csv_hardware_wmi_detalhe:
177 188 pattern: /csv/hardware/{classe}/{propriedade}
178 189 defaults: { _controller: CacicRelatorioBundle:Hardware:csvWMIRelatorioDetalhe }
179 190  
  191 + defaults: { _controller: CacicRelatorioBundle:Hardware:csvWMIRelatorioDetalhe }
  192 +
180 193 cacic_faturamento_computador:
181 194 pattern: /faturamento/computador
182 195 defaults: { _controller: CacicRelatorioBundle:Faturamento:computador }
183 196 \ No newline at end of file
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamento.html.twig
... ... @@ -47,15 +47,16 @@
47 47 <div class="controls">
48 48 <button type="reset" class="btn">
49 49 <i class="icon-refresh"></i>
50   - {{ "Resetar Valores"|trans }}
  50 + {{ "Resetar"|trans }}
51 51 </button>
52 52 <button type="submit" class="btn btn-primary">
53 53 <i class="icon-search"></i>
54 54 {{ 'Gerar relatório'|trans }}
55 55 </button>
56   - <button type="submit" class="btn btn-success" formaction="{{ path('cacic_faturamento_csv') }}">
  56 + <a class="btn btn-success" type="submit" href="{{ path('cacic_faturamento_csv_inicial') }}" target="_self">
57 57 <i class="icon-download-alt"></i>
58 58 {{'Gerar CSV'|trans }}
  59 + </a>
59 60 </button>
60 61 <button type="submit" class="btn btn-warning" formaction="{{ path('cacic_faturamento_listar_csv') }}">
61 62 <i class="icon-download-alt"></i>
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamentoResultado.html.twig
... ... @@ -12,12 +12,12 @@
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 <hr />
14 14  
15   - <form id="csv" action="{{ path('cacic_faturamento_csv') }}" method="post">
16   - <button class="btn btn-primary" type="submit">
17   - <i class="icon-bar-chart"></i>
18   - Gerar CSV
19   - </button>
20   - </form>
  15 + <!--Botão CSV -->
  16 + <a class="btn btn-primary" type="submit" href="{{ path('cacic_faturamento_csv') }}" title="{{ "Máquinas faturadas"|trans }}" target="_self">
  17 + <i class="icon-bar-chart"></i>
  18 + Gerar CSV
  19 + </a>
  20 + <!--Botão CSV -->
21 21  
22 22 <form id="faturamento" class="form-horizontal" method="post" >
23 23  
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativos.html.twig
... ... @@ -49,16 +49,17 @@
49 49 <div class="controls">
50 50 <button type="reset" class="btn">
51 51 <i class="icon-refresh"></i>
52   - {{ "Resetar Valores"|trans }}
  52 + {{ "Resetar"|trans }}
53 53 </button>
54 54 <button type="submit" class="btn btn-primary">
55 55 <i class="icon-search"></i>
56 56 {{ 'Gerar relatório'|trans }}
57 57 </button>
58   - <button type="submit" class="btn btn-success" formaction="{{ path('cacic_inativos_csv') }}">
59   - <i class="icon-download-alt"></i>
  58 + <a class="btn btn-success" type="submit" href="{{ path('cacic_inativos_csv_inicial') }}" target="_self">
  59 + <i class="icon-download-alt"></i>
60 60 {{'Gerar CSV'|trans }}
61   - </button>
  61 + </a>
  62 +
62 63 </div>
63 64 </div>
64 65  
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativosResultado.html.twig
... ... @@ -8,12 +8,18 @@
8 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 com total de máquinas sem Coletas por subredes'|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>
  11 + <h2 class="">{{ 'Relatório com total de máquinas sem coletas por subredes'|trans }}</h2>
13 12 <h5 class="">{{ 'Período: '|trans }}{{data['dtAcaoInicio']|date("d/m/Y") }} a {{ data['dtAcaoFim']|date("d/m/Y") }}</h5>
  13 + <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>
14 14  
15 15 <hr />
16 16  
  17 + <!--Botão CSV-->
  18 + <a class="btn btn-primary" type="submit" href="{{ path('cacic_inativos_csv') }}" title="{{ "Máquinas sem coletas"|trans }}" target="_self">
  19 + <i class="icon-bar-chart"></i>
  20 + Gerar CSV
  21 + </a>
  22 + <!--Botão CSV -->
17 23  
18 24 <form id="inativas" class="form-horizontal" method="post" >
19 25  
... ... @@ -25,11 +31,7 @@
25 31 <th width="30%" style="text-align: center">{{ "Subrede"|trans }}</th>
26 32 <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th>
27 33 <th width="20%" style="text-align: center">{{ "Estações"|trans }}</th>
28   - <th style="text-align: center">
29   - <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="_self">
30   - <i class="icon-download-alt"></i>
31   - </a>
32   - </th>
  34 + <th style="text-align: center"></th>
33 35 </tr>
34 36 </thead>
35 37  
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/listar.html.twig
... ... @@ -3,10 +3,17 @@
3 3 {% block body %}
4 4  
5 5 <h2>{{ 'Relatório de máquinas da subrede '|trans }} {{ rede }}</h2>
6   - <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>
  6 + <h5>{{ 'Relatório gerado em'|trans }} {% if idioma == 'pt_BR' %}{{ "now"|date("d/m/Y H\\hi") }}{% else %}{{ "now"|date("d/m/Y H\hi") }}{% endif %}</h5>
7 7  
8 8 <hr />
9 9  
  10 + <!--Botão CSV -->
  11 + <a class="btn btn-primary" type="submit" href="{{ path('cacic_faturamento_listar_csv',{'idRede':idRede,'dataInicio':dtAcaoInicio|trim,'dataFim':dtAcaoFim|trim})}}" title="{{ "Máquinas faturadas"|trans }}" target="_self">
  12 + <i class="icon-bar-chart"></i>
  13 + Gerar CSV
  14 + </a>
  15 + <!--Botão CSV -->
  16 +
10 17 <table class="display datatable" id="datatable">
11 18 <thead>
12 19 <tr>
... ... @@ -21,7 +28,8 @@
21 28 </thead>
22 29  
23 30 <tbody>
24   - {% for reg in dados %}
  31 +
  32 + {% for reg in dados %}
25 33 {% set computadores = reg.idComputador|split(',') %}
26 34 {% set nomes = reg.nmComputador|split(',') %}
27 35 {% set ips = reg.teIpComputador|split(',') %}
... ... @@ -51,6 +59,7 @@
51 59 <td style="text-align: center" colspan="7"><b>{{ "NENHUM REGISTRO ENCONTRADO!"|trans }}</b></td>
52 60 </tr>
53 61 {% endfor %}
  62 +
54 63 </tbody>
55 64 </table>
56 65  
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/listarInativos.html.twig
... ... @@ -2,15 +2,22 @@
2 2  
3 3 {% block body %}
4 4  
5   - <h2>{{ 'Relatório de máquinas da subrede '|trans }} {{ rede }}</h2>
  5 + <h2>{{ 'Relatório de máquinas sem coletas da subrede '|trans }} {{ rede }}</h2>
6 6 <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>
7 7  
8 8 <hr />
9 9  
  10 + <!--Botão CSV-->
  11 + <a class="btn btn-primary" type="submit" href="{{ path('cacic_inativos_listar_csv',{'idRede':idRede,'dataInicio':dtAcaoInicio|trim,'dataFim':dtAcaoFim|trim})}}" title="{{ "Máquinas sem coletas"|trans }}" target="_self">
  12 + <i class="icon-bar-chart"></i>
  13 + Gerar CSV
  14 + </a>
  15 + <!--Botão CSV-->
  16 +
10 17 <table class="display datatable" id="datatable">
11 18 <thead>
12 19 <tr>
13   - <th width="5%" style="text-align: center"></th>
  20 + <th width="5%" style="text-align: center"></th>
14 21 <th width="15%">{{ "Computador"|trans }}</th>
15 22 <th width="10%">{{ "MAC Address"|trans }}</th>
16 23 <th width="10%">{{ "Endereço IP"|trans }}</th>
... ... @@ -32,6 +39,7 @@
32 39 <td><span class="{% if reg.inMswindows == 'S' %}red{% else %}blue{% endif %}">{{ reg.sgSo }}</span></td>
33 40 <td>{{ reg.nmLocal }}</td>
34 41 <td>{{ reg.nmRede }} / {{ reg.teIpRede }}</td>
  42 +
35 43 </tr>
36 44 {% else %}
37 45 <tr>
... ...