mirror of
https://forge.chapril.org/tykayn/caisse-bliss
synced 2025-06-20 01:44:42 +02:00
130 lines
3.8 KiB
PHP
130 lines
3.8 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
|
|
final class DefaultController extends AbstractController
|
|
{
|
|
#[Route('/', name: 'app_default')]
|
|
public function index(): Response
|
|
{
|
|
return $this->render('default/main-screen.html.twig', [
|
|
'controller_name' => 'DefaultController',
|
|
]);
|
|
}
|
|
#[Route('/accueil', name: 'app_home')]
|
|
public function accueil(): Response
|
|
{
|
|
return $this->render('default/main-screen.html.twig', [
|
|
'controller_name' => 'DefaultController',
|
|
]);
|
|
}
|
|
#[Route('/dashboard', name: 'dashboard')]
|
|
public function dashboard(): Response
|
|
{
|
|
return $this->render('logged/dashboard.html.twig', [
|
|
'controller_name' => 'DefaultController',
|
|
]);
|
|
}
|
|
|
|
|
|
#[Route('/export_all', name: 'export_all')]
|
|
public function export_all(): Response
|
|
{
|
|
return $this->render('logged/export_all.html.twig', [
|
|
'controller_name' => 'DefaultController',
|
|
]);
|
|
}
|
|
|
|
#[Route('/previsionnel', name: 'previsionnel')]
|
|
public function previsionnel(): Response
|
|
{
|
|
return $this->render('logged/previsionnel.html.twig', [
|
|
'controller_name' => 'DefaultController',
|
|
]);
|
|
}
|
|
|
|
// export_all_json
|
|
|
|
#[Route('/export_all_json', name: 'export_all_json')]
|
|
public function export_all_json(): Response
|
|
{
|
|
return $this->render('logged/export_all_json.html.twig', [
|
|
'controller_name' => 'DefaultController',
|
|
]);
|
|
}
|
|
|
|
#[Route('/history', name: 'history')]
|
|
public function history(): Response
|
|
{
|
|
return $this->render('logged/history.html.twig', [
|
|
'controller_name' => 'DefaultController',
|
|
'chiffreAffaires' => 10000,
|
|
'statisticsSoldProducts' => [
|
|
[
|
|
'name' => 'mock 1',
|
|
'count' => 10,
|
|
'value' => 10,
|
|
],[
|
|
'name' => 'mock 2',
|
|
'count' => 1,
|
|
'value' => 20,
|
|
],
|
|
],
|
|
'activeFestival' => [
|
|
'fondDeCaisseAvant' => 10,
|
|
'chiffreAffaire' => 10,
|
|
'clientsCount' => 10,
|
|
'name' => 'demo festival mock dans default controller',
|
|
],
|
|
'allSellings' => 12,
|
|
'recentSellings' => [],
|
|
'recentSells' => [
|
|
[
|
|
'id' => '1234',
|
|
'date' => date_create('now'),
|
|
'comment' => 'blah',
|
|
'amount' => 52,
|
|
'productsSold' => [
|
|
'name' => 'un truc de démo aussi làààà'
|
|
],
|
|
],
|
|
],
|
|
'activeSelling' => [],
|
|
// 'sellingComment' => [],
|
|
'statisticsFestivals' => 'todo',
|
|
'recentSells' => ''
|
|
]);
|
|
}
|
|
|
|
|
|
#[Route('/logged/get-my-products', name: 'get_my_products')]
|
|
public function get_my_products(): JsonResponse
|
|
{
|
|
// TODO: replace this with actual logic to get products of the logged user
|
|
// récupérer les produits de l'user connecté
|
|
|
|
// $products = $this->getUser()->getProducts();
|
|
return $this->json([
|
|
'products' => $this->getUser()->getProducts(),
|
|
]);
|
|
}
|
|
#[Route('/logged/import', name: 'import')]
|
|
public function import(): Response
|
|
{
|
|
// prendre en compte l'ajout de nouveaux produits si on a une valeur dans le POST
|
|
return $this->render('logged/import.html.twig', []);
|
|
}
|
|
#[Route('/logged/mass_create', name: 'mass_create')]
|
|
public function mass_create(): Response
|
|
{
|
|
// prendre en compte l'ajout de nouveaux produits si on a une valeur dans le POST
|
|
return $this->render('logged/import.html.twig', []);
|
|
}
|
|
|
|
|
|
}
|