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 moduleadmin(): Response
  86. {
  87. return $this->render('admin/moduleadmin.html.twig'
  88. /*, [
  89. 'stats' => [
  90. 'total' => $data['nballda'],
  91. 'valide' => $data['totalvalid'],
  92. 'rejete' => $data['totalrejet'],
  93. ]
  94. ]*/
  95. );
  96. }
  97. public function moduleflotte(): Response
  98. {
  99. return $this->render('fleet/moduleflotte.html.twig'
  100. /*, [
  101. 'stats' => [
  102. 'total' => $data['nballda'],
  103. 'valide' => $data['totalvalid'],
  104. 'rejete' => $data['totalrejet'],
  105. ]
  106. ]*/
  107. );
  108. }
  109. public function modulestock(): Response
  110. {
  111. return $this->render('stock/modulestock.html.twig'
  112. /*, [
  113. 'stats' => [
  114. 'total' => $data['nballda'],
  115. 'valide' => $data['totalvalid'],
  116. 'rejete' => $data['totalrejet'],
  117. ]
  118. ]*/
  119. );
  120. }
  121. public function alerteGenerale(): Response {
  122. $emailDest="rodjah0@gmail.com";
  123. $contenu="teste";
  124. $this->emailService->Envoi($emailDest,$contenu);
  125. return $this->redirect( $this->generateUrl('gestion_compte'));
  126. }
  127. }