police = new Police(); } public function index() { $conommations = $this->police->getsyntheseconsopolice() ; $this->genererVueAjax(array('conommations' => $conommations)); } public function exportxls() { $conommations = $this->police->getsyntheseconsopolice() ; // Excel $headerXLS = array ( "dateReference", "idAderent", _('No Adhérent'), _('Adhérent'), "primeStat", "primeTtc", "plafond_OUT", "consommation_OUT", "plafond_INP", "consommation_INP", "plafond_OPT", "consommation_OPT", "plafond_MON", "consommation_MON", "plafond_DEN", "consommation_DEN", "plafond_FUN", "consommation_FUN", "consommation_ALL" ); $dataXLS = array(); foreach ($conommations as $conommation) { $dataXLS[]=$conommation; } $classeur = new Spreadsheet(); $classeur->getProperties()->setCreator("INTER-SANTE"); $classeur->setActiveSheetIndex(0); $feuille=$classeur->getActiveSheet(); $feuille->setTitle(_('SYNTHESE CONSOMMATIONS')); $feuille->fromArray($headerXLS, NULL, 'A1', true); $feuille->fromArray($dataXLS, NULL, 'A2', true); //Forcer le téléchargement vers le navigateur; $fichier = 'Temp/TMP_SYNTHESE_CONS'."_".uniqid().".xlsx"; $writer = new Xlsx($classeur); $writer->save($fichier); $t_html ='
'; $t_html .=' '._("TELECHARGER").' '; $t_html .='