add supresion source

master
Bastien OLLIER 3 years ago
parent 4c20650a4d
commit bb66d7af18

@ -84,9 +84,9 @@ class ControllerAdmin {
function supprimerSource() { function supprimerSource() {
global $dsn,$user,$pass,$vues; global $dsn,$user,$pass,$vues;
if(isset($_REQUEST["idSource"])) { if(isset($_REQUEST["source"])) {
$gate = new GatewaySources(new Connection($dsn, $user, $pass)); $gate = new GatewaySources(new Connection($dsn, $user, $pass));
$gate->deleteSources($_REQUEST["idSource"]); $gate->deleteSources($_REQUEST["source"]);
} }
header("location: index.php?action=goToAdministration"); header("location: index.php?action=goToAdministration");
} }

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

@ -8,8 +8,9 @@
</html> </html>
<?php <?php
foreach ($listeSources as $n){ if(!is_null($listeSources)) {
echo '<form action="index.php?action=supprimerSource&idSource='.$n->getlink().'">'; foreach ($listeSources as $n) {
echo '<form action="index.php?action=supprimerSource&source=' . $n->getlink() . '" method="POST">';
echo "<div class=source>"; echo "<div class=source>";
echo "<p id=link>"; echo "<p id=link>";
echo $n->getlink(); echo $n->getlink();
@ -17,6 +18,7 @@
echo '<input type="submit" value="x">'; echo '<input type="submit" value="x">';
echo "</div>"; echo "</div>";
echo "</form>"; echo "</form>";
}
} }
?> ?>

Loading…
Cancel
Save