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");
<?php
require_once("connection.php");
require_once("ControllerAdmin.php");
//chargement config
require_once("config.php");
require_once("ControllerAdmin.php");
//chargement config
require_once("config.php");
$controller = new ControllerAdmin();
//$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>
?>

@ -4,14 +4,14 @@ class sources
private string $link;
public function __construct(string $link)
{
$this->link = $link;
}
{
$this->link = $link;
}
public function getlink()
{
return $this->link;
}
public function getlink()
{
return $this->link;
}
}

Loading…
Cancel
Save