src/Controller/IntranetController.php line 50

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\FamilleJ;
  4. use App\Entity\CategoryJ;
  5. use App\Entity\RapportageDA;
  6. use App\Entity\ContratCadre;
  7. use App\Entity\CategoryCatalogue;
  8. use App\Entity\DemAchatTemp;
  9. use App\Entity\demAchat;
  10. use App\Entity\CatalogueAsset;
  11. use App\Entity\Catalogue;
  12. use App\Entity\Magasin;
  13. use App\Entity\ArticleStock;
  14. use App\Entity\CommandeAchat;
  15. use App\Entity\LigneArticleMagasin;
  16. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  17. use Symfony\Component\HttpFoundation\Response;
  18. use Symfony\Component\Routing\Annotation\Route;
  19. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  20. use Symfony\Component\HttpFoundation\Request;
  21. use Symfony\Component\HttpFoundation\RedirectResponse;
  22. use App\Service\DemandeAchatService;
  23. use App\Service\EmailService;
  24. use App\Service\ContratCadreService;
  25. use Doctrine\ORM\EntityManagerInterface;
  26. class IntranetController extends AbstractController
  27. {
  28. private EntityManagerInterface $em;
  29. private DemandeAchatService $demandeAchatService;
  30. private EmailService $emailService;
  31. private ContratCadreService $contratCadreService;
  32. public function __construct(
  33. EntityManagerInterface $em,
  34. DemandeAchatService $demandeAchatService,
  35. EmailService $emailService,
  36. ContratCadreService $contratCadreService
  37. ) {
  38. $this->em = $em;
  39. $this->demandeAchatService = $demandeAchatService;
  40. $this->emailService = $emailService;
  41. $this->contratCadreService = $contratCadreService;
  42. }
  43. #[Route('/', name: 'mstope_intranet_index')]
  44. public function index(): Response
  45. {
  46. $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
  47. return $this->render('intranet/index.html.twig');
  48. }
  49. public function moduleachat(): Response
  50. {
  51. $data = $this->demandeAchatService ->getValidationData(); // ton return actuel
  52. return $this->render('DemandeAchatVue/moduleachat.html.twig', [
  53. 'stats' => [
  54. 'total' => $data['nballda'],
  55. 'valide' => $data['totalvalid'],
  56. 'rejete' => $data['totalrejet'],
  57. ]
  58. ]);
  59. }
  60. public function moduleimmo(): Response
  61. {
  62. $data = $this->demandeAchatService ->getValidationData(); // ton return actuel
  63. return $this->render('asset/moduleimmo.html.twig'
  64. /*, [
  65. 'stats' => [
  66. 'total' => $data['nballda'],
  67. 'valide' => $data['totalvalid'],
  68. 'rejete' => $data['totalrejet'],
  69. ]
  70. ]*/
  71. );
  72. }
  73. public function modulefinance(): Response
  74. {
  75. return $this->render('finance/modulefinance.html.twig'
  76. /*, [
  77. 'stats' => [
  78. 'total' => $data['nballda'],
  79. 'valide' => $data['totalvalid'],
  80. 'rejete' => $data['totalrejet'],
  81. ]
  82. ]*/
  83. );
  84. }
  85. public function modulerh(): Response
  86. {
  87. return $this->render('conge/modulerh.html.twig');
  88. }
  89. public function moduleadmin(): Response
  90. {
  91. return $this->render('admin/moduleadmin.html.twig'
  92. /*, [
  93. 'stats' => [
  94. 'total' => $data['nballda'],
  95. 'valide' => $data['totalvalid'],
  96. 'rejete' => $data['totalrejet'],
  97. ]
  98. ]*/
  99. );
  100. }
  101. public function moduleflotte(): Response
  102. {
  103. return $this->render('fleet/moduleflotte.html.twig'
  104. /*, [
  105. 'stats' => [
  106. 'total' => $data['nballda'],
  107. 'valide' => $data['totalvalid'],
  108. 'rejete' => $data['totalrejet'],
  109. ]
  110. ]*/
  111. );
  112. }
  113. public function modulestock(): Response
  114. {
  115. return $this->render('stock/modulestock.html.twig'
  116. /*, [
  117. 'stats' => [
  118. 'total' => $data['nballda'],
  119. 'valide' => $data['totalvalid'],
  120. 'rejete' => $data['totalrejet'],
  121. ]
  122. ]*/
  123. );
  124. }
  125. public function alerteGenerale(): Response {
  126. $emailDest="rodjah0@gmail.com";
  127. $contenu="teste";
  128. $this->emailService->Envoi($emailDest,$contenu);
  129. return $this->redirect( $this->generateUrl('gestion_compte'));
  130. }
  131. }