-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php~
executable file
·117 lines (99 loc) · 3.19 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
require('functions.php');
session_start();
spl_autoload_register('chargerClasse');
//connection a la bdd
$bdd = connexionBdd();
//instanciation des gestionnaire de classe
$articleManager = new articleManager($bdd);
$utilisateurManager = new utilisateurManager($bdd);
$imageDescriptionManager = new imageDescriptionManager($bdd);
//I get articles to publish (6)
$articles = $articleManager->getLesArticlesAPublier();
$authors = array();
$images = array();
if($articles)
{
foreach($articles as $article)
{
$authors[] = $utilisateurManager->get($article->ID_UTILISATEUR());
$images[] = $imageDescriptionManager->get($article->ID_IMAGE_1());
}
}
//recuperation de la liste des 10 derniers articles
$lastArticles = $articleManager->getTenLast();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/index.css" rel="stylesheet" type="text/css">
<link href="css/library.css" rel="stylesheet" type="text/css">
<title>Home - Golbit</title>
<?php
include('header.php');
?>
<div class="container-fluid" id="container-index">
<div class="row">
<div class="col-sm-3 subnavigation">
<div class="see-also">
<h4 class="title_subnavigation"><strong>See also</strong></h4>
<ul class="nav nav-pills nav-stacked">
<?php if($lastArticles){ ?>
<?php foreach($lastArticles as $article)
{
?>
<li role="presentation"><a href="article.php?idArticle=<?php echo $article->ID_ARTICLE(); ?>"><?php echo $article->TITRE()?></a></li>
<?php
}
?>
<?php
}
?>
</ul>
</div>
</div>
<div class="col-sm-8 articles">
<?php
$k = 0;
while($k < 6)
{
?>
<div class="col-sm-8 article">
<?php
if(isset($articles[$k])){
?>
<a class="title" href="article.php?idArticle=<?php echo $articles[$k]->ID_ARTICLE(); ?>" ><?php echo htmlspecialchars($articles[$k]->TITRE());?></a>
<a href="article.php?idArticle=<?php echo $articles[$k]->ID_ARTICLE(); ?>"><img class="img-rounded" src="<?php echo $images[$k]->SOURCE()?>" alt="<?php echo $images[$k]->ALT()?>" /></a>
<a class="preambleLink" data-toggle="collapse" href="#collapseExample<?php echo $k ?>" aria-expanded="false" aria-controls="collapseExample">
<span class="glyphicon glyphicon glyphicon-hand-down" aria-hidden="true"></span> Show more
</a>
<div class="collapse" id="collapseExample<?php echo $k ?>">
<div class="well">
<p class="introduction"><?php echo htmlspecialchars($articles[$k]->INTRODUCTION()); ?></p>
</div>
</div>
<?php } ?>
</div>
<?php
$k = $k + 1;
}
?>
</div>
</div>
</div>
<script>
$('.main-nav li').first().addClass('active');
$( ".preambleLink" ).click(function() {
if ($(this).children("span").hasClass('glyphicon-hand-down')) {
$(this).text("");
$(this).append("<span class=\"glyphicon glyphicon glyphicon-hand-up\" aria-hidden=\"true\"></span> Show less");
}
else {
$(this).text("");
$(this).append("<span class=\"glyphicon glyphicon glyphicon-hand-down\" aria-hidden=\"true\"></span> Show more");
}
});
</script>
</body>
</html>