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,7 +463,7 @@ class ComputadorRepository extends EntityRepository
463 // Monta a Consulta básica... 463 // Monta a Consulta básica...
464 $query = $this->createQueryBuilder('comp') 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 ->innerJoin('comp.idSo', 'so') 467 ->innerJoin('comp.idSo', 'so')
468 ->innerJoin('comp.idRede', 'rede') 468 ->innerJoin('comp.idRede', 'rede')
469 ->innerJoin('rede.idLocal', 'loc'); 469 ->innerJoin('rede.idLocal', 'loc');
src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 17
18 class FaturamentoController extends Controller { 18 class FaturamentoController extends Controller {
19 19
20 - 20 + //Página inicial faturamento
21 public function faturamentoAction(Request $request) { 21 public function faturamentoAction(Request $request) {
22 22
23 $locale = $request->getLocale(); 23 $locale = $request->getLocale();
@@ -31,10 +31,12 @@ @@ -31,10 +31,12 @@
31 ); 31 );
32 } 32 }
33 33
  34 + //Página que exibe todas as regionais faturamento
34 public function faturamentoRelatorioAction(Request $request){ 35 public function faturamentoRelatorioAction(Request $request){
35 36
36 $locale = $request->getLocale(); 37 $locale = $request->getLocale();
37 $form = $this->createForm( new LogPesquisaType() ); 38 $form = $this->createForm( new LogPesquisaType() );
  39 +
38 if ( $request->isMethod('POST') ) 40 if ( $request->isMethod('POST') )
39 { 41 {
40 $form->bind( $request ); 42 $form->bind( $request );
@@ -67,8 +69,53 @@ @@ -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 $dataInicio = $request->get('dtAcaoInicio'); 120 $dataInicio = $request->get('dtAcaoInicio');
74 $dataFim = $request->get('dtAcaoFim'); 121 $dataFim = $request->get('dtAcaoFim');
@@ -77,19 +124,25 @@ @@ -77,19 +124,25 @@
77 $locale = $request->getLocale(); 124 $locale = $request->getLocale();
78 $dados = $this->getDoctrine() 125 $dados = $this->getDoctrine()
79 ->getRepository('CacicCommonBundle:LogAcesso') 126 ->getRepository('CacicCommonBundle:LogAcesso')
80 - ->gerarRelatorioRede($filtros = array(),$idRede, $dataInicio, $dataFim); 127 + ->gerarRelatorioRede($filtros = array(),$idRede, $dataInicio, $dataFim);
  128 +
81 129
82 return $this->render( 130 return $this->render(
83 'CacicRelatorioBundle:Faturamento:listar.html.twig', 131 'CacicRelatorioBundle:Faturamento:listar.html.twig',
84 array( 132 array(
85 'rede'=> $dados[0]['nmRede'], 133 'rede'=> $dados[0]['nmRede'],
86 'idioma'=> $locale, 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 $dataInicio = $request->get('dtAcaoInicio'); 147 $dataInicio = $request->get('dtAcaoInicio');
95 $dataFim = $request->get('dtAcaoFim'); 148 $dataFim = $request->get('dtAcaoFim');
@@ -97,7 +150,7 @@ @@ -97,7 +150,7 @@
97 150
98 $printers = $this->getDoctrine() 151 $printers = $this->getDoctrine()
99 ->getRepository('CacicCommonBundle:LogAcesso') 152 ->getRepository('CacicCommonBundle:LogAcesso')
100 - ->listarCsv($filtros = array(), $idRede, $dataInicio, $dataFim); 153 + ->listarCsv($filtros = array(),$idRede, $dataInicio , $dataFim);
101 154
102 155
103 // Gera CSV 156 // Gera CSV
@@ -106,11 +159,6 @@ @@ -106,11 +159,6 @@
106 // Create the workflow from the reader 159 // Create the workflow from the reader
107 $workflow = new Workflow($reader); 160 $workflow = new Workflow($reader);
108 161
109 -  
110 -  
111 - // Create the workflow from the reader  
112 - $workflow = new Workflow($reader);  
113 -  
114 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); 162 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader));
115 163
116 // Add the writer to the workflow 164 // Add the writer to the workflow
@@ -126,11 +174,15 @@ @@ -126,11 +174,15 @@
126 // Retorna o arquivo 174 // Retorna o arquivo
127 $response = new BinaryFileResponse($tmpfile); 175 $response = new BinaryFileResponse($tmpfile);
128 $response->headers->set('Content-Type', 'text/csv'); 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 $response->headers->set('Content-Transfer-Encoding', 'binary'); 178 $response->headers->set('Content-Transfer-Encoding', 'binary');
131 179
132 return $response; 180 return $response;
  181 +
133 } 182 }
  183 +
  184 +
  185 + //Página inicial inativos
134 public function inativosAction(Request $request) { 186 public function inativosAction(Request $request) {
135 187
136 $locale = $request->getLocale(); 188 $locale = $request->getLocale();
@@ -145,21 +197,20 @@ @@ -145,21 +197,20 @@
145 ); 197 );
146 } 198 }
147 199
  200 + //Página que exibe todas as regionais inativos
148 public function inativosRelatorioAction(Request $request){ 201 public function inativosRelatorioAction(Request $request){
149 - $locale = $request->getLocale();  
150 202
  203 + $locale = $request->getLocale();
151 $form = $this->createForm( new LogPesquisaType() ); 204 $form = $this->createForm( new LogPesquisaType() );
152 205
153 -  
154 if ( $request->isMethod('POST') ) 206 if ( $request->isMethod('POST') )
155 { 207 {
156 $form->bind( $request ); 208 $form->bind( $request );
157 $data = $form->getData(); 209 $data = $form->getData();
158 $filtroLocais = array(); // Inicializa array com locais a pesquisar 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 $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Computador') 215 $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Computador')
165 ->pesquisarInativos( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); 216 ->pesquisarInativos( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);
@@ -171,6 +222,7 @@ @@ -171,6 +222,7 @@
171 } 222 }
172 } 223 }
173 224
  225 +
174 return $this->render( 'CacicRelatorioBundle:Faturamento:inativosResultado.html.twig', 226 return $this->render( 'CacicRelatorioBundle:Faturamento:inativosResultado.html.twig',
175 array( 227 array(
176 'idioma'=> $locale, 228 'idioma'=> $locale,
@@ -182,6 +234,7 @@ @@ -182,6 +234,7 @@
182 ); 234 );
183 } 235 }
184 236
  237 + //Página que exibe cada regional inativos
185 public function listarInativosAction( Request $request, $idRede) { 238 public function listarInativosAction( Request $request, $idRede) {
186 239
187 240
@@ -194,97 +247,62 @@ @@ -194,97 +247,62 @@
194 ->getRepository('CacicCommonBundle:Computador') 247 ->getRepository('CacicCommonBundle:Computador')
195 ->gerarRelatorioRede($filtros = array(),$idRede, $dataInicio, $dataFim); 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 array( 252 array(
200 'rede'=> $dados[0]['nmRede'], 253 'rede'=> $dados[0]['nmRede'],
201 'idioma'=> $locale, 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 $dataInicio = $request->get('dtAcaoInicio'); 267 $dataInicio = $request->get('dtAcaoInicio');
210 $dataFim = $request->get('dtAcaoFim'); 268 $dataFim = $request->get('dtAcaoFim');
211 $idRede = $request->get('idRede'); 269 $idRede = $request->get('idRede');
212 270
213 $printers = $this->getDoctrine() 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 $reader = new ArrayReader($printers); 277 $reader = new ArrayReader($printers);
220 278
221 - // Create the workflow from the reader 279 + // Create the workflow from the reader
222 $workflow = new Workflow($reader); 280 $workflow = new Workflow($reader);
223 281
224 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); 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 $file = new \SplFileObject($tmpfile, 'w'); 286 $file = new \SplFileObject($tmpfile, 'w');
229 $writer = new CsvWriter($file); 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 $workflow->addWriter($writer); 289 $workflow->addWriter($writer);
232 290
233 - // Process the workflow 291 + // Process the workflow
234 $workflow->process(); 292 $workflow->process();
235 293
236 - // Retorna o arquivo 294 + // Retorna o arquivo
237 $response = new BinaryFileResponse($tmpfile); 295 $response = new BinaryFileResponse($tmpfile);
238 $response->headers->set('Content-Type', 'text/csv'); 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 $response->headers->set('Content-Transfer-Encoding', 'binary'); 298 $response->headers->set('Content-Transfer-Encoding', 'binary');
241 299
242 return $response; 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 $em = $this->getDoctrine()->getManager(); 307 $em = $this->getDoctrine()->getManager();
290 308
@@ -309,7 +327,7 @@ @@ -309,7 +327,7 @@
309 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); 327 $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader));
310 328
311 // Add the writer to the workflow 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 $file = new \SplFileObject($tmpfile, 'w'); 331 $file = new \SplFileObject($tmpfile, 'w');
314 $writer = new CsvWriter($file); 332 $writer = new CsvWriter($file);
315 $writer->writeItem(array('Local', 'Subrede','Endereço IP','Estações')); 333 $writer->writeItem(array('Local', 'Subrede','Endereço IP','Estações'));
@@ -321,9 +339,12 @@ @@ -321,9 +339,12 @@
321 // Retorna o arquivo 339 // Retorna o arquivo
322 $response = new BinaryFileResponse($tmpfile); 340 $response = new BinaryFileResponse($tmpfile);
323 $response->headers->set('Content-Type', 'text/csv'); 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 $response->headers->set('Content-Transfer-Encoding', 'binary'); 343 $response->headers->set('Content-Transfer-Encoding', 'binary');
326 -} 344 +
  345 + return $response;
  346 + }
  347 +
