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.
66 lines
1.3 KiB
66 lines
1.3 KiB
<?php
|
|
|
|
|
|
class Controlleur
|
|
{
|
|
public function __construct() {
|
|
global $rep,$vues;
|
|
|
|
try{
|
|
$action=$_REQUEST['action'];
|
|
switch($action){
|
|
case NULL:
|
|
$this->homePage();
|
|
break;
|
|
case "VoirScore":
|
|
$this->afficherScore();
|
|
break;
|
|
default:
|
|
$dVueEreur[] = "Erreur d'appel php";
|
|
require ($rep.$vues['error']);
|
|
break;
|
|
}
|
|
|
|
} catch (PDOException $e)
|
|
{
|
|
echo $e->getMessage();
|
|
$dVueEreur[] = "Erreur inattendue PDO!!! ";
|
|
require ($rep.$vues['error']);
|
|
|
|
}
|
|
catch (Exception $e2)
|
|
{
|
|
$dVueEreur[] = "Erreur inattendue!!! ";
|
|
require ($rep.$vues['error']);
|
|
}
|
|
}
|
|
|
|
public function homePage(){
|
|
global $vues, $rep;
|
|
|
|
require($rep . $vues['homePage']);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function afficherScore()
|
|
{
|
|
global $vues, $rep;
|
|
try {
|
|
$listPlayer = new ModelScore();
|
|
$listP = $listPlayer->getHScore();
|
|
|
|
} catch (Exception $e)
|
|
{
|
|
$listP = array("error" => $e->getMessage());
|
|
}
|
|
|
|
require($rep . $vues['score']);
|
|
}
|
|
|
|
|
|
|
|
} |