src/Controller/Visiteur/SiteclientController.php line 70

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Visiteur;
  3. use App\DTO\AffichageGraphiqueDTO;
  4. use App\Entity\PluvioDatabase;
  5. use App\Entity\Pluviometrie;
  6. use App\Repository\PluviometrieRepository;
  7. use App\Entity\StationsMeteo;
  8. use App\Repository\StationsMeteoRepository;
  9. use App\Form\AffichageGraphiqueType;
  10. use App\Entity\Infiltration;
  11. use App\Entity\Pluvio;
  12. use App\DTO\ReutilisationDTO;
  13. use App\Form\InfiltrationType;
  14. use App\Repository\Fiche\FicheBatimentExempleRepository;
  15. use App\Repository\Fiche\FicheBatimentRepository;
  16. use App\Service\Fiche\FicheExempleService;
  17. use App\Service\Fiche\FicheBatimentImportService;
  18. use Doctrine\ORM\EntityManagerInterface;
  19. use http\Env\Response;
  20. use Knp\Bundle\SnappyBundle\KnpSnappyBundle;
  21. use Knp\Component\Pager\PaginatorInterface;
  22. use PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf;
  23. use Spipu\Html2Pdf\Html2Pdf;
  24. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  25. use Symfony\Component\HttpFoundation\Request;
  26. use Symfony\Component\HttpFoundation\Session\Session;
  27. use Symfony\Component\Routing\Annotation\Route;
  28. use Symfony\Component\Security\Core\Security;
  29. use Psr\Log\LoggerInterface;
  30. use Symfony\Component\String\Slugger\AsciiSlugger;
  31. use ZipArchive;
  32. use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
  33. use Symfony\Component\Serializer\SerializerInterface;
  34. use Knp\Snappy\Pdf;
  35. use Knp\Snappy\Bundle\Snappy\Response\PdfResponse;
  36. class SiteclientController extends AbstractController {
  37.     const NB_FICHE_HOMEPAGE 15;
  38.     const NB_INDEX 20;
  39.     
  40.     protected function toFloat($value) {
  41.         $value str_replace(',''.'$value);
  42.         return floatval($value);
  43.     }
  44.         #[Route(path'/'name'index')]
  45.     public function index(EntityManagerInterface $em\App\Repository\PluvioDatabaseRepository $pluvioRepo,
  46.             Request $reqSession $sessionSecurity $security
  47.             StationsMeteoRepository $stationsMeteoRepositoryPluviometrieRepository $PluviometrieRepository) {
  48.         $idInitial 0;
  49.         $session->start();
  50.         $lastPage $session->get("lastPage");        
  51.         $calculEffectue $session->get("calculEffectue");
  52.         if ($lastPage "listePluvio"){
  53.             $idInitial $session->get("pluvioId");
  54.         } elseif ($calculEffectue 1) {
  55.             $idInitial $session->get("pluvioId");
  56.         } else {
  57.              $idInitial 0;
  58.         }
  59.         $show_complement=false;
  60.         $allowPDF=false;
  61.         $idFinal=0;
  62.         $session->set("lastPage""index");
  63.         $this->em $em;
  64.         $this->user $security->getUser();
  65.         
  66.         //dump($idInitial);
  67.         if ($idInitial != null) {
  68.         $reutilisationDTO $pluvioRepo->find($idInitial);
  69.         }
  70.         if ($idInitial == 0) {
  71.             $reutilisationDTO = new \App\Entity\PluvioDatabase();
  72.             $reutilisationDTO->setTauxRaccordement(100);
  73.             $reutilisationDTO->setCertivea(0);            
  74.             $reutilisationDTO->setCoutEau(4);
  75.             $reutilisationDTO->setCoutPompe(4000);
  76.             $reutilisationDTO->setchoixVolume(1000);
  77.             $reutilisationDTO->setCoutVolume(1000);
  78.             $reutilisationDTO->setChoixVolume2(4000);
  79.             $reutilisationDTO->setCoutVolume2(4000);            
  80.         } 
  81.         
  82.         $form $this->createForm(\App\Form\ReutilisationType::class, $reutilisationDTO);
  83.         $form->handleRequest($req);
  84.         // $fichePluvio = $pluvioRepo->find($idInitial);
  85.         
  86.         $arrayReu null;
  87.         if ($form->isSubmitted() && $form->isValid()) {
  88.         set_time_limit(100);
  89.             //climat et pluviometrie
  90.             
  91.             $AnneesCalculees $reutilisationDTO->getAnneesCalculees();
  92.             dump($AnneesCalculees);
  93.             
  94.             $climat $reutilisationDTO->getClimat();
  95.             $stationMeteo $reutilisationDTO->getStationmeteo();
  96.             $ParisPluie = array(0.21.600.8000.204.82.40.46.71.40.84.200000000000001.21.40.600.26.810.10.87.12.2000.20000.61.43.20000000.40005.22.89.104.811.78.315.10.60.4000000000.80.200.21.40.212.53.60000004000000000000000.600.20.4000000.404.40.80.6010.500.8184.409.50.20.2000.813.800.8007.714.72.400000000.80.400003.22.207.23.6010.6000000000000000000.211.75.21.45.66.9100020067.71110.20000000.400350.400.210000.600.402.6000.62.46.51601.801.40.4015.44.6000000130.63.2002.2013.20.200000.215.75.91.80.2136.13.600.42.84.60.20000010.20.20.414.80.418.70.201.400.200.600000.20.2000.26.700.44.43.21.40.40001.200.20003.6000010.88.89.7000001.400006.70.40.8014.7115000.40003.62.44.625.63.2013.632.60.44.8000.61.21.600.22.25.43015.10.8114.55.7118.70.62.80.802.60.400009.75.24.43.235.69.87.20.26.71.41.60.6000.211.11.20.4600.212.70032.40.810.45.63.60003000000000.6010.27.1033.23.20.616.50.2205.62.60.410.12.400000000.678.92.80.2000.67.21.400008.10.204.800.20000004.70000.2001.215.16.80.20.20000000002.40.65.800000002.40012.60.2021.634.20.204.6007.113.44.4000.62.478.20.600.20000.400000000000000000.400000000200000.6100000010.7000000000004.91.4002.20.2001.80000.20030.4000.213.26.100000000.2000000.40.600000.2011.80.46.1000000000.20000.41.60002.200000000000.20000.60012.12.42.62.400000.64019.413.75.100.400000.6100.45.814.8115.10.40070.65.41.81.80.25.11.22.200.200.20152.402.802.23.20.69.2000000.20.40.20000000.600.801.20.80.80030040.807.4111.21.64.4019.60.41.215.9000040.81.83.68.50.200000000000000001.210.64.22.4112.100.86.40.80.82.615.80.22.82.2000000000000000.64.60.20000003.2000000000.200005.80.21.22.41.200037.25.20.802.412.4143.811.5000000.617.30.20.200001000.20000014.517.50.21.40.40.202.82.85.78.300004.81.20000000000000000000000000000.605.50000012.80.800000000019.30031.3005.90000.214.91.600000000000000000000000000000000008.104.61.66.11.20405.2010.24.21.64.25.64.20.2000.231.443.60.84.211.2000.40.20.22.67.50.20.60.22.86.52.46.600.26.90.401.80.62.66.44.83.817001.6000.43.22.200.212.31.20.20.62.40.40.20002.6012.36.22.2114.32.42.24.64.50.2012.726.20.43.6008.6000001.20.40.200000.64.20000.201.21.40.8000000003.86.21.602.83.810.511.88.30.40002.429.3202.400.66.80.25.20.42.6000.4426.48.105.1214.805.215.2003.83.201.40.60100000000000000000000002.6000001.2000000.6000000003.43.59.38.90.60001.800035.615.2000000000003.60.4000000000028.83.41.400000.48.21.2000000.4001.600000.610002000000000000000000000006.30000000000000000214.86.1007.65.100.42.20000.20.600.41.21.80.600000.200.20000000000002.40009.57.56.35.813.13.80.63.414.518.416.88102.81.61.602.21.40.600000.611.30.2001.612.80.23.83001.20.81.20.200.2000.21.22.20.400.404.40012000.21.200.200.20.20100.210.71.41.200006.17.42.20.871.42.80.40.21.86.110.417.18.82.40011.114.31.230.80000.2000.20000.65.22.22.2011.60.602.86.913.30.24.62.403.48.24.48.36.66.82.62.66.902.4211.20200000.20.41.207.6000000.210.600000.21000001.245.482.22.82.433000001.60.620000000000.40.60014.513.70.60.4000000000.20000000.8000.80.20.200.87.700.25.400.65.206.18.231.81400.42.6348.90.2000000030.72.60000000000013.512.41.4181.4016.6008.31.41.20.42.41.6006.73.2000000.605.343.30.20000000000.26.93.48.200001.47.30.60.20.407.403.20.2000000.20000000.200000.20.20000010.8002.60.20.6001.2812.40.20012.30.20000.2012.24.20.60.605.219.26.408.70.200.20.20000.200.2003.40.41.215.400200.20.207.25.74.13.85.61.43.600.200.200.200.2100.20.200.2001.600.200.21.44.20.2030.6011.744.41.82015.91.40.80.400000.2000000.27.41.25.213.31.25.20.20.2);
  97.             $MarignanePluie = array(0000000000.6000.20000000.4021012.313.40.2000001.400.4500110.5000000.20.2000000000011.400.26.13.41.21.20000020000.20.20000.2041.91.815.80.200000.414.73008.90000.2000.200000000000012.92.600013.301.60.20.2019.200000.200.200004000000000001.40004.50000000000000000000000011.51.400.2000000000000000000000000000000000003.10.2000000000000000000000000.21.8000000002.8000001.40000000.200000002.20000000000000.200.20.400000000000000000039.900000000.2000000000000000000.800.600000.40.409.46.200.200000.40000000.22.6101.81.20.4000000070000010.2000000000066.610.500001.4002.40.630000000000.23.60003.6005.61.60011.27.301.28.61.20002.40.2006.57.87.500001.200000010.60000000001.86.11.238.514.70.400000000000000011.300.2000.8010.403.200.2027.81.6000.20008.70.20.20000.40.20.42.85.50.202.61.80.61.411.40.202001.2000000000000000000000000000000006.100014.2000000000000000000015.50047.20000000000.20000000000000000000000000000000000000000000040.61.113.1071.800007.45.85.70.200.200000.20.25.28.947.618.936.17.10.21.2012.311.5508.900000.20.20.61.60039.665.221.408.5000015.80.20.200000000000.401.89.801.815.100000000000000000000000000010000000.6000001.60.607.92.800000000000000000000000000000000.600000000000000000000000000023.80119.600002.80000000000.20.22.407.30000000000001.8000.2000000.604.6000000000000000000000.208.50.2000000000000000000000000100.2000000000000000004.40000000000000000.40000000003000006.10000000000010.77.6000000000033.623.50000000.209.100000000.2000017.92.6000.801724.28.571.900000.20.20.20.2250.90.42.20.202.600.80.400040.916.30000.2213.341.220.72.803.80.80.207.560.60001.2000.4000.65.62.6000004.222.85.50000000000000000006.30.400000.207.5004.2000.27.5012.9000000.2000000000000.20.2001.80000000001.402.62.42.4004.300000000000000000002.4000003.6000000000000000000.810.714.442000014.44000.200000005.423.741.4012.205.26000000000000001.80.44.29.2011.300000010.90000000000000000000000000000000000000000000000000000000000000000000000000000.42.800000000014.320000000033.3191.420.20100000005.20006.30000000000000000.86.20200000000000086.19.80000007.50000000000000000000.6007.500111.60000.20000.412.1001.60000.61.4001.219.70.47.1000003.6000000000.63.209.51.200000010.50.40000010.4012.50.2001.2000000000.20.400000.600000000000000000001.40000002.20000000300000016.77.200006.54.4000000002.86.42.218.2526.60000.60.8000.821.3000.20.622.401.2003.402.61.2000001.204.40.60.20.20000000000000000.200000000000028.3000000000000000000000000.400.60.20009.9000.200000001.600.40.20000.40.200.40.2000000.20.215.1000.2000.22.400.20010.88.7010.20.20.200.401.224.90.200000.440.34.60.40.2000000.40.2000.20.20.404.31.600.200.2000.25.930.52.6140.20.200000220.70.20.8012.60000.205.80013.923.400.40002.201.81.60082.362.20000000000000.27.811.206.6000.20.4);
  98.             $AurillacPluie = array(000000008.97.22.610.511.610.200000000006.5704.60018.620.510.912.21.22.21.6000.2010.6000000.2001.600011.717.15.40.816.920.69.85.72.64001.65.2000000013.41.412.314.91.20000011.57.2000.2000000.40000000000000022.10.20.20022.810.32.8002.812.31.8000.412.54.90.80006.537.140.2000.20000011.21.800.849.500.4100.200001.80.8000000000.60014.370.417.510.115.67000000.4010.62.80000000024.92.61.6010.750.21.80.206.41.60.2000.201017.91.64.55.25.200.2000.200.200000000000.2191.60.46.10010.2018.210.73.890.816.96.434.63.42.60.200.200.210.200.2063.84.22.80.20.200000.20.20000000.230.25.44.20.20.200.40.604.40000033.90.20.424.205.46.811.91000000000013.31009.11.62.80.400.40007.90.8645.618.3112.311.56.44.25.416.60000002.68.37.3019.14.95.613.99.625.411.67.22.21.415.94.84.81.800.60.48.716.914.82.231.79.55.80.4010.7000006.3001.42.611.30.6102.80.83.2039.13.86.23.4030.600000003.810.310.32.42.62.24.63.201.80.42.614.80.616.12.29.99.52.41.60000.6100.4115.41.45.64.2006.75.60.60049.90.6101.21.200000000.80.400.200018.73.200000.20.66.5600011.97.88.61.820.2001.48.30100.601.419.26.23.80.60.200020.12002.269.76.80.202.2000.200000000000000.60.434.12.80.200000001.40.2320.21.60000.200000.43.60000000002.200.600314.10.20014.20.2000001.20.40.200.20.6000.20008290.2000.20000.20000001.801.4000000.200.4000012.82.40.2020001600.2000000000.22.4115.10.82.43.82.2006.33.8302.62.20200007.3000.6004.4061.40.207.31.49.9211102.62.84.48.480000.2013.914.50.24.254.611.17.80.40.2000000000000002.60.6001.240.200.42.200.20.206400.85.213.3311.76.719.67.34.80.20.200.24.81.20.270.400000000000000000.4020.6309.53.409.21.20.45.65.2121.803.83.4000000000000006.610.41.250.8204.410.20003.41.20000.4108.111.925.693.80.40002.80.65.400515.140.24.600002.814.55.21.40.23.4008.30.40.46.44.2000000012.10300.81.851.605.85.90.201.20.20.80.200000000000.40000.6003.4000.200000000.200.20002.834.8000.600.8000010.30.2014.80.210.90.800.6100104.84.200000000000.41.2002.200000.800000000000037.503.85.80.6000.80152.8020.81.800.61.60.400015.56.500.65.8014.5025.841.83.6000.80.404.6214.415.330.428.58.87.32.44.8604.62.22.810.48.7000002112.900.89.520.214.44.38.80000001.28.27.2013.326.621.9500004.417.324.625.89.7400.20.60000002.40000.40.26.92.4000001600000.20000.811.78.40.67.60.81.81.41.20.600002.66.95.8011.70004.62.81.80.600008.2212.10.22.210.5151.65206.20.210.14.61.400.6001.24.20000000.4000000.60.400000000000000000014.611.55.42.20.20.200.428.92.87.32214.710.90.20.4000007.70.21.620.90.2000000003.6000000002038.846.1040.6021.211.30.40.21.64.84.40.40000.2002.816.900.60.405.200.20000000.400001.800000000000000001.800.4000000.400.418.20.40.47.90.20.200040.40.20.200.20.21.217.256.70.200000.200000000000008.90.83.82.65114.83.826.66.30.2013.929.230.59.64.89.3001.21.85.805.61.2000000028.80.419.17.430.60.40000.40.800028.50.20.20.6000015.90.201.80.8000000000000.80.417.72.61.25.414.133.49.9181.604.417.40004.603.605.86.20.202020127.715.70001.2000000011.54.26.80.68.30.400314.713.310.510007.217.7120.22320.92.81.200171.25.211.74.4016.50000000000.20000000000007.9001.47.62.815.901.61.20.43.80.40000001.200000000000000.40.620.8000000003.62.4000004.43.62.61.420050.216.10.205.610.52.27.85.45.819.83.62.44.2403.44.205.60.20000000.201.417.20.200.2000.20000.20017.80225.52.20.250.650.20.227.638.30.202.26.10.62.60.67.600.20.20.812.136.65.200.20.200000000.20.25.60.20.25.74.60012.910.50.219.50.20100.80.20.20.42.200.20.200.20.20.20.200.20000003.45.90.20.2008.16.20.40.20.20.257.90.22.2012.511.113.2010030.80.20.606.100017.70.25.8000000000000005.51.40.40000000.42.423.611.322.80.80000.800100.22.400000000004.81.24.26.83.600.2151.47.517.45.62.418.3611.72.20000000000000015.835.18.78.700);
  99.             $BordeauxPluie = array(0000000050.2211.3104.20.200000000000.21.801.600.49.925.84.23.47.43.2000000.60000000000.8000.47.211.73.4015.35.461.710.30003.2100000000.40.43.83.6000000001.87.73.20000000000000000000001.8100007.84.8000120000.240.2410005.619.45.20.40.20.4000000501.202.816.40.62.40013.200001.81.600000000.2000.61035.413.526.4120.4000007.601.60.8000.800003.80.20004.22.402.40.40003.20000004.92.83.9000003.2000.6000000006.308.30.203.802.81.20.80015.62.83.63.22.85.62411.630000000.65.10.2001.81.62.60.60.400.8000000.40.20.20.200.20.62.80.201.61.600.200.2000.600000.21060.43.40.802.22.25.40000000000021.60.40010.302.4000.800011.52.211.351.41815.67.69.300.21.6000.21003.214.33.8212.305.410.910.92.69.152.60.800.452.201.40.29.18.81.43.84.418.93.21.80012.13.600003.61.406.7000001.421.205.614.94.42.804.40.40.800000003.87.30.64.210.22.2300.803.27.3024.20.211.30.47.100011.93.63.81.69.36.63.898.700.21.20.201.411.70.8422.10.6014.900.20000001.200001.84.46.26.701.61.600000001.29.32.82.60000004.70.2004.811.91.840.20.20.20005.16.21.7001.23.848.33.61.61.8001.2000000000007.46.20.2017.22.20.400000000.234.5000.200.400000000.80000000000.47.710.2000.20000000002.200.2007.30000000010020.200000000000000000000000004901.89.71.40019.31.4000.60000000.40.6017.100105.800011.514.96.95.436.447.900.40.200.2000005.26.240005.80.48.910.8202.60.61.60.8100.20.25.806.84.60312.714.614.22.800000000000000000.4000.40.40.80.202.23.51.23.20.2011.61.810.239.8113.37.411.511.50.809.210.6000.241.2000000000000000000.402.41.2053.20.21.81.401.831.81.4034.4000000000000002.83.80.816.94.12.4300.40000.49.50000000292.64.88.51.600001.802.6001.664.20100001.21.22.414.410.7000.20.400.60.8200000011.3218.70.80.80318.43.88.500004.400.63.60000000000.60002.800.20.200000000000000002.428.14.8002.503.2000004.8006.59.22.301.40.40.2050.20000000.2000001.400000.28.70.214.90.2000000000015.88.32.25.88.80.4100.801.40.610.802.4011.60.20.20025.66.11.60.41.411.370.218.84.37.90.20.410.20.21.41.615182513.613.112.215.82.883.67.52.611.19.1214.90000.42513.31.226.3441015.13.8000000.610.32.8012.540.618.33.8000.2013.73910.31.60.40000000001.6000005.80.6000002.43.86.20008.12.200.20.611.33.813.143.61.200000000.60.42.811000.430.400.20000.89.213.116.918.711.38.812.5619.85.4024.80.600.2002310000000000002.25.9000002.25.60.2000020.4000.25.629.20.45.81.60.21.43.411.65.74.812.740.8134.80.22.80006.911.3715.804.200000000020000000014.801.611.40.801.67.70.220.25.46.300.28.66.315.100.200000.200000000010.20000000000.20.200000.20000.600.6000000.2000000021.619.912.301.200000.42.40.20.200.601.63.62.60000000000.20000.2000002.23.91.628.60.60.213.119.311.5000916.82323.214.27.412.3002.6026.97.82.400002.87.80.4182.2016.16.86.200.200.200.40.80001.200.21.200.20.4011.7000.80000000000002.42.449.714.811.33.220.8011.924.310.32.407.200.8001.60.40.600.84.20028.115.12.816.110.16.205.4000000002.64.62.803.20.2006.3820.112.48.100.46.45.25.81611.77.40.614.2011.96.84.217.66.78.28.3000000.20000.20000000000001.8000.23.61.44.830000.40.40000001.600000000000001.811.52000000000.400000.42.202.62.800006.7017.50.2024.411.33.93.29.18.514.70.80.80.80.8064.80.41.210000.4000013.15.800000000003.41.238.3443.312.12.22.22.6004.81.670000.64.82.8006.10.40029.69.40.80.2000000000.60.200.20.200.252013.7100.46.91.60002.40.200.40.4000000.2000000000010.60.2000111.83.200020.200.24.216.45.4000.2003.61.60.22.43.900.21.89.33.25.20000.2000000000023.2000.43.40.2001.40.41.211.722.96.30001.2000000.40.600000.200.400.4721521.11.51.570.419.118.45.22.417.9714.75000000000000004.414.125.49.11.200);
  100.             $NantesPluie = array(1.600000.201300.25.200.40.810000000000.22.20.2316.15.11.26.28.98.239.31.200001.82.201.20000.210.200.6000.815.45.211.702410.90.840.40.200.212.50.20000002.62.88.45.80.2000000.22.22.6000.4000000000000000000000.60.20.800.87.62.80002400000.83.40.40.400071.60.20000000.22.616.914.30.2000.40.8013.51.200.40.20000.80.60000000000.600115.11.42.80.40.800000021.10.62.40.40000001.806.11.211.9013.8002.80.40010.21.600010.80.2000.60000.220.60.800.200000.200.80.801.82.60.609.10.20.601.619.30.820.64.46.400.641.20.40.20.20.20.2082.60.21.20.64.41.61.61.20.20.20.400.211.400.81.20.60.200.20.80.48.74.29.80.21.20.40.20.20.200.6000039.30.402.800.40.21.40.800.200.2000000.613.30.800.25.61.20.20.80.20.20.2000.212.7011.316.3133.69.20.21.20.20.40.20.400.400.44.824.202.214.126.47.14.294.41.27.710.203.23.20.203.6010.91.60.6512.54.81.40.83.83.41.80.20.422.60.48.11180.2001043.20.20.616.790.611.36.51.41.40000000004.80.42.23.20.660.40.601.40.81.8010.92.80.811.90.600004.20029.33.218.716.31.20.278.84.40014.12.22.4702.6021.40000000000.20.22.6070.40.64.6000000.2001.66.40.800000000001430.801.6200.6009.38.7412.61.81.216.40.270.14.80.21.20020.200000000000060.10.80.2000.20000000000005.80.20000006.102.41.20.200000006.720010.20.20.20.20.20000000002.6013.10000.2000000000.20.200000000.45.601.21.600000.6000000017.72.2000.87.3000.20.60.20.60000000.200.2050.20.20.60.200.2009.18.5021.722.817.40.40.200.4000000.22.223.432.94.408.411.41.633.56.24.909.10.47.83.400.20001.612.32.40.611.5712.722.40.200000.400.200.200000.2000.400.20.200000.800.61.203.80.200.80530.29.50.271008.70.61.60.47.315.92.400.200000.210.200.4000000.20.44.2013.95.4014.752.21.4003.40.20.20.23.21.40.6000000000000001.81.62.236.41.20.20.20.200002.4000000010.58.92.2400.20.202.66.70.20.2005.411.903.2000000100.41.2002.80021.61.60.40.200.216.97.81.811.56.40.40.60.26.43.600.20.2000.20.40002.61.8000000.60.40000000000.40000000.600.200002.25.60.4021.60.200002.8102.48.400.41.400.80.22.616.310000000000.2000.2000000.2009.5000.2000000003.20.814.138.29.13.41.46.97.93.601.6030.443.41.20.2000.217.299.35.4602.201.20.65.201.45.60.83.412.95.69.5243.46.20.48.115.7010.30.43.409.70.230.20.200.21.816.22.40.27.83.629.38.420.211.50000.4031.89.807.83.412.73.462.23.20.40.220.7516513.30.20000.200.61.60.60.60.600.21.432.8400.24.410.311.62.49.10.60.2000000.219.461.24.43.821.816.32.82.40006.54.43.60.41.62007.76.732.800.80.20.20.87.966.51.61.66.247.43.23.8298.35.90.43.45.40.80.600.81.40.4000.2000000000000000000.4100000.25.80001.60.2015.92.200.2000.20.213.81.88.44.40.47.408.50.4001.418.210.200000000000.60.2000000000000.20.200.600632.79.84.716.37.95.46.61.20.601.60000.22.251.20.40.20.6002.20.4000000000.200000000002.800.4000000.600.20.200.4000.41.221.44.40.26.58.20.210.312.9011.6001.40.42.63.82.90000.20.20000.200000000.2000.417.310.701.65.660000.21.613.915.88.922.81.830.2001.801.24.4100000018.20.200.812.11.24.85.60008.15.6400000010.21.82.81.20.819.600100.200.20.20.20.20.40.20.200.20.20.213.50.82.402011.315.74.616.2302.20.23.41.63.811.3145002.819.411.45.200.20.25.60.4000.20.2000.20010.26.400.20.47.925.42.822.200.87.614.77.89.97.415.59.240000011.9020.20.20.40.20.606.800020000.20000.80.6000000.24.61.22.81.800001.40.400.2000.202.20.200.20000000000.22.43.60.80000000000000000000.80019.79.32.60.200.65.64.293.46.30.610.90.83002.436.9500.20000001.614.80000000000000.221013.518.18.10.2000.62.62.650.2000.41.812.74.23.2001.27.33.810.400.200000000.84.600.83.200.600.21.60.85.60.84.62.83.20.20.20.20.20000.20000.205.200000000000000.2009.71.93.40.6000.40.200.20.40.60.4000.20030.43.26.500.24.896.70.611.32.40.2000.20.400.2000000.83.27.70.4001.20.200.23.40.21.410.95.67.80000000000000000008.7000011.60.206.100.813.30.210.611.51.28.700.6000000000000.41.86.413.819.812.91.200);
  101.             $LyonPluie = array(0000.2000025.30301.20000000000000002.4004.80.42.21.601.200.400000000000.4000.20001.65.50.41.6068.47000000000000.60022.625.80.21.40000006.44.20000000000000000000000290.60009.52.26.23.80015.53000.410.113.50.8200017.93.30000000000001.6016.40.21.45.300000020.218.5000000005.300.413.58.10.41.82.40000000011.5000000000.60.21.610.71.60.6100005.60001.803.5013.813.200.61.60001009.9000001.60.400008.92.802.40000006.200.2002.600.62.601.2000003.6000013.31.60.8201.400.8000000000000011.400000000000030.91.600.2000.23.85.50.600000000004.86.7004.64.60.60000003.80.403.86.81.623.405.264.900.20.60.20000.2209.74.41.60.8025.82.40.2004.420.200001.84.60.22.60.210.13.40.8006.926.400.20.407.50.81013.43.60.202030.21.42.83.814.200000000001.64.210.72.28.10.26.10.8013.72.230.40020.67.76.300000.20000.41.86011.7100013.300004.60.23.20.61.80.60000000000000.605.61.40.60.20.600000.67.1007.421.3120.21.20000024.58.9000.63.63.8016.10.2002.24.80.408.92.800.411.944.2000000000000000000040.60.83.25.40.400000004.95.9000014.2000000014.10000000000014.2001.212.51.202.6000000.61.6000006.30000000.85.20000001.400000000.20300000010000025.75.800.21.40000000000000000.62.213.145.80.211.200001.29.9003.20.6010001009.30025.4032.60003.810.36.62.601.4220.610.600002.62.80.40.411.907.21.200000000000000001.62.80065.91.6000.200001.64.8000.21.40.20.206.29.712.90.80002.6002.21.20000000000000000002.800010.70.200.80.20.22.81.47.10.201.60000000000000000.218.31.6002.800000000.6100000021.845.71.60.63.20002.604.90.201.415.550.26.1000002.27.30.40.20000002.80.40000000300.4014.911.316.10015.726.700001.25.70000000003.800001.400000000000000.4000000.8280.400000009.124.44.2021.4010.90.4000008.65.612.50000.2000000000000001.400000000000008.500.82.80000010.20.80005.6009.9000020.421.80144.431.72.80.619.400002.4005.26.21.85.6212.40.200.400.200480000002.4010003.60.63.23.616.74.70000001.4109.177.76.6000.20011.76.32.61.41.400.43.20000000000000.400000006.3000000001.60.22.21.24.801.44.80.21.8000001.80.801.40006.301.80.200002.201.201.418.903.46.8000.222.20300000000000000000.600000000000000000000.23000003.801.420.11.412.710.615.8000.400007.11.21.221.80000000006.1000000000014.621.7010.505.67.900.416.49.20036.310.600000005.114.3004.9000000003.200001.2000000.41.40000000003.60.23.20000000.2007.5001.800001.800000023.9000000000000000000000.82326.51.8073.47.610.74.20.40.21.448.600.820.4000.20.60.6001.2000000014.512.1041.81.62.20000002.200006.10000008.70000.800000000000.42.60.82.67.4050.40.2006.21.200.819.802.208.312.74.203.44.40.800.20.206.38.20000000000055.83.82.611.90.40000.614.50.40.2005.28.606.51.68.83.840050.80.44.4005.400000000000000000000003.6000403.80.82.68.80.2000000006.400000000000000022.6000000000.20.20000.20.203.64.419.47.50.802.4010.71.600105.92.80.44.82.47.99.20.60.860.212.51010.20000002.2304.800000.2000000000.4014.25.80.82.8000020.80.8002.87.42363.85.908.9048.812580.800000051.4009.90015.44008.914.40016.400006.1005.7000000.2000000000000.80.800000140.2001.23.8408.913.118.70000500.20000079.413.44.3000000000000003.600000.400004.8414.414.101.2000000002.40.200000000001.40.21.411.5002.615.43.25.61.212.58.26.11.8000000000000001.80.615.9196.70.20);
  102.             $pluieBDD = ['Paris' => $ParisPluie'Marignane' => $MarignanePluie'Aurillac' => $AurillacPluie'Bordeaux' => $BordeauxPluie'Nantes' => $NantesPluie'Lyon' => $LyonPluie
  103.             ];
  104.             $pluieBaseBDD = ['Paris' => 637.4'Marignane' => 515.4'Aurillac' => 1174'Bordeaux' => 944.1'Nantes' => 819.5'Lyon' => 880.9];
  105.             $pluieBase $pluieBaseBDD[$climat];
  106.                         
  107.             $ParisETP= array (    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     3.8,     3.6,     1,     2.7,     3.1,     1.1,     1.9,     2.2,     4.1,     4.6,     3.6,     3.2,     3.8,     3.7,     4.9,     5.9,     6.4,     3.1,     3.7,     3.7,     4.6,     4.9,     5.2,     4.6,     6.7,     7.2,     6.5,     6.8,     6.9,     6.1,     5.7,     6.2,     5.5,     3.4,     4.7,     6,     4.8,     5.4,     6.9,     6.4,     7.1,     8,     5.8,     5.7,     7.3,     7.9,     6.3,     5.8,     7.4,     7.8,     7.6,     7.9,     8.5,     6.1,     6.1,     6.6,     6.1,     3.3,     4.2,     4.5,     2.7,     2.9,     3,     5,     5.7,     6.8,     6.4,     8,     7,     4.5,     2.4,     4.7,     4,     4.7,     5.3,     5.5,     6.3,     6.2,     7.1,     5.9,     5.1,     6.1,     3.4,     4.2,     2.7,     3.9,     2.9,     3.5,     4.9,     6.3,     6.9,     3.9,     4.9,     6,     6.4,     5.5,     5.2,     5.2,     5.8,     2.9,     2.8,     2.4,     3.3,     2.1,     3.7,     4.4,     3.4,     3.9,     2.4,     2.7,     3.6,     4,     3,     4.5,     4.7,     3.7,     1.8,     3.7,     4.1,     4.3,     5.1,     2.4,     3.6,     3.4,     3.3,     3.1,     3.8,     2.8,     3.4,     3,     2.2,     2.8,     2.6,     3,     3.1,     1.3,     2.6,     2.8,     2.2,     2,     1.7,     2.3,     1.5,     2.4,     2.5,     2.4,     3,     2.8,     2.4,     1.6,     1.3,     2.7,     2.7,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     2.8,     3.5,     4.3,     4.8,     5.2,     5.5,     6.5,     6.5,     4.9,     4.7,     4.9,     3.7,     2.8,     1.3,     3.6,     4.8,     5.3,     4.8,     4.7,     5,     4.4,     3.8,     4.3,     4.8,     4.8,     5.1,     5.8,     4.7,     2.8,     4.4,     4.8,     2.6,     4.2,     5.5,     4.8,     2.4,     2.5,     5,     4.9,     4,     3.7,     1.5,     2.5,     3,     2.9,     5,     5.5,     4.7,     4.8,     4.5,     5.8,     6,     5.9,     5.6,     5.9,     6,     7.3,     7,     7.7,     7.3,     7.1,     7.7,     7.1,     7,     6.6,     5,     6.5,     7.1,     6.9,     7.1,     6.6,     4.4,     5.6,     6,     6.6,     6.7,     7.4,     6.4,     6.8,     7.4,     4.4,     5.7,     5.6,     6.5,     6.2,     7.6,     6.9,     7.4,     6.8,     6.8,     5.7,     6.5,     6.4,     7.4,     8,     8.8,     7.2,     7.3,     7.9,     6.2,     2.2,     4.7,     4.9,     6.5,     5,     4.3,     4.4,     5.8,     5.9,     4.9,     5.1,     3.5,     3.9,     4.9,     4.7,     4.3,     4.5,     4.4,     4.3,     4.4,     2.5,     2.5,     4.1,     4.6,     4.6,     4.5,     1.9,     3.8,     3.2,     4,     3.6,     4.6,     4,     4.5,     4.4,     1.6,     3.7,     3.3,     3.6,     4.6,     3,     4.2,     3.8,     3.7,     3,     2.3,     3.1,     3.3,     2.9,     2.8,     3.2,     3.5,     2.8,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     3.6,     2.5,     2.8,     1.7,     2.7,     2.5,     3.8,     2.1,     2.2,     2.6,     3,     4.1,     5.2,     5.7,     5.7,     4.9,     3.2,     2.4,     2.1,     3.2,     3.3,     4.1,     4.6,     5.6,     4,     3.9,     5,     4,     3.9,     3,     4.6,     5.8,     7.9,     3.6,     4.9,     1.3,     4.6,     3.8,     4.5,     3.6,     3.9,     3.2,     2.6,     2.8,     4.5,     5.2,     4.7,     5.1,     5.8,     6.1,     4.3,     5.4,     5.7,     6,     6.4,     7,     7.5,     7.8,     8.2,     8.4,     6.7,     6.1,     6.6,     7.1,     7.2,     7.6,     7.7,     6.5,     7.3,     6.9,     6.4,     6,     6.4,     6.3,     4.7,     5.9,     5.7,     6.6,     5.9,     5.9,     5.5,     6.1,     6.7,     8.7,     8.5,     9,     7,     3.6,     5.2,     6.6,     6,     5.1,     5.5,     6.5,     4.8,     6.2,     5.6,     2.8,     5.2,     5.2,     3.2,     6.8,     3.6,     3.4,     3.6,     4.8,     4.7,     4.6,     1.3,     3,     4.7,     5,     4.3,     5.2,     5.5,     5.5,     5.8,     6,     6,     5.2,     4.8,     5.2,     6.7,     5.1,     4.3,     4.1,     4.3,     3.6,     3.7,     3.7,     3.7,     3.2,     4.1,     4.2,     2.7,     3,     3.8,     4.3,     4.3,     4.1,     4.4,     4.1,     5.5,     4.1,     2.3,     3.1,     1.8,     1.9,     2.6,     2.5,     2.7,     2.2,     2.3,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     3.4,     3.9,     3,     3.7,     2.7,     5.7,     5.1,     4.9,     3.7,     3.1,     4.1,     4.1,     4.7,     4.7,     5,     4.7,     4.8,     5.6,     5.8,     5.9,     5.8,     5.5,     4.8,     4.6,     5.1,     6.6,     6.8,     6.7,     7.4,     6.9,     7.2,     6.8,     7.3,     6.6,     2.2,     3.2,     5.2,     3.8,     4,     4.2,     4,     4.8,     3,     4.9,     4.2,     4,     4.6,     3.8,     4.6,     3.5,     5.1,     3.7,     5.5,     7.1,     8.4,     8.2,     6.7,     4.1,     5.9,     6,     4.5,     3.6,     4.3,     4.9,     3.9,     4.2,     5.3,     5.8,     5.8,     7.3,     5.8,     6.3,     6.6,     7.4,     4.8,     4.4,     3,     4.8,     6.5,     7,     7.1,     7.4,     6.4,     6.6,     4.9,     5.6,     5.7,     8.1,     6.4,     5.9,     7.2,     8.1,     5.6,     6.2,     5.4,     5.7,     6.8,     7.1,     8.1,     7.5,     9,     7,     6.4,     7,     4.8,     4,     4.4,     4,     3.7,     5,     3.1,     5.6,     6.8,     5.4,     4.1,     3.9,     5.8,     5.4,     4.8,     3.7,     2.4,     3.1,     3.8,     3.7,     3.9,     5.1,     5.7,     4.4,     2.9,     3.8,     3.8,     5.1,     3.8,     3.8,     3.5,     4.1,     4.8,     5.6,     5.2,     5.5,     4.3,     4.8,     3.8,     4.9,     3.7,     2.7,     2.1,     2.2,     2.9,     0.9,     1.2,     0.9,     2.4,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     2.4,     2.6,     4.1,     3.5,     3.2,     1.4,     3.8,     4.2,     5.6,     4.3,     2.6,     2.8,     3.4,     2,     2.9,     3.2,     3.4,     3.5,     3.4,     3.5,     5.2,     4.1,     4.3,     3.5,     3.3,     3.1,     4.5,     5.6,     5.7,     6.4,     7.1,     6.8,     5.6,     5.6,     3.1,     3.2,     5.3,     5.2,     5.6,     6.2,     6.6,     5.9,     5.3,     7,     7.3,     6.7,     7.6,     5.2,     5.2,     3.6,     4.5,     5.8,     2.1,     2,     4.1,     2.9,     2.8,     3.4,     4.7,     2.8,     2.6,     4.2,     4.9,     4.2,     4,     3.4,     5.9,     5,     4.9,     3.8,     3,     4.1,     3.2,     1.2,     3.6,     5.3,     4.1,     4.5,     6.8,     6.7,     6.7,     6.6,     7,     6.5,     5.7,     4,     4,     2,     5.1,     4.8,     5,     4.8,     4.9,     3.8,     3.3,     2.8,     4.7,     4.9,     3.8,     4.9,     4,     3.8,     4.6,     5.1,     5.8,     6,     5.8,     4.6,     2.7,     2.9,     2.9,     3.8,     3.9,     4,     2.8,     5.3,     5.3,     3.6,     4.6,     3.6,     2.9,     3.4,     4.8,     4.6,     4.5,     4.2,     4.4,     4.7,     5,     5.6,     4.7,     3.8,     3.6,     3.6,     3.2,     3.6,     2.8,     1.7,     3.5,     3.2,     3.5,     3.5,     2,     2.8,     2.9,     2.8,     2.7,     2.5,     2,     1.9,     2.3,     3,     2.5,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0    );
  108.             $MarignaneETP = array(0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004.62.43.53.43.73.36.37.65.73.33.85.34.44.87.25.86.76.76.68.46.356.15.95.86.677.97.26.55.35.765.67.98.18.696.76.67.97.27.87.47.8899997.26.66.97.58.497.68.46.57.48.39997.48.58.48.58.58.97.36.4999998.78.48.48.66.85.99999997.18.59988.18.89997.799997.36.16.667.27.5997.17.35.15.16.86.76.46.65.67.44.87.997.55.45.6996.13.26.98.58.14.45.83.244.33.36.45.83.12.833.52.23.53.74.13.92.2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003.55.66.14.34.23.83.34.75.46.64.45.11.83.14.85.83.94.95.45.43.73.74.75.45.34.34.73.853.74.35.54.844.55.25.92.65.95.67.355.77.28.28.37.4998.37.98.197.96.77.67.17.17.66.77.77.76.76.87.49998.99997.98.48.17.84.198.2878.1997.38.77.77.96.87.56.97.98.497.18.397.77.46.63.58.18.66.36.896.87.16.46.86.76.76.86.17.1998.96.15.95.28.298.75.85.45.84.23.77.24.843.85.14.25.375.84.83.93.94.64.65876.84.54.13.25.23.73.2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003.23.95.47.66.36.63.52.94.34.66.37.96.75.94.14.53.34.62.85.77.55.44.73.94.55.46.598.86.35.95.36.36.38.296.87.98.35.77.32.25.45.38.25.88.45.97.57.8667.56.57.88.88.68.898.797.97.18.57.67.76.87.88.46.497.999996.97.68.76.76.26.96.67.388.27698.9896.1998.17.68.67.28.27.77.377.49998.25.26.15.16.16.75.75.76.16.26.34.44.86.26.56.87.797.45.6988.98.56.32.35.855.34.14.64.94.43.75.14.63.835.64.54.84.83.64.42.64.60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.95.76.45.43.36.85.76.74.22.12.24.54.73.75.13.43.95.96.15.75.85.85.37.65.96.46.65.45.45.95.25.55.14.63.175.86.48.67.37.55.37.43.57.297.47.35.67.29997.67.17.47.56.96.88.38.96.26.898.99997.776.896.37.37.68.1996.96.96.16.46.87.798.47.47.35.37.26.8899997.76.87.16.47.36.46.67.37.47.56.86.17.27.66.37.78.18.49966.37.15.92.37.48.27.15.25.354.57.27.55.73.81.93.34.8555.24.54.85.27.73.53.61.93.33.65.864.344.12.7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.15.55.145.63.76.75.18.534.85.265.52.22.26.94.976.63.93.95.847.45.85.94.36.15.46.16.16.46.94.87.77.377.87.48.37.36.87.76.66.26.57.38.46.57.57.27.86.37.596.887.38.898.87.86.13.87.97.55.88.496.98.18.78.37.48.78.77.98.17.37.46.97.1998.17.976.36.85.9897.962.36.96.36.16.77.27.17.57.37.97.87998.166.34.66.195.35.26.697.96.96.35.84.64.54.94.354.74.97.87.2354.73.84.96.8254.25.75.33.84.23.73.94.32.33.24.15.65.100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
  109.             $AurillacETP = array(0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.522.32.74.72.22.13.43.63.423.53.23.34.45.35.52.82.22.33.753.14.85.66.267.46.83.12.94.54.40.83.84.33.53.25.43.85.15.73.55.74.94.86.15.767.66.76.36.82.14.86.24.44.72.52.51.621.94.75.37.76.36.45.43.31.93.32.54.74.94.84.96.88.15.41.52.43.14.13.53.43.12.54.54.23.863.35.24.74.33.34.74.73.121.71.433.45.33.4343.24.23.23.9644.55.565.3552.41.93.12.22.62.823.52.31.82.11.91.92.30.41.81.51.40.61.71.422.61.92.42.61.51.42.52.52.90.9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.332.13.61.43.92.52.50.92.43.52.41.30.30.31.52.33.53.43.63.833.53.44.37.23.31.82.62.42.53.84.53.94.12.533.73.35.44.32.83.34.73.323.63.53.34.86.15.65.65.25.45.46.95.75.75.86.76.65.666.33.14.555.155.15.15.44.95.35.42.24.75.35.24.64.53.74.65.65.36.25.93.35.55.65.64.95.85.86.26.17.57.14.42.74.44.65.91.93.34.54.82.13.24.24.24.65.84.73.91.73.83.55.13.23.12.93.83.54.14.43.11.53.644.13.64.34.82.73.63.34.84.74.23.73.82.83.13.23.12.544.43.12.63.3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003.51.91.91.82.73.23.91.41.72.62.13.64.64.74.541.11.40.61.92.63.44.22.63.33.72.22.33.13.14.35.56.43.572.84.42.73.731.82.12.15.531.945.375.24.32.94.45.67.17.598.98.47.27.35.44.85.66.47.85.95.55.83.25.45.25.45.65.75.44.95.84.25.24.75.36.48.68.694.41.84.54.92.94.43.24.75.26.24.643.65.26.842.13.63.83.733.84.9531.93.44.25.25.655.83.53.74.14.65.12.943.94.13.73.32.93.42.62.53.53.85.23.64.74.14.45.154.54.91.82.20.91.721.82.63.12.30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.91.42.54.33.73.74.15.84.51.63.81.81.32.62.43.13.53.84.44.244.51.33.34.34.85.35.15.15.25.44.14.93.12.112.94.12.232.81.62.12.43.32.732.72.23.243.75.14.875.85.44.43.34.94.43.43.74.344.25.74.75.55.64.35.55.25.652.22.43.24.85.76.36.255.25.8546.85.15.57.18.25.44.44.14.85.57.38.96.56.47.776.53.44.45.23.12.74.15.67.46.74.23.43.55.13.83.90.92.52.532.92.83.15.14.42.93.63.22.53.93.53.54.46.24.544.46.53.71.82.31.72.71.21.41.30.111.21.6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.22.63.13.13.30.23.14.55.42.81.92.12.32.80.71.82.81.32.43.13.52.22.51.73.12.93.94.94.74.14.53.93.24.21.5432.73.84.14.35.2555.55.65.83.74.74.933.53.63.52.33.84.23.21.92.22.73.83.92.63.33.923.53.53.93.24.50.80.81.51.53.24.45.54.86.95.85.96.43.52.642.83.23.81.71.53.13.40.822.73.82.13.13.64.24.33.93.853.22.43.32.72.73.74.53.13.32.93.13.93.22.933.43.34.43.12.63.13.74.34.54.92.52.72.62.93.33.72.91.82.81.40.91.52.22.32.62.52.71.72.31.60.91.600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
  110.             $BordeauxETP = array(0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.83.13.44.73.44.14.245.33.15.35.43.54.95.66.74.81.13.44.15.664.15.67.67.95.47.73.74.73.95.15.52.12.74.75.14.26.93.55.875.85.46.14.96.18.27.797.57.973.92.95.74.734.53.82.62.53.44.16.68.34.175.55.14.25.23.43.55.25.37.18.494.353.244.34.74.41.52.74.75.254.85.25.74.855.364.95.14.34.34.94.24.47.42.73.73.92.84.24.56.785.55.75.26.14.75.95.33.64.22.43.63.83.22.43.13.43.33.42.53.33.11.83.72.52.41.53.12.72.632.62.833.42.13.33.13.22.4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003.12.123.94.44.35.34.34.74.44.6131.63.94.12.9555.44.244.64.12.53.23.22.23.33.82.94.355.23.81.83.54.34.75.34.22.83.13.63.52.83.84.93.34.66.15.887.578.27.86.57.36.87.96.45.94.43.84.14.25.77.66.66.86.86.567.45.64.64.856.35.83.94.25.86.46.175.24.84.85.25.56.87.37.77.88.37.55.54.44.74.25.86.24.55.455.35.85.25.84.96.15.65.54.82.24.43.66.64.544.34.85.85.45.13.42.344.23.43.845.13.43.54.244.6444.42.13.43.543.9453.64.13.7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004.233.42.63.244.22.12.63.23.44.76.16.96.85.42.62.32.22.53.24.14.14.14.54.22.83.43.94.65.76.67.14.45.11.34.34.24.463.83.23.24.73.44.84.86.58.34.951.84.56.8658.78.14.65.63.83.43.26.67.78.26.95.85.67.17.26.86.26.68.47.36.86.75.55.85.66.57.397.8922.95.16.25.34.94.75.265.94.84.14.86.76.74.62.84.33.44.64.24.44.83.74.45.55.85.966.65.75.25.6455.25.82.44.64.84.84.44.423.93.23.34.33.95.14.45.34.765.55.96.54.23.12.22.92.33.52.53.42.73.10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.61.44.85.45.15.254.54.40.60.81.11.92.54.75.34.75.15.75.65.65.42.856.57.17.47.38.36.87.25.85.964.33.143.72.93.23.113.82.854.13.83.73.13.64.74.166.576.14.75.13.85.84.93.84.53.54.55.36.16.16.86.95.17.37.87.95.95.73.14.66.48.17.27.15.86.86.44.85.27.14.95.68.57.74.95.34.75.86.57.58.87766.55.1256.25.14.357.27.43.24.33.744.754.24.83.23.93.654.34.25.44.34.94.14.855.24.74.35.97.33.64.86.24.33.32.71.92.33.63.31.70.91.632.32.4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003.23.44.12.641.12.84.91.94.23.43.81.33.50.93.33.92.53.45.11.52.943.83.93.84.76.44.76.165.653.91.74.55.45.26.16.25.95.76.17.77.86.96.42.25.33.65.54.93.72.63.54.44.81.534.34.23.65.14.33.26.15.13.33.84.14.25.53.32.33.24.15.25.96.57.37.267.13.94.54.34.52.24.93.44.42.13.63.52.23.44.34.94.24.43.65.65.93.14.75.74.13.54.12.82.85.44.54.24.44.85.25.45.45.65.15.35.55.323.53.64.85.76.43.31.83.43.44.55.44.13.73.53.41.733.32.92.92.72.94.22.73.31.72.72.400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
  111.             $NantesETP = array(0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.42.63.13.14.53.13.13.84.43.52.63.23.84.74.35.92.81.733.44.55.14.85.47.57.65.44.72.53.24.755.32.93.83.44.44.24.34.75.13.95.34.855.45.67.18.88.66.56.45.14.94.94.84.54.24.94.12.72.93.645.87.64.16.77.35.74.44.43.83.955.66.47.493.75.13.64.11.63.43.92.64.63.93.44.83.55.14.35.71.95.14.85.84.83.64.33.61.44.354.541.44.33.13.54.66.443.54.43.85.564.71.23.13.13.21.333.23.32.41.32.72.23.22.61.53.42.32.12.31.92.62.12.72.42.92.21.222.21.912.2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.90.93.13.74.24.43.93.33.743.21.22.53.54.73.93.65.14.94.85.14.454.11.93.64.243.23.11.74.14.64.42.52.20.93.13.44.43.70.22.23.91.64.53.33.83.23.95.95.76.576.36.67.47.57.98.17.86.73.35.14.73.73.75.57.37.35.85.95.15.25.76.45.45.74.33.24.63.74.35.16.55.45.13.44.62.33.95.24.56.17.56.86.96.95.353.444.133.433.73.64.13.83.62.44.45.33.33.73.32.844.32.73.23.43.95.14.453.94.33.14.23.93.13.23.62.73.93.73.143.43.1330.71.42.84.24.13.73.43.72.6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.62.62.23.32.933.13.53.40.73.73.95.46.66.354.23.12.62.54.13.944.83.51.74.33.82.14.14.75.84.24.62.63.43.32.53.92.83.81.22.93.93.92.74.156.43.15.3567.224.98.697.45.36.666.78.296.26.77.17.98.77.46.74.96.47.46.86.96.32.64.74.14.76.28.66.87.41.35.24.84.74.64.33.95.35.94.33.52.34.34.73.75.94.14.23.61.83.62.91.34.63.84.15.15.176.73.95.64.83.13.64.44.14.744.12.73.33.14.53.21.83.93.22.53.74.84.74.94.366.36.55.43.51.23.111.32.52.71.60.80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.51.11.93.43.22.74.73.13.53.53.24.24.94.84.54.14.24.95.35.15.54.24.64.266.77.77.48.77.98.57.66.75.83.93.65.42.73.34.62.61.23.4332.43.42.33.43.63.634.66.26.95.71.73.31.93.22.43.84.64.113.44.74.65.14.65.35.76.85.94.34.63.65.45.76.26.57.67.66.152.44.83.55.55.98.55.35.65.25.64.84.56.48.56.26.16.45.92.834.64.12.44.23.12.24.25.53.93.43.3341.63.62.32.23.643.73.43.74.12.43.23.74.43.83.33.54.76.12.446.64.12.62.32.62.71.81.93.132.20.91.31.7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003.62.831.12.82.32.64.93.73.83.22.32.92.42.92.83.62.73.834.53.93.33.53.22.13.54.95.47.16.46.33.813.34.13.94.85.45.44.45.85.96.96.86.54.74.12.332.12.722.44.43.31.33.63.43.63.94.53.33.73.11.643.23.22.61.82.83.93.444.24.65.36.87.487.586.32.84.34.22.8444.63.43.33.51.71.81.94.13.73.942.83.94.24.65.13.94.532.53.14.61.43.63.74.65.64.74.34.94.23.34.35.35.64.843.85.97.44.22.43.733.53.72.82.432.93.42.72.73.93.22.62.80.633.92.632.100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
  112.             $LyonETP = array(0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.61.72.32.73.81.323.143.91.61.82.43.64.64.66.66.733.84.35.65.96.96.35.97.58.18.76.25.35.15.94.63.75.95.44.86.36.37.16.46.86.64.95.67.37.96.4998.38.58.37.96.93.87.24.75.44.83.13.85.95.79987.35.94.25.67.26.97.77.87.57.6996.74.13.45.15.63.74.95.46.36.56.26.16.67.37.86.86.38.16.524.55.23.54.44.56.874.35.75.15.96.355.26.45995.75.776.31.34.33.23.34.34.24.94.33.72.63.53.73.94.92.82.52.822.62.12.72.62.72.732.22.53.234.31.6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002.94.73.64.754.55.65.54.73.14.15.810.92.52.73.44.55.34.94.75.12.74.64.86.25.13.44.93.344.55.44.94.54.65.95.645.37.24.33.94.766.65.66.15.76.86.77.37.56.87.17.47.17.88.36.16.98.48.35.26.25.45.27.288.68.67.26.26.46.15.56.97.46.66.65.74.56.78.46.37.27.17.93.45.96.57.68.787.3998.497.32.75.366.84.45.16.364.77.37.26.96.46.25.36.13.85.34.65.56.24.75.85.54.94.44.452.64.83.84.25.14.76.45.45.263.95.36.14.24.45.83.66.14.73.433.34.23.91.5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004.13.14.32.13.14.14.72.42.53.94.14.966.35.84.12.33.32.63.14.55.955.66.66.64.44.25.255.55.88.35.8994.97.35.70.90.71.156.333.35.15.47.294.94.35.15.36.78.58.67.58.58.28.68.67.78.27.876.86.47.57.98.75.26.68.47.97.57.37.26.678.76.67.98.19994.755.45.46.75.56.96.66.26.16.23.95.48.34.84.445.15.34.84.37.17.41.10.93.24.14.24.855.24.95.44.75.16.14.77.35.94.354.55.132.63.74.34.13.93.84.54.76.55.35.23.95.44.832.32.73.24.13.74.13.30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.91.73.54.65.93.84.57.47.13.93.91.90.71.52.94.46.56.787.56.15.92.64.45.66.25.566.95.45.65.86.55.23.72.84.644.91.23.44.92.7355.353.94.35.35.667.26.57.58.9786.36.36.15.96.27.46.36.67.77.96.67.388.37.67.67.14.25.95.87.777.67.74.96.68.16.87.598.48.48.597.94.65.46.16.46.77.187.77.97.88.75.25.46.53.95.25.97.3996.36.85.776.661.73.44.74.55.24.74.76.16.76.16.34.53.85.75.35.44.95.95.95.856.15.62.92.83.23.63.23.32.10.70.521.8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.93.63.64.24.31.63.85.181.42.93.63.53.41.73.63.92.73.64.53.14.344.43.64.65.85.26.46.15.77.13.56.97.64.64.84.45.95.96.26.97.18.17.17.67.87.18.67.74.25.254.64.24.35.57.22.54.93.65.16.22.83.66.81.25.14.35.455.44.53.10.91.14.25.16.76.8765.97.35.95.865.14.95.73.44.53.94.22.91.94.35.71.34.54.34.85.35.24.85.56.65.453.8445.55.85.33.444.75.454.73.54.73.843.54.54.24.45.484.13.143.855.24.62.43.53.42.313.32.72.62.73.93.23.32.83.63.300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
  113.             $ETPBDD = ['Paris' => $ParisETP'Marignane' => $MarignaneETP'Aurillac' => $AurillacETP'Bordeaux' => $BordeauxETP'Nantes' => $NantesETP'Lyon' => $LyonETP];
  114.             $ETP $ETPBDD[$climat];
  115.             ////////fin climat
  116.             
  117.             If ($AnneesCalculees == 2) {
  118.                $pluviometrie $pluieBDD[$climat]; 
  119.             } else {
  120.                 //Récupérer la station choisie
  121.                $stationId $reutilisationDTO->getStationAPI();
  122.                $stationBDD $stationsMeteoRepository->findOneBy(['IdStation' => $stationId]);
  123.                 //Aller chercher les données météo de chaque année
  124.                $pluviometrieParAn $PluviometrieRepository->findBy(['idStation' => $stationBDD]);
  125.                dump($pluviometrieParAn);
  126.                 //les cumuler dans un tableau
  127.                $pluviometrie[]= null;
  128.                    $pluviometrieAnnuelleData0 $pluviometrieParAn[0]->getRainData();
  129.                    $pluviometrieAnnuelleData1 $pluviometrieParAn[1]->getRainData();
  130.                    $pluviometrieAnnuelleData2 $pluviometrieParAn[2]->getRainData();
  131.                    $pluviometrieAnnuelleData3 $pluviometrieParAn[3]->getRainData();
  132.                    $pluviometrieAnnuelleData4 $pluviometrieParAn[4]->getRainData();
  133.                dump($pluviometrieAnnuelleData0);
  134.                $pluviometrie array_merge_recursive($pluviometrieAnnuelleData0,$pluviometrieAnnuelleData1,
  135.                        $pluviometrieAnnuelleData2,$pluviometrieAnnuelleData3,$pluviometrieAnnuelleData4);
  136.                $pluviometrie array_slice($pluviometrie01825);
  137.                dump($pluviometrie);              
  138.             }
  139.             
  140.             // Besoins en eau            
  141.             $besoinWc 0;
  142.             $nbreUtilisateur $reutilisationDTO->getNbreUtilisateur();
  143.             $tauxRaccordement $reutilisationDTO->getTauxRaccordement()/100;
  144.             $volumeParUtilisation =  $this->toFloat($reutilisationDTO->getVolumeParUtilisation());
  145.             $scenarioUtilisation $reutilisationDTO->getScenarioUtilisation();            
  146.             $scenario5sur7 = array(111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001,1111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100);
  147.             $scenarioEnseignement = array(0000000110.51100110.51100110.5100110.51100110.5110000000000000111111111110.51100110.5110110.51100110.5110011000000000000000100110.51100110.5110110.51100110.51100110.51100110.5100110.51100110.51100110.5110010.511000000000000000000000000000000000000000000000000000000000000000110.5110110.51100110.51100110.51100111100110.51100110.510000000000000000110.51100110.51100110.5100110.51100110.51100110.5110010.5110000000000000000000000000000000110.51100110.51100110.5100110.51100110.5110000000000000111111111110.51100110.5110110.51100110.5110011000000000000000100110.51100110.5110110.51100110.51100110.51100110.5100110.51100110.51100110.5110010.511000000000000000000000000000000000000000000000000000000000000000110.5110110.51100110.51100110.51100111100110.51100110.510000000000000000110.51100110.51100110.5100110.51100110.51100110.5110010.5110000000000000000000000000000000110.51100110.51100110.5100110.51100110.5110000000000000111111111110.51100110.5110110.51100110.5110011000000000000000100110.51100110.5110110.51100110.51100110.51100110.5100110.51100110.51100110.5110010.511000000000000000000000000000000000000000000000000000000000000000110.5110110.51100110.51100110.51100111100110.51100110.510000000000000000110.51100110.51100110.5100110.51100110.51100110.5110010.5110000000000000000000000000000000110.51100110.51100110.5100110.51100110.5110000000000000111111111110.51100110.5110110.51100110.5110011000000000000000100110.51100110.5110110.51100110.51100110.51100110.5100110.51100110.51100110.5110010.511000000000000000000000000000000000000000000000000000000000000000110.5110110.51100110.51100110.51100111100110.51100110.510000000000000000110.51100110.51100110.5100110.51100110.51100110.5110010.5110000000000000000000000000000000110.51100110.51100110.5100110.51100110.5110000000000000111111111110.51100110.5110110.51100110.5110011000000000000000100110.51100110.5110110.51100110.51100110.51100110.5100110.51100110.51100110.5110010.511000000000000000000000000000000000000000000000000000000000000000110.5110110.51100110.51100110.51100111100110.51100110.510000000000000000110.51100110.51100110.5100110.51100110.51100110.5110010.5110000000000000000000000000);
  148.             
  149.             //Transformation du besoin en eau libre
  150.                 $besoinEau $reutilisationDTO->getBesoinEau();
  151.                 // Besoin en eau séparé par des points-virgules
  152.                 if (!empty($besoinEau)) {
  153.                     // Supprimer les espaces et remplacer les virgules par des points
  154.                     $besoinEau str_replace(" """$besoinEau);
  155.                     $besoinEau str_replace(",""."$besoinEau);
  156.                     // Transformer la chaîne en tableau
  157.                     $besoinEauArray explode(";"$besoinEau);
  158.                     // Répéter la série jusqu'à obtenir 1825 éléments dans le tableau
  159.                     $i 0;
  160.                     while (count($besoinEauArray) < 1826) {
  161.                         // Ajouter les éléments de la série à la fin du tableau
  162.                         $besoinEauArray[] = $besoinEauArray[$i count($besoinEauArray)];
  163.                         $i++;
  164.                     }
  165.                 } else {
  166.                     // Créer un tableau de 1825 zéros
  167.                     $besoinEauArray array_fill(018260);
  168.                 }
  169. //dump($reutilisationDTO->getCertivea());                
  170. // Apports toiture
  171. if ($reutilisationDTO->getCertivea()){
  172.     $surfaceRecuperee =
  173.         (
  174.         $this->toFloat($reutilisationDTO->getSurfaceRecuperee())
  175.         + $this->toFloat($reutilisationDTO->getSurfaceRecuperee2())
  176.         + $this->toFloat($reutilisationDTO->getSurfaceRecuperee3())
  177.         );
  178.     //dump($reutilisationDTO->getCertivea()); 
  179. else 
  180. {
  181.     $surfaceRecuperee =
  182.         (
  183.         $this->toFloat($reutilisationDTO->getSurfaceRecuperee()) * $this->toFloat($reutilisationDTO->getRendementToiture())
  184.         + $this->toFloat($reutilisationDTO->getSurfaceRecuperee2()) * $this->toFloat($reutilisationDTO->getRendementToiture2())
  185.         + $this->toFloat($reutilisationDTO->getSurfaceRecuperee3()) * $this->toFloat($reutilisationDTO->getRendementToiture3())
  186.         ) * 0.9// 0.9 pour le filtre Kf
  187.             
  188.             // Autres paramètres
  189.             $volumeCuveUser =  $this->toFloat($reutilisationDTO->getVolumeCuve());
  190.             $tauxRecupObjectif =  $this->toFloat($reutilisationDTO->getTauxObjectif());
  191.         $show_complement=true;
  192.             $time date('d/m/y H:i');
  193.             $reutilisationDTO->setTime($time);
  194.             
  195.             // Données économiques récupérées :
  196.             $coutEau =  $this->toFloat($reutilisationDTO->getCoutEau());
  197.             $coutPompe =  $this->toFloat($reutilisationDTO->getCoutPompe());
  198.             $coutVolume =  $this->toFloat($reutilisationDTO->getCoutVolume());
  199.             $choixVolume =  $this->toFloat($reutilisationDTO->getChoixVolume());
  200.             $coutVolume2  =  $this->toFloat($reutilisationDTO->getCoutVolume2());
  201.             $choixVolume2  =  $this->toFloat($reutilisationDTO->getChoixVolume2());
  202.             //////////////        
  203.                         
  204.             // Arrosage 
  205.             $sArrosage $this->toFloat($reutilisationDTO->getSArrosage());
  206.             $typePlante $reutilisationDTO->getTypePlante();
  207.             $profondeurTerre $reutilisationDTO->getProfondeurTerre();
  208.             $ru $reutilisationDTO->getRu();
  209.             $kcArray = array('Gazon Kc=0.8 racines=20cm' => '0.8''Vivaces Kc=0.2 racines=40cm' => '0.2''Arbustes Kc=0.2 racines=70cm' => '0.2''Graminees Kc=0.8 racines=80cm' => '0.8');
  210.             $profondeurRacineArray = array('Gazon Kc=0.8 racines=20cm' => '0.2''Vivaces Kc=0.2 racines=40cm' => '0.4''Arbustes Kc=0.2 racines=70cm' => '0.7''Graminees Kc=0.8 racines=80cm' => '0.8');            
  211.             $kc $kcArray[$typePlante];
  212.             $profondeurRacine $profondeurRacineArray[$typePlante];  
  213.             $RFUmax min($profondeurRacine,$profondeurTerre) * $ru 2/3;
  214.             //////////////
  215.             $iteration 0;
  216.             $victoire 0;
  217.             Do {
  218.             $volumeEauInitial 0//Litres
  219.             $tauxRecup null;
  220.             $tempsDeRetour null;
  221.             $volumeCuveGraph null;
  222.             
  223.             $besoinArrosageCinqAnsSurfacique 0;            
  224.             $besoinArrosageAnnuel 0;
  225.             $ETPstring implode(",",$ETP);
  226.             $ETPmax max($ETP);
  227.             $besoinJournalierMax $nbreUtilisateur $volumeParUtilisation $tauxRaccordement max($besoinEauArray) + $sArrosage $ETPmax;
  228.                 $volumeTheorique round(min($besoinJournalierMax$surfaceRecuperee)/10)*10;
  229.                 $volumeCuveArray = [0.25 $volumeTheorique0.5 $volumeTheorique$volumeTheorique,
  230.                     $volumeTheorique$volumeTheorique27 $volumeTheorique];
  231.                 if ($volumeCuveUser != null) {
  232.                     $volumeCuveArray [] = $volumeCuveUser;
  233.                     $volumeCuveArray [] = $volumeCuveUser 2;
  234.                     $volumeCuveArray [] = $volumeCuveUser 0.5;
  235.                     asort($volumeCuveArray);
  236.                 }
  237.                 if ($tauxRecupObjectif != null) {
  238.                     if ($iteration 0) {
  239.                         $yObjectif max(2,$tauxRecupObjectif * ($ya $yb) / ($xa $xb) + ($xa $yb $xb $ya) / ($xa $xb));
  240.                         $yObjectifInf max(1$yObjectif 0.25 $yObjectif);
  241.                         $yObjectifSup max(3,$yObjectif 0.25 $yObjectif);
  242.                         $volumeCuveArray = [0.25 $volumeTheorique0.5 $volumeTheorique$volumeTheorique,
  243.                             $volumeTheorique$volumeTheorique27 $volumeTheorique$yObjectifInf$yObjectif$yObjectifSup];
  244.                         asort($volumeCuveArray);
  245. //                        
  246.                     }
  247.                 } else {
  248.                     $victoire 2;
  249.                 }
  250.                 
  251.                 // Calcul volume par volume de cuve :
  252.                 foreach ($volumeCuveArray as $volumeCuve) {
  253.                     $volumeEauInitial 0;
  254.                     $SommeTropPleinNuitEtJour 0;
  255.                     $sommeManqueEau 0;
  256.                     
  257.                     $besoinEauAnnuel 0;
  258.                     $jour 0;
  259.                     $besoinEauJournalier 0;
  260.                     $apportEauAnnuel 0;
  261.                     $RFUJournalier 0;
  262.                     $graphVolumeEau null;
  263.                     $graphTropPleinNuitEtJour null;
  264.                     $graphManqueEau null;
  265.                     $arrayReuJournalier null;
  266.                     $graphApportCuve null;
  267.                     $besoinArrosageAnnuel 0;
  268.                     $besoinWcAnnuel 0;
  269.                     $besoinEauAutreAnnuel 0;
  270.                     $besoinArrosageCinqAnsSurfacique 0;
  271.                     
  272.                     //Calcul jour par jour :
  273.                     foreach ($pluviometrie as $pluieDuJour) {
  274.                         //Calcul des besoins WC : 
  275.                         if ($scenarioUtilisation == 1) {// ajouter également ici le taux
  276.                             $besoinWc $nbreUtilisateur $volumeParUtilisation $tauxRaccordement;
  277.                         } else if ($scenarioUtilisation == 2) {
  278.                             $besoinWc $nbreUtilisateur $volumeParUtilisation $tauxRaccordement $scenario5sur7[$jour];
  279.                         } else if ($scenarioUtilisation == 3) {
  280.                             $besoinWc $nbreUtilisateur $volumeParUtilisation $tauxRaccordement $scenarioEnseignement[$jour];
  281.                         }
  282.                         //calcul des besoins d'arrosage :
  283.                         $besoinArrosageJournalierSurfacique 0;
  284.                         $ConsoPlanteJournalier $kc $ETP[$jour];
  285.                         If ($AnneesCalculees == 2) {
  286.                             $RFUJournalier $RFUJournalier $ConsoPlanteJournalier $pluieDuJour $stationMeteo $pluieBase;
  287.                         } else {
  288.                             $RFUJournalier $RFUJournalier $ConsoPlanteJournalier $pluieDuJour;
  289.                         }
  290.                         if ($RFUJournalier 0) {
  291.                             $besoinArrosageJournalierSurfacique abs($RFUJournalier);
  292.                             $RFUJournalier 0;
  293.                         } else if ($RFUJournalier $RFUmax) {
  294.                             $RFUJournalier $RFUmax;
  295.                         }
  296.                         $besoinArrosageCinqAnsSurfacique $besoinArrosageJournalierSurfacique $besoinArrosageCinqAnsSurfacique;
  297.                         
  298.                         $besoinEauJournalier $besoinEauArray[$jour] + $besoinWc $besoinArrosageJournalierSurfacique $sArrosage;
  299.                         
  300.              //Ajouter ici une condition sur le choix des années :
  301.                         If ($AnneesCalculees == 2) {
  302.                             $apportEauJournalier $surfaceRecuperee $pluieDuJour $stationMeteo $pluieBase;
  303.                         } else {
  304.                             $apportEauJournalier $surfaceRecuperee $pluieDuJour;
  305.                         }
  306.                         //nouveau calcul :
  307.                         $manqueEauDuJour 0;
  308.                         $tropPleinNuit =0;
  309.                         $tropPleinJour 0;
  310.                         $volumeEau $volumeEauInitial $apportEauJournalier *0.3 ;
  311.                         if ($volumeEau >= $volumeCuve) {
  312.                             $tropPleinNuit $volumeEau $volumeCuve;
  313.                             $volumeEau $volumeCuve;
  314.                         } 
  315.                         $volumeEau $volumeEau $besoinEauJournalier $apportEauJournalier *0.7;
  316.                         if ($volumeEau >= $volumeCuve) {
  317.                             $tropPleinJour $volumeEau $volumeCuve;
  318.                             $volumeEau $volumeCuve;
  319.                         }
  320.                         if ($volumeEau <= 0) {
  321.                             $manqueEauDuJour abs($volumeEau);
  322.                             $volumeEau 0;
  323.                         }
  324.                         $TropPleinNuitEtJour $tropPleinNuit $tropPleinJour;
  325.                         $SommeTropPleinNuitEtJour $SommeTropPleinNuitEtJour $TropPleinNuitEtJour;
  326.                         $besoinWCnonRaccordeJournalier $besoinWc/$tauxRaccordement*(1-$tauxRaccordement);
  327.                         
  328.                         $sommeManqueEau $manqueEauDuJour $sommeManqueEau $besoinWCnonRaccordeJournalier;
  329.                          
  330.                         //somme annuelle
  331.                         $besoinArrosageAnnuel $besoinArrosageJournalierSurfacique$sArrosage $besoinArrosageAnnuel;
  332.                         $besoinWcAnnuel $besoinWcAnnuel $besoinWc;
  333.                         $besoinEauAutreAnnuel $besoinEauAutreAnnuel $besoinEauArray[$jour];
  334.                         $apportEauAnnuel $apportEauAnnuel $apportEauJournalier;
  335.                         $besoinEauAnnuel $besoinEauAnnuel $besoinEauJournalier $besoinWCnonRaccordeJournalier
  336.                         //préparation graphique et tableau
  337.                         $graphVolumeEau[] = $volumeEau;
  338.                         $graphVolumeEauArray [$volumeCuve] = $graphVolumeEau;
  339.                         if ($volumeCuve == $volumeEau){
  340.                             $graphTropPleinNuitEtJour[] = $TropPleinNuitEtJour $volumeEau;
  341.                         } else {
  342.                             $graphTropPleinNuitEtJour[] = $volumeEau;
  343.                         }
  344.                         
  345.                         $graphTropPleinArray[$volumeCuve] = $graphTropPleinNuitEtJour;
  346.                         
  347.                         $graphManqueEau[] = - $manqueEauDuJour;
  348.                         $graphManqueEauArray[$volumeCuve] = $graphManqueEau;
  349.                          $graphApportCuve[] = $besoinEauJournalier $manqueEauDuJour;
  350.                          $graphApportCuveArray[$volumeCuve] = $graphApportCuve;
  351.                        
  352.                         //tableau d'analyse jour par jour
  353.                         $arrayReuJournalier = array($jour$pluieDuJour$RFUJournalier$ETP[$jour], $ConsoPlanteJournalier$besoinArrosageJournalierSurfacique,
  354.                             $besoinEauJournalier$pluieDuJour $surfaceRecuperee$volumeEau,  $manqueEauDuJour); //$bilanEau,
  355.                         $arrayReu [] = $arrayReuJournalier;
  356.                         $arrayReuAnnuel[$volumeCuve]=$arrayReu;                        
  357.                         $jour $jour 1;
  358.                         $volumeEauInitial $volumeEau;
  359.                     }  //on change de jour
  360.                     
  361.                     $tauxRecup [$volumeCuve] =$besoinEauAnnuel ? ($besoinEauAnnuel $sommeManqueEau) / $besoinEauAnnuel 100 0;
  362.                     $volumeCuveGraph [] = $volumeCuve;
  363.                     if ($volumeCuveUser != null AND $volumeCuve == $volumeCuveUser) {
  364.                         $tauxRecupUser =$besoinEauAnnuel ? ($besoinEauAnnuel $sommeManqueEau) / $besoinEauAnnuel 100 0;
  365.                     } else if ($volumeCuveUser == null) {
  366.                         $tauxRecupUser 0;
  367.                         $volumeCuveUser 0;
  368.                     }
  369.                     //calcul du temps de retour
  370.                     
  371.                     $eauReutilisee $apportEauAnnuel $SommeTropPleinNuitEtJour;
  372.                     $gainAnnuel $coutEau $eauReutilisee 1000 /5;
  373.                     $coutCuve $coutPompe + ($coutVolume2 $coutVolume)/($choixVolume2 $choixVolume) * ($volumeCuve $choixVolume) + $coutVolume;
  374.                     $tempsDeRetour [$volumeCuve] = $coutCuve max($gainAnnuel1);
  375.                     $arrayVerif ['volumeCuve'] = $volumeCuve;
  376.                     $arrayVerif ['$tauxRecup'] = $besoinEauAnnuel round(($besoinEauAnnuel $sommeManqueEau) / $besoinEauAnnuel 1001) : 0;
  377.                     $arrayVerif ['eau reutilisée'] = round($eauReutilisee //1000);
  378.                     $arrayVerif ['$sommeManqueEau'] = round($sommeManqueEau //1000);
  379.                     $arrayVerif ['$SommeTropPleinNuitEtJour'] = round($SommeTropPleinNuitEtJour //1000);
  380.                     $arrayVerif ['$gainAnnuel'] = round($gainAnnuel);
  381.                     $arrayVerif ['coutcuve'] = round($coutCuve);
  382.                     $arrayVerif ['tempsDeRetour'] = round($coutCuve max($gainAnnuel1), 1);
  383.                     $tableauParametrique[$volumeCuve] = $arrayVerif;
  384.                     
  385.                 } //on change de volume de cuve
  386.                 
  387.                 
  388.                 $x 1;
  389.                 $xMax count($tauxRecup);
  390.                 
  391.                 $position reset($tauxRecup);
  392.                 
  393.                 foreach ($tauxRecup as $y) {
  394.                     $yRound round($y);
  395.                     if ($yRound == $tauxRecupObjectif) {
  396.                         $victoire++;
  397.                         $tauxRecupUser $y;
  398.                         $volumeCuveUser array_search($y$tauxRecup);
  399.                     }
  400.                     if ($x == and $tauxRecupObjectif $yRound) {
  401.                         $position next($tauxRecup);
  402.                         goto a;
  403.                     }
  404.                     if ($tauxRecupObjectif $yRound) {
  405.                         goto a;
  406.                     }
  407.                     if ($y $tauxRecupObjectif) {
  408.                         if ($x == $xMax) {
  409.                             $position prev($tauxRecup);
  410.                             goto a;
  411.                         } else {
  412.                             $position next($tauxRecup);
  413.                         }
  414.                     }
  415. //                    
  416.                     $x++;
  417.                 }
  418.                 a:
  419.                 $xa prev($tauxRecup);
  420.                 $xb next($tauxRecup);
  421.                 $ya array_search($xa$tauxRecup);
  422.                 $yb array_search($xb$tauxRecup);
  423.                 if ($iteration 5) {
  424.                     goto finDesIterations;
  425.                 };
  426.                 if ($xa == $xb) {
  427.                     goto finDesIterations;
  428.                 };
  429.                 $iteration++;
  430.             } while ($victoire 1.9);
  431.             
  432.             finDesIterations:
  433.             //Mise en graphique de l'étude paramétrique
  434.             $x 0;
  435.             $chaineCaractere null;
  436.             $cles array_keys($tauxRecup);
  437.             foreach ($tauxRecup as $y) {
  438.                 $chaineCaractere [] = "{ x: ";
  439.                 $chaineCaractere [] = $cles[$x];
  440.                 $chaineCaractere [] = ", y: ";
  441.                 $chaineCaractere [] = $y;
  442.                 $chaineCaractere [] = "}";
  443.                 $pointJson [] = implode($chaineCaractere);
  444.                 $chaineCaractere null;
  445.                 $x $x 1;
  446.             }
  447.             $graphParametriqueJson implode(","$pointJson);
  448.             $graphParametriqueUserJson = array("{ x: "$volumeCuveUser", y: "$tauxRecupUser"}");
  449.             $graphParametriqueUserJson implode($graphParametriqueUserJson);
  450.             //dump($tauxRecup);
  451.             //dump($graphParametriqueJson);
  452.             //Mise en graphique de l'étude paramétrique Temps de retour
  453.             $pointJson null;
  454.             $x 0;
  455.             $chaineCaractere null;
  456.             $cles array_keys($tempsDeRetour);
  457.             foreach ($tempsDeRetour as $y) {
  458.                 $chaineCaractere [] = "{ x: ";
  459.                 $chaineCaractere [] = $cles[$x];
  460.                 $chaineCaractere [] = ", y: ";
  461.                 $chaineCaractere [] = $y;
  462.                 $chaineCaractere [] = "}";
  463.                 $pointJson [] = implode($chaineCaractere);
  464.                 $chaineCaractere null;
  465.                 $x $x 1;
  466.             }
  467.             $graphTempsDeRetour implode(","$pointJson);
  468.             
  469.             //Mise en graphique du volume de cuve avec un coef de 1
  470.             $pointJson null;
  471.             $x 1;
  472.             $chaineCaractere null;
  473.             if ($volumeCuveUser != null){
  474.                 $graphVolumeEau $graphVolumeEauArray[$volumeCuveUser];
  475.                 $arrayReu $arrayReuAnnuel [$volumeCuveUser];
  476.                 $graphManqueEau $graphManqueEauArray[$volumeCuveUser];
  477.                 $graphTropPlein $graphTropPleinArray[$volumeCuveUser];
  478.                 $graphApportCuve $graphApportCuveArray[$volumeCuveUser];
  479.                 $maxGraph $volumeCuveUser 5;
  480.             } else {
  481.                 $graphVolumeEau $graphVolumeEauArray[$volumeTheorique];
  482.                 $arrayReu $arrayReuAnnuel [$volumeTheorique];
  483.                 $graphManqueEau $graphManqueEauArray[$volumeTheorique];
  484.                 $graphTropPlein $graphTropPleinArray[$volumeTheorique];
  485.                 $graphApportCuve $graphApportCuveArray[$volumeTheorique];
  486.                 $maxGraph $volumeTheorique 5;
  487.             }
  488.             
  489.             
  490.             foreach ($graphVolumeEau as $y) {
  491.                 $chaineCaractere [] = "{ x: ";
  492.                 $chaineCaractere [] = $x;
  493.                 $chaineCaractere [] = ", y: ";
  494.                 $chaineCaractere [] = $y;
  495.                 $chaineCaractere [] = "}";
  496.                 $pointJson [] = implode($chaineCaractere);
  497.                 $chaineCaractere null;
  498.                 $x $x 1;
  499.                 if ($x 364) {
  500.                     goto fin1;
  501.                 };
  502.             }
  503.             fin1:
  504.             $graphVolumeEauJson implode(","$pointJson);
  505.             $graphJourParJour['volumeEau']=$graphVolumeEauJson;
  506.             
  507.             //mise en graphique du manque d'eau
  508.             $pointJson null;
  509.             $x 1;
  510.             $chaineCaractere null;
  511.             foreach ($graphManqueEau as $y) {
  512.                 $chaineCaractere [] = "{ x: ";
  513.                 $chaineCaractere [] = $x;
  514.                 $chaineCaractere [] = ", y: ";
  515.                 $chaineCaractere [] = $y;
  516.                 $chaineCaractere [] = "}";
  517.                 $pointJson [] = implode($chaineCaractere);
  518.                 $chaineCaractere null;
  519.                 $x $x 1;
  520.                                 if ($x 364) {
  521.                     goto fin2;
  522.                 };
  523.             }
  524.             fin2:            
  525.             $graphManqueEauJson implode(","$pointJson);
  526.             $graphJourParJour['manqueEau']=$graphManqueEauJson;
  527.             $pointJson null;
  528.             $x 1;
  529.             $chaineCaractere null;
  530.             foreach ($graphManqueEau as $y) {
  531.                 $chaineCaractere [] = "{ x: ";
  532.                 $chaineCaractere [] = $x;
  533.                 $chaineCaractere [] = ", y: ";
  534.                 $chaineCaractere [] = - $y;
  535.                 $chaineCaractere [] = "}";
  536.                 $pointJson [] = implode($chaineCaractere);
  537.                 $chaineCaractere null;
  538.                 $x $x 1;
  539.                             if ($x 364) {
  540.                     goto fin3;
  541.                 };
  542.             }
  543.             fin3:
  544.             $graphManqueEauJson implode(","$pointJson);
  545.             $graphJourParJour['manqueEauPositif']=$graphManqueEauJson;
  546.             
  547.             //mise en graphique du trop plein
  548.             $pointJson null;
  549.             $x 1;
  550.             $chaineCaractere null;
  551.             foreach ($graphTropPlein as $y) {
  552.                 $chaineCaractere [] = "{ x: ";
  553.                 $chaineCaractere [] = $x;
  554.                 $chaineCaractere [] = ", y: ";
  555.                 $chaineCaractere [] = $y;
  556.                 $chaineCaractere [] = "}";
  557.                 $pointJson [] = implode($chaineCaractere);
  558.                 $chaineCaractere null;
  559.                 $x $x 1;
  560.                             if ($x 364) {
  561.                     goto fin4;
  562.                 };
  563.             }
  564.             fin4:
  565.             $graphTropPleinJson implode(","$pointJson);
  566.             $graphJourParJour['tropPlein']=$graphTropPleinJson;
  567.             
  568.             //mise en graphique de la pluviometrie
  569.             $pointJson null;
  570.             $x 1;
  571.             $chaineCaractere null;
  572.             foreach ($pluviometrie as $y) {
  573.                 $chaineCaractere [] = "{ x: ";
  574.                 $chaineCaractere [] = $x;
  575.                 $chaineCaractere [] = ", y: ";
  576.                 $chaineCaractere [] = $y $stationMeteo $pluieBase;
  577.                 $chaineCaractere [] = "}";
  578.                 $pointJson [] = implode($chaineCaractere);
  579.                 $chaineCaractere null;
  580.                 $x $x 1;
  581.                             if ($x 364) {
  582.                     goto fin5;
  583.                 };
  584.             }
  585.             fin5:
  586.             $graphPluviometrieJson implode(","$pointJson);
  587.             $graphJourParJour['pluviometrie']=$graphPluviometrieJson;
  588.             
  589.               //mise en graphique de l'apport cuve
  590.             $pointJson null;
  591.             $x 1;
  592.             $chaineCaractere null;
  593.             foreach ($graphApportCuve as $y) {
  594.                 $chaineCaractere [] = "{ x: ";
  595.                 $chaineCaractere [] = $x;
  596.                 $chaineCaractere [] = ", y: ";
  597.                 $chaineCaractere [] = $y;
  598.                 $chaineCaractere [] = "}";
  599.                 $pointJson [] = implode($chaineCaractere);
  600.                 $chaineCaractere null;
  601.                 $x $x 1;
  602.                             if ($x 364) {
  603.                     goto fin6;
  604.                 };
  605.             }
  606.             fin6:
  607.             $graphApportCuveJson implode(","$pointJson);
  608.             $graphJourParJour['apportCuve']=$graphApportCuveJson;
  609.             $graphJourParJour['maximum']= $maxGraph
  610.             
  611.             
  612.             //mise en graphique de la tarte
  613.             $totalDesBesoins $besoinArrosageAnnuel $besoinWcAnnuel $besoinEauAutreAnnuel;
  614.             $graphTarte['tauxArrosage'] = $totalDesBesoins $besoinArrosageAnnuel $totalDesBesoins 0;
  615.             $graphTarte['tauxWc'] = $totalDesBesoins $besoinWcAnnuel $totalDesBesoins 0;
  616.             $graphTarte['tauxAutres'] = $totalDesBesoins $besoinEauAutreAnnuel $totalDesBesoins 0;
  617.             $graphTarte['Arrosage'] = round($besoinArrosageAnnuel/1000/5) ;
  618.             $graphTarte['Wc'] = round($besoinWcAnnuel/1000/5);
  619.             $graphTarte['Autres'] = round($besoinEauAutreAnnuel/1000/5) ;
  620.             
  621.             $pluviometrieTotale array_sum($pluviometrie)* $stationMeteo $pluieBase;
  622.             $tableauSynthese['pluviometrieMoyenne'] = round($pluviometrieTotale /5);
  623.             $tableauSynthese['besoinArrosage'] = round($besoinArrosageCinqAnsSurfacique /5);
  624.             $tableauSynthese['besoinAnnuel'] = round($totalDesBesoins /1000);
  625.             if ($this->user != null) {
  626.                 $reutilisationDTO->setTheUser($this->user);
  627.             }
  628.             
  629.             
  630.             // Stockage des données des graphiques pour ré-uitilisation ( pdf, ... )
  631.             $dataGraphique['graphJourParJour'] = $graphJourParJour;
  632.             $dataGraphique['graphParametrique'] = $graphParametriqueJson;
  633.             $dataGraphique['graphParametriqueUserJson'] = $graphParametriqueUserJson;
  634.             $dataGraphique['graphTempsDeRetour'] = $graphTempsDeRetour;
  635.             $dataGraphique['graphPluviometrie'] = $graphPluviometrieJson;
  636.             $dataGraphique['tauxRecupUser'] = $tauxRecupUser;
  637.             $dataGraphique['besoinArrosageTotal'] = $besoinArrosageCinqAnsSurfacique;
  638.             $dataGraphique['tableau'] = $arrayReu;
  639.             $dataGraphique['volumeCuveUser'] = $volumeCuveUser;
  640.             $dataGraphique['graphTarte'] = $graphTarte;
  641.             $dataGraphique['besoinEauAnnuel'] = $besoinEauAnnuel;
  642.             $dataGraphique['sommeManqueEau'] = $sommeManqueEau;
  643.             $dataGraphique['apportEauAnnuel'] = $apportEauAnnuel;
  644.             $dataGraphique['fichePluvio'] = $reutilisationDTO;
  645.             $dataGraphique['tableauSynthese'] = $tableauSynthese;
  646.             $dataGraphique['tableauParametrique'] = $tableauParametrique;
  647.             $session->set('GraphData'$dataGraphique);
  648.             // Stockage des données des graphiques pour ré-uitilisation ( pdf, ... )
  649. //            $reutilisationDTO->setGraphData(
  650. //                ['graphJourParJour' => $graphJourParJour,
  651. //                    'graphParametrique' => $graphParametriqueJson,
  652. //                    'graphParametriqueUserJson' => $graphParametriqueUserJson,
  653. //                    'graphTempsDeRetour' => $graphTempsDeRetour,
  654. //                    'graphPluviometrie' => $graphPluviometrieJson,
  655. //                    'tauxRecupUser' => $tauxRecupUser,
  656. //                    'besoinArrosageTotal' => $besoinArrosageCinqAnsSurfacique,
  657. //                    'tableau' => $arrayReu,
  658. //                    'volumeCuveUser' => $volumeCuveUser,
  659. //                    'graphTarte' => $graphTarte,
  660. //                    'besoinEauAnnuel' => $besoinEauAnnuel,
  661. //                    'sommeManqueEau' => $sommeManqueEau,
  662. //                    'apportEauAnnuel' => $apportEauAnnuel,
  663. //                    'fichePluvio' => $reutilisationDTO,
  664. //                    'tableauSynthese' => $tableauSynthese,
  665. //                    'tableauParametrique' => $tableauParametrique]
  666. //            );
  667.             $em->persist($reutilisationDTO);
  668.             $em->flush();
  669.         $allowPDF true;
  670.             $session->set("calculEffectue"1);
  671.             $idFinal $reutilisationDTO->getId();
  672.             $session->set("pluvioId"$idFinal);
  673.             $fichePluvioAffichage $reutilisationDTO;
  674.         } else {
  675.             $graphVolumeEauJson "";
  676.             $graphParametriqueJson "";
  677.             $graphParametriqueUserJson "";
  678.             $graphPluviometrieJson "";
  679.             $graphTempsDeRetour "";
  680.             $graphTarte['tauxArrosage'] = "";
  681.             $graphTarte['tauxWc'] = "";
  682.             $graphTarte['tauxAutres'] = "";
  683.             $graphTarte['Arrosage'] = "";
  684.             $graphTarte['Wc'] = "";
  685.             $graphTarte['Autres'] = "";
  686.             $volumeCuveUser "";
  687.             $tauxRecupUser null;
  688.             $besoinArrosageCinqAnsSurfacique 0;
  689.             $besoinEauAnnuel ="";
  690.             $sommeManqueEau "";
  691.             $apportEauAnnuel ="";
  692.             $graphJourParJour['pluviometrie'] ="";
  693.             $graphJourParJour['tropPlein'] ="";
  694.             $graphJourParJour['manqueEau'] ="";
  695.             $graphJourParJour['manqueEauPositif']="";
  696.             $graphJourParJour['volumeEau'] ="";
  697.             $graphJourParJour['apportCuve']="";
  698.             $graphJourParJour['maximum']="";
  699.             $tableauSynthese['pluviometrieMoyenne'] = 0;
  700.             $tableauSynthese['besoinArrosage'] = 0;
  701.             $tableauSynthese['besoinAnnuel'] = 0;
  702.             $tableauParametrique null;
  703.             $fichePluvioAffichage $reutilisationDTO;
  704.         }
  705.         // Stockage en session des données de la fiche pluvio
  706.         // récupération des données de la fiche pluvio
  707.         return $this->render('reutilisation.html.twig',
  708.                         ['form' => $form->createView(),
  709.                 'show_complement' => $show_complement,
  710.                 'allowPDF' => $allowPDF,
  711.                     'idPluvio' => $idFinal,
  712.                             'graphJourParJour' => $graphJourParJour,
  713.                             'graphParametrique' => $graphParametriqueJson,
  714.                             'graphParametriqueUserJson' => $graphParametriqueUserJson,
  715.                             'graphTempsDeRetour' => $graphTempsDeRetour,
  716.                             'graphPluviometrie' => $graphPluviometrieJson,
  717.                             'tauxRecupUser' => $tauxRecupUser,
  718.                             'besoinArrosageTotal' => $besoinArrosageCinqAnsSurfacique,
  719.                             'tableau' => $arrayReu,
  720.                             'volumeCuveUser' => $volumeCuveUser,
  721.                             'graphTarte' => $graphTarte,
  722.                             'besoinEauAnnuel' => $besoinEauAnnuel,
  723.                             'manqueEau' => $sommeManqueEau,
  724.                             'apportEauAnnuel' => $apportEauAnnuel,
  725.                             'tableauSynthese' => $tableauSynthese,
  726.                             'tableauParametrique' => $tableauParametrique,
  727.                             'fichePluvio' => $fichePluvioAffichage                                            
  728.         ]);
  729.     }
  730.     /**
  731.      * Génération du PDF de la fiche pluvio
  732.      */
  733.     #[Route(path'/bilan_reutilisation/{idFiche}'name'RetutilisationBilanPdf')]
  734.     public function retutilisationBilanPdf(
  735.         Request $req,
  736.         \App\Repository\PluvioDatabaseRepository $pluvioDatabaseRepository,
  737.         LoggerInterface $logger,
  738.         Pdf  $knpSnappyPdf,
  739.         Request $requestSession $session,
  740.         $idFiche,
  741.         SerializerInterface $serializer) {
  742.         $session->start();
  743.         $fiche $pluvioDatabaseRepository->findOneById($idFiche);
  744.         if($fiche) {
  745.             $slugger = new AsciiSlugger('fr_FR');
  746.             // Récupère les infos de la session pour les passer à la vue
  747.             $dataReutilisation $session->get('GraphData');
  748.             $dataReutilisation['form'] = $fiche;
  749.             // Récupère les infos de la session pour les passer à la vue
  750.             $form $this->createForm(\App\Form\ReutilisationType::class, $fiche);
  751.             $formKeys array_keys($form->all());
  752.             $fields = [
  753.                 'rendementToiture''rendementToiture2''rendementToiture3',
  754.                 'climat',
  755.                 'stationmeteo''stationAPI',
  756.                 'scenarioUtilisation',
  757.                 'ru',
  758.                 'typePlante',
  759.                 'profondeurTerre',
  760.             ];
  761.             $customChoices = [];
  762.             foreach($fields as $field) {
  763.                 $selectedValue $form->get($field)->getData();
  764.                 $choices $form->get($field)->getConfig()->getOption('choices');
  765.                 $customChoices[$field] = array_search($selectedValue$choices);
  766.             }
  767.             foreach($formKeys as $key) {
  768.                 if(!in_array($key$fields)) {
  769.                     $customChoices[$key] = $form->get($key)->getData();
  770.                 }
  771.             }
  772. //            $selectedValue = $fiche->getClimat();
  773. //            $choices = $form->get('climat')->getConfig()->getOption('choices');
  774. //            dump(array_search($selectedValue, $choices));
  775. //            $selectedValue = $fiche->getStationMeteo();
  776. //            $choices = $form->get('stationmeteo')->getConfig()->getOption('choices');
  777. //            dump(array_search($selectedValue, $choices));
  778. //            stationmeteo
  779. //            dd('ok');
  780.             //dd('test');
  781.             $params $request->request->all();
  782.             $dataReutilisation['form'] = $customChoices;
  783.             $dataReutilisation['img']='';
  784.             if(isset($params['img'])) $dataReutilisation['img']=$params['img'];
  785. //            $dataReutilisation['customChoices'] = $customChoices;
  786.             $content $this->renderView('bilan_reutilisation.html.twig'$dataReutilisation);
  787.             
  788. //            $content = '<pre>';
  789. //            $content .= print_r($request->files, true);
  790. //            $content .= print_r($request->request->all(),true);
  791. //            $content .='</pre>';
  792.             $nomProjet trim($fiche->getNomDuProjet() ?? 'Projet_Sans_Nom');
  793.                         $time $fiche->getTime() ?? time();
  794.                         $filename $slugger->slug("Bilan_reutilisation_{$nomProjet}-{$time}") . ".pdf";
  795.             $pdf = new Html2Pdf('P''A4''fr'true'UTF-8', array(5555));
  796.             $pdf->pdf->SetDisplayMode('fullpage');
  797.             $pdf->writeHTML($content);
  798.             $pdf->output($filename'D');
  799. //            $knpSnappyPdf->setTemporaryFolder('../var/');
  800. //            // $dompdf->setPaper('A4', 'portrait');
  801. //            $knpSnappyPdf->setLogger($logger);
  802. //            $knpSnappyPdf->setOption('encoding', 'utf-8');
  803. //            $knpSnappyPdf->setOption('page-size', 'A4');
  804. //            $knpSnappyPdf->setOption('orientation', 'portrait');
  805. //
  806. //            $output = $knpSnappyPdf->getOutputFromHtml($content);
  807. //            $knpSnappyPdf->removeTemporaryFiles();
  808.             return new \Knp\Bundle\SnappyBundle\Snappy\Response\PdfResponse($output,$filename);
  809.             //return new Response($pdf->generatePdf($content, $filename));
  810.         }
  811.         die('Pas de pdf à générer');
  812.     }
  813.         
  814. //        /**
  815.     //     * Copie de la fiche Pluvio
  816.     //     *
  817.     //     * @Route("/CopieCalcul/{idFiche}", name="CopieCalcul")
  818.     //     */
  819.     //    public function CopieCalcul(
  820.     //        Request $req,
  821.     //        \App\Repository\PluvioDatabaseRepository $pluvioDatabaseRepository,
  822.     //        LoggerInterface $logger,
  823.     //        Request $request, Session $session,
  824.     //        $idFiche,
  825.     //        SerializerInterface $serializer) {
  826.     //        $session->start();
  827.     //
  828.     //        $fiche = $pluvioDatabaseRepository->findOneById($idFiche);
  829.     //        
  830.     //                
  831.     //    }
  832.         
  833.     #[Route(path'/apropos'name'apropos')]
  834.     public function apropos() {
  835.         return $this->render('apropos.html.twig');
  836.     }
  837.     
  838.     /**
  839.  * Convertit la valeur de certivea en booléen.
  840.  *
  841.  * @param mixed $certivea La valeur de certivea
  842.  * @return bool Le booléen correspondant
  843.  */
  844. private function toBool($certivea)
  845. {
  846.     return filter_var($certiveaFILTER_VALIDATE_BOOLEAN);
  847. }
  848.     #[Route(path'/workinprogress'name'workinprogress')]
  849.     public function workinprogress() {
  850.         return $this->render('workinprogress.html.twig');
  851.     }
  852.     #[Route(path'/aide'name'aide')]
  853.     public function aide() {
  854.         return $this->render('aide.html.twig');
  855.     }
  856.     
  857.      #[Route(path'/listePluvio'name'listePluvio')]
  858.     public function listePluvio(\App\Repository\PluvioDatabaseRepository $pluvioRepo
  859.             Request $theRequestPaginatorInterface $thePaginator,
  860.             Session $session) {
  861.    
  862.         $session->start();
  863.         $session->set("lastPage""listePluvio");
  864.         
  865.         if (!$this->isGranted('ROLE_ADMIN')) {
  866.             $typeFormFilter 'utilisateur';
  867.             $idUser $this->getUser()->getId();
  868.         } else {
  869.             $typeFormFilter 'admin';
  870.             $idUser null;
  871.         }
  872.         
  873.         $listFichePluvioBuilder $pluvioRepo->findAllIndexBuilder($idUser);
  874.         
  875.         
  876.         $listFichePluvio $thePaginator->paginate(
  877.             $listFichePluvioBuilder,
  878.             $theRequest->get('page'1),
  879.             self::NB_INDEX
  880.         );
  881.         
  882.         return $this->render('listePluvio.html.twig', [
  883.             'listFichePluvio' => $listFichePluvio
  884.         ]);
  885.     }
  886.     
  887.         #[Route(path'/pluvioId/{id}'name'pluvioId'options: ['expose' => true])]
  888.     public function pluvioId(Session $session$id) {
  889.         
  890.         $session->start();
  891.         $session->set("pluvioId"$id);
  892.         return $this->redirectToRoute('index');
  893.     }
  894.     
  895.      #[Route(path'/postConnexion'name'postConnexion')]
  896.     public function postConnexion(Session $session) {
  897.         
  898.         $session->start();
  899.         $lastPage $session->get("lastPage");
  900.         //dump($lastPage);
  901.         $array = [];
  902.         if ($lastPage === "tri"){
  903.             $idProjet $session->get("idProjet");
  904.             $array = ["idProjet" => $idProjet];
  905.             return $this->redirectToRoute($lastPage,$array);
  906.         } 
  907.         if ($lastPage === "lot"){
  908.             $idProjet $session->get("idProjet");
  909.             $lot $session->get("lot");
  910.             $array = ["idProjet" => $idProjet"lot" => $lot];
  911.             return $this->redirectToRoute($lastPage,$array);
  912.         }
  913.         return $this->redirectToRoute($lastPage);
  914.     }
  915.     
  916. //    /**
  917.     //     * @Route("/", name="index")
  918.     //     */
  919.     //    public function index(Session $session) {
  920.     //
  921.     //        $session->start();
  922.     //        $session->set("lastPage", "index");
  923.     //        
  924.     //        return $this->redirect('https://quveo.fr/reutilisation');
  925.     //    }
  926.     #[Route(path'/admin'name'admin')]
  927.     public function admin(FicheBatimentRepository $fb) {
  928.         $fb->supprimerdoublon();
  929. //        return $this->render('admin.html.twig');
  930.     }
  931.     #[Route(path'/quiplusest'name'quiplusest')]
  932.     public function quiplusest() {
  933.         return $this->redirect('http://www.quiplusest.coop');
  934.     }
  935.     #[Route(path'/emaarchitectes'name'emaarchitectes')]
  936.     public function emaarchitectes() {
  937.         return $this->redirect('http://www.emaarchitectes.com');
  938.     }
  939.     #[Route(path'/upload-dropzone'name'upload-dropzone')]
  940.     public function uploadDropzone(Request $req,
  941.             FicheBatimentImportService $service,
  942.             FicheBatimentRepository $ficheBatRep,
  943.             EntityManagerInterface $em,
  944.             Session $session) {
  945.         $session->start();
  946.         $idFicheBatiments $session->get("idFicheBatiments");
  947.         $time date('YmdHis');
  948.         // Récup contenu du fichier temporaire crée et 
  949.         $fichier $req->files->get('fichier');
  950.         
  951.         
  952.         //si c'est un fichier zip, on extrait le XML
  953.         $extension pathinfo($fichierPATHINFO_EXTENSION);
  954.         
  955.         if ($extension "zip") {
  956.             $zip = new ZipArchive();
  957.             if ($zip->open($fichier) === TRUE) {
  958.                 $zip->extractTo('EXTRACTION''fiche.xml');
  959.                 $zip->close();
  960.                 $nomFichier uniqid() . '.xml';
  961.                 rename("EXTRACTION/fiche.xml"'IMPORTS/' $nomFichier);
  962.                 $nomInitialFichier 'fiche.xml';
  963.             }
  964. //                
  965.         } else {
  966.             $nomFichier uniqid() . '.xml';
  967.             $nomInitialFichier $fichier->getClientOriginalName();
  968.             $fichier->move('IMPORTS'$nomFichier);
  969.         }
  970.         //analyse que s'il est conforme RT2012
  971.         $xml simplexml_load_file('IMPORTS/' $nomFichier);
  972.         
  973.         if (isset($xml->Entree_Projet->Index) or isset($xml->RSET->Entree_Projet->Index)) {
  974.             $fichesBatiment $service->importer('IMPORTS/' $nomFichier$time$nomInitialFichier);
  975.             foreach ($fichesBatiment as $ficheBatiment) {
  976.                 $fichesOps[] = $ficheBatiment;
  977.                 $idFicheBatiments[] = $ficheBatiment->getId();
  978.             }
  979.         }
  980.         $session->set("idFicheBatiments"$idFicheBatiments);
  981.         return $this->json($fichesOps);
  982.     }
  983.     #[Route(path'/homepage'name'homepage')]
  984.     public function homepage(
  985.             Request $req,
  986.             FicheBatimentRepository $fichebatimentRepository,
  987.             FicheBatimentRepository $ficheBatRep,
  988.             FicheBatimentExempleRepository $theFicheBatimentExempleRepository,
  989.             Session $session,
  990.             PaginatorInterface $thePaginator
  991.     ) {
  992.         $session->start();
  993.         $session->set("lastPage""homepage");
  994.         $page $req->get('page'1);
  995.         if ($this->getUser() == null) {
  996.             $idFicheBatimentsUser $session->get("idFicheBatiments");
  997.             if ($idFicheBatimentsUser != null) {
  998.                 $listFicheBatimentUser $fichebatimentRepository->findByIds($idFicheBatimentsUser);
  999.             } else {
  1000.                 $listFicheBatimentUser = [];
  1001.                 $idFicheBatimentsUser = [];
  1002.             }
  1003.             if (count($listFicheBatimentUser) == 0) {
  1004.                 $listFicheBatimentUser[] = $theFicheBatimentExempleRepository->findSingleton()->getTheFicheBatiment();
  1005.             }
  1006.             $listFicheBatimentUser $thePaginator->paginate(
  1007.                 $listFicheBatimentUser,
  1008.                 $page,
  1009.                 self::NB_FICHE_HOMEPAGE
  1010.             );
  1011.         } else {
  1012.             $idFicheBatimentsUser $fichebatimentRepository->findIdsByUser($this->getUser()->getId());
  1013.             $listFicheBatimentUserBuilder $fichebatimentRepository->findByUserBuilder($this->getUser()->getId());
  1014.             $idFicheBatimentsUser array_column($idFicheBatimentsUser'id');
  1015.             $listFicheBatimentUser $thePaginator->paginate(
  1016.                 $listFicheBatimentUserBuilder,
  1017.                 $page,
  1018.                 self::NB_FICHE_HOMEPAGE
  1019.             );
  1020.         }
  1021.         //******************************************        
  1022.         // Mise en place du formulaire de filtre
  1023.         //******************************************
  1024.         $filtreDTO = new AffichageGraphiqueDTO();
  1025.         $filtreForm $this->createForm(AffichageGraphiqueType::class, $filtreDTO);
  1026.         $filtreForm->handleRequest($req);
  1027.         // Insitialise fichesBatiments soit avec tous soit via critères submitted
  1028.         if ($filtreForm->isSubmitted()) {
  1029.             $listFicheBatimentAll $ficheBatRep->filtrer($filtreDTO->getUsage(), $filtreDTO->getZoneClimatique(), $filtreDTO->getEtancheiteMin(),
  1030.                     $filtreDTO->getEtancheiteMax(), $filtreDTO->getTauxVitreeMin(), $filtreDTO->getTauxVitreeMax());
  1031.             if ($filtreDTO->getAbscisse() == 'compacite') {
  1032.                 $abscisse 'Compacité en m² enveloppe par m² SHONRT';
  1033.             } elseif ($filtreDTO->getAbscisse() == 'tauxVitre') {
  1034.                 $abscisse 'Taux de vitrage en m² de vitrage par m² SHONRT';
  1035.             } elseif ($filtreDTO->getAbscisse() == 'orientationSud') {
  1036.                 $abscisse 'Pourcentage de baies au sud';
  1037.             } elseif ($filtreDTO->getAbscisse() == 'compaciteVitre') {
  1038.                 $abscisse 'Compacité x Taux vitré';
  1039.             } elseif ($filtreDTO->getAbscisse() == 'compaciteVitreBrassage') {
  1040.                 $abscisse 'Compacité x Taux vitré x Brassage';
  1041.             }
  1042.             if ($filtreDTO->getOrdonnee() == 'bBioChauffage') {
  1043.                 $ordonnee 'BBIO Chauffage';
  1044.             } elseif ($filtreDTO->getOrdonnee() == 'bBioEclairage') {
  1045.                 $ordonnee 'BBIO Eclairage';
  1046.             }
  1047.         } else {
  1048.             $listFicheBatimentAll $ficheBatRep->findAll();
  1049.             $abscisse "Compacité en m² enveloppe par m² SHONRT";
  1050.             $ordonnee "BBIO Chauffage";
  1051.         }
  1052.         // Prépare les données du graphique
  1053.         $graphiqueAll = [];
  1054.         $graphiqueUser = [];
  1055.         foreach ($listFicheBatimentAll as $aFicheBatimentAll) {
  1056.             $coordonnees = [];
  1057.             if ($filtreForm->isSubmitted()) {
  1058.                 if ($filtreDTO->getAbscisse() == 'compacite') {
  1059.                     $coordonnees[] = $aFicheBatimentAll->getCompacite();
  1060.                     $abscisse 'Compacité en m² enveloppe par m² SHONRT';
  1061.                 } elseif ($filtreDTO->getAbscisse() == 'tauxVitre') {
  1062.                     $coordonnees[] = $aFicheBatimentAll->getTauxVitrage();
  1063.                     $abscisse 'Taux de vitrage en m² de vitrage par m² SHONRT';
  1064.                 } elseif ($filtreDTO->getAbscisse() == 'orientationSud') {
  1065.                     $coordonnees[] = $aFicheBatimentAll->getPartBaiesSudBatiment();
  1066.                     $abscisse 'Pourcentage de baies au sud';
  1067.                 } elseif ($filtreDTO->getAbscisse() == 'compaciteVitre') {
  1068.                     $coordonnees[] = $aFicheBatimentAll->getCombinaisonCompaciteTauxVitrage();
  1069.                     $abscisse 'Compacité x Taux vitré';
  1070.                 } elseif ($filtreDTO->getAbscisse() == 'compaciteVitreBrassage') {
  1071.                     $coordonnees[] = $aFicheBatimentAll->getCombinaisonCompaciteTauxVitrageBrassageBBIO();
  1072.                     $abscisse 'Compacité x Taux vitré x Brassage';
  1073.                 }
  1074.                 if ($filtreDTO->getOrdonnee() == 'bBioChauffage') {
  1075.                     $coordonnees[] = $aFicheBatimentAll->getBbioChaudAnnuel();
  1076.                     $ordonnee 'BBIO Chauffage';
  1077.                 } elseif ($filtreDTO->getOrdonnee() == 'bBioEclairage') {
  1078.                     $coordonnees[] = $aFicheBatimentAll->getBbioEclairageAnnuel();
  1079.                     $ordonnee 'BBIO Eclairage';
  1080.                 }
  1081.             } else {
  1082.                 $coordonnees[] = $aFicheBatimentAll->getCompacite();
  1083.                 $coordonnees[] = $aFicheBatimentAll->getBbioChaudAnnuel();
  1084.                 $abscisse "Compacité en m² enveloppe par m² SHONRT";
  1085.                 $ordonnee "BBIO Chauffage";
  1086.             }
  1087.             if (in_array($aFicheBatimentAll->getId(), $idFicheBatimentsUser)) {
  1088.                 $graphique = &$graphiqueUser;
  1089.             } else {
  1090.                 $graphique = &$graphiqueAll;
  1091.             }
  1092.             $graphique['coordonnees'][] = $coordonnees;
  1093.             $graphique['taux_de_vitrage'][] = $aFicheBatimentAll->getTauxVitrage();
  1094.             $graphique['q_4_pasurf'][] = $aFicheBatimentAll->getQ4PaSurf();
  1095.             $graphique['uw_moyen'][] = $aFicheBatimentAll->getUwMoyen();
  1096.             $graphique['ids'][] = $aFicheBatimentAll->getId();
  1097.         }
  1098.         if (count($graphiqueAll) > 0) {
  1099.             $graphiqueJsonCoordonnees json_encode($graphiqueAll['coordonnees']);
  1100.             $graphiqueJsonAll = ['data' => $graphiqueJsonCoordonnees];
  1101.             $graphiqueJsonAll['taux_de_vitrage'] = json_encode($graphiqueAll['taux_de_vitrage']);
  1102.             $graphiqueJsonAll['q_4_pasurf'] = json_encode($graphiqueAll['q_4_pasurf']);
  1103.             $graphiqueJsonAll['uw_moyen'] = json_encode($graphiqueAll['uw_moyen']);
  1104.             $graphiqueJsonAll['ids'] = json_encode($graphiqueAll['ids']);
  1105.             $alert null;
  1106.         } else {
  1107.             $graphiqueJsonAll = ['data' => '[0,0]'];
  1108.             $graphiqueJsonAll['taux_de_vitrage'] = '[0,0]';
  1109.             $graphiqueJsonAll['q_4_pasurf'] = '[0,0]';
  1110.             $graphiqueJsonAll['uw_moyen'] = '[0,0]';
  1111.             $graphiqueJsonAll['ids'] = '[0,0]';
  1112.             $alert 'Encore aucune donnée pour ces filtres';
  1113.         }
  1114.         if (count($graphiqueUser) > 0) {
  1115.             $graphiqueJsonCoordonnees json_encode($graphiqueUser['coordonnees']);
  1116.             $graphiqueJsonUser = ['data' => $graphiqueJsonCoordonnees];
  1117.             $graphiqueJsonUser['taux_de_vitrage'] = json_encode($graphiqueUser['taux_de_vitrage']);
  1118.             $graphiqueJsonUser['q_4_pasurf'] = json_encode($graphiqueUser['q_4_pasurf']);
  1119.             $graphiqueJsonUser['uw_moyen'] = json_encode($graphiqueUser['uw_moyen']);
  1120.             $graphiqueJsonUser['ids'] = json_encode($graphiqueUser['ids']);
  1121.             $alertUtilisateur null;
  1122.         } else {
  1123.             $graphiqueJsonUser = ['data' => '[0,0]'];
  1124.             $graphiqueJsonUser['taux_de_vitrage'] = '[0,0]';
  1125.             $graphiqueJsonUser['q_4_pasurf'] = '[0,0]';
  1126.             $graphiqueJsonUser['uw_moyen'] = '[0,0]';
  1127.             $graphiqueJsonUser['ids'] = '[0,0]';
  1128.             $alertUtilisateur 'Encore aucune donnée pour cet utilisateur';
  1129.         }
  1130.         //******************************************        
  1131.         // Fin du graphique avec données utilisateur
  1132.         //******************************************
  1133.         //
  1134.         // Renvoie vers le template index
  1135.         return $this->render('homepage.html.twig', [
  1136.                     'all' => $listFicheBatimentAll,
  1137.                     'alert' => $alert,
  1138.                     'alertUtilisateur' => $alertUtilisateur,
  1139.                     'graphiqueJsonAll' => $graphiqueJsonAll,
  1140.                     'graphiqueJsonUser' => $graphiqueJsonUser,
  1141.                     'abscisse' => $abscisse,
  1142.                     'ordonnee' => $ordonnee,
  1143. //                    'monForm' => $uploadForm->createView(),
  1144.                     'affichage' => $filtreForm->createView(),
  1145.                     'listFicheBatiment' => $listFicheBatimentUser,
  1146.         ]);
  1147.     }
  1148.     
  1149.     #[Route(path'/infiltration'name'infiltration')]
  1150.     public function infiltration(EntityManagerInterface $emRequest $req
  1151.     ) {
  1152.         $infiltration = new Infiltration();
  1153.         $form $this->createForm(InfiltrationType::class, $infiltration);
  1154.         $form->handleRequest($req);
  1155.         if ($form->isSubmitted() && $form->isValid()) {
  1156.             $nbreEtage $infiltration->getNbrEtage();
  1157.             $p4 $infiltration->getQ4();
  1158.             $n50 1.8 $p4 * ($nbreEtage 1) / $nbreEtage;
  1159.             $infiltration->setN50($n50);
  1160.             $facadeExposee $infiltration->getFacadeExposee();
  1161.             $localisation $infiltration->getLocalisation();
  1162.             if ($facadeExposee == 'Espace chauffé sans façade exposée') {
  1163.                 $exposition 0.01;
  1164.             } else if ($facadeExposee == 'Espace chauffé à simple exposition') {
  1165.                 if ($localisation == 'Site non abrité') {
  1166.                     $exposition 0.03;
  1167.                 } else if ($localisation == 'Site modérément abrité') {
  1168.                     $exposition 0.02;
  1169.                 } else if ($localisation == 'Site très abrité') {
  1170.                     $exposition 0.02;
  1171.                 }
  1172.             } else if ($facadeExposee == 'Espace chauffé avec expositions multiples') {
  1173.                 if ($localisation == 'Site non abrité') {
  1174.                     $exposition 0.05;
  1175.                 } else if ($localisation == 'Site modérément abrité') {
  1176.                     $exposition 0.03;
  1177.                 } else if ($localisation == 'Site très abrité') {
  1178.                     $exposition 0.02;
  1179.                 }
  1180.             }
  1181.             $infiltration->setFactExposition($exposition);
  1182.             
  1183.             $hauteurTotale $nbreEtage 4;
  1184.             
  1185.             if ($hauteurTotale <= 10){
  1186.                 $factHauteur 1;
  1187.             } else if ($hauteurTotale <= 30){
  1188.                 $factHauteur 1.2;
  1189.             } else if ($hauteurTotale 30){
  1190.                 $factHauteur 1.5;
  1191.             }
  1192.             $infiltration->setFactCorrectifHauteur($factHauteur);
  1193.             
  1194.             $volumeChauffe $infiltration->getVolumeChauffe();
  1195.             $debitAirInfil $volumeChauffe $n50 $exposition $factHauteur;
  1196.             
  1197.             $infiltration->setDebitAirInfil($debitAirInfil);
  1198.             
  1199.             $ratioInfil number_format($debitAirInfil $volumeChauffe2);
  1200.             
  1201.             $em->persist($infiltration);
  1202.             $em->flush();
  1203.         } else {
  1204.             $ratioInfil "";
  1205.             
  1206.         }
  1207.         return $this->render('infiltration.html.twig', [
  1208.         'form' => $form->createView(),
  1209.         'infiltration' => $infiltration,
  1210.             'ratioInfil' => $ratioInfil
  1211.         ]);
  1212.     }
  1213.         
  1214.         
  1215.         
  1216.     #[Route(path'/efae/{idFiche}'name'efae')]
  1217.     public function efae(Request $reqEntityManagerInterface $emFicheBatimentRepository $rep$idFiche) {
  1218.         $ficheOpsManaged $rep->findOneById($idFiche);
  1219.         if ($ficheOpsManaged->getOCefgazimpchannuel() != 0) {
  1220.             $conso $ficheOpsManaged->getOCefgazimpchannuel();
  1221.             $prod 'Gaz';
  1222.             $usage 'Chauffage';
  1223.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1224.             $tab[] = $data;
  1225.         }
  1226.         if ($ficheOpsManaged->getOCefgazimpfrannuel() != 0) {
  1227.             $conso $ficheOpsManaged->getOCefgazimpfrannuel();
  1228.             $prod 'Gaz';
  1229.             $usage 'Froid';
  1230.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1231.             $tab[] = $data;
  1232.         }
  1233.         if ($ficheOpsManaged->getOCefgazimpecsannuel() != 0) {
  1234.             $conso $ficheOpsManaged->getOCefgazimpecsannuel();
  1235.             $prod 'Gaz';
  1236.             $usage 'ECS';
  1237.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1238.             $tab[] = $data;
  1239.         }
  1240.         if ($ficheOpsManaged->getOCeffioulimpchannuel() != 0) {
  1241.             $conso $ficheOpsManaged->getOCeffioulimpchannuel();
  1242.             $prod 'Fioul';
  1243.             $usage 'Chauffage';
  1244.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1245.             $tab[] = $data;
  1246.         }
  1247.         if ($ficheOpsManaged->getOCeffioulimpfrannuel() != 0) {
  1248.             $conso $ficheOpsManaged->getOCeffioulimpfrannuel();
  1249.             $prod 'Fioul';
  1250.             $usage 'Froid';
  1251.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1252.             $tab[] = $data;
  1253.         }
  1254.         if ($ficheOpsManaged->getOCeffioulimpecsannuel() != 0) {
  1255.             $conso $ficheOpsManaged->getOCeffioulimpecsannuel();
  1256.             $prod 'Fioul';
  1257.             $usage 'ECS';
  1258.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1259.             $tab[] = $data;
  1260.         }
  1261.         if ($ficheOpsManaged->getOCefcharbonimpchannuel() != 0) {
  1262.             $conso $ficheOpsManaged->getOCefcharbonimpchannuel();
  1263.             $prod 'Charbon';
  1264.             $usage 'Chauffage';
  1265.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1266.             $tab[] = $data;
  1267.         }
  1268.         if ($ficheOpsManaged->getOCefcharbonimpfrannuel() != 0) {
  1269.             $conso $ficheOpsManaged->getOCefcharbonimpfrannuel();
  1270.             $prod 'Charbon';
  1271.             $usage 'Froid';
  1272.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1273.             $tab[] = $data;
  1274.         }
  1275.         if ($ficheOpsManaged->getOCefcharbonimpecsannuel() != 0) {
  1276.             $conso $ficheOpsManaged->getOCefcharbonimpecsannuel();
  1277.             $prod 'Charbon';
  1278.             $usage 'ECS';
  1279.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1280.             $tab[] = $data;
  1281.         }
  1282.         if ($ficheOpsManaged->getOCefboisgranimpchannuel() != 0) {
  1283.             $conso $ficheOpsManaged->getOCefboisgranimpchannuel();
  1284.             $prod 'Chaudière Bois granulé';
  1285.             $usage 'Chauffage';
  1286.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1287.             $tab[] = $data;
  1288.         }
  1289.         if ($ficheOpsManaged->getOCefboisgranimpfrannuel() != 0) {
  1290.             $conso $ficheOpsManaged->getOCefboisgranimpfrannuel();
  1291.             $prod 'Chaudière Bois granulé';
  1292.             $usage 'Froid';
  1293.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1294.             $tab[] = $data;
  1295.         }
  1296.         if ($ficheOpsManaged->getOCefboisgranimpecsannuel() != 0) {
  1297.             $conso $ficheOpsManaged->getOCefboisgranimpecsannuel();
  1298.             $prod 'Chaudière Bois granulé';
  1299.             $usage 'ECS';
  1300.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1301.             $tab[] = $data;
  1302.         }
  1303.         if ($ficheOpsManaged->getOCefboisbuchimpchannuel() != 0) {
  1304.             $conso $ficheOpsManaged->getOCefboisbuchimpchannuel();
  1305.             $prod 'Chaudière Bois buche';
  1306.             $usage 'Chauffage';
  1307.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1308.             $tab[] = $data;
  1309.         }
  1310.         if ($ficheOpsManaged->getOCefboisbuchimpfrannuel() != 0) {
  1311.             $conso $ficheOpsManaged->getOCefboisbuchimpfrannuel();
  1312.             $prod 'Chaudière Bois buche';
  1313.             $usage 'Froid';
  1314.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1315.             $tab[] = $data;
  1316.         }
  1317.         if ($ficheOpsManaged->getOCefboisbuchimpecsannuel() != 0) {
  1318.             $conso $ficheOpsManaged->getOCefboisbuchimpecsannuel();
  1319.             $prod 'Chaudière Bois buche';
  1320.             $usage 'ECS';
  1321.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1322.             $tab[] = $data;
  1323.         }
  1324.         if ($ficheOpsManaged->getOCefboisplaqimpchannuel() != 0) {
  1325.             $conso $ficheOpsManaged->getOCefboisplaqimpchannuel();
  1326.             $prod 'Chaudière Bois plaquette';
  1327.             $usage 'Chauffage';
  1328.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1329.             $tab[] = $data;
  1330.         }
  1331.         if ($ficheOpsManaged->getOCefboisplaqimpfrannuel() != 0) {
  1332.             $conso $ficheOpsManaged->getOCefboisplaqimpfrannuel();
  1333.             $prod 'Chaudière Bois plaquette';
  1334.             $usage 'Froid';
  1335.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1336.             $tab[] = $data;
  1337.         }
  1338.         if ($ficheOpsManaged->getOCefboisplaqimpecsannuel() != 0) {
  1339.             $conso $ficheOpsManaged->getOCefboisplaqimpecsannuel();
  1340.             $prod 'Chaudière Bois plaquette';
  1341.             $usage 'ECS';
  1342.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1343.             $tab[] = $data;
  1344.         }
  1345.         if ($ficheOpsManaged->getOCefboisgranpoelimpchannuel() != 0) {
  1346.             $conso $ficheOpsManaged->getOCefboisgranpoelimpchannuel();
  1347.             $prod 'Poele Bois granulé';
  1348.             $usage 'Chauffage';
  1349.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1350.             $tab[] = $data;
  1351.         }
  1352.         if ($ficheOpsManaged->getOCefboisgranpoelimpfrannuel() != 0) {
  1353.             $conso $ficheOpsManaged->getOCefboisgranpoelimpfrannuel();
  1354.             $prod 'Poele Bois granulé';
  1355.             $usage 'Froid';
  1356.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1357.             $tab[] = $data;
  1358.         }
  1359.         if ($ficheOpsManaged->getOCefboisgranpoelimpecsannuel() != 0) {
  1360.             $conso $ficheOpsManaged->getOCefboisgranpoelimpecsannuel();
  1361.             $prod 'Poele Bois granulé';
  1362.             $usage 'ECS';
  1363.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1364.             $tab[] = $data;
  1365.         }
  1366.         if ($ficheOpsManaged->getOCefboisbuchpoelimpchannuel() != 0) {
  1367.             $conso $ficheOpsManaged->getOCefboisbuchpoelimpchannuel();
  1368.             $prod 'Poele Bois buche';
  1369.             $usage 'Chauffage';
  1370.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1371.             $tab[] = $data;
  1372.         }
  1373.         if ($ficheOpsManaged->getOCefboisbuchpoelimpfrannuel() != 0) {
  1374.             $conso $ficheOpsManaged->getOCefboisbuchpoelimpfrannuel();
  1375.             $prod 'Poele Bois buche';
  1376.             $usage 'Froid';
  1377.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1378.             $tab[] = $data;
  1379.         }
  1380.         if ($ficheOpsManaged->getOCefboisbuchpoelimpecsannuel() != 0) {
  1381.             $conso $ficheOpsManaged->getOCefboisbuchpoelimpecsannuel();
  1382.             $prod 'Poele Bois buche';
  1383.             $usage 'ECS';
  1384.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1385.             $tab[] = $data;
  1386.         }
  1387.         if ($ficheOpsManaged->getOCefboisplaqpoelimpchannuel() != 0) {
  1388.             $conso $ficheOpsManaged->getOCefboisplaqpoelimpchannuel();
  1389.             $prod 'Poele Bois plaquette';
  1390.             $usage 'Chauffage';
  1391.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1392.             $tab[] = $data;
  1393.         }
  1394.         if ($ficheOpsManaged->getOCefboisplaqpoelimpfrannuel() != 0) {
  1395.             $conso $ficheOpsManaged->getOCefboisplaqpoelimpfrannuel();
  1396.             $prod 'Poele Bois plaquette';
  1397.             $usage 'Froid';
  1398.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1399.             $tab[] = $data;
  1400.         }
  1401.         if ($ficheOpsManaged->getOCefboisplaqpoelimpecsannuel() != 0) {
  1402.             $conso $ficheOpsManaged->getOCefboisplaqpoelimpecsannuel();
  1403.             $prod 'Poele Bois plaquette';
  1404.             $usage 'ECS';
  1405.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1406.             $tab[] = $data;
  1407.         }
  1408.         if ($ficheOpsManaged->getOCefelecimpchannuel() != 0) {
  1409.             $conso $ficheOpsManaged->getOCefelecimpchannuel();
  1410.             $prod 'Electricité';
  1411.             $usage 'Chauffage';
  1412.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1413.             $tab[] = $data;
  1414.         }
  1415.         if ($ficheOpsManaged->getOCefelecimpfrannuel() != 0) {
  1416.             $conso $ficheOpsManaged->getOCefelecimpfrannuel();
  1417.             $prod 'Electricité';
  1418.             $usage 'Froid';
  1419.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1420.             $tab[] = $data;
  1421.         }
  1422.         if ($ficheOpsManaged->getOCefelecimpecsannuel() != 0) {
  1423.             $conso $ficheOpsManaged->getOCefelecimpecsannuel();
  1424.             $prod 'Electricité';
  1425.             $usage 'ECS';
  1426.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1427.             $tab[] = $data;
  1428.         }
  1429.         if ($ficheOpsManaged->getOCefelecimpeclannuel() != 0) {
  1430.             $conso $ficheOpsManaged->getOCefelecimpeclannuel();
  1431.             $prod 'Electricité';
  1432.             $usage 'Eclairage';
  1433.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1434.             $tab[] = $data;
  1435.         }
  1436.         if ($ficheOpsManaged->getOCefelecimpauxvannuel() != 0) {
  1437.             $conso $ficheOpsManaged->getOCefelecimpauxvannuel();
  1438.             $prod 'Electricité';
  1439.             $usage 'Ventilation';
  1440.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1441.             $tab[] = $data;
  1442.         }
  1443.         if ($ficheOpsManaged->getOCefelecimpauxsannuel() != 0) {
  1444.             $conso $ficheOpsManaged->getOCefelecimpauxsannuel();
  1445.             $prod 'Electricité';
  1446.             $usage 'Distribution';
  1447.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1448.             $tab[] = $data;
  1449.         }
  1450.         if ($ficheOpsManaged->getOCefelecimpAUEannuel() != 0) {
  1451.             $conso $ficheOpsManaged->getOCefelecimpAUEannuel();
  1452.             $prod 'Electricité';
  1453.             $usage 'AUE';
  1454.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1455.             $tab[] = $data;
  1456.         }
  1457.         if ($ficheOpsManaged->getOCefreseauchaleurimpchannuel() != 0) {
  1458.             $conso $ficheOpsManaged->getOCefreseauchaleurimpchannuel();
  1459.             $prod 'Réseau de chaleur';
  1460.             $usage 'Chauffage';
  1461.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1462.             $tab[] = $data;
  1463.         }
  1464.         if ($ficheOpsManaged->getOCefreseauchaleurimpfrannuel() != 0) {
  1465.             $conso $ficheOpsManaged->getOCefreseauchaleurimpfrannuel();
  1466.             $prod 'Réseau de chaleur';
  1467.             $usage 'Froid';
  1468.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1469.             $tab[] = $data;
  1470.         }
  1471.         if ($ficheOpsManaged->getOCefreseauchaleurimpecsannuel() != 0) {
  1472.             $conso $ficheOpsManaged->getOCefreseauchaleurimpecsannuel();
  1473.             $prod 'Réseau de chaleur';
  1474.             $usage 'ECS';
  1475.             $data = ['conso' => $conso'prod' => $prod'usage' => $usage];
  1476.             $tab[] = $data;
  1477.         }
  1478.         return $this->render('efae.html.twig');
  1479.     }
  1480.     #[Route(path'/upload-dropzone-test'name'upload-dropzone-test')]
  1481.     public function uploadDropzoneTest(Request $req,
  1482.             FicheBatimentRepository $ficheBatRep,
  1483.             EntityManagerInterface $em,
  1484.             Session $session) {
  1485.         $session->start();
  1486.         $idFicheBatiments $session->get("idFicheBatiments");
  1487.         $time date('YmdHis');
  1488.         // Récup contenu du fichier temporaire crée et 
  1489.         $fichier $req->files->get('fichier');
  1490.         $nomFichier uniqid() . '.xml';
  1491.         $nomInitialFichier $fichier->getClientOriginalName();
  1492.         $fichier->move('IMPORTSTEST'$nomFichier);
  1493. //        $xml = simplexml_load_file('IMPORTSTEST/' .$nomFichier);
  1494. //        
  1495. //        $ficheTest[] = $nomInitialFichier;    
  1496. //        $ficheTest[] = $xml->Entree_Projet->Version;
  1497. //            
  1498. //            $ficheTest[] = $xml->Sortie_Projet->Name;        
  1499. //            $ficheTest[] = $xml->Datas_Comp->donnees_generales->maitre_ouvrage->nom;
  1500. //            $ficheTest[] = $xml->Datas_Comp->donnees_generales->operation->adresse->ville;
  1501. //            $ficheTest[] = $xml->Sortie_Projet->Departement;
  1502. //            
  1503. //            $ficheTest['SHONRT'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->SHON_RT;
  1504. //            $ficheTest['SURT'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->SURT;
  1505. //            $ficheTest['V'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->V;
  1506. //            $ficheTest['Qv_occ_BBIO'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Qv_occ_BBIO;
  1507. //            $ficheTest['Ak'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Paroi_opaque_Collection->Paroi_Opaque->Ak;
  1508. //            $ficheTest['Uk'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Paroi_opaque_Collection->Paroi_Opaque->Uk;
  1509. //            if ($xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Paroi_opaque_Collection->Paroi_Opaque->Alpha > 0) {
  1510. //              $ficheTest['Gamma'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Paroi_opaque_Collection->Paroi_Opaque->Masque_Collection->Masque_Lointain_Azimutal->Gamma;  
  1511. //            };
  1512. //            $ficheTest['Ab'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Baie_Collection->Baie->Ab;
  1513. //            $ficheTest['Usp_vert'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Baie_Collection->Baie->Usp_Vert;
  1514. //            $ficheTest['Ratio_ecl_nat'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Eclairage_Collection->Eclairage->Ratio_ecl_nat;
  1515. //            $ficheTest['Rat_local'] = $xml->Entree_Projet->Batiment_Collection->Batiment->Zone_Collection->Zone->Groupe_Collection->Groupe->Eclairage_Collection->Eclairage->Rat_local;//// 
  1516. //            
  1517. //        //analyse que s'il est conforme RT2012
  1518. //        $xml = simplexml_load_file('IMPORTS/' . $nomFichier);
  1519. //        if (isset($xml->Entree_Projet->Index)) {
  1520. //            $fichesBatiment = $service->importer('IMPORTS/' . $nomFichier, $time, $nomInitialFichier);
  1521. //            foreach ($fichesBatiment as $ficheBatiment) {
  1522. //                $fichesOps[] = $ficheBatiment;
  1523. //                $idFicheBatiments[] = $ficheBatiment->getId();
  1524. //            }
  1525. //        }
  1526. //        $session->set("idFicheBatiments", $idFicheBatiments);
  1527. //
  1528. //        return $this->json($fichesOps);
  1529.         return $this->render('workinprogress.html.twig');
  1530.     }
  1531.     
  1532.     
  1533.     
  1534. }