-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
97 lines (87 loc) · 2.31 KB
/
index.php
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
include_once('entete.php');
$db = new PDO('mysql:host=localhost; dbname=todoapp', 'root', '');
$rq = 'SELECT * FROM tache';
$v = array();
$res = $db->prepare($rq);
$res->execute($v);
$i = 0;
while ($t = $res->fetch(PDO::FETCH_OBJ)) {
$i++;
};
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/TODOAPP/tache.css">
<title>Liste des taches</title>
<style>
.tache {
text-decoration: none;
padding: 5px 5px;
border-radius: 4px;
color: #fff;
background-color: #9481fd;
}
.tache:hover {
background-color: #571094;
}
.description{
font-size: 20px;
}
/*taches modification*/
.choix {
display: flex;
margin-top: 20px;
margin-bottom: 20px;
}
.choix a{
margin-right: 10px;
}
/* Style for the links */
.choix1 {
text-decoration: none;
padding: 5px 15px;
border-radius: 4px;
color: #fff;
background: #9481fd;
/*background: linear-gradient(#9481fd,#571094);*/
}
.choix1:hover {
background: #571094;
}
</style>
</head>
<body>
<div class="task-container">
<div class="box">
<h1>Liste de mes taches (<?php echo $i; ?>)</h1>
<?php
$db = new PDO('mysql:host=localhost; dbname=todoapp', 'root', '');
$rq = 'SELECT * FROM tache';
$v = array();
$res = $db->prepare($rq);
$res->execute($v);
$i = 1;
while ($t = $res->fetch(PDO::FETCH_OBJ)) {
echo '
<p class="liste">
<strong><span class="description">' .$i . '_' . $t->description . '</span></strong><br>
<div class="dates">
<span class="date">du ' . $t->date_debut . '</span>
<span class="date"> au ' . $t->date_fin . '</span><br>
</div>
<div class="faire">
<a href="conf_sup_tache.php?id_tache=' . $t->id . '" class="tache">Supprimer</a>
<a href="modif_tache.php?id_tache=' . $t->id . '" class="tache">Modifier cette tache</a>
</div>
</p>';
$i++;
}
?>
</div>
</div>
</body>
</html>