<?php /** * Created by PhpStorm. * User: 1253250 * Date: 30/10/2015 * Time: 10:07 */ include "BD.php"; ShowSondages();
function ModifSondage($Mdp, $Debut, $Fin, $Active) { if ($Debut < $Fin) { try { $pdo = new PDO('sqlite:bd.sqlite3'); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } $Update = "Update Sondage SET SondageActive = :SondageActive, SondageDateDebut = :SondageDateDebut, SondageDateFin = :SondageDateFin WHERE SondageMdp = :SondageMdp"; $req = $pdo->prepare($Update); $req->bindValue(':SondageActive', $Active); $req->bindValue(':SondageDateDebut', $Debut); $req->bindValue(':SondageDateFin', $Fin); $req->bindValue(':SondageMdp', $Mdp); $req->execute(); } else { echo "<script> alert('date de debut apres la date de fin') </script>"; } ShowSondages(); }