validationConnexion(); break; case "ajoutSource": $this->ajoutSource($_REQUEST["linkSource"]); break; case "supprimerSource": $this->supprimerSource($_REQUEST["idSource"]); break; case "setNbArticlesParPage": $this->setNbArticlesParPage($_REQUEST["nbSourceParPage"]); break; default: $gatewayNews = new GatewayNews(new Connection($dsn,$user,$pass)); $page = 1; if(isset($_GET['page'])){ $page = $_GET['page']; } $listeNews = $gatewayNews->getNews($page,10); $pageAvant = $page - 1; $pageApres = $page + 1; $pageMAX = $gatewayNews->getNbNews()/10 + 1; 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'); } } ?>