modif gestion flux

feature/gestionFlux
maxime.point2 1 year ago
parent 4c2424ef31
commit e465122afa

@ -2,11 +2,15 @@
namespace controleur;
use DAL\ArticleGateway;
use DAL\Connection;
use DAL\FluxGateway;
use http\Exception;
use metier\Flux;
use model\AdminModel;
use model\ArticleModel;
use model\FluxModel;
use model\Parser;
class AdminControleur
{
@ -122,8 +126,10 @@ class AdminControleur
public function deleteFlux(){
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['flux'])){
$articleModel = new ArticleModel();
$fluxModel = new FluxModel();
$fluxModel->removeFluxBySrc($_POST['flux']);
$articleModel->removeAticleIdFlux(intval($_POST['flux']));
$fluxModel->removeFluxById(intval($_POST['flux']));
$_REQUEST['action'] = 'listFlux';
$this->init();
}
@ -135,8 +141,13 @@ class AdminControleur
public function ajoutFlux(){
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['fluxAdd'])){
$con = new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto','rorossetto','tpphp');
$gwArticle = new ArticleGateway($con);
$gwFlux = new FluxGateway($con);
$parser = new Parser($gwFlux,$gwArticle);
$fluxModel = new FluxModel();
$fluxModel->addFluxBySrc($_POST['fluxAdd']);
$parser->addAllArticles();
$_REQUEST['action'] = 'listFlux';
unset($_POST['fluxAdd']);
$this->init();

Loading…
Cancel
Save