Récupération de la liste des périodes de stage correspondant */ $fastSelectData = array(); $res = $db->prepare($fastSelectSql); $res->execute($preparedValue); while ($res_f = $res->fetch()) { $fastSelectData[] = array('dateDebut' => DatetimeToTimestamp($res_f['debutStage']), 'dateFin' => DatetimeToTimestamp($res_f['finStage']), 'promotion' => array('id' => $res_f['promotionId'], 'nom' => $res_f['promotionNom'])); } /* Exportation de la liste des services */ if (isset($_GET['download']) && $_GET['download'] == 'csv') { $exportList = array(); // Liste des services dont on veux exporter les données csv $sqlExport = $coreSqlExport . $whereSqlContent . $groupbySqlContent; $res = $db->prepare($sqlExport); $res->execute($preparedValue); while ($res_f = $res->fetch()) { $exportList[] = $res_f[0]; } // On crée le CSV if (isset($exportList) && count($exportList) > 0) { if ($_SESSION['rang'] >= 3) { $moderate = TRUE; } else { $moderate = FALSE; } $csv = generateAllCSV($exportList, $filtres['dateMin'], $filtres['dateMax'], $filtres['promotion'], $moderate); downloadFILE($csv['csvPath']); } }
} } } ?> </div> <?php /** Bouton de téléchargement **/ if (isset($_GET['download'])) { if ($_GET['download'] == 'csv') { downloadFILE(generateCSV($evaluationData, TRUE)['csvPath'], $evaluationData['service']['FullName'] . '.csv'); } else { if ($_GET['download'] == 'pdf') { downloadFILE(generatePDF($evaluationData, TRUE, TRUE)['pdfPath'], $evaluationData['service']['FullName'] . '.pdf'); } } } /** Masquage du service **/ if (isset($_GET['hideService']) && $_SESSION['rang'] >= 3) { unset($_GET['hideService']); if ($evaluationData['service']['hide'] == 1) { $setHideValue = 0; } else { $setHideValue = 1; } $sql = 'UPDATE eval_ccpc_resultats SET hide = ' . $setHideValue . ' WHERE service = ?'; $res = $db->prepare($sql);
$zip = new ZipArchive(); $zipPath = PLUGIN_PATH . 'cache/' . $filtreData['nom'] . '.zip'; if ($zip->open($zipPath, ZipArchive::CREATE) === true) { foreach ($filtreData['detected'][$_GET['dateFin']][$_GET['dateDebut']] as $serviceDetected) { $serviceData = getServiceInfo($serviceDetected['service']['id']); // On crée les fichiers $csvPath = generateCSV(getEvaluationCCPCFullData($serviceData['id'], $promotion, $_GET['dateDebut'], $_GET['dateFin'], TRUE), TRUE)['csvPath']; $pdfPath = generatePDF(getEvaluationCCPCFullData($serviceData['id'], $promotion, $_GET['dateDebut'], $_GET['dateFin'], TRUE), TRUE, TRUE)['pdfPath']; // On les ajoute à l'archive if ($zip->addEmptyDir($serviceData['FullName'])) { $zip->addFile($csvPath, $serviceData['FullName'] . '/' . $serviceData['FullName'] . '.csv'); $zip->addFile($pdfPath, $serviceData['FullName'] . '/' . $serviceData['FullName'] . '.pdf'); } } $zip->close(); downloadFILE($zipPath); } } } } } // Envoie des emails if ($action == 'mail' && isset($_POST['action']) && $_POST['action'] == 'envoyerMail') { if (isset($_GET['dateDebut']) && isset($_GET['dateFin']) && isset($filtreData['detected'][$_GET['dateFin']][$_GET['dateDebut']])) { /** Contenue des messages à envoyer **/ $erreur = array(); $_SESSION['sendMail']['settings']['objet'] = htmLawed($_POST['titre']); $_SESSION['sendMail']['settings']['message'] = htmLawed($_POST['message']); /*