<?php
namespace App\Controller\Etudiant;
use ZipArchive;
use SplFileObject;
use App\Entity\Rapport;
use Selective\Rar\RarFileReader;
use Doctrine\Persistence\ManagerRegistry;
use phpDocumentor\Reflection\Types\This;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Component\String\Slugger\SluggerInterface;
use Symfony\Component\Finder\Exception\AccessDeniedException;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
#[Route('/etudiant/rapport')]
class RapportController extends AbstractController
{
private $client;
private $em;
public function __construct(HttpClientInterface $client, ManagerRegistry $em)
{
$this->client = $client;
$this->em = $em->getManager();
}
#[Route('/', name: 'rapport_index')]
public function index(): Response
{
$response = $this->client->request('GET', $this->getParameter("api")."/getetablissement");
$etablissements = $response->toArray();
return $this->render('rapport/index.html.twig', [
'etablissements' => $etablissements
]);
}
#[Route('/import', name: 'rapport_import')]
public function import(Request $request, SluggerInterface $slugger): Response
{
$files = $request->files->get('file');
foreach ($files as $file) {
if($file->guessExtension() !== 'pdf'){
return new JsonResponse('Prière d\'enregister des fichiers pdf!', 500);
}
}
foreach ($files as $file) {
$name = $file->getClientOriginalName();
$data = explode("_", $name);
$stage = $data[1];
$inscription = $data[2];
$type = $data[3];
$originalFilename = pathinfo($name, PATHINFO_FILENAME);
$safeFilename = $slugger->slug($originalFilename);
$newFilename = $safeFilename.'-'.uniqid().'.'.$file->guessExtension();
// dd($originalFilename, $newFilename);
try {
// dd("hi");
$file->move(
$this->getParameter('rapport_directory'),
$newFilename
);
$rapportExist = $this->em->getRepository(Rapport::class)->findOneBy(['stage' => $stage, 'inscription' => $inscription, 'type' => $type]);
// dd($rapportExist);
if($rapportExist){
$rapportExist->setUrl($newFilename);
$rapportExist->setDateUpdated(new \DateTime("now"));
} else {
$rapport = new Rapport();
$rapport->setStage($stage);
$rapport->setInscription($inscription);
$rapport->setType($type);
$rapport->setDateCreated(new \DateTime("now"));
$rapport->setDateUpdated(new \DateTime("now"));
$rapport->setUrl($newFilename);
$this->em->persist($rapport);
}
$this->em->flush();
} catch (FileException $e) {
return new JsonResponse($e, 500);
}
}
return new JsonResponse("Bien enregistre");
}
#[Route('/list/{id}/{cyclekey}', name: 'rapport_list')]
public function list(Request $request, $id, $cyclekey): Response
{
// dd("test");
ini_set("pcre.backtrack_limit", "5000000000");
ini_set('max_execution_time', '-1');
// dd(ini_get('max_execution_time'));
// set_time_limit(0);
$response = $this->client->request('GET', $this->getParameter("api")."/getlistofstagebysemestreannee/$id");
$session = $request->getSession();
$data = $response->toArray();
$inscriptions = $data['inscriptions'];
// dd($inscriptions);
$cycles = $data['cycles'];
// $ncycles = [];
// if($cycles[$cyclekey]){
// array_push($ncycles[$cyclekey], $cycles[$cyclekey]);
// }
// $ncycles[$cyclekey] = $ncycles[0];
$ncycles[$cyclekey]= $cycles[$cyclekey];
// dd($cycles);
$etab = $inscriptions[0]['etab'];
$data = [];
$c = 0;
$stageSimulation = $stageClinique = $stageSDentaire = $stagePharmacy = $stagePharmacyHopital = $stagePharmacyStaff = $stageFmaGlobal = $stageFpaGlobal = $stageFdaGlobal = null;
foreach ($inscriptions as $key => $inscription) {
// if($inscription['id'] == "19265") {
$arrayOfStage = [];
// if($inscription['id'] == "17835"){
// dd($cycles);
// }
foreach ($ncycles as $key => $cycle) {
// if($key != $cyclekey){
// continue;
// }
switch ($etab) {
case 'FMDA':
$stageFdaGlobal = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "global");
$stageSDentaire = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "dentaire");
$stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
$stageClinique = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "clinique");
break;
case 'FPA':
$stageFpaGlobal = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "global");
$stagePharmacyHopital = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "hopital");
$stagePharmacy = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "pharmacy");
$stagePharmacyStaff = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "staff");
$stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
break;
default:
$stageFmaGlobal = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "global");
$stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
$stageClinique = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "clinique");
break;
}
// $stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
// $stageClinique = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "clinique");
// $stageSDentaire = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "dentaire");
// $stagePharmacy = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "pharmacy");
// $stagePharmacyHopital = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "hopital");
// $stagePharmacyStaff = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "staff");
// dd($stagePharmacyHopital);
array_push($arrayOfStage, [
'clinique' => $stageClinique,
'simulation' => $stageSimulation,
'pharmacy' => $stagePharmacy,
'dentaire' => $stageSDentaire,
'staff' => $stagePharmacyStaff,
'hopital' => $stagePharmacyHopital,
'fmaglobal' => $stageFmaGlobal,
'fdaglobal' => $stageFdaGlobal,
'fpaglobal' => $stageFpaGlobal,
]);
}
// dd($arrayOfStage);
array_push($data, [
'inscription' => $inscription,
'stages' => $arrayOfStage
]);
// }
}
// dd($data);
$html = $this->render("rapport/page/table.html.twig", [
'datas' => $data,
'cycles' => $ncycles
])->getContent();
// dd($cycles);
$session->set("inscriptions", $inscriptions);
return new JsonResponse($html);
}
#[Route('/stageDetails/{rapport}', name: 'rapport_stageDetails')]
public function stageDetails(Request $request, Rapport $rapport): Response
{
$session = $request->getSession();
$inscriptions = $session->get("inscriptions");
$inscription = $inscriptions[array_search($rapport->getInscription(), array_column($inscriptions, 'id'))];
// dd($rapport);
return $this->render("rapport/detail.html.twig", [
'rapport' => $rapport,
'inscription' => $inscription
]);
}
#[Route('/rapportsave/{rapport}', name: 'rapport_rapport_save')]
public function rapport_save(Request $request, Rapport $rapport): Response
{
// dd($request);
if(!in_array('ROLE_ENSEIGNANT', $this->getUser()->getRoles())) {
throw new AccessDeniedException("Vous avez pas le droit!");
}
$rapport->setNote(floatval($request->get('note')));
$rapport->setObservation($request->get('observation'));
$rapport->setProf($this->getUser());
$this->em->flush();
return $this->redirectToRoute('rapport_stageDetails', [
'rapport' => $rapport->getId()
]);
}
#[Route('/export_etat_Notes/{semestre}/{cyclekey}', name: 'export_etat_Notes')]
public function export_etat_Notes(Request $request, $semestre,$cyclekey)
{
// set_time_limit(0);
// set_time_limit(0);
// ini_set('max_execution_time', '0');
// dd(ini_get('max_execution_time'));
$response = $this->client->request('GET', $this->getParameter("api")."/getlistofstagebysemestreannee/$semestre")->toArray();
$abreviations = $this->client->request('GET', $this->getParameter("api")."/getabreviationsbysemestre/$semestre")->toArray();
$inscriptions = $response['inscriptions'];
$cycles = $response['cycles'];
$etab = $inscriptions[0]['etab'];
$stageSimulation = $stageClinique = $stageDentaire = $stagePharmacy = $stagePharmacyHopital = $stagePharmacyStaff = $stageFmaGlobal = $stageFpaGlobal = $stageFdaGlobal = null;
// dd($cycles,$semestre,$cyclekey);
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'ORD');
// $values = [];
$i=2;
$j=1;
$headers = [];
foreach ($inscriptions as $inscription) {
// if($inscription['id'] == "19274" || $inscription['id'] == "19265") {
$sheet->setCellValue('A'.$i, $j);
$sheet->fromArray(
$inscription,
null,
'B'.$i
);
$k = $cyclekey + 1;
// $k = 1;
foreach ($cycles as $key => $cycle) {
if($key != $cyclekey){
continue;
// dd($cycles,$cycle);
}
switch ($etab) {
case 'FMDA':
$stageFdaGlobal = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "global");
$stageDentaire = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "dentaire");
$stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
$stageClinique = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "clinique");
break;
case 'FPA':
$stageFpaGlobal = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "global");
$stagePharmacyHopital = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "hopital");
$stagePharmacy = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "pharmacy");
$stagePharmacyStaff = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "staff");
$stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
break;
default:
$stageFmaGlobal = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "global");
$stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
$stageClinique = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "clinique");
break;
}
if (($stageClinique != null || $stageSimulation != null || $stageFmaGlobal != null) && $stagePharmacyHopital == null ) {
// dd($stageSimulation);
$inscription['stage'.$k] = $cycle['designation'][0];
// $inscription['P-Cli'.$k] = $stageClinique->getProf() == null ? 'null' : $stageClinique->getProf()->getNom() . " " .$stageClinique->getProf()->getPrenom();
$inscription['P-Cli'.$k] = $stageClinique != null ? ($stageClinique->getProf() == null ? 'null' : $stageClinique->getProf()->getNom() . " " .$stageClinique->getProf()->getPrenom()) : "";
$inscription['N-Cli'.$k] = $stageClinique != null ? ($stageClinique->getNote() == 0 ? "0" : $stageClinique->getNote()) : "";
$inscription['OBS Cli'.$k] = $stageClinique != null ? $stageClinique->getObservation() : "";
$inscription['P-Sim'.$k] = $stageSimulation != null ? ($stageSimulation->getProf() == null ? 'null' : $stageSimulation->getProf()->getNom() . " " .$stageSimulation->getProf()->getPrenom()) : "";
$inscription['N-Sim'.$k] = $stageSimulation != null ? ($stageSimulation->getNote() == 0 ? "0" : $stageSimulation->getNote()) : "";
$inscription['OBS Sim'.$k] = $stageSimulation != null ? $stageSimulation->getObservation() : "";
$inscription['P-Glb'.$k] = $stageFmaGlobal != null ? ($stageFmaGlobal->getProf() == null ? 'null' : $stageFmaGlobal->getProf()->getNom() . " " .$stageFmaGlobal->getProf()->getPrenom()) : "";
$inscription['N-Glb'.$k] = $stageFmaGlobal != null ? ($stageFmaGlobal->getNote() == 0 ? "0" : $stageFmaGlobal->getNote()) : "";
$inscription['OBS Glb'.$k] = $stageFmaGlobal != null ? $stageFmaGlobal->getObservation() : "";
}
elseif ($stageSimulation != null || $stagePharmacyHopital != null || $stageFpaGlobal != null) {
$inscription['stage'.$k] = $cycle['designation'][0];
$inscription['P-Simulation'.$k] = $stageSimulation != null ? ($stageSimulation->getProf() == null ? 'null' : $stageSimulation->getProf()->getNom() . " " .$stageSimulation->getProf()->getPrenom()) : "";
$inscription['N-Simulation'.$k] = $stageSimulation != null ? ($stageSimulation->getNote() == 0 ? "0" : $stageSimulation->getNote()) : "";
$inscription['OBS Simulation'.$k] = $stageSimulation != null ? $stageSimulation->getObservation() : "";
$inscription['P-Hopital'.$k] = $stagePharmacyHopital != null ? ($stagePharmacyHopital->getProf() == null ? 'null' : $stagePharmacyHopital->getProf()->getNom() . " " .$stagePharmacyHopital->getProf()->getPrenom()) : "";
$inscription['N-Hopital'.$k] = $stagePharmacyHopital != null ? ($stagePharmacyHopital->getNote() == 0 ? "0" : $stagePharmacyHopital->getNote()) : "";
$inscription['OBS Hopital'.$k] = $stagePharmacyHopital != null ? $stagePharmacyHopital->getObservation() : "";
$inscription['P-Glb'.$k] = $stageFpaGlobal != null ? ($stageFpaGlobal->getProf() == null ? 'null' : $stageFpaGlobal->getProf()->getNom() . " " .$stageFpaGlobal->getProf()->getPrenom()) : "";
$inscription['N-Glb'.$k] = $stageFpaGlobal != null ? ($stageFpaGlobal->getNote() == 0 ? "0" : $stageFpaGlobal->getNote()) : "";
$inscription['OBS Glb'.$k] = $stageFpaGlobal != null ? $stageFpaGlobal->getObservation() : "";
}
elseif ($stagePharmacy != null) {
$inscription['stage'.$k] = $cycle['designation'][0];
$inscription['P-Phar'.$k] = $stagePharmacy->getProf() == null ? 'null' : $stagePharmacy->getProf()->getNom() . " " .$stagePharmacy->getProf()->getPrenom();
$inscription['N-Phar'.$k] = $stagePharmacy->getNote() == 0 ? "0" : $stagePharmacy->getNote();
$inscription['OBS Phar'.$k] = $stagePharmacy->getObservation();
}elseif ($stageDentaire != null || $stageFdaGlobal != null) {
$inscription['stage'.$k] = $cycle['designation'][0];
$inscription['P-Dent'.$k] = $stageDentaire->getProf() == null ? 'null' : $stageDentaire->getProf()->getNom() . " " .$stageDentaire->getProf()->getPrenom();
$inscription['N-Dent'.$k] = $stageDentaire->getNote() == 0 ? "0" : $stageDentaire->getNote();
$inscription['OBS Dent'.$k] = $stageDentaire->getObservation();
$inscription['P-Glb'.$k] = $stageFdaGlobal->getProf() == null ? 'null' : $stageFdaGlobal->getProf()->getNom() . " " .$stageFdaGlobal->getProf()->getPrenom();
$inscription['N-Glb'.$k] = $stageFdaGlobal->getNote() == 0 ? "0" : $stageFdaGlobal->getNote();
$inscription['OBS Glb'.$k] = $stageFdaGlobal->getObservation();
}else{
// $inscription['stage'.$k] = $cycle['designation'][0];
$inscription['stage'.$k] = "";
$inscription['P-Phar'.$k] = "";
$inscription['N-Phar'.$k] = "";
$inscription['OBS Phar'.$k] = "";
}
if (count($inscription) >= count($headers)) {
$headers = $inscription;
}
$k++;
}
$sheet->fromArray(
$inscription,
null,
'B'.$i
);
$i++;
$j++;
}
// }
$sheet->fromArray(
array_keys($headers),
null,
'B1'
);
$writer = new Xlsx($spreadsheet);
$fileName = 'Extraction Des Notes.xlsx';
$temp_file = tempnam(sys_get_temp_dir(), $fileName);
$writer->save($temp_file);
return $this->file($temp_file, $fileName, ResponseHeaderBag::DISPOSITION_INLINE);
}
// #[Route('/export_etat_Notes/{semestre}', name: 'export_etat_Notes')]
// public function export_etat_Notes(Request $request, $semestre)
// {
// $response = $this->client->request('GET', $this->getParameter("api")."/getlistofstagebysemestreannee/$semestre")->toArray();
// $abreviations = $this->client->request('GET', $this->getParameter("api")."/getabreviationsbysemestre/$semestre")->toArray();
// // dd($response);
// $inscriptions = $response['inscriptions'];
// $cycles = $response['cycles'];
// // dd($cycles);
// // dd($inscriptions);
// $spreadsheet = new Spreadsheet();
// $sheet = $spreadsheet->getActiveSheet();
// $sheet->setCellValue('A1', 'ORD');
// $sheet->fromArray(
// array_keys($inscriptions[0]),
// null,
// 'B1'
// );
// // $sheet->setCellValue('S1', 'CYCLE 1');
// // $sheet->setCellValue('T1', 'N-Cli');
// // $sheet->setCellValue('U1', 'N-Sim');
// // $sheet->setCellValue('V1', 'OBS Cli');
// // $sheet->setCellValue('W1', 'OBS Sim');
// // $sheet->setCellValue('R1', 'CYCLE 1');
// // $sheet->setCellValue('S1', 'N-Cli');
// // $sheet->setCellValue('T1', 'N-Sim');
// // $sheet->setCellValue('U1', 'N-Phar');
// // $sheet->setCellValue('V1', 'N-Dent');
// // $sheet->setCellValue('W1', 'OBS Cli');
// // $sheet->setCellValue('X1', 'OBS Sim');
// // $sheet->setCellValue('Y1', 'OBS Phar');
// // $sheet->setCellValue('Z1', 'OBS Dent');
// // $sheet->setCellValue('AA1', 'CYCLE 2');
// // $sheet->setCellValue('AB1', 'N-Cli');
// // $sheet->setCellValue('AC1', 'N-Sim');
// // $sheet->setCellValue('AD1', 'N-Phar');
// // $sheet->setCellValue('AE1', 'N-Dent');
// // $sheet->setCellValue('AF1', 'OBS Cli');
// // $sheet->setCellValue('AG1', 'OBS Sim');
// // $sheet->setCellValue('AH1', 'OBS Phar');
// // $sheet->setCellValue('AI1', 'OBS Dent');
// // $sheet->setCellValue('AJ1', 'CYCLE 3');
// // $sheet->setCellValue('AK1', 'N-Cli');
// // $sheet->setCellValue('AL1', 'N-Sim');
// // $sheet->setCellValue('AM1', 'N-Phar');
// // $sheet->setCellValue('AN1', 'N-Dent');
// // $sheet->setCellValue('AO1', 'OBS Cli');
// // $sheet->setCellValue('AP1', 'OBS Sim');
// // $sheet->setCellValue('AQ1', 'OBS Phar');
// // $sheet->setCellValue('AR1', 'OBS Dent');
// // $sheet->setCellValue('AS1', 'CYCLE 4');
// // $sheet->setCellValue('AT1', 'N-Cli');
// // $sheet->setCellValue('AU1', 'N-Sim');
// // $sheet->setCellValue('AV1', 'N-Phar');
// // $sheet->setCellValue('AW1', 'N-Dent');
// // $sheet->setCellValue('AX1', 'OBS Cli');
// // $sheet->setCellValue('AY1', 'OBS Sim');
// // $sheet->setCellValue('AZ1', 'OBS Phar');
// // $sheet->setCellValue('BA1', 'OBS Dent');
// $i=2;
// $j=1;
// foreach ($inscriptions as $inscription) {
// // dd($infoBYinscription);
// $sheet->setCellValue('A'.$i, $j);
// $sheet->fromArray(
// $inscription,
// null,
// 'B'.$i
// );
// $k = 1;
// foreach ($cycles as $cycle) {
// if ($k == 1) {
// $stageClinique = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "clinique");
// // dd($cycle['designation']);
// $stageSimulation = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "simulation");
// $stagePharmacy = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "pharmacy");
// $stageDentaire = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "dentaire");
// $stagePharmacy = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "pharmacy");
// $stageSDentaire = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "dentaire");
// $stagePharmacyStaff = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "staff");
// // dd($stagePharmacyStaff);
// $stagePharmacyHopital = $this->em->getRepository(Rapport::class)->findStage($inscription["id"], $cycle['stages'], "hopital");
// $sheet->setCellValue('S1', 'stage'.$k);
// $sheet->setCellValue('S'.$i,$cycle['designation'][0]);
// if ($stageClinique != null || $stageSimulation != null) {
// $sheet->setCellValue('T1', 'N-Cli');
// $sheet->setCellValue('U1', 'N-Sim');
// $sheet->setCellValue('V1', 'OBS Cli');
// $sheet->setCellValue('W1', 'OBS Sim');
// $sheet->setCellValue('T'.$i, $stageClinique->getNote());
// $sheet->setCellValue('U'.$i, $stageSimulation->getNote());
// $sheet->setCellValue('V'.$i, $stageClinique->getObservation());
// $sheet->setCellValue('W'.$i, $stageSimulation->getObservation());
// }elseif ($stagePharmacyStaff != null || $stagePharmacyHopital != null) {
// $sheet->setCellValue('T1', 'N-Staf');
// $sheet->setCellValue('U1', 'N-Hopital');
// $sheet->setCellValue('V1', 'OBS Staf');
// $sheet->setCellValue('W1', 'OBS Hopital');
// $sheet->setCellValue('T'.$i, $stagePharmacyStaff->getNote());
// $sheet->setCellValue('U'.$i, $stagePharmacyHopital->getNote());
// $sheet->setCellValue('V'.$i, $stagePharmacyStaff->getObservation());
// $sheet->setCellValue('W'.$i, $stagePharmacyHopital->getObservation());
// }elseif ($stagePharmacy != null) {
// $sheet->setCellValue('T1', 'N-Phar');
// $sheet->setCellValue('U1', 'OBS Phar');
// $sheet->setCellValue('T'.$i, $stagePharmacy->getNote());
// $sheet->setCellValue('U'.$i, $stagePharmacy->getObservation());
// }elseif ($stageDentaire != null) {
// $sheet->setCellValue('T1', 'N-Dent');
// $sheet->setCellValue('U1', 'OBS Dent');
// $sheet->setCellValue('T'.$i, $stageDentaire->getNote());
// $sheet->setCellValue('U'.$i, $stageDentaire->getObservation());
// }
// }
// $k++;
// }
// $i++;
// $j++;
// }
// // $sheet = $spreadsheet->getActiveSheet();
// $writer = new Xlsx($spreadsheet);
// $fileName = 'Extraction Des Notes.xlsx';
// $temp_file = tempnam(sys_get_temp_dir(), $fileName);
// $writer->save($temp_file);
// return $this->file($temp_file, $fileName, ResponseHeaderBag::DISPOSITION_INLINE);
// }
}