<?php
namespace App\Controller;
use App\Entity\FamilleJ;
use App\Entity\CategoryJ;
use App\Entity\RapportageDA;
use App\Entity\ContratCadre;
use App\Entity\CategoryCatalogue;
use App\Entity\DemAchatTemp;
use App\Entity\demAchat;
use App\Entity\CatalogueAsset;
use App\Entity\Catalogue;
use App\Entity\CommandeAchat;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use App\Service\DemandeAchatService;
use App\Service\EmailService;
use App\Service\ContratCadreService;
use Doctrine\ORM\EntityManagerInterface;
class IntranetController extends AbstractController
{
private EntityManagerInterface $em;
private DemandeAchatService $demandeAchatService;
private EmailService $emailService;
private ContratCadreService $contratCadreService;
public function __construct(
EntityManagerInterface $em,
DemandeAchatService $demandeAchatService,
EmailService $emailService,
ContratCadreService $contratCadreService
) {
$this->em = $em;
$this->demandeAchatService = $demandeAchatService;
$this->emailService = $emailService;
$this->contratCadreService = $contratCadreService;
}
#[Route('/', name: 'mstope_intranet_index')]
public function index(): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
return $this->render('intranet/index.html.twig');
}
public function moduleachat(): Response
{
$data = $this->demandeAchatService ->getValidationData(); // ton return actuel
return $this->render('DemandeAchatVue/moduleachat.html.twig', [
'stats' => [
'total' => $data['nballda'],
'valide' => $data['totalvalid'],
'rejete' => $data['totalrejet'],
]
]);
}
public function moduleimmo(): Response
{
$data = $this->demandeAchatService ->getValidationData(); // ton return actuel
return $this->render('asset/moduleimmo.html.twig'
/*, [
'stats' => [
'total' => $data['nballda'],
'valide' => $data['totalvalid'],
'rejete' => $data['totalrejet'],
]
]*/
);
}
public function moduleadmin(): Response
{
return $this->render('admin/moduleadmin.html.twig'
/*, [
'stats' => [
'total' => $data['nballda'],
'valide' => $data['totalvalid'],
'rejete' => $data['totalrejet'],
]
]*/
);
}
public function moduleflotte(): Response
{
return $this->render('fleet/moduleflotte.html.twig'
/*, [
'stats' => [
'total' => $data['nballda'],
'valide' => $data['totalvalid'],
'rejete' => $data['totalrejet'],
]
]*/
);
}
public function alerteGenerale(): Response {
$catas = $this->em->getRepository(Catalogue::class)->findByTypeArticle("ASSET");
$familleJ = $this->em->getRepository(FammileJ::class)->findAll();
$categoryJ = $this->em->getRepository(CategoryJ::class)->findAll();
foreach($catas as $cata){
}
$this->em->flush();
return $this->redirect( $this->generateUrl('gestion_compte'));
}
}