' . $var . "
";
if ( isset($_GET[$var]) )
{
//echo '$_get -> $var =>' . $var . "
";
return $_GET[$var];
}
elseif ( isset($_POST[$var]) )
{
//echo '$_POST -> $var =>' . $var . "
";
return $_POST[$var];
}else
{
return false;
}
}
// MET LA PREMIÈRE LETTRE D'UN MOT EN MAJUSCULE ( utf8 compliant )
function mb_ucfirst($str)
{
$char = mb_substr($str,0,1,"UTF8");
$str = mb_substr( $str, 1, NULL, "UTF8");
$char = mb_strtoupper( $char, "UTF8");
return $char . $str;
}
function choixVotation($path, $methode=2) //2 = toutes les votations 1 = votations en cours 0 = votations cloturées
{
global $db, $base_url, $action;
$query = "SELECT * FROM liste_votations";
if ($methode != 2)
{
$query .= " where status=" . $methode;
}
$result = $db->query($query);
$votations = $db->result->fetch_all(MYSQLI_ASSOC);
if ($db->result->num_rows == 1)
{
$redirect = '');
print "
"; print ''; foreach($votations as $key => $value ) { print ' ' . $value["titre"] . ' :' . $value["libelle"] . '
'; } print '