1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__serveur-vote-lalis/gestionsite/saisieVotation.php

45 lines
1.0 KiB
PHP

<?php
session_start();
require_once '../session_init.php';
require_once 'config.inc.php';
require_once 'db.class.php';
require_once 'entete.php';
require_once 'fonctions.inc.php';
$path = $_SERVER["PHP_SELF"];
print('<br><br>
<!-- lalis Grid Section -->
<section id="content">
<div class="container">');
print(' <div class="row">
<div class="col-lg-12 text-center">
<h3>Nouvelle votation</h3>
<h4>');
$titre = getpost("titre");
$libelle = getpost("libelle");
$dateDebut = getpost("dateDebut");
$dateFin = getpost("dateFin");
if ($titre !== null and $libelle!== null and $dateDebut!== null and $dateFin !== null)
{
$db = new db();
$query = "INSERT INTO liste_votations VALUES(0, '" . $titre . "', '" . $libelle . "', '0', '" . $dateDebut . "', '" . $dateFin . "')"; // clotûre
$db->query($query);
$db->close();
// TODO retour à l'index
}else
{
votationForm($path, $titre, $libelle, $dateDebut, $dateFin);
}
print(' </div>
</div>
</form>
</div>
</section>');
require_once("footer.html");
?>