-
Notifications
You must be signed in to change notification settings - Fork 0
/
labeerbook_ajax.php
41 lines (27 loc) · 838 Bytes
/
labeerbook_ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
error_reporting(E_ALL);
ini_set("display_errors", true);
// Avant tout, on inclut la configuration de certaines constantes
include_once("config.php");
//nom de l'application
$nameApp = "labeerbook";
// Inclusion des classes et librairies
require_once 'lib/core.php';
require_once $nameApp.'/controller/mainController.php';
//action par défaut
$action = "login";
if(key_exists("action", $_REQUEST))
$action = $_REQUEST['action'];
session_start();
$context = context::getInstance();
$context->init($nameApp);
$response = $context->executeAction($action, $_REQUEST);
// Inclusion de la vue par rapport a la reponse de l'action du controleur
if ($response === context::SUCCESS || $response === context::ERROR) {
$view = $nameApp."/view/".$action.$response.".php";
include($view);
}
else {
echo $response;
}
?>