ajout fermeture de la database
This commit is contained in:
@@ -46,8 +46,9 @@ function mb_ucfirst($str)
|
||||
|
||||
function choixVotation($path, $methode = 2, $confirm = true) //2 = toutes les votations 1 = votations en cours 0 = votations cloturées
|
||||
{
|
||||
global $db, $base_url, $action;
|
||||
global $base_url, $action;
|
||||
|
||||
$db = new db();
|
||||
$query = "SELECT * FROM liste_votations";
|
||||
if ($methode != 2)
|
||||
{
|
||||
@@ -82,6 +83,7 @@ function choixVotation($path, $methode = 2, $confirm = true) //2 = toutes les v
|
||||
<input type="submit" value="Envoyer"/>
|
||||
</div>
|
||||
</form>';
|
||||
$db->close;
|
||||
}
|
||||
|
||||
function votationForm($path, $titre="", $libelle="", $dateDebut="", $DateFin="", $status=0)
|
||||
@@ -133,6 +135,7 @@ function votesForm($path, $libelle = "", $method = 0)
|
||||
print('<input type="submit" formaction="index.php" value="' . _("Annuler") . '"/>') . EOL;
|
||||
print('<input type="submit" value="' . _("Envoyer") . '"/>') . EOL;
|
||||
print('</form>') . EOL;
|
||||
$db->close();
|
||||
}
|
||||
|
||||
function envoiMail($destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
|
||||
@@ -219,10 +222,11 @@ function listeAdherents()
|
||||
|
||||
function listeVotants($idVotation, $idVote, $listeAdherents)
|
||||
{
|
||||
global $db;
|
||||
$nv = 0;
|
||||
$text = '';
|
||||
|
||||
$db->open();
|
||||
|
||||
$query = "SELECT DISTINCT idVotant FROM votes WHERE idVotation=" . $idVotation . ' AND idVote=' . $idVote;
|
||||
$result = $db->query($query);
|
||||
|
||||
@@ -233,6 +237,7 @@ function listeVotants($idVotation, $idVote, $listeAdherents)
|
||||
}
|
||||
print('Nombre de votants : ' . $nv . EOLH . '<div id="listeVotants' . $idVote . '" style="display: none; line-height: 0.8;">' . $text . '</div>');
|
||||
print('<button id="button' . $idVote . '" onclick="show(\'listeVotants\',\'' . $idVote . '\')">Voir la liste des votants</button>' . EOLH);
|
||||
$db->close();
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user