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

44 lines
1.0 KiB
PHP
Raw Normal View History

2022-09-15 11:44:34 +02:00
<?php
2022-09-15 12:42:52 +02:00
require_once '../session_init.php';
2022-09-15 11:44:34 +02:00
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">
2022-09-15 12:35:54 +02:00
<div class="container">');
2022-09-15 11:44:34 +02:00
print(' <div class="row">
<div class="col-lg-12 text-center">
<h3>Nouvelle votation</h3>
<h4>');
2022-09-15 18:34:18 +02:00
$titre = getpost("titre");
$libelle = getpost("libelle");
$dateDebut = getpost("dateDebut");
$dateFin = getpost("dateFin");
if ($titre !== null and $libelle!== null and $dateDebut!== null and $dateFin !== null)
2022-09-15 11:44:34 +02:00
{
2022-09-15 18:34:18 +02:00
$db = new db();
$query = "INSERT INTO liste_votations ('titre', 'libelle', 'status', 'dateDebut', 'dateFin') VALUES('" . $titre . "', '" . $libelle . "', '0', '" . $dateDebut . "', '" . $dateFin . "')"; // clotûre
$db->query($query);
2022-09-19 11:11:15 +02:00
$db->close();
2022-09-15 12:42:52 +02:00
}else
{
2022-09-15 18:34:18 +02:00
votationForm($path, $titre, $libelle, $dateDebut, $dateFin);
2022-09-15 11:44:34 +02:00
}
2022-09-15 12:42:52 +02:00
2022-09-15 11:44:34 +02:00
print(' </div>
</div>
</form>
</div>
</section>');
require_once("footer.html");
?>