validationConnexion(); break; case "ajoutSource": $this->ajoutSource($_REQUEST["linkSource"]); break; case "supprimerSource": $this->supprimerSource($_REQUEST["idSource"]); break; case "setNbArticlesParPage": $this->setNbArticlesParPage($_REQUEST["nbSourceParPage"]); break; default: $gateway = new GatewayNews(new Connection($dsn,$user,$pass)); $listeNews = $gateway->getNews(); //echo $vues['listeNews']; require($vues['listeNews']); break; } } catch (PDOException $e) { // $dataVueEreur[] = "Erreur inattendue!!! "; // require(__DIR__.'/../vues/erreur.php'); } catch (Exception $e2) { // $dataVueEreur[] = "Erreur inattendue!!! "; // require ($rep.$vues['erreur']); } } function ajoutSource($linkSource) { global $con; $mdl = new GatewaySources($con); $source = new Sources($linkSource); $mdl->addSources($source); //require('menuAdmin.php'); } function validationConnexion() { global $vues; $validation = new Validation(); $error =[]; $validation->val_form($_POST['name'],$_POST['password'],$error); Foreach ($error as $key) { print($key); } if (empty($error)) { $MdlAdmin = new MdlAdmin(); $validation = $MdlAdmin->connection($_POST['name'],$_POST['password']); if (!empty($validation)) { echo "toto"; header("location:".$vues['listeNews']); } } } function supprimerSource($idSource) { global $con; $mdl = new GatewaySources($con); $mdl->deleteSources($idSource); //require('menuAdmin.php'); } function setNbArticlesParPage(){ //require('menuAdmin.php'); } } ?>