added comment for candidats
This commit is contained in:
parent
6fdeb9d502
commit
ae357e7e95
@ -10,10 +10,11 @@ $db = new db();
|
||||
$idVotation = getpost("idVotation");
|
||||
$idVote = getpost("idVote");
|
||||
$candidat = getpost("candidat");
|
||||
$libelle = getpost("libelle");
|
||||
|
||||
if (!empty($idCandidat))
|
||||
{
|
||||
$query = "INSERT INTO liste_candidats VALUES (0, " . $idVotation . ", " . $idVote . ",'" . $candidat . "')";
|
||||
$query = "INSERT INTO liste_candidats VALUES (0, " . $idVotation . ", " . $idVote . ",'" . $libelle . "', '". $candidat . "')";
|
||||
$db->query($query);
|
||||
header("Location: " . $$base_url . "/" . $path , TRUE, 301);
|
||||
return;
|
||||
@ -38,12 +39,19 @@ if (!empty($idCandidat))
|
||||
$votationName = $db->queryVotationName($idVotation);
|
||||
$voteName = $db->queryVoteName($idVote);
|
||||
$candidatsList = $db->queryCandidatsList($idVotation, $idVote);
|
||||
print('<h3>Nouveau candidat pour le vote ' . $voteName . ' de la votation ' . $votationName . '</h3>');
|
||||
|
||||
print('<h3>Nouveau candidat pour le vote "' . $voteName . '" de la votation "' . $votationName . '"</h3>');
|
||||
if (empty($candidatsList))
|
||||
{
|
||||
print("Aucun candidats saisi pour l'instant" . EOLH);
|
||||
}else
|
||||
{
|
||||
print('Liste des candidats');
|
||||
foreach($candidatsList as $line)
|
||||
{
|
||||
print($line["libelle"] . EOLH);
|
||||
}
|
||||
}
|
||||
candidatsForm($path, $idVotation, $idVote);
|
||||
}
|
||||
print(' </div>
|
||||
|
@ -161,6 +161,8 @@ function candidatsForm($path, $idVotation, $idVote)
|
||||
print('<input type="hidden" name="idVotation" value="' . $idVotation . '">');
|
||||
print('<input type="hidden" name="idVote" value="' . $idVote . '">');
|
||||
print('<label for="candidat">' . _("Candidat") .'</label><br><input type="text" id="candidat" name="candidat" value=""/>') . EOLH;
|
||||
print('<label for="libelle">' . _("Libellé") .'</label><br><input type="text" id="libelle" name="libelle" value=""/>') . EOLH;
|
||||
|
||||
print('<input type="submit" formaction="index.php" value="' . _("Annuler") . '"/>') . EOLH;
|
||||
print('<input type="submit" value="' . _("Envoyer") . '"/>') . EOLH;
|
||||
}
|
||||
|
Reference in New Issue
Block a user