fix bug css/media pas visibles sur pages

php
Anthony RICHARD 2 years ago
parent 837fd0bd7b
commit 84d23f0478

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before

Width:  |  Height:  |  Size: 882 KiB

After

Width:  |  Height:  |  Size: 882 KiB

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

@ -8,7 +8,11 @@ $rep = __DIR__ . '/../';
//$dConfig['includes']= array('controleur/Validation.php'); //$dConfig['includes']= array('controleur/Validation.php');
//BD //BD
global $dsn;
$dsn = 'mysql:host=localhost;dbname=dbanrichard7'; $dsn = 'mysql:host=localhost;dbname=dbanrichard7';
global $login;
$login = 'anrichard7'; $login = 'anrichard7';
$password = 'achanger';
global $password;
$password = 'achanger';

@ -13,8 +13,6 @@ class AdminController
global $twig; global $twig;
session_start(); session_start();
$dVueEreur = [];
try { try {
$action = $_REQUEST['action'] ?? null; $action = $_REQUEST['action'] ?? null;
@ -39,15 +37,19 @@ class AdminController
case 'removeUser': case 'removeUser':
$this->removeUser(); $this->removeUser();
break; break;
case 'showAllGroups': case 'showAllGroups':
$this->showAllGroups(); $this->showAllGroups();
break; break;
case 'showGroupDetails': case 'showGroupDetails':
$this->showGroupDetails(); $this->showGroupDetails();
break; break;
case 'removeUserFromGroup': case 'removeUserFromGroup':
$this->removeUserFromGroup(); $this->removeUserFromGroup();
break; break;
case 'removeGroup': case 'removeGroup':
$this->removeGroup(); $this->removeGroup();
break; break;

@ -2,7 +2,57 @@
namespace controller; namespace controller;
use mysql_xdevapi\Exception;
class FrontController class FrontController
{ {
private array $adminActions = array(
'showAllUsers',
'showAllAdmins',
'showAllTeachers',
'showAllStudents',
'removeUser',
'showAllGroups',
'showGroupDetails',
'removeUserFromGroup',
'removeGroup',
'addGroup',
'addUserToGroup'
);
private array $teacherActions = array(
);
private array $studentActions = array(
);
public function __construct()
{
global $twig;
session_start();
$dVueEreur = array();
try {
$action = $_REQUEST['action'] ?? null;
switch ($action) {
case null:
echo $twig->render('home.html');
break;
default :
if (in_array($this->adminActions,$action)) new AdminController();
else if (in_array($this->teacherActions, $action)) new TeacherController();
else if (in_array($this->studentActions, $action)) new StudentController();
else throw new Exception("invalid Action");
break;
}
}
catch (\PDOException $e) {
$dVueEreur[] = 'Erreur inattendue!!! ';
} catch (\Exception $e2) {
$dVueEreur[] = $e2->getMessage().'Erreur inattendue!!! ';
echo $twig->render('erreur.html', ['dVueEreur' => $dVueEreur]);
}
}
} }

@ -5,7 +5,7 @@ require_once __DIR__ . '/config/config.php';
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
use controller\AdminController; use controller\FrontController;
//twig //twig
$loader = new \Twig\Loader\FilesystemLoader('templates'); $loader = new \Twig\Loader\FilesystemLoader('templates');
@ -13,4 +13,4 @@ $twig = new \Twig\Environment($loader, [
'cache' => false, 'cache' => false,
]); ]);
$ctrl = new AdminController(); $ctrl = new FrontController();
Loading…
Cancel
Save