controlller admin

master
Bastien OLLIER 3 years ago
parent 82526a93f4
commit 1a587f62e5

@ -1,48 +1,9 @@
<html>
<body>
<?php
require_once("connection.php");
require_once("gatewayNews.php");
require_once("gatewayAdmins.php");
//require_once("gatewaySources.php");
require_once("ControllerAdmin.php");
//chargement config
require_once("config.php");
//$user= 'jeducourth';
//$pass='achanger';
//$dsn='mysql:host=localhost;dbname=dbjeducourth';
/*$title="titre";
$description="descirption du titre";
$pubdate="2022-04-12 8:8:8";
$link="exemple.com";
*/
$controller = new ControllerAdmin();
try{
$con = new Connection($dsn,$user,$pass);
$gateNews = new GatewayNews($con);
$gateNews->addNews(new News($title,$description,$pubdate,$link));
$gateAdmin = new gatewayAdmin($con);
$sources = new GatewaySources($con);
$gateAdmin->addAdmin(new admin("toto","tata"));
$sources->addSources(new sources($link));
require("listeNews.php");
}
catch( PDOException $Exception ) {
echo 'erreur';
echo $Exception->getMessage();
}
?>
</body>
</html>

Loading…
Cancel
Save