327 348
328 /** 349 /**
329 * Search computer with params 350 * Search computer with params
src/Cacic/RelatorioBundle/Resources/config/routing.yml
@@ -118,7 +118,6 @@ cacic_relatorio_hardware_wmi_rel: @@ -118,7 +118,6 @@ cacic_relatorio_hardware_wmi_rel:
118 requirements: 118 requirements:
119 _method: POST 119 _method: POST
120 120
121 -#teste git  
122 cacic_relatorio_software_lista: 121 cacic_relatorio_software_lista:
123 pattern: /software/inventariados/{nmSoftware}/{nmLocal}/{idRede} 122 pattern: /software/inventariados/{nmSoftware}/{nmLocal}/{idRede}
124 defaults: { _controller: CacicRelatorioBundle:Software:lista, nmSoftware:null, nmLocal:null, idRede:null } 123 defaults: { _controller: CacicRelatorioBundle:Software:lista, nmSoftware:null, nmLocal:null, idRede:null }
@@ -140,7 +139,7 @@ cacic_relatorio_inativos_rel: @@ -140,7 +139,7 @@ cacic_relatorio_inativos_rel:
140 _method: POST 139 _method: POST
141 140
142 cacic_relatorio_inativos_listar: 141 cacic_relatorio_inativos_listar:
143 - pattern: /inativos/{idRede}/{dtAcaoInicio}/{dtAcaoFim} 142 + pattern: software/inativos/{idRede}/{dtAcaoInicio}/{dtAcaoFim}
144 defaults: { _controller: CacicRelatorioBundle:Faturamento:listarInativos, idRede: null, dtAcaoInicio: null, dtAcaoFim: null } 143 defaults: { _controller: CacicRelatorioBundle:Faturamento:listarInativos, idRede: null, dtAcaoInicio: null, dtAcaoFim: null }
145 requirements: 144 requirements:
146 idRede: \d+ 145 idRede: \d+
@@ -149,14 +148,26 @@ cacic_faturamento_csv: @@ -149,14 +148,26 @@ cacic_faturamento_csv:
149 pattern: /faturamento/csv 148 pattern: /faturamento/csv
150 defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamentoCsv } 149 defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamentoCsv }
151 requirements: 150 requirements:
152 - _method: POST 151 + _method: GET
153 152
154 cacic_inativos_csv: 153 cacic_inativos_csv:
155 pattern: /inativos/csv 154 pattern: /inativos/csv
156 defaults: { _controller: CacicRelatorioBundle:Faturamento:inativosCsv } 155 defaults: { _controller: CacicRelatorioBundle:Faturamento:inativosCsv }
157 requirements: 156 requirements:
  157 + _method: GET
  158 +
  159 +cacic_faturamento_csv_inicial:
  160 + pattern: /faturamento/csv
  161 + defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamentoCsv }
  162 + requirements:
158 _method: POST 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 cacic_faturamento_listar_csv: 171 cacic_faturamento_listar_csv:
161 pattern: /faturamento/listar/csv/{idRede}/{dtAcaoInicio}/{dtAcaoFim} 172 pattern: /faturamento/listar/csv/{idRede}/{dtAcaoInicio}/{dtAcaoFim}
162 defaults: { _controller: CacicRelatorioBundle:Faturamento:listarCsv, idRede: null, dtAcaoInicio: null, dtAcaoFim: null } 173 defaults: { _controller: CacicRelatorioBundle:Faturamento:listarCsv, idRede: null, dtAcaoInicio: null, dtAcaoFim: null }
@@ -177,6 +188,8 @@ cacic_relatorio_csv_hardware_wmi_detalhe: @@ -177,6 +188,8 @@ cacic_relatorio_csv_hardware_wmi_detalhe:
177 pattern: /csv/hardware/{classe}/{propriedade} 188 pattern: /csv/hardware/{classe}/{propriedade}
178 defaults: { _controller: CacicRelatorioBundle:Hardware:csvWMIRelatorioDetalhe } 189 defaults: { _controller: CacicRelatorioBundle:Hardware:csvWMIRelatorioDetalhe }
179 190
  191 + defaults: { _controller: CacicRelatorioBundle:Hardware:csvWMIRelatorioDetalhe }
  192 +
180 cacic_faturamento_computador: 193 cacic_faturamento_computador:
181 pattern: /faturamento/computador 194 pattern: /faturamento/computador
182 defaults: { _controller: CacicRelatorioBundle:Faturamento:computador } 195 defaults: { _controller: CacicRelatorioBundle:Faturamento:computador }
183 \ No newline at end of file 196 \ No newline at end of file
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamento.html.twig
@@ -47,15 +47,16 @@ @@ -47,15 +47,16 @@
47 <div class="controls"> 47 <div class="controls">
48 <button type="reset" class="btn"> 48 <button type="reset" class="btn">
49 <i class="icon-refresh"></i> 49 <i class="icon-refresh"></i>
50 - {{ "Resetar Valores"|trans }} 50 + {{ "Resetar"|trans }}
51 </button> 51 </button>
52 <button type="submit" class="btn btn-primary"> 52 <button type="submit" class="btn btn-primary">
53 <i class="icon-search"></i> 53 <i class="icon-search"></i>
54 {{ 'Gerar relatório'|trans }} 54 {{ 'Gerar relatório'|trans }}
55 </button> 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 <i class="icon-download-alt"></i> 57 <i class="icon-download-alt"></i>
58 {{'Gerar CSV'|trans }} 58 {{'Gerar CSV'|trans }}
  59 + </a>
59 </button> 60 </button>
60 <button type="submit" class="btn btn-warning" formaction="{{ path('cacic_faturamento_listar_csv') }}"> 61 <button type="submit" class="btn btn-warning" formaction="{{ path('cacic_faturamento_listar_csv') }}">
61 <i class="icon-download-alt"></i> 62 <i class="icon-download-alt"></i>
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamentoResultado.html.twig
@@ -12,12 +12,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> 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 <hr /> 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 <form id="faturamento" class="form-horizontal" method="post" > 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,16 +49,17 @@
49 <div class="controls"> 49 <div class="controls">
50 <button type="reset" class="btn"> 50 <button type="reset" class="btn">
51 <i class="icon-refresh"></i> 51 <i class="icon-refresh"></i>
52 - {{ "Resetar Valores"|trans }} 52 + {{ "Resetar"|trans }}
53 </button> 53 </button>
54 <button type="submit" class="btn btn-primary"> 54 <button type="submit" class="btn btn-primary">
55 <i class="icon-search"></i> 55 <i class="icon-search"></i>
56 {{ 'Gerar relatório'|trans }} 56 {{ 'Gerar relatório'|trans }}
57 </button> 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 {{'Gerar CSV'|trans }} 60 {{'Gerar CSV'|trans }}
61 - </button> 61 + </a>
  62 +
62 </div> 63 </div>
63 </div> 64 </div>
64 65
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativosResultado.html.twig
@@ -8,12 +8,18 @@ @@ -8,12 +8,18 @@
8 <h2 class="box_head round_top"><i class="icon-list"></i> {{'Total de estações sem coletas' |trans }}</h2> 8 <h2 class="box_head round_top"><i class="icon-list"></i> {{'Total de estações sem coletas' |trans }}</h2>
9 <div class="block box_content round_bottom padding_10"> 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 <h5 class="">{{ 'Período: '|trans }}{{data['dtAcaoInicio']|date("d/m/Y") }} a {{ data['dtAcaoFim']|date("d/m/Y") }}</h5> 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 <hr /> 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 <form id="inativas" class="form-horizontal" method="post" > 24 <form id="inativas" class="form-horizontal" method="post" >
19 25
@@ -25,11 +31,7 @@ @@ -25,11 +31,7 @@
25 <th width="30%" style="text-align: center">{{ "Subrede"|trans }}</th> 31 <th width="30%" style="text-align: center">{{ "Subrede"|trans }}</th>
26 <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th> 32 <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th>
27 <th width="20%" style="text-align: center">{{ "Estações"|trans }}</th> 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 </tr> 35 </tr>
34 </thead> 36 </thead>
35 37
src/Cacic/RelatorioBundle/Resources/views/Faturamento/listar.html.twig
@@ -3,10 +3,17 @@ @@ -3,10 +3,17 @@
3 {% block body %} 3 {% block body %}
4 4
5 <h2>{{ 'Relatório de máquinas da subrede '|trans }} {{ rede }}</h2> 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 <hr /> 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 <table class="display datatable" id="datatable"> 17 <table class="display datatable" id="datatable">
11 <thead> 18 <thead>
12 <tr> 19 <tr>
@@ -21,7 +28,8 @@ @@ -21,7 +28,8 @@
21 </thead> 28 </thead>
22 29
23 <tbody> 30 <tbody>
24 - {% for reg in dados %} 31 +
  32 + {% for reg in dados %}
25 {% set computadores = reg.idComputador|split(',') %} 33 {% set computadores = reg.idComputador|split(',') %}
26 {% set nomes = reg.nmComputador|split(',') %} 34 {% set nomes = reg.nmComputador|split(',') %}
27 {% set ips = reg.teIpComputador|split(',') %} 35 {% set ips = reg.teIpComputador|split(',') %}
@@ -51,6 +59,7 @@ @@ -51,6 +59,7 @@
51 <td style="text-align: center" colspan="7"><b>{{ "NENHUM REGISTRO ENCONTRADO!"|trans }}</b></td> 59 <td style="text-align: center" colspan="7"><b>{{ "NENHUM REGISTRO ENCONTRADO!"|trans }}</b></td>
52 </tr> 60 </tr>
53 {% endfor %} 61 {% endfor %}
  62 +
54 </tbody> 63 </tbody>
55 </table> 64 </table>
56 65
src/Cacic/RelatorioBundle/Resources/views/Faturamento/listarInativos.html.twig
@@ -2,15 +2,22 @@ @@ -2,15 +2,22 @@
2 2
3 {% block body %} 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 <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("m/d/Y H\\hi") }}{% endif %}</h5>
7 7
8 <hr /> 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 <table class="display datatable" id="datatable"> 17 <table class="display datatable" id="datatable">
11 <thead> 18 <thead>
12 <tr> 19 <tr>
13 - <th width="5%" style="text-align: center"></th> 20 + <th width="5%" style="text-align: center"></th>
14 <th width="15%">{{ "Computador"|trans }}</th> 21 <th width="15%">{{ "Computador"|trans }}</th>
15 <th width="10%">{{ "MAC Address"|trans }}</th> 22 <th width="10%">{{ "MAC Address"|trans }}</th>
16 <th width="10%">{{ "Endereço IP"|trans }}</th> 23 <th width="10%">{{ "Endereço IP"|trans }}</th>
@@ -32,6 +39,7 @@ @@ -32,6 +39,7 @@
32 <td><span class="{% if reg.inMswindows == 'S' %}red{% else %}blue{% endif %}">{{ reg.sgSo }}</span></td> 39 <td><span class="{% if reg.inMswindows == 'S' %}red{% else %}blue{% endif %}">{{ reg.sgSo }}</span></td>
33 <td>{{ reg.nmLocal }}</td> 40 <td>{{ reg.nmLocal }}</td>
34 <td>{{ reg.nmRede }} / {{ reg.teIpRede }}</td> 41 <td>{{ reg.nmRede }} / {{ reg.teIpRede }}</td>
  42 +
35 </tr> 43 </tr>
36 {% else %} 44 {% else %}
37 <tr> 45 <tr>