This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="fr"> | |
<head> | |
<title>Bootstrap 3 Canvas</title> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="web/style.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
if ($("#content").hasClass("displayBg")) { | |
$("body").css('background', 'url(bg.jpg) fixed no-repeat'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nomFichier = strtr($fichier, | |
'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ', | |
'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); | |
$nomFichier = preg_replace('/([^.a-z0-9]+)/i', '-', $fichier); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function isVotingTime() | |
{ | |
$dateEnd = new DateTime("03/31/2019", new DateTimeZone('Europe/Paris')); | |
$dateEndRelative = new DateTime("03/31/2019 last day of +1 month", new DateTimeZone('Europe/Paris')); | |
//Pour avoir +1 mois pile, on peut avoir des incohérences selon le nombre de jours | |
$dateBeginningVote = new DateTime("03/19/2018", new DateTimeZone('Europe/Paris')); | |
$today = new DateTime("now", new DateTimeZone('Europe/Paris')); | |
if ($today > $dateBeginningVote && $today < $dateEndRelative) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function openCSV() | |
{ | |
$delimiteur = ";" | |
$csvPath = realpath($_FILES['csv']['tmp_name']); | |
try { | |
$csvData = file_get_contents($csvPath); | |
$lines = explode(PHP_EOL, $csvData); | |
$array = array(); | |
foreach ($lines as $line) { | |
$array[] = str_getcsv($line, $delimiteur); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function uploadImg() | |
{ | |
$dossier = 'participations/'; | |
if (!file_exists($dossier)) { | |
mkdir($dossier, 0700); | |
} | |
$fichier = basename($_FILES['imgParticipation']['name']); | |
$taille_maxi = 3000000; | |
$taille = filesize($_FILES['imgParticipation']['tmp_name']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Database | |
{ | |
private static $datasource = 'mysql:host=localhost; dbname=mydbname'; | |
private static $username = 'root'; | |
private static $password = 'root'; | |
private static $pdo; | |
public static function getPDO() | |
{ | |
if (!isset(self::$db)) { |