src/Controller/IntranetController.php line 47

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\CommandeAchat;
  13. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  14. use Symfony\Component\HttpFoundation\Response;
  15. use Symfony\Component\Routing\Annotation\Route;
  16. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  17. use Symfony\Component\HttpFoundation\Request;
  18. use Symfony\Component\HttpFoundation\RedirectResponse;
  19. use App\Service\DemandeAchatService;
  20. use App\Service\EmailService;
  21. use App\Service\ContratCadreService;
  22. use Doctrine\ORM\EntityManagerInterface;
  23. class IntranetController extends AbstractController
  24. {
  25. private EntityManagerInterface $em;
  26. private DemandeAchatService $demandeAchatService;
  27. private EmailService $emailService;
  28. private ContratCadreService $contratCadreService;
  29. public function __construct(
  30. EntityManagerInterface $em,
  31. DemandeAchatService $demandeAchatService,
  32. EmailService $emailService,
  33. ContratCadreService $contratCadreService
  34. ) {
  35. $this->em = $em;
  36. $this->demandeAchatService = $demandeAchatService;
  37. $this->emailService = $emailService;
  38. $this->contratCadreService = $contratCadreService;
  39. }
  40. #[Route('/', name: 'mstope_intranet_index')]
  41. public function index(): Response
  42. {
  43. $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
  44. return $this->render('intranet/index.html.twig');
  45. }
  46. public function moduleachat(): Response
  47. {
  48. $data = $this->demandeAchatService ->getValidationData(); // ton return actuel
  49. return $this->render('DemandeAchatVue/moduleachat.html.twig', [
  50. 'stats' => [
  51. 'total' => $data['nballda'],
  52. 'valide' => $data['totalvalid'],
  53. 'rejete' => $data['totalrejet'],
  54. ]
  55. ]);
  56. }
  57. public function moduleimmo(): Response
  58. {
  59. $data = $this->demandeAchatService ->getValidationData(); // ton return actuel
  60. return $this->render('asset/moduleimmo.html.twig'
  61. /*, [
  62. 'stats' => [
  63. 'total' => $data['nballda'],
  64. 'valide' => $data['totalvalid'],
  65. 'rejete' => $data['totalrejet'],
  66. ]
  67. ]*/
  68. );
  69. }
  70. public function moduleadmin(): Response
  71. {
  72. return $this->render('admin/moduleadmin.html.twig'
  73. /*, [
  74. 'stats' => [
  75. 'total' => $data['nballda'],
  76. 'valide' => $data['totalvalid'],
  77. 'rejete' => $data['totalrejet'],
  78. ]
  79. ]*/
  80. );
  81. }
  82. public function moduleflotte(): Response
  83. {
  84. return $this->render('fleet/moduleflotte.html.twig'
  85. /*, [
  86. 'stats' => [
  87. 'total' => $data['nballda'],
  88. 'valide' => $data['totalvalid'],
  89. 'rejete' => $data['totalrejet'],
  90. ]
  91. ]*/
  92. );
  93. }
  94. public function alerteGenerale(): Response {
  95. $catas = $this->em->getRepository(Catalogue::class)->findByTypeArticle("ASSET");
  96. $familleJ = $this->em->getRepository(FammileJ::class)->findAll();
  97. $categoryJ = $this->em->getRepository(CategoryJ::class)->findAll();
  98. foreach($catas as $cata){
  99. }
  100. $this->em->flush();
  101. return $this->redirect( $this->generateUrl('gestion_compte'));
  102. }
  103. }