diff --git a/config.php b/config.php new file mode 100644 index 0000000..e26eeb9 --- /dev/null +++ b/config.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/gatewaySources.php b/gatewaySources.php index 13a5dbc..34fa007 100644 --- a/gatewaySources.php +++ b/gatewaySources.php @@ -15,6 +15,14 @@ class GatewaySources ) ); } + + public function deleteSources($idSource) + { + $query = "delete from sources where :idsource;"; + $this->con->executeQuery($query, array(':idsource' => array($idSource, PDO::PARAM_INT) + ) + ); + } } ?> diff --git a/index.php b/index.php index 4e24167..3238dab 100644 --- a/index.php +++ b/index.php @@ -7,6 +7,8 @@ //require_once("gatewaySources.php"); require_once("ControllerAdmin.php"); + //chargement config + require_once("config.php"); //$user= 'jeducourth'; //$pass='achanger'; @@ -19,7 +21,7 @@ */ $controller = new ControllerAdmin(); - /*try{ + try{ $con = new Connection($dsn,$user,$pass); $gateNews = new GatewayNews($con); $gateNews->addNews(new News($title,$description,$pubdate,$link)); @@ -30,6 +32,8 @@ $sources->addSources(new sources($link)); + + require("listeNews.php"); @@ -37,7 +41,7 @@ catch( PDOException $Exception ) { echo 'erreur'; echo $Exception->getMessage(); - }*/ + } ?>