Skip to content
Extraits de code Groupes Projets
Valider 5c54e227 rédigé par Animation des soirees's avatar Animation des soirees
Parcourir les fichiers

list of events

parent 3c82a566
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
@font-face {
font-family: 'Roboto';
src: url('font/Roboto-Regular.ttf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'RobotoBold';
src: url('font/Roboto-Bold.ttf');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'Roboto';
color: #111111;
background: #A9A9A9;
}
div.header {
text-align: center;
font-size: 3.5em;
margin-bottom: 30px;
}
div.content {
width: 940px;
margin: auto;
}
table.calendar {
width: 30%;
text-align: center;
}
div.content table {
border-collapse: collapse; /* Les bordures du tableau seront collées (plus joli) */
margin-left: auto;
margin-right:auto;
}
div.content table tr.table_header {
font-family: 'RobotoBold';
text-align: center;
}
div.content table td {
border: 1px solid black;
padding: 5px;
}
div.content table td img {
vertical-align: middle;
}
div.retour {
text-align: center;
margin-top: 30px;
font-size: 1.5em;
}
div.tags {
text-align: justify;
}
div.header {
margin:auto;
width:800px;
text-align:center
}
......@@ -3,21 +3,64 @@ require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();
$bdd = new PDO('mysql:host=mysql.iiens.net;dbname=assoce_nightiies', 'assoce_nightiies', 'VwuQREP5JwJQTF5h', array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));
$samPics = array('sam1.jpg', 'sam2.jpg', 'sam3.jpg');
$app->get(
'/',
function () {
global $samPics;
global $bdd;
$sam = $samPics[array_rand($samPics)];
$events = $bdd->prepare('SELECT id, title, date, place, description
FROM sam
ORDER BY date');
$events->execute();
echo <<<EOF
<html>
<head>
<link rel="stylesheet" type="text/css" href="/links/common.css">
</head>
<body>
<div style="margin:auto; width:800px; text-align:center">
<div class="header">
<img src="assets/sam/$sam" style="margin:auto">
</div>
<div class="content">
<table class="calendar">
<thead>
<tr>
<th>id</th>
<th>Date</th>
<th>Titre</th>
<th>Description</th>
<th>Salle</th>
</tr>
</thead>
<tbody>
EOF;
while ($event = $events->fetch()) {
$date = date('d/m/y', $event[2]);
$description = preg_replace("#(^|[\n ])(http://[\w\#$%&~/.\-;:=,?@\[\]+]+)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $event[4]);
echo <<<EOF
<tr>
<td>$event[0]</td>
<td>$date</td>
<td>$event[1]</td>
<td>$description</td>
<td>$event[3]</td>
</tr>
EOF;
}
echo <<<EOF
</tbody>
</table>
</div>
</body>
</html>
EOF;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter