Commit 8ef4bc8ce4e303a2dbc355aa30f36922d4027733
1 parent
090360d5
Exists in
master
and in
1 other branch
Acrescentar total de máquinas no final dos relatório
Showing
1 changed file
with
27 additions
and
21 deletions
Show diff stats
src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | - namespace Cacic\RelatorioBundle\Controller; | ||
| 4 | - | ||
| 5 | - use Cacic\CommonBundle\Entity\ComputadorColetaRepository; | ||
| 6 | - use Ddeboer\DataImport\ValueConverter\ArrayValueConverterMap; | ||
| 7 | - use Ddeboer\DataImport\ValueConverter\CharsetValueConverter; | ||
| 8 | - use Doctrine\Common\Util\Debug; | ||
| 9 | - use Symfony\Component\HttpFoundation\Request; | ||
| 10 | - use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
| 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; | 2 | + namespace Cacic\RelatorioBundle\Controller; |
| 3 | + use Cacic\CommonBundle\Entity\ComputadorColetaRepository; | ||
| 4 | + use Ddeboer\DataImport\ValueConverter\ArrayValueConverterMap; | ||
| 5 | + use Ddeboer\DataImport\ValueConverter\CharsetValueConverter; | ||
| 6 | + use Doctrine\Common\Util\Debug; | ||
| 7 | + use Symfony\Component\HttpFoundation\Request; | ||
| 8 | + use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
| 9 | + use Cacic\CommonBundle\Form\Type\LogPesquisaType; | ||
| 10 | + use Ddeboer\DataImport\Workflow; | ||
| 11 | + use Ddeboer\DataImport\Reader\ArrayReader; | ||
| 12 | + use Ddeboer\DataImport\Writer\CsvWriter; | ||
| 13 | + use Ddeboer\DataImport\ValueConverter\CallbackValueConverter; | ||
| 14 | + use Symfony\Component\HttpFoundation\BinaryFileResponse; | ||
| 17 | 15 | ||
| 18 | 16 | ||
| 19 | class FaturamentoController extends Controller { | 17 | class FaturamentoController extends Controller { |
| @@ -48,6 +46,11 @@ | @@ -48,6 +46,11 @@ | ||
| 48 | 46 | ||
| 49 | $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso') | 47 | $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso') |
| 50 | ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); | 48 | ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); |
| 49 | + | ||
| 50 | + foreach ($logs as $cont ){ | ||
| 51 | + $TotalnumComp = $cont['numComp']; | ||
| 52 | + } | ||
| 53 | + | ||
| 51 | } | 54 | } |
| 52 | 55 | ||
| 53 | return $this->render( 'CacicRelatorioBundle:Faturamento:faturamentoResultado.html.twig', | 56 | return $this->render( 'CacicRelatorioBundle:Faturamento:faturamentoResultado.html.twig', |
| @@ -55,7 +58,8 @@ | @@ -55,7 +58,8 @@ | ||
| 55 | 'idioma'=> $locale, | 58 | 'idioma'=> $locale, |
| 56 | 'form' => $form->createView(), | 59 | 'form' => $form->createView(), |
| 57 | 'data' =>$data, | 60 | 'data' =>$data, |
| 58 | - 'logs' => ( isset( $logs ) ? $logs : null ) | 61 | + 'logs' => ( isset( $logs ) ? $logs : null ), |
| 62 | + 'totalnumcomp' => $TotalnumComp | ||
| 59 | ) | 63 | ) |
| 60 | ); | 64 | ); |
| 61 | } | 65 | } |
| @@ -99,6 +103,11 @@ | @@ -99,6 +103,11 @@ | ||
| 99 | // Create the workflow from the reader | 103 | // Create the workflow from the reader |
| 100 | $workflow = new Workflow($reader); | 104 | $workflow = new Workflow($reader); |
| 101 | 105 | ||
| 106 | + | ||
| 107 | + | ||
| 108 | + // Create the workflow from the reader | ||
| 109 | + $workflow = new Workflow($reader); | ||
| 110 | + | ||
| 102 | $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); | 111 | $workflow->addValueConverter("reader",new CharsetValueConverter('UTF-8',$reader)); |
| 103 | 112 | ||
| 104 | // Add the writer to the workflow | 113 | // Add the writer to the workflow |
| @@ -305,8 +314,5 @@ | @@ -305,8 +314,5 @@ | ||
| 305 | $response->headers->set('Content-Type', 'text/csv'); | 314 | $response->headers->set('Content-Type', 'text/csv'); |
| 306 | $response->headers->set('Content-Disposition', 'attachment; filename="Não Coletadas.csv"'); | 315 | $response->headers->set('Content-Disposition', 'attachment; filename="Não Coletadas.csv"'); |
| 307 | $response->headers->set('Content-Transfer-Encoding', 'binary'); | 316 | $response->headers->set('Content-Transfer-Encoding', 'binary'); |
| 308 | - | ||
| 309 | - return $response; | ||
| 310 | - } | ||
| 311 | - | ||
| 312 | - } | 317 | +} |
| 318 | +} |