<?php
namespace App\Controller\Backend;
use App\Entity\Abstractt;
use App\Entity\AuteurAbstract;
use App\Form\Abstractt\ajoutAbstracttType;
use App\Form\Abstractt\modifAbstracttType;
use App\Form\Abstractt\SoumissionType;
use App\Form\AuteurAbstract\AuteurAbstractType;
use App\Repository\AbstracttRepository;
use App\Repository\AuteurAbstractRepository;
use App\Repository\CongresRepository;
use App\Repository\PaysRepository;
use Doctrine\ORM\EntityManagerInterface;
use App\Repository\UserRepository;
use DatePeriod;
use DateTime;
use Dompdf\Dompdf;
use App\Entity\AbstractInscription;
use App\Repository\AbstractInscriptionRepository;
use Dompdf\Options;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class AbstractsController extends AbstractController
{
/**
* @var AbstracttRepository
*/
private $repository;
public function __construct(AbstracttRepository $repository)
{
$this->repository = $repository;
}
/**
* @Route("/admin/abstractsIndex", name="tous_abstracts")
*/
public function findAll(Request $request, EntityManagerInterface $em, PaginatorInterface $paginator, UserRepository $userRepository, CongresRepository $congresRepository)
{
$abstract = new Abstractt();
$users = $userRepository->findAll();
$congres = $congresRepository->findAll();
$currentDate = new DateTime();
$form = $this->createForm(ajoutAbstracttType::class, $abstract);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em->persist($abstract);
$em->flush();
return $this->redirectToRoute('tous_abstracts');
}
$abstracts = $this->repository->findAllDesc();
return $this->render('backend/abstracts/abstracts.html.twig', array('form' => $form->createView(), 'abstracts' => $abstracts,'users'=>$users,'congres'=>$congres,'currentDate'=>$currentDate));
}
/**
* @Route("/user/abstractsIndexUser", name="abstractsUser")
*/
public function findAllAbstractUser(Request $request, AbstracttRepository $abstracttRepository, PaginatorInterface $paginator)
{
$user = $this->container->get('security.token_storage')->getToken()->getUser();
$abstracts = $abstracttRepository->findBy(['emailCorrespondant'=>$user->getEmail()]);
$tousabstracts= $abstracttRepository->findAll();
return $this->render('backend/abstracts/abstractsUser.html.twig', array('abstracts' => $abstracts,'tousabstracts'=>$tousabstracts));
}
/**
* @Route("/admin/auteurIndex", name="auteurs_index")
*/
public function findAllAuteurs(Request $request, EntityManagerInterface $em, AuteurAbstractRepository $repository)
{
$auteurAbstract = new AuteurAbstract();
$form = $this->createForm(AuteurAbstractType::class, $auteurAbstract);
$form->handleRequest($request);
$auteurAbstract = $repository->findAll();
return $this->render('backend/auteurAbstract/auteurAbstract.html.twig', array('form' => $form->createView(), 'auteurs' => $auteurAbstract));
}
/**
* @Route("/modifierAbstract/{id}", name="modifier_abstract")
* @param Abstractt $abstract
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function editer(Abstractt $abstract, Request $request, $id, EntityManagerInterface $em, AbstracttRepository $repository)
{
$abstract = $repository->find($id);
$form = $this->createForm(modifAbstracttType::class, $abstract);
$form->handleRequest($request);
$abstracts = $this->repository->findAll();
if ($form->isSubmitted() && $form->isValid()) {
$em->flush();
// $this->addFlash('success','user modifié avec succès!');
return $this->redirectToRoute('tous_abstracts');
}
return $this->render('backend/abstracts/edit.html.twig', array('form' => $form->createView(), 'abstracts' => $abstracts));
}
/**
* @Route("/admin/ajoutAbstract", name="ajouter_abstract")
*/
public function ajoutAbstact(Request $request, EntityManagerInterface $em)
{
$abstract = new Abstractt();
$form = $this->createForm(SoumissionType::class, $abstract);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$abstract->setStatut("en attente");
$abstract->setDateSoumission(new \DateTime('now'));
foreach ($abstract->getAuteur() as $auteur) {
$auteur->setAbstractt($abstract);
}
$em->persist($abstract);
$em->flush();
return $this->redirectToRoute('tous_abstracts');
}
return $this->render('backend/abstracts/add.html.twig', array('form' => $form->createView()));
}
/**
* @Route("{id}/soumettreabstract", name="soumettre_abstract")
*/
public function soumettreAbstract($id,Request $request, EntityManagerInterface $em, CongresRepository $congresRepository, PaysRepository $paysRepository, RequestStack $requestStack, SessionInterface $session, AbstractInscriptionRepository $abstractInscriptionRepository)
{
if ($session->has('user_abstract')){
$abstract = new Abstractt();
$user = $abstractInscriptionRepository->findOneBy(['id'=>$session->has('user_abstract')]);
$congres = $congresRepository->findOneBy(['id'=>$id]);
$dateNow=new \DateTime('now');
// $congresDuAnnee = $congresrepository->findOneByDateDebut($dateNow);
$form = $this->createForm(SoumissionType::class, $abstract);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$abstract->setStatut("en attente");
$abstract->setUser($user);
$abstract->setDateSoumission(new \DateTime('now'));
foreach ($abstract->getAuteur() as $auteur) {
$auteur->setAbstractt($abstract);
}
$abstract->setCongres($congres);
// $abstract->setUser($congres);
$em->persist($abstract);
$em->flush();
if($request->getLocale()=='fr'){
$this->addFlash('success','Votre abstract a soumis avec succès. Vous recevrez un e-mail après décision du comité scientifique');
}
elseif($request->getLocale()=='en'){
$this->addFlash('success','Your abstract has been successfully submitted. You will receive a e-mail after decision of the scientific committee');
}
$to = 'urotunisia22@gmail.com';
$subject = "ATU - Abstract submission";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= 'From: contact@urotunisia.com' . "\r\n" .
'Reply-To: contact@urotunisia.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
// $template= new TwigEngine();
$message = "<div align='center'><img src='http://urotunisia.com/front-assets/assets/img/logo1.png' width='40%' class='img-responsive center-block' align='center'></div><h4>Dear Dr ".$abstract->getNomAuteurCorrespondant()." ".$abstract->getPrenomAuteurCorrespondant()."!</h4><p>We inform you that we received your abstract <strong> ".$abstract->getTitle()."</strong></p>
<p>It will be submitted to the scientific committee.</p>
<p>The decision will be sent to you by e-mail</p>
<p>We remain at your disposal for any further information.</p>
<p><br />Best regards, <br />Le secrétariat de l'ATU</p><br><br>
<h4>Cher Dr ".$abstract->getNomAuteurCorrespondant()." ".$abstract->getPrenomAuteurCorrespondant()."!</h4><p>Nous vous informons que nous avons reçu votre résumé <strong> ".$abstract->getTitle()."</strong></p>
<p>Il sera soumis au comité scientifique.</p>
<p>La décision vous sera envoyée par e-mail</p>
<p>Nous restons à votre disposition pour toute information complémentaire.</p>
<p><br />Bien à vous, <br />Le secrétariat de l'ATU</p>";
mail($to, $subject, $message, $headers);
$to = $abstract->getEmailCorrespondant();
$subject = "ATU - Abstract submission";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= 'From: contact@urotunisia.com' . "\r\n" .
'Reply-To: contact@urotunisia.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
// $template= new TwigEngine();
$message = "<div align='center'><img src='http://urotunisia.com/front-assets/assets/img/logo1.png' width='40%' class='img-responsive center-block' align='center'></div><h4>Cher Dr ".$abstract->getNomAuteurCorrespondant()." ".$abstract->getPrenomAuteurCorrespondant()."!</h4><p>Nous vous informons que nous avons reçu votre résumé <strong> ".$abstract->getTitle()."</strong></p>
<p>Il sera soumis au comité scientifique.</p>
<p>La décision vous sera envoyée par E mail</p>
<p>Nous restons à votre disposition pour toute information complémentaire.</p>
<br /><br />Bien cordialement, <br />Le secrétariat de l'ATU</p><br><br>
<h4>Dear Dr ".$abstract->getNomAuteurCorrespondant()." ".$abstract->getPrenomAuteurCorrespondant()."!</h4><p>We inform you that we received your abstract <strong> ".$abstract->getTitle()."</strong></p>
<p>It will be submitted to the scientific committee.</p>
<p>The decision will be sent to you by E mail</p>
<p>We remain at your disposal for any further information.</p>
<br /><br />Best regards, <br />The ATU secretariat</p>
";
mail($to, $subject, $message, $headers);
return $this->redirectToRoute('congres_nationaux');
}
return $this->render('backend/abstracts/soumettre.html.twig', array('form' => $form->createView(),'congresCurrent'=>$congres,'pays' => $paysRepository->findAll(),'dateNow'=>$dateNow));
} else{
return $this->redirectToRoute('app_login_abstract');
}
}
/**
* @Route("/reviewer/abstractsIndex", name="liste_abstracts")
*/
public function allAbstracts(Request $request, EntityManagerInterface $em, PaginatorInterface $paginator)
{
$abstracts = $this->repository->findAll();
return $this->render('backend/abstracts/reviewer_abstracts.html.twig', array('abstracts' => $abstracts));
}
/**
* @Route("/reviewer/accepterabstactposter", name="accepter_Poster")
* @param Abstractt $abstract
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function accepter_Poster(Request $request, EntityManagerInterface $em, AbstracttRepository $repository)
{
$id = $request->request->get('id');
$abstract= $repository->findOneBy(['id'=>$id]);
$abstract->setTypeFinal("poster");
$abstract->setStatut("accepter");
$em->flush();
$to = $abstract->getEmailCorrespondant();
$subject = "ATU - Acceptance of Your Abstract - ".$abstract->getCongres()->getLabelEn();
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= 'From: contact@urotunisia.com' . "\r\n" .
'Reply-To: contact@urotunisia.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$message = "<table width='100%' border='0' cellspacing='0' cellpadding='5'>
<tr>
<td align='center'>
<table width='600' border='0' cellspacing='0' cellpadding='5'>
<tr><td bgcolor='#fff' align='center'><div align='center'><img src='http://urotunisia.com/front-assets/assets/img/logo1.png' width='40%' class='img-responsive center-block'></div></td></tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Dear Dr. ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>We are pleased to inform you that your abstract <strong> (N°".$abstract->getId().") entitled « ".$abstract->getTitle()." »</strong> has been accepted by the Scientific Committee as an electronic poster for presentation at the ".$abstract->getCongres()->getLabelEn().".</p>
<p>Please note the following important recommendations for your presentation:</p>
<ul>
<li>Poster Type: Displayed electronic poster</li>
<li>Poster Format: One single slide in portrait mode</li>
<li>File Format: PPTX (PowerPoint)</li>
<li>Submission Deadline: October 10th, 2026, before midnight</li>
</ul>
<p>Please click <a href='http://urotunisia.com/user/abstractsIndexUser'>HERE</a> to upload your poster or alternatively, you can send it directly to <a href='mailto:urotunisia22@gmail.com'>urotunisia22@gmail.com</a></p>
<br/><br/>Best regards, <br/>On behalf of the TAU office.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Cher Dr ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>Nous avons le plaisir de vous informer que votre résumé <strong> (N°".$abstract->getId().") intitulé « ".$abstract->getTitle()." »</strong> été accepté par le comité scientifique en tant que poster électronique dans le cadre du ".$abstract->getCongres()->getLabel().".</p>
<p>Veuillez noter les recommandations importantes suivantes pour votre présentation :</p>
<ul>
<li>Type de poster : Poster électronique affiché</li>
<li>Format du poster : Une seule diapositive en mode portrait</li>
<li>Format du fichier : PPTX (PowerPoint)</li>
<li>Délai d'envoi : 10 octobre 2025 avant minuit</li>
</ul>
<p>Veuillez cliquer <a href='http://urotunisia.com/user/abstractsIndexUser'>ICI</a> pour télécharger votre poster ou bien l'envoyer directement à l'adresse <a href='mailto:urotunisia22@gmail.com'>urotunisia22@gmail.com</a></p>
<br/><br/>Cordialement, <br/>Pour le bureau de l'ATU.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
mail($to, $subject, $message, $headers);
// $this->addFlash('success','user modifié avec succès!');
return new JsonResponse('abstractAcceperPoster');
}
/**
* @Route("/reviewer/accepterabstactvideo", name="accepter_Video")
* @param Abstractt $abstract
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function acceptervideo(Request $request, EntityManagerInterface $em, AbstracttRepository $repository)
{
$id = $request->request->get('id');
$abstract= $repository->findOneBy(['id'=>$id]);
$abstract->setTypeFinal("video");
$abstract->setStatut("accepter");
$em->flush();
$to = $abstract->getEmailCorrespondant();
$subject = "ATU - Acceptance of an abstract in the form of Video - ".$abstract->getCongres()->getLabelEn();
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= 'From: contact@urotunisia.com' . "\r\n" .
'Reply-To: contact@urotunisia.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$message = "<table width='100%' border='0' cellspacing='0' cellpadding='5'>
<tr>
<td align='center'>
<table width='600' border='0' cellspacing='0' cellpadding='5'>
<tr><td bgcolor='#fff' align='center'><div align='center'><img src='http://urotunisia.com/front-assets/assets/img/logo1.png' width='40%' class='img-responsive center-block'></div></td></tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Dear Dr. ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>We are pleased to inform you that your abstract <strong> ".$abstract->getId()." entitled « ".$abstract->getTitle()." »</strong> has been accepted by the Scientific Committee as a video for presentation at the ".$abstract->getCongres()->getLabel().".</p>
<p>Further instructions regarding your submission will be provided in a forthcoming email</p>
<p>In the meantime, please click <a href='http://urotunisia.com/user/abstractsIndexUser'>HERE</a> to upload your poster or alternatively, you can send it directly to <a href='mailto:urotunisia22@gmail.com'>urotunisia22@gmail.com</a></p>
<br/><br/>Best regards, <br/>On behalf of the TAU office.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Cher Dr ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>Nous avons le plaisir de vous informer que votre résumé <strong> ".$abstract->getId()." intitulé « ".$abstract->getTitle()." »</strong> été accepté par le comité scientifique en tant que vidéo dans le cadre du ".$abstract->getCongres()->getLabel().".</p>
<p>Des instructions complémentaires concernant votre soumission vous seront communiquées dans un prochain email.</p>
<p>En attendant, veuillez cliquer <a href='http://urotunisia.com/user/abstractsIndexUser'>ICI</a> pour télécharger votre poster ou bien l'envoyer directement à l'adresse <a href='mailto:urotunisia22@gmail.com'>urotunisia22@gmail.com</a></p>
<br/><br/>Cordialement, <br/>Pour le bureau de l'ATU.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
mail($to, $subject, $message, $headers);
// $this->addFlash('success','user modifié avec succès!');
return new JsonResponse('abstractAcceperVideo');
}
/**
* @Route("/reviewer/accepterabstactcomm", name="accepter_CO")
* @param Abstractt $abstract
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function accepterComm(Request $request, EntityManagerInterface $em, AbstracttRepository $repository)
{
$id = $request->request->get('id');
$abstract= $repository->findOneBy(['id'=>$id]);
$abstract->setTypeFinal("communication orale");
$abstract->setStatut("accepter");
$em->flush();
$to = $abstract->getEmailCorrespondant();
$subject = "ATU - Acceptance of an abstract in the form of an oral communication - ".$abstract->getCongres()->getLabelEn();
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= 'From: contact@urotunisia.com' . "\r\n" .
'Reply-To: contact@urotunisia.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$message = "<table width='100%' border='0' cellspacing='0' cellpadding='5'>
<tr>
<td align='center'>
<table width='600' border='0' cellspacing='0' cellpadding='5'>
<tr><td bgcolor='#fff' align='center'><div align='center'><img src='http://urotunisia.com/front-assets/assets/img/logo1.png' width='40%' class='img-responsive center-block'></div></td></tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Dear Dr. ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>We are pleased to inform you that your abstract <strong> (N°".$abstract->getId().") entitled « ".$abstract->getTitle()." »</strong> has been accepted by the Scientific Committee as an oral communication for presentation at the ".$abstract->getCongres()->getLabelEn().".</p>
<p>Please note the following important recommendations for your presentation:</p>
<ul>
<li>Poster Type: Oral presentation</li>
<li>Presentation Duration: 5 minutes</li>
<li>Maximum Slides: <strong style='color:red'><u>5 slides (excluding the title slide)</u></strong></li>
<li>Format: PPTX (PowerPoint)</li>
<li>Submission Deadline: October 10th, 2025, before midnight</li>
</ul>
<p>Please click <a href='http://urotunisia.com/user/abstractsIndexUser'>HERE</a> to upload your poster or alternatively, you can send it directly to <a href='mailto:urotunisia22@gmail.com'>urotunisia22@gmail.com</a></p>
<br/><br/>Best regards, <br/>On behalf of the TAU office.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Cher Dr ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>Nous avons le plaisir de vous informer que votre résumé <strong> (N°".$abstract->getId().") intitulé « ".$abstract->getTitle()." »</strong> été accepté par le comité scientifique en tant que communication orale dans le cadre du ".$abstract->getCongres()->getLabel().".</p>
<p>Veuillez noter les recommandations importantes suivantes pour votre présentation :</p>
<ul>
<li>Type de présentation : communication orale</li>
<li>Durée de la présentation : 5 minutes</li>
<li>Nombre maximum de diapositives : <strong style='color:red'><u>5 diapositives (hors diapositive de titre)</u></strong></li>
<li>Format : PPTX (PowerPoint)</li>
<li>Délai d'envoi des diapositives : 10 octobre 2025 avant minuit</li>
</ul>
<p>Veuillez cliquer <a href='http://urotunisia.com/user/abstractsIndexUser'>ICI</a> pour télécharger votre poster ou bien l'envoyer directement à l'adresse <a href='mailto:urotunisia22@gmail.com'>urotunisia22@gmail.com</a></p>
<br/><br/>Cordialement, <br/>Pour le bureau de l'ATU.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
mail($to, $subject, $message, $headers);
// $this->addFlash('success','user modifié avec succès!');
return new JsonResponse('abstractAcceperCO');
}
/**
* @Route("/reviewer/refuserabstact", name="refuser_abstract")
* @param Abstractt $abstract
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function refuser( Request $request, EntityManagerInterface $em, AbstracttRepository $repository)
{
$id = $request->request->get('id');
$abstract= $repository->findOneBy(['id'=>$id]);
$abstract->setStatut("refuser");
$abstract->setTypeFinal("refuser");
$em->flush();
$to = $abstract->getEmailCorrespondant();
$subject = "ATU - Notification Regarding Your Abstract - ".$abstract->getCongres()->getLabelEn();
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= 'From: contact@urotunisia.com' . "\r\n" .
'Reply-To: contact@urotunisia.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$message = "<table width='100%' border='0' cellspacing='0' cellpadding='5'>
<tr>
<td align='center'>
<table width='600' border='0' cellspacing='0' cellpadding='5'>
<tr><td bgcolor='#fff' align='center'><div align='center'><img src='http://urotunisia.com/front-assets/assets/img/logo1.png' width='40%' class='img-responsive center-block'></div></td></tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Dear Dr. ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>On behalf of the Scientific Committee of the TAU, we regret to inform you that, despite the high quality of your abstract <strong> (N°".$abstract->getId().") entitled « ".$abstract->getTitle()." »</strong>, it was not selected for presentation at the ".$abstract->getCongres()->getLabelEn().".</p>
<p>This year, we received an exceptionally large number of submissions, making the selection process highly competitive. We sincerely appreciate your contribution and encourage your continued participation in future events.</p>
<p>We hope to see you at the conference.</p>
<br/><br/>Best regards, <br/>On behalf of the TAU office.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' class='body'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='10' bgcolor='#FFFFFF' > </td>
<td valign='top' bgcolor='#FFFFFF' align='left'>
<h4>Cher Dr ".$abstract->getNomAuteurCorrespondant()." " .$abstract->getPrenomAuteurCorrespondant(). "!</h4><p>Au nom du comité scientifique de l'ATU, nous avons le regret de vous informer que, malgré la grande qualité de votre résumé <strong> (N°".$abstract->getId().") intitulé « ".$abstract->getTitle()." »</strong>, celui-ci n'a pas été retenu pour une présentation lors du ".$abstract->getCongres()->getLabel().".</p>
<p>Cette année, nous avons reçu un nombre exceptionnellement élevé de soumissions, rendant le processus de sélection particulièrement compétitif. Nous vous remercions chaleureusement pour votre contribution et espérons vivement vous compter parmi nous lors des prochains événements.</p>
<p>Nous espérons vous voir au congrès.</p>
<br/><br/>Cordialement, <br/>Pour le bureau de l'ATU.
<p> </p>
</td>
<td width='10' bgcolor='#FFFFFF' > </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
mail($to, $subject, $message, $headers);
// $this->addFlash('success','user modifié avec succès!');
return new JsonResponse('abstractRefuser');
}
/**
* @Route("/user/uploadsAbstract/{id}", name="uploadsAbstract")
*/
public function uploadsAbstract(Request $request, AbstracttRepository $abstracttRepository, $id, EntityManagerInterface $em)
{
$user = $this->container->get('security.token_storage')->getToken()->getUser();
$abstract = $abstracttRepository->findOneBy(['id'=>$id]);
$oldFile = $abstract->getUploads();
if($abstract->getUploads()!=null)
{$abstract->setUploads(
new File($this->getParameter('uploadAbstractuploads_directory') . '/' . $abstract->getUploads())
);}
if($request->isMethod('post')){
if ($abstract->getTypeFinal()=='poster' || $abstract->getTypeFinal()=='communication orale' ){
$brochureFile = $request->files->get('uploads');
if ($brochureFile) {
$fileNameimage = md5(uniqid()) . '.' . $brochureFile->guessExtension();
$abstract->setUploads($fileNameimage);
$brochureFile->move(
$this->getParameter('uploadAbstractuploads_directory'),
$fileNameimage
);
} else {
$abstract->setUploads($oldFile);
}
}
elseif($abstract->getTypeFinal()=='video'){
$abstract->setUploads($request->request->get('uploads'));
}
$em->flush();
return $this->redirectToRoute('abstractsUser');
}
return $this->render('backend/abstracts/uploadsAbstract.html.twig', array('abstracts' => $abstract));
}
/**
* @Route("/admin/supprimerAbstarct/{id}", name="supprimer_abstract")
*/
public function supprimer($id, AbstracttRepository $repository, EntityManagerInterface $em)
{
$abstract = $repository->find($id);
$em->remove($abstract);
$em->flush();
return $this->redirectToRoute('tous_abstracts');
}
/**
* @Route("/admin/abstractsearch/", name="abstract_search")
*/
public function searchAbstarct(AbstracttRepository $repository, Request $request, PaginatorInterface $paginator)
{
$abstract = $repository->findByNamePopular(
$request->query->get('query')
);
$abstract = $paginator->paginate(
// Doctrine Query, not results
$abstract,
// Define the page parameter
$request->query->getInt('page', 1),
// Items per page
2
);
$entityManager = $this->getDoctrine()->getManager();
$categoryRepository = $entityManager->getRepository(Abstractt::class);
return $this->render('backend/abstracts/reviewer_abstracts.html.twig', [
'abstract' => $abstract
]);
}
/**
* @Route("/reviewer/abstractrecherche/", name="abstract_recherche")
*/
public function rechercheAbstract(AbstracttRepository $repository, Request $request, PaginatorInterface $paginator)
{
$abstract = $repository->findByNamePopular(
$request->query->get('query')
);
$abstract = $paginator->paginate(
// Doctrine Query, not results
$abstract,
// Define the page parameter
$request->query->getInt('page', 1),
// Items per page
2
);
$entityManager = $this->getDoctrine()->getManager();
$categoryRepository = $entityManager->getRepository(Abstractt::class);
return $this->render('backend/abstracts/abstracts.html.twig', [
'abstract' => $abstract
]);
}
/**
* @Route("/user/telechargerAbstract/{id}", name="telecharger_abstract")
*/
public function pdfAbstract(AbstracttRepository $repository, $id, EntityManagerInterface $em, AuteurAbstractRepository $repositoryAuteur)
{
$abstract = $repository->find($id);
$auteurAbstract = new AuteurAbstract();
$auteurAbstract = $repositoryAuteur->findBy(array('abstractt' => $id));
// Configure Dompdf according to your needs
$pdfOptions = new Options();
$pdfOptions->set('defaultFont', 'Arial');
$pdfOptions->set('isRemoteEnabled', true); // temp folder with write permission
$pdfOptions->setIsRemoteEnabled(true);
// Instantiate Dompdf with our options
$dompdf = new Dompdf($pdfOptions);
// Retrieve the HTML generated in our twig file
$html = $this->renderView('backend/abstracts/pdfAbstract.html.twig', ['abstract' => $abstract, 'auteurs' => $auteurAbstract]);
// Load HTML to Dompdf
$dompdf->loadHtml($html);
// $paper_size = array(0,0,360,360);
// (Optional) Setup the paper size and orientation 'portrait' or 'portrait'
$dompdf->setPaper('A4', 'portrait');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser (force download)
$dompdf->stream("Abstract-" . $abstract->getId() . ".pdf", [
"Attachment" => true
]);
return $this->render('backend/abstracts/abstracts.html.twig');
}
}