You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

<?php
class Controleur {
function __construct() {
global $rep,$vues;
session_start();
$dVueEreur = array ();
try{
$action=$_REQUEST['action'];
echo $action;
switch($action) {
case NULL:
//require ($rep.$vues['vueLogin']);
$this->afficherQuestions();
break;
case 'login' :
$this->verificationConnexion();
break;
default:
$dVueEreur[] ="Erreur d'appel php";
require ($rep.$vues['erreur']);
break;
}
} catch (PDOException $e)
{
$dVueEreur[] = "Erreur inattendue!!! ";
//require ($rep.$vues['erreur']);
}
//$this->afficherQuestions();
}
function afficherQuestions(){
global $rep,$vues;
$model = new Modele();
$dVueQuestions = $model->afficherQuestions();
require ($rep.$vues['vuePrincipale']);
}
function verificationConnexion(){
global $rep,$vues;
$id = $_POST['identifiant'];
$mdp = $_POST['motdepasse'];
$modele = new Modele();
if($modele->connection($id,$mdp)==null){
require($rep.$vues['vueLogin']);
}
else $this->afficherQuestions();
}
}