Commit 51f0da63e2fb12038007edbb650d4a263754909a
1 parent
8b2a3b7c
Exists in
master
and in
1 other branch
Colocando exportação CSV
Showing
11 changed files
with
521 additions
and
202 deletions
Show diff stats
src/Cacic/CommonBundle/Entity/ComputadorRepository.php
| @@ -358,5 +358,75 @@ class ComputadorRepository extends EntityRepository | @@ -358,5 +358,75 @@ class ComputadorRepository extends EntityRepository | ||
| 358 | 358 | ||
| 359 | return $query->getQuery()->execute(); | 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,8 +102,56 @@ class LogAcessoRepository extends EntityRepository | ||
| 102 | ->andWhere( 'log.data >= (current_date() - 30)' ); | 102 | ->andWhere( 'log.data >= (current_date() - 30)' ); |
| 103 | 103 | ||
| 104 | return $query->getQuery()->execute(); | 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/Resources/views/base.html.twig
| @@ -139,7 +139,7 @@ | @@ -139,7 +139,7 @@ | ||
| 139 | </li> | 139 | </li> |
| 140 | <li><a class="round_top" href="{{ path('cacic_relatorio_autorizacoes') }}">{{ "Autorizações"|trans }}</a></li> | 140 | <li><a class="round_top" href="{{ path('cacic_relatorio_autorizacoes') }}">{{ "Autorizações"|trans }}</a></li> |
| 141 | <li><a class="round_top" href="{{ path('cacic_relatorio_faturamento') }}">{{ "Faturamento"|trans }}</a></li> | 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 | <li><a class="round_top" href="{{ path('cacic_relatorio_patrimonio') }}">{{ "Patrimônio"|trans }}</a></li> | 143 | <li><a class="round_top" href="{{ path('cacic_relatorio_patrimonio') }}">{{ "Patrimônio"|trans }}</a></li> |
| 144 | </ul> | 144 | </ul> |
| 145 | </li> | 145 | </li> |
src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
| @@ -3,22 +3,28 @@ | @@ -3,22 +3,28 @@ | ||
| 3 | namespace Cacic\RelatorioBundle\Controller; | 3 | namespace Cacic\RelatorioBundle\Controller; |
| 4 | 4 | ||
| 5 | use Cacic\CommonBundle\Entity\ComputadorColetaRepository; | 5 | use Cacic\CommonBundle\Entity\ComputadorColetaRepository; |
| 6 | + use Ddeboer\DataImport\ValueConverter\ArrayValueConverterMap; | ||
| 7 | + use Ddeboer\DataImport\ValueConverter\CharsetValueConverter; | ||
| 6 | use Doctrine\Common\Util\Debug; | 8 | use Doctrine\Common\Util\Debug; |
| 7 | use Symfony\Component\HttpFoundation\Request; | 9 | use Symfony\Component\HttpFoundation\Request; |
| 8 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 10 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
| 9 | use Cacic\CommonBundle\Form\Type\LogPesquisaType; | 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 | class FaturamentoController extends Controller { | 19 | class FaturamentoController extends Controller { |
| 13 | 20 | ||
| 14 | 21 | ||
| 15 | - public function indexAction(Request $request) { | 22 | + public function faturamentoAction(Request $request) { |
| 16 | 23 | ||
| 17 | $locale = $request->getLocale(); | 24 | $locale = $request->getLocale(); |
| 18 | 25 | ||
| 19 | $form = $this->createForm( new LogPesquisaType() ); | 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 | array( | 28 | array( |
| 23 | 'locale'=> $locale, | 29 | 'locale'=> $locale, |
| 24 | 'form' => $form->createView() | 30 | 'form' => $form->createView() |
| @@ -27,6 +33,7 @@ | @@ -27,6 +33,7 @@ | ||
| 27 | } | 33 | } |
| 28 | 34 | ||
| 29 | public function faturamentoRelatorioAction(Request $request){ | 35 | public function faturamentoRelatorioAction(Request $request){ |
| 36 | + | ||
| 30 | $locale = $request->getLocale(); | 37 | $locale = $request->getLocale(); |
| 31 | $form = $this->createForm( new LogPesquisaType() ); | 38 | $form = $this->createForm( new LogPesquisaType() ); |
| 32 | if ( $request->isMethod('POST') ) | 39 | if ( $request->isMethod('POST') ) |
| @@ -43,7 +50,7 @@ | @@ -43,7 +50,7 @@ | ||
| 43 | ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); | 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 | array( | 54 | array( |
| 48 | 'idioma'=> $locale, | 55 | 'idioma'=> $locale, |
| 49 | 'form' => $form->createView(), | 56 | 'form' => $form->createView(), |
| @@ -74,7 +81,44 @@ | @@ -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 | public function inativosAction(Request $request) { | 122 | public function inativosAction(Request $request) { |
| 79 | 123 | ||
| 80 | $locale = $request->getLocale(); | 124 | $locale = $request->getLocale(); |
| @@ -141,6 +185,128 @@ | @@ -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,7 +4,7 @@ cacic_relatorio_autorizacoes: | ||
| 4 | 4 | ||
| 5 | cacic_relatorio_faturamento: | 5 | cacic_relatorio_faturamento: |
| 6 | pattern: /faturamento | 6 | pattern: /faturamento |
| 7 | - defaults: { _controller: CacicRelatorioBundle:Faturamento:index } | 7 | + defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamento } |
| 8 | requirements: | 8 | requirements: |
| 9 | _method: GET | 9 | _method: GET |
| 10 | 10 | ||
| @@ -144,3 +144,26 @@ cacic_relatorio_inativos_listar: | @@ -144,3 +144,26 @@ cacic_relatorio_inativos_listar: | ||
| 144 | requirements: | 144 | requirements: |
| 145 | idRede: \d+ | 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 | \ No newline at end of file | 170 | \ No newline at end of file |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/acessoResultado.html.twig
| @@ -1,68 +0,0 @@ | @@ -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 | \ No newline at end of file | 0 | \ No newline at end of file |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamento.html.twig
0 → 100644
| @@ -0,0 +1,121 @@ | @@ -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 | \ No newline at end of file | 122 | \ No newline at end of file |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/faturamentoResultado.html.twig
0 → 100644
| @@ -0,0 +1,70 @@ | @@ -0,0 +1,70 @@ | ||
| 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 | + <a class="btn btn-success" href="{{ path('cacic_faturamento_listar_csv') }}/{{ logs[0]['idRede'] }}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank"> | ||
| 28 | + <i class="icon-download-alt"></i> | ||
| 29 | + </a> | ||
| 30 | + </th> | ||
| 31 | + </tr> | ||
| 32 | + </thead> | ||
| 33 | + | ||
| 34 | + <tbody> | ||
| 35 | + {% for log in logs %} | ||
| 36 | + | ||
| 37 | + <tr> | ||
| 38 | + <td style="text-align: center">{{ loop.index }}</td> | ||
| 39 | + <td> | ||
| 40 | + <b><a href="{{ path('cacic_relatorio_faturamento_listar') }}/{{ log['idRede'] }}/{{data['dtAcaoInicio'] }}/{{ data['dtAcaoFim'] }}" title="{{ "Máquinas faturadas"|trans }}" target="_blank"> | ||
| 41 | + {{ log['nmLocal'] }}</a></b> | ||
| 42 | + </td> | ||
| 43 | + <td>{{ log['nmRede'] }}</td> | ||
| 44 | + <td>{{ log['teIpRede'] }}</td> | ||
| 45 | + <td>{{ log['numComp'] }}</td> | ||
| 46 | + <td> | ||
| 47 | + <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"> | ||
| 48 | + <i class="icon-search"></i> | ||
| 49 | + </a> | ||
| 50 | + </td> | ||
| 51 | + </tr> | ||
| 52 | + | ||
| 53 | + {% else %} | ||
| 54 | + <tr> | ||
| 55 | + <td style="text-align: center;" colspan="4"><b>{{ "NENHUM REGISTRO ENCONTRADO!"|trans }}</b></td> | ||
| 56 | + </tr> | ||
| 57 | + {% endfor %} | ||
| 58 | + | ||
| 59 | + </tbody> | ||
| 60 | + </table> | ||
| 61 | + | ||
| 62 | + | ||
| 63 | + </form> | ||
| 64 | + | ||
| 65 | + </div> <!-- /block --> | ||
| 66 | + </div> <!-- /box --> | ||
| 67 | + </div> <!-- /span --> | ||
| 68 | +</div> <!-- /row --> | ||
| 69 | + | ||
| 70 | +{% endblock %} | ||
| 0 | \ No newline at end of file | 71 | \ No newline at end of file |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativos.html.twig
| 1 | {% extends 'CacicCommonBundle::base.html.twig' %} | 1 | {% extends 'CacicCommonBundle::base.html.twig' %} |
| 2 | 2 | ||
| 3 | {% block breadcrumb %} | 3 | {% block breadcrumb %} |
| 4 | - <li class="active">{{ 'Inativos'|trans }}</li> | 4 | + <li class="active">{{ 'Não Coletada'|trans }}</li> |
| 5 | {% endblock %} | 5 | {% endblock %} |
| 6 | 6 | ||
| 7 | {% block body %} | 7 | {% block body %} |
| @@ -11,19 +11,19 @@ | @@ -11,19 +11,19 @@ | ||
| 11 | <div class="span8"> | 11 | <div class="span8"> |
| 12 | <div class="box grad_colour_black"> | 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 | <div class="block box_content round_bottom padding_10"> | 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 | <div class="control-group"> | 22 | <div class="control-group"> |
| 23 | <label for="log_acesso_periodo" class="control-label">{{ 'Período'|trans }}</label> | 23 | <label for="log_acesso_periodo" class="control-label">{{ 'Período'|trans }}</label> |
| 24 | <div class="controls"> | 24 | <div class="controls"> |
| 25 | {{ form_widget(form.dtAcaoInicio, { 'attr': {'class': 'datepicker_on'} }) }} a {{ form_widget(form.dtAcaoFim, { 'attr': {'class': 'datepicker_on'} }) }} | 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 | </div> | 27 | </div> |
| 28 | </div> | 28 | </div> |
| 29 | 29 | ||
| @@ -52,6 +52,10 @@ | @@ -52,6 +52,10 @@ | ||
| 52 | <i class="icon-search"></i> | 52 | <i class="icon-search"></i> |
| 53 | {{ 'Gerar relatório'|trans }} | 53 | {{ 'Gerar relatório'|trans }} |
| 54 | </button> | 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 | </div> | 59 | </div> |
| 56 | </div> | 60 | </div> |
| 57 | 61 | ||
| @@ -67,7 +71,7 @@ | @@ -67,7 +71,7 @@ | ||
| 67 | 71 | ||
| 68 | <div class="block box_content round_bottom padding_10"> | 72 | <div class="block box_content round_bottom padding_10"> |
| 69 | <p> | 73 | <p> |
| 70 | - {{ "Faturamento"|trans }}. | 74 | + {{ "Sem coletas"|trans }}. |
| 71 | </p> | 75 | </p> |
| 72 | <p> | 76 | <p> |
| 73 | {{ "O período é obrigatório"|trans }}. | 77 | {{ "O período é obrigatório"|trans }}. |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativosResultado.html.twig
| @@ -5,27 +5,29 @@ | @@ -5,27 +5,29 @@ | ||
| 5 | <div class="row-fluid"> | 5 | <div class="row-fluid"> |
| 6 | <div class="span12"> | 6 | <div class="span12"> |
| 7 | <div class="box grad_colour_black"> | 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 | <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 sem Coletas'|trans }}</h2> | 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> | 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 | <hr /> | 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 | <table class="table table-striped table-bordered"> | 19 | <table class="table table-striped table-bordered"> |
| 20 | <thead> | 20 | <thead> |
| 21 | <tr> | 21 | <tr> |
| 22 | <th width="10%" style="text-align: center"></th> | 22 | <th width="10%" style="text-align: center"></th> |
| 23 | <th width="20%">{{ "Local"|trans }}</th> | 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 | <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th> | 25 | <th width="20%" style="text-align: center">{{ "Endereço IP"|trans }}</th> |
| 26 | <th width="20%" style="text-align: center">{{ "Estações"|trans }}</th> | 26 | <th width="20%" style="text-align: center">{{ "Estações"|trans }}</th> |
| 27 | <th style="text-align: center"> | 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 | </th> | 31 | </th> |
| 30 | </tr> | 32 | </tr> |
| 31 | </thead> | 33 | </thead> |
src/Cacic/RelatorioBundle/Resources/views/Faturamento/index.html.twig
| @@ -1,117 +0,0 @@ | @@ -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 | \ No newline at end of file | 0 | \ No newline at end of file |