-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·61 lines (57 loc) · 2.27 KB
/
Copy pathindex.php
File metadata and controls
executable file
·61 lines (57 loc) · 2.27 KB
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
<?php
$page_title = "Vie De Geek - Index";
include ($_SERVER['DOCUMENT_ROOT'].'/VieDeGeek/fragments/shared/header.php');
require_once 'fragments/traitements/db.php';
require_once 'fragments/traitements/anecdote.php';
require_once 'fragments/traitements/inscrit.php';
?>
<?php
if(!isset($_GET['nbAnecdotes'])){
$_GET['nbAnecdotes'] = 0;
}
$anecdotes = anecdotesValidees($_GET['nbAnecdotes']);
foreach ($anecdotes as $uneAnecdote) {
$inscrit = infoUser($uneAnecdote['num_inscrit']);
?>
<div id="anecdotes">
<div id="text_anecdotes">
<?php echo $uneAnecdote['libelle_anecdote'] ?>
<div id="split"></div>
<div id="votes">
<em> Postée par <?php echo $inscrit[0]['nom_inscrit'] ?> le <?php echo $uneAnecdote['date_creation_anecdote'] ?> :
<?php if(isset($_SESSION['login'])){ ?>
<img height="1%"width="1.5%" src="res/img/fleche_haut.png" alt="up" title="Up vote" onclick="upVote(<?php echo $uneAnecdote['num_anecdote']; ?>)"/>
<img height="1%"width="1.5%" src="res/img/fleche_bas.png" alt="down" title="Down vote" onclick="downVote(<?php echo $uneAnecdote['num_anecdote']; ?>)"/>
/ <?php } ?><label id="<?php echo $uneAnecdote['num_anecdote']; ?>"><?php echo $uneAnecdote['nb_like'] - $uneAnecdote['nb_dislike'] ?></label>
<label id="e<?php echo $uneAnecdote['num_anecdote']; ?>"></label>
</em>
</div>
</div>
</div>
<?php
}
?>
<div id="bas_de_page">
<table align="center">
<tr>
<?php
$precedent = intval($_GET['nbAnecdotes']) - 12;
$nbAnecdotes = nbAnecdotes();
$suivant = intval($_GET['nbAnecdotes']) + 12;
if($precedent >= 0){
?>
<td><a id="valider" href="index.php?nbAnecdotes=<?php echo $precedent ?>">Page précédente</a></td>
<?php
}
if($suivant <= $nbAnecdotes[0][0]){
?>
<td><a id="valider" href="index.php?nbAnecdotes=<?php echo $suivant ?>">Page suivante</a></td>
<?php
}
?>
</tr>
</table>
</div>
<?php
include ($_SERVER['DOCUMENT_ROOT'].'/VieDeGeek/fragments/shared/footer.php');
?>