Jeremy DUCOURTHIAL 3 years ago
commit 28316a6711

@ -15,7 +15,6 @@ class ControllerAdmin {
switch($action) { switch($action) {
case "goToAdminConnexion": case "goToAdminConnexion":
require($vues['adminConnexion']); require($vues['adminConnexion']);
header("location:".$vues['adminConnexion']);
break; break;
case "goToAdministration": case "goToAdministration":
$gatewaySources = new GatewaySources(new Connection($dsn,$user,$pass)); $gatewaySources = new GatewaySources(new Connection($dsn,$user,$pass));
@ -89,7 +88,7 @@ class ControllerAdmin {
$gate = new GatewaySources(new Connection($dsn, $user, $pass)); $gate = new GatewaySources(new Connection($dsn, $user, $pass));
$gate->deleteSources($_REQUEST["idSource"]); $gate->deleteSources($_REQUEST["idSource"]);
} }
header("location: ".$vues['administration']); header("location: index.php?action=goToAdministration");
} }
function setNbArticlesParPage(){ function setNbArticlesParPage(){

@ -17,7 +17,7 @@ class GatewaySources
public function deleteSources($idSource) public function deleteSources($idSource)
{ {
$query = "delete from sources where idsource = :idsource;"; $query = "delete from sources where link = :idsource;";
$this->con->executeQuery($query, array(':idsource' => array($idSource, PDO::PARAM_INT) $this->con->executeQuery($query, array(':idsource' => array($idSource, PDO::PARAM_INT)
) )
); );

@ -1,31 +1,26 @@
<!doctype html> <!doctype html>
<link href="css/administration.css" rel="stylesheet" type="text/css"> <link href="css/administration.css" rel="stylesheet" type="text/css">
<html> <html>
<div id="pageRight"> <form action="index.php?action=ajoutSource" method="POST">
<div id="listSources"> <input type="text" name="linkSource" placeholder="source" />
<div> <input type="submit" value="add source">
<?php </form>
foreach ($listeSources as $n){ </html>
echo "<div class=source>";
echo "<p id=link>"; <?php
echo $n->getlink(); foreach ($listeSources as $n){
echo "</p>"; echo '<form action="index.php?action=supprimerSource&idSource='.$n->getlink().'">';
echo "</div>"; echo "<div class=source>";
} echo "<p id=link>";
?> echo $n->getlink();
</div> echo "</p>";
<div id="listSourceBottom"> echo '<input type="submit" value="x">';
<form action="../index.php?action=ajoutSource" method="POST"> echo "</div>";
<input type="text" name="linkSource" placeholder="source" /> echo "</form>";
<input type="submit" value="add source"> }
</form> ?>
</div>
</div> <form action="index.php">
<div id="refresh"> <input type="hidden" name="action" value="refreshData">
<form action="index.php"> <input type="submit" value="refresh">
<input type="hidden" name="action" value="refreshData"> </form>
<input type="submit" id="buttonRefresh" value="refresh">
</form>
</div>
</div>
</html>
Loading…
Cancel
Save