version 0.1
This commit is contained in:
parent
df07673a67
commit
7ae8c343ab
@ -5,14 +5,14 @@ define( 'EOLH', "<br>\n" );
|
|||||||
define( 'LF', "\r\n" );
|
define( 'LF', "\r\n" );
|
||||||
define( 'TAB', "\t" );
|
define( 'TAB', "\t" );
|
||||||
|
|
||||||
//constantes des niveaux de log
|
//Log Level constants
|
||||||
define( "INFO", 1 );
|
define( "INFO", 1 );
|
||||||
define( "ALERT", 2 );
|
define( "ALERT", 2 );
|
||||||
define( "ERROR", 3 );
|
define( "ERROR", 3 );
|
||||||
|
|
||||||
define( "DATE_MYSQL", "Y-m-d H:i:s" );
|
define( "DATE_MYSQL", "Y-m-d H:i:s" );
|
||||||
|
|
||||||
//variables diverses
|
//environment variables
|
||||||
$admin = "Daniel";
|
$admin = "Daniel";
|
||||||
$webmaster = "contact@lalis.fr";
|
$webmaster = "contact@lalis.fr";
|
||||||
$site = "Lalis";
|
$site = "Lalis";
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
//test if not directly called
|
||||||
if ( !isset($site) )
|
if ( !isset($site) )
|
||||||
{
|
{
|
||||||
require_once( "config.inc.php" );
|
require_once( "config.inc.php" );
|
||||||
@ -10,7 +11,7 @@ require_once "log.php";
|
|||||||
|
|
||||||
class dbDolibarr extends dbcore
|
class dbDolibarr extends dbcore
|
||||||
{
|
{
|
||||||
protected $server = "192.168.1.251";
|
protected $server = "192.168.1.250";
|
||||||
protected $port = 3306;
|
protected $port = 3306;
|
||||||
protected $user = "dolibarr";
|
protected $user = "dolibarr";
|
||||||
protected $passwd = "mysql_dolibarr";
|
protected $passwd = "mysql_dolibarr";
|
||||||
@ -31,6 +32,7 @@ class dbcore
|
|||||||
public $connect;
|
public $connect;
|
||||||
public $result;
|
public $result;
|
||||||
public $id;
|
public $id;
|
||||||
|
public $error;
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
@ -65,14 +67,12 @@ class dbcore
|
|||||||
|
|
||||||
function query( $string )
|
function query( $string )
|
||||||
{
|
{
|
||||||
|
$this->error = 0;
|
||||||
//log_write( $string );
|
|
||||||
if ( empty( $this->connect ) ) $this->open();
|
if ( empty( $this->connect ) ) $this->open();
|
||||||
|
|
||||||
$this->result = $this->connect->query( $string ) ;
|
$this->result = $this->connect->query( $string ) ;
|
||||||
$error = $this->connect->error;
|
$this->error = $this->connect->error;
|
||||||
if ( $this->connect->errno > 0 ) log_error( "Échec de la commande query => " . $error . "<br />" . __file__ . ' ligne ' . __line__ . "\n" . $string, true, false);
|
if ( $this->connect->errno > 0 ) log_error( "Échec de la commande query => " . $this->error . "<br />" . __file__ . ' ligne ' . __line__ . "\n" . $string, true, false);
|
||||||
return $error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +80,6 @@ class dbcore
|
|||||||
{
|
{
|
||||||
$flag = 0;
|
$flag = 0;
|
||||||
$query='SELECT IF(identifiant="' . $idVotant . '" AND idVotation="' . $idVotation .'" AND INSTR(idVote, "' . $idVote .'"),TRUE,FALSE) as r FROM liste_votants';
|
$query='SELECT IF(identifiant="' . $idVotant . '" AND idVotation="' . $idVotation .'" AND INSTR(idVote, "' . $idVote .'"),TRUE,FALSE) as r FROM liste_votants';
|
||||||
//$query='SELECT EXISTS (SELECT * FROM liste_votants WHERE (SELECT INSTR(idVote, "' . $idVote .'"))';
|
|
||||||
$this->query($query);
|
$this->query($query);
|
||||||
if ( ($r = $this->result->fetch_array(MYSQLI_ASSOC)))
|
if ( ($r = $this->result->fetch_array(MYSQLI_ASSOC)))
|
||||||
{
|
{
|
||||||
@ -103,7 +102,7 @@ class dbcore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 255;
|
return 'Error ';
|
||||||
}
|
}
|
||||||
|
|
||||||
function resultat()
|
function resultat()
|
||||||
|
@ -10,9 +10,11 @@ require_once 'fonctions.inc.php';
|
|||||||
// $level => INFO, ALERT, ERROR
|
// $level => INFO, ALERT, ERROR
|
||||||
function log_write($log, $level=INFO)
|
function log_write($log, $level=INFO)
|
||||||
{
|
{
|
||||||
//require_once( "envoi_courriel.inc.php" );
|
|
||||||
global $table_prefix, $webmaster, $db;
|
global $table_prefix, $webmaster, $db;
|
||||||
$user = ( !empty( $_SERVER["PHP_AUTH_USER"])?$_SERVER["PHP_AUTH_USER"]:'' );
|
// actual connected user or user 'script'
|
||||||
|
$user = (!empty( $_SERVER["PHP_AUTH_USER"])?$_SERVER["PHP_AUTH_USER"]:'Intruder?!');
|
||||||
|
|
||||||
|
//mail message
|
||||||
$log_mail = str_replace ( "<br />", "\n", $log ) . "\n";
|
$log_mail = str_replace ( "<br />", "\n", $log ) . "\n";
|
||||||
$log_mail .= ( !empty( $_SERVER["REQUEST_METHOD"])?'$_SERVER["REQUEST_METHOD"]' . $_SERVER["REQUEST_METHOD"] . "\n":'' );
|
$log_mail .= ( !empty( $_SERVER["REQUEST_METHOD"])?'$_SERVER["REQUEST_METHOD"]' . $_SERVER["REQUEST_METHOD"] . "\n":'' );
|
||||||
$log_mail .= ( !empty( $_SERVER["QUERY_STRING"])?'$_SERVER["QUERY_STRING"]' . $_SERVER["QUERY_STRING"] . "\n":'' );
|
$log_mail .= ( !empty( $_SERVER["QUERY_STRING"])?'$_SERVER["QUERY_STRING"]' . $_SERVER["QUERY_STRING"] . "\n":'' );
|
||||||
@ -25,24 +27,26 @@ function log_write($log, $level=INFO)
|
|||||||
$log_mail .= "Utilisateur: $user \n";
|
$log_mail .= "Utilisateur: $user \n";
|
||||||
$log_mail .= ( !empty( $_SERVER["ORIG_PATH_INFO"])?'$_SERVER["ORIG_PATH_INFO"]' . $_SERVER["ORIG_PATH_INFO"] . "\n":'' );
|
$log_mail .= ( !empty( $_SERVER["ORIG_PATH_INFO"])?'$_SERVER["ORIG_PATH_INFO"]' . $_SERVER["ORIG_PATH_INFO"] . "\n":'' );
|
||||||
$log_mail .= ( !empty( $_SERVER["PATH_INFO"])?'$_SERVER["PATH_INFO"]' . $_SERVER["PATH_INFO"] . "\n":'' );
|
$log_mail .= ( !empty( $_SERVER["PATH_INFO"])?'$_SERVER["PATH_INFO"]' . $_SERVER["PATH_INFO"] . "\n":'' );
|
||||||
//$db = new db();
|
|
||||||
//$db->open();
|
// verifying connection to database
|
||||||
if( !empty( $db->connect ) )
|
if( !empty( $db->connect ) )
|
||||||
{
|
{
|
||||||
|
// saving log into database
|
||||||
$query = 'INSERT INTO ' . $db->protect($table_prefix) . 'logs SET date=NOW(), auteur="' . $db->protect( $user ) . '", log="' . $db->protect($log) . '", niveau="' . $db->protect($level) . '"';
|
$query = 'INSERT INTO ' . $db->protect($table_prefix) . 'logs SET date=NOW(), auteur="' . $db->protect( $user ) . '", log="' . $db->protect($log) . '", niveau="' . $db->protect($level) . '"';
|
||||||
$db->query( $query );
|
$db->query( $query );
|
||||||
if ( !$db->result )
|
if ( !$db->result )
|
||||||
{
|
{
|
||||||
|
// send mail in case of query error
|
||||||
$text = $db->error() . "\n\n" . $log_mail;
|
$text = $db->error() . "\n\n" . $log_mail;
|
||||||
mail( $webmaster, "Erreur écriture logs => " . __file__ . " ligne " . __line__, $text );
|
mail( $webmaster, "Erreur écriture logs => " . __file__ . " ligne " . __line__, $text );
|
||||||
}
|
}
|
||||||
|
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
//echo $db->error();
|
//send mail in case of database connection error
|
||||||
mail( $webmaster, "Erreur de connecxion à la base de données => " . __file__ . " ligne " . __line__ , $log_mail);
|
mail( $webmaster, "Erreur de connecxion à la base de données => " . __file__ . " ligne " . __line__ , $log_mail);
|
||||||
}
|
}
|
||||||
//$db->close();
|
// send mail to admin in case of level > INFO
|
||||||
if ( $level == ALERT )
|
if ( $level == ALERT )
|
||||||
{
|
{
|
||||||
mail( $webmaster, "Alerte Site Web", $log_mail );
|
mail( $webmaster, "Alerte Site Web", $log_mail );
|
||||||
@ -52,25 +56,25 @@ function log_write($log, $level=INFO)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $w_db = true -> écrire les logs dans la base (défaut)
|
// $w_db = true -> write log in database (default)
|
||||||
// $die = true -> execute die() -> termine le programme
|
// $die = true -> execute die() -> script end
|
||||||
function log_error($log, $w_db=true, $die=false)
|
function log_error($log, $w_db=true, $die=false)
|
||||||
{
|
{
|
||||||
global $webmaster, $headers, $accueil, $db;
|
global $webmaster, $headers, $accueil, $db;
|
||||||
if ( $w_db ) log_write($log, ERROR);
|
if ( $w_db ) log_write($log, ERROR);
|
||||||
//echo "$log<br />\n";
|
|
||||||
$log_err = 'erreur dans la requête<br/>un rapport détaillé a été envoyé au webmaster';
|
$log_err = 'erreur dans la requête<br/>un rapport détaillé a été envoyé au webmaster';
|
||||||
if ( $die )
|
if ( $die )
|
||||||
{
|
{
|
||||||
//echo "\n";
|
//echo "\n";
|
||||||
//die( $log_err );
|
die( $log_err );
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
//store error in table session[]
|
||||||
$_SESSION['error'] = $log_err;
|
$_SESSION['error'] = $log_err;
|
||||||
//header( 'Location: ' . $accueil );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//diplay logs
|
||||||
function affich_log( $nl, $np = 1, $level=0)
|
function affich_log( $nl, $np = 1, $level=0)
|
||||||
{
|
{
|
||||||
global $table_prefix, $base_url, $path, $page;
|
global $table_prefix, $base_url, $path, $page;
|
||||||
@ -136,7 +140,7 @@ function affich_log( $nl, $np = 1, $level=0)
|
|||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//////////////// affiche page précédente et page suivante
|
//////////////// display next and previous page
|
||||||
if ( $np > 1 )
|
if ( $np > 1 )
|
||||||
{
|
{
|
||||||
echo '<a href="logs.php?np=' . ($np - 1) . '">Page précédente</a>';
|
echo '<a href="logs.php?np=' . ($np - 1) . '">Page précédente</a>';
|
||||||
@ -147,7 +151,7 @@ function affich_log( $nl, $np = 1, $level=0)
|
|||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/////////////////////// affiche les logs dans un tableau
|
/////////////////////// display logs in table
|
||||||
if ($total_lignes != 0 )
|
if ($total_lignes != 0 )
|
||||||
{
|
{
|
||||||
$query = 'SELECT * FROM ' . $table_prefix . 'logs';
|
$query = 'SELECT * FROM ' . $table_prefix . 'logs';
|
||||||
|
@ -11,9 +11,10 @@ $idVotation = $_GET["v"];
|
|||||||
|
|
||||||
$dolibarr = new dbDolibarr();
|
$dolibarr = new dbDolibarr();
|
||||||
|
|
||||||
$query = "SELECT * FROM llx_adherent WHERE login='" . $dolibarr->protect($idVotant) . "'";
|
$query = "SELECT * FROM llx_adherent as a LEFT JOIN llx_adherent_type as t ON a.fk_adherent_type=t.rowid WHERE a.login='" . $dolibarr->protect($idVotant) . "' AND (DATE(a.datefin)>=CURDATE() OR t.subscription=0) AND t.vote=1";
|
||||||
|
print $query .EOLH;
|
||||||
$result = $dolibarr->query($query);
|
$result = $dolibarr->query($query);
|
||||||
|
print_r($dolibarr);
|
||||||
$votant = $dolibarr->result->fetch_array();
|
$votant = $dolibarr->result->fetch_array();
|
||||||
print('<br><br>
|
print('<br><br>
|
||||||
<!-- lalis Grid Section -->
|
<!-- lalis Grid Section -->
|
||||||
@ -29,7 +30,7 @@ print(' <div class="row">
|
|||||||
<h4>');
|
<h4>');
|
||||||
if ($dolibarr->result->num_rows == 0)
|
if ($dolibarr->result->num_rows == 0)
|
||||||
{
|
{
|
||||||
print "Identifiant non autorisé.<br>Si vous pensez qu'il s'agit d'une erreur, adressez vous à un responsable de l'association</h4>.<br><br><br><br>";
|
print "Identifiant non autorisé.<br>Vous n'êtes probablement pas à jour de votre cotisation.<br>Si vous pensez qu'il s'agit d'une erreur, adressez vous à un responsable de l'association</h4>.<br><br><br><br>";
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
$dolibarr->close();
|
$dolibarr->close();
|
||||||
@ -38,23 +39,24 @@ if ($dolibarr->result->num_rows == 0)
|
|||||||
$resultVotation = $db->query($query);
|
$resultVotation = $db->query($query);
|
||||||
$votation = $db->result->fetch_array();
|
$votation = $db->result->fetch_array();
|
||||||
$now = date('Y-m-d');
|
$now = date('Y-m-d');
|
||||||
if ( time() >= $votation['td'] AND time() <= $votation['tf'] )
|
if ($resultVotation === FALSE)
|
||||||
{
|
{
|
||||||
$query = "SELECT * FROM votes WHERE idVotant='" . $db->protect($idVotant) ."'";
|
print "Votation non trouvée</h4>" . EOLH;
|
||||||
$db->query($query);
|
}else
|
||||||
if ($db->result->num_rows == 0)
|
{
|
||||||
|
if ( time() >= $votation['td'] AND time() <= $votation['tf'] )
|
||||||
{
|
{
|
||||||
if ($resultVotation === FALSE)
|
$query = "SELECT * FROM votes WHERE idVotant='" . $db->protect($idVotant) ."'";
|
||||||
{
|
$db->query($query);
|
||||||
print "Votation non trouvée</h4>" . EOLH;
|
if ($db->result->num_rows == 0)
|
||||||
}else
|
|
||||||
{
|
{
|
||||||
echo $votation["libelle"] . "</h4>";
|
echo $votation["libelle"] . "</h4>";
|
||||||
print (' <hr class="star-primary">
|
print (' <hr class="star-primary">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row"><h5>Bonjour ' . $votant['firstname'] . " " . $votant['lastname'] . "</h5>" . EOLH . EOLH . "Attention: les votes blancs sont comptés comme vote exprimés." . EOLH . "Les abstentions ou l'absence de choix, comme non exprimés." . EOLH . "
|
<div class="row"><h5>Bonjour ' . $votant['firstname'] . " " . $votant['lastname'] . "</h5>" . EOLH . EOLH . "ATTENTION :" .EOLH . "
|
||||||
Vérifiez bien votre vote avant de l'envoyer, il est impossible de le modifier après.");
|
1 - les votes blancs sont comptés comme vote exprimés. Si plus de 50% de vote blanc, alors le résultat du vote est nul." . EOLH . "2 - L'absence de choix est compté comme abstention et donc non exprimés." . EOLH . "
|
||||||
|
3 - Vérifiez bien votre vote avant de l'envoyer, il est impossible de le modifier après.");
|
||||||
|
|
||||||
$query='SELECT * FROM liste_votes WHERE idVotation="' . $db->protect($idVotation) .'"';
|
$query='SELECT * FROM liste_votes WHERE idVotation="' . $db->protect($idVotation) .'"';
|
||||||
$result = $db->query($query);
|
$result = $db->query($query);
|
||||||
@ -70,21 +72,21 @@ if ($dolibarr->result->num_rows == 0)
|
|||||||
{
|
{
|
||||||
echo '<input type="radio" name="vote[' . $vote["id"] . ']" value="' . $candidat["id"] . '"> ' . $candidat["candidat"] . ' <br>';
|
echo '<input type="radio" name="vote[' . $vote["id"] . ']" value="' . $candidat["id"] . '"> ' . $candidat["candidat"] . ' <br>';
|
||||||
}
|
}
|
||||||
|
echo '<input type="radio" name="vote[' . $vote["id"] . ']" value="0"> Vote blanc <br>';
|
||||||
print "</pre>
|
print "</pre>
|
||||||
</div><br>";
|
</div><br>";
|
||||||
}
|
}
|
||||||
print (' <div class="text-center">
|
print (' <div class="text-center">
|
||||||
<h4><input type="submit" value="Voter"></h4>');
|
<h4><input type="submit" value="Voter"></h4>');
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
print " Bonjour " . $votant['firstname'] . " " . $votant['lastname'] . ',' . EOLH . EOLH . "vous avez déjà voté, vous ne pouvez pas revoter ou modifier votre vote." . EOLH . "Si vous pensez que c'est une erreur, veuillez prendre contact avec les responsables de l'association.</h4>";
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
print " Bonjour " . $votant['firstname'] . " " . $votant['lastname'] . ',' . EOLH . EOLH . "vous avez déjà voté, vous ne pouvez pas revoter ou modifier votre vote." . EOLH . "Si vous pensez que c'est une erreur, veuillez prendre contact avec les responsables de l'association.</h4>";
|
print " Bonjour " . $votant['firstname'] . " " . $votant['lastname'] . ',</h4>' . EOLH . EOLH . "Le vote ne sera ouvert qu'à partir du " . formattedate('fr', $votation['td'] , "Europe/Paris") . " et jusqu'au " . formattedate('fr', $votation['tf'] , "Europe/Paris") . '.' . EOLH . "Si vous pensez que ceci est une erreur, veuillez prendre contact avec les responsables de l'association.</h4>";
|
||||||
}
|
}
|
||||||
}else
|
|
||||||
{
|
|
||||||
print " Bonjour " . $votant['firstname'] . " " . $votant['lastname'] . ',</h4>' . EOLH . EOLH . "Le vote ne sera ouvert qu'à partir du " . formattedate('fr', $votation['td'] , "Europe/Paris") . " et jusqu'au " . formattedate('fr', $votation['tf'] , "Europe/Paris") . '.' . EOLH . "Si vous pensez que ceci est une erreur, veuillez prendre contact avec les responsables de l'association.</h4>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
print(' </div>
|
print(' </div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,7 +22,7 @@ if ( empty($idVotation))
|
|||||||
<div class="col-lg-12 text-center">
|
<div class="col-lg-12 text-center">
|
||||||
<h3>VOTE</h3>
|
<h3>VOTE</h3>
|
||||||
<h4>');
|
<h4>');
|
||||||
$query = 'SELECT *, UNIX_TIMESTAMP(dateFin) as tf FROM liste_votations WHERE id=' . $db->protect($idVotation);
|
$query = 'SELECT *, UNIX_TIMESTAMP(DATE_ADD(dateFin, INTERVAL 1 DAY)) as tf FROM liste_votations WHERE id=' . $db->protect($idVotation);
|
||||||
$result = $db->query($query);
|
$result = $db->query($query);
|
||||||
$votation = $db->result->fetch_array(MYSQLI_ASSOC);
|
$votation = $db->result->fetch_array(MYSQLI_ASSOC);
|
||||||
if ($result === FALSE)
|
if ($result === FALSE)
|
||||||
@ -44,12 +44,19 @@ if ( empty($idVotation))
|
|||||||
$votes = $db->result->fetch_all(MYSQLI_ASSOC);
|
$votes = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||||
foreach ($votes as $vote)
|
foreach ($votes as $vote)
|
||||||
{
|
{
|
||||||
|
$total = 0;
|
||||||
echo "<div><h5>" . $vote["libelle"] . "</h5><br>";
|
echo "<div><h5>" . $vote["libelle"] . "</h5><br>";
|
||||||
$query='SELECT * FROM liste_candidats WHERE idVotation=' . $idVotation . ' AND idVote=' . $vote["id"];
|
$query='SELECT * FROM liste_candidats WHERE idVotation=' . $idVotation . ' AND idVote=' . $vote["id"];
|
||||||
$result = $db->query($query);
|
$result = $db->query($query);
|
||||||
$candidats = $db->result->fetch_all(MYSQLI_ASSOC);
|
$candidats = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||||
echo "<pre>";
|
echo "<pre>";
|
||||||
//$resultatCandidats = '';
|
//$resultatCandidats = '';
|
||||||
|
|
||||||
|
$query='SELECT COUNT(*) as n FROM votes WHERE idVotation=' . $db->protect($idVotation) . ' AND idVote=' . $vote["id"] .' AND idCandidat=0';
|
||||||
|
$result = $db->query($query);
|
||||||
|
$resultat = $db->result->fetch_array(MYSQLI_ASSOC);
|
||||||
|
$blanc = $resultat["n"];
|
||||||
|
echo 'Votes blancs : ' . $blanc . '<br>';
|
||||||
foreach($candidats as $candidat)
|
foreach($candidats as $candidat)
|
||||||
{
|
{
|
||||||
$query='SELECT COUNT(*) as n FROM votes WHERE idVotation=' . $db->protect($idVotation) . ' AND idVote=' . $vote["id"] .' AND idCandidat=' . $candidat["id"];
|
$query='SELECT COUNT(*) as n FROM votes WHERE idVotation=' . $db->protect($idVotation) . ' AND idVote=' . $vote["id"] .' AND idCandidat=' . $candidat["id"];
|
||||||
@ -57,17 +64,25 @@ if ( empty($idVotation))
|
|||||||
$resultat = $db->result->fetch_array(MYSQLI_ASSOC);
|
$resultat = $db->result->fetch_array(MYSQLI_ASSOC);
|
||||||
echo $candidat["candidat"] . ' :' . $resultat["n"] . '<br>';
|
echo $candidat["candidat"] . ' :' . $resultat["n"] . '<br>';
|
||||||
$resultatCandidats[$candidat['candidat']] = $resultat["n"];
|
$resultatCandidats[$candidat['candidat']] = $resultat["n"];
|
||||||
|
$total += $resultat["n"];
|
||||||
}
|
}
|
||||||
array_multisort($resultatCandidats, SORT_DESC, SORT_NUMERIC);
|
array_multisort($resultatCandidats, SORT_DESC, SORT_NUMERIC);
|
||||||
reset($resultatCandidats);
|
reset($resultatCandidats);
|
||||||
print("<h5>Remporte le vote : " . key($resultatCandidats));
|
if ($total >= $blanc)
|
||||||
unset($resultatCandidats);
|
{
|
||||||
print "</h5></pre>
|
print("<h5>Remporte le vote : " . key($resultatCandidats));
|
||||||
</div><br>";
|
unset($resultatCandidats);
|
||||||
|
print("</h5>");
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
print("<h5>Aucun candidat n'emporte le vote, car il y a plus de 50% de votes blancs.</h5>");
|
||||||
|
}
|
||||||
|
|
||||||
|
print("</pre></div><br>");
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
print "Bonjour, vous pourrez consulter les résultats après la clôture du vote le " . formattedate('fr', $votation['tf'] , "Europe/Paris") . "</h4>";
|
print "Bonjour, vous pourrez consulter les résultats à partir du " . formattedate('fr', $votation['tf'] , "Europe/Paris") . "</h4>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user