-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivites.php
More file actions
46 lines (29 loc) · 845 Bytes
/
activites.php
File metadata and controls
46 lines (29 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
session_start();
require_once __DIR__ . '/vendor/autoload.php';
include 'class/ActiviteDAL.php';
use DAL\ActiviteDAL;
$loader = new Twig_Loader_Filesystem( __DIR__ . './templates');
$twig = new Twig_Environment($loader);
$db = new PDO('mysql:host=localhost;dbname=projet_tut;port=3306;charset=utf8', 'root', '');
$act = new ActiviteDAL($db);
?>
<!doctype html>
<html lang="fr">
<body>
<?php
if(isset($_POST['sports'])&&isset($_POST['ville']) )
{
$result=$act->getActiviteByResearchWithoutDate(($_POST['sports']),($_POST['ville']));
$template = $twig->loadTemplate('activite.html');
echo $template->render(array(
'activites' => $result,
));
}
else
{
echo $twig->render('activite.html');
}
?>
</body>
</html>