-
Notifications
You must be signed in to change notification settings - Fork 0
/
image.php
112 lines (100 loc) · 4.38 KB
/
image.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
<style>
.carousel-inner > .item > img,
.carousel-inner > .item > a > img
{
width: 70%;
margin: auto;
}
</style>
<?php
include("page/header.php");
include("page/nav.php");?>
<div class="container">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!--indicator-->
<ol class="carousel-indicators">
<?php
$doss_img ="uploads/";
$i = 0;
if (is_dir($doss_img))
{
if ($dh = opendir($doss_img))
{
while(($file = readdir($dh))!== false)
{
if (getimagesize("uploads/".$file))
{
if ($i==0)
{
echo "<li data-target='#myCarousel' data-slide-to='0' class='active'></li>";
$i++;
}
else
{
echo "<li data-target='#myCarousel' data-slide-to=".$i."></li>";
$i++;
}
}
}
}
}
?>
</ol>
<!--image du slide-->
<?php
$j = 0;
$doss_img ="uploads/";
// ouvre un dossier bien connu et liste tous les fichiers
if (is_dir($doss_img))
{
if ($dh = opendir($doss_img))
{
while(($file = readdir($dh))!== false)
{
if (getimagesize("uploads/".$file))
{
if ($j==0)
{
echo "<div class='carousel-inner' role='listbox'>
<div class='item active'>
<img src='uploads/".$file."' alt=".$j." >
<div class='carousel-caption'>
<h3>".$file."</h3>
<p>fichier :". $file." : type - : " . filetype($doss_img . $file)."- image numéro - ".$j."</p>
</div>
</div>
";
$j++;
}
else
{
echo "
<div class='item'>
<img src='uploads/".$file."' alt=".$j." >
<div class='carousel-caption'>
<h3>".$file."</h3>
<p>fichier :". $file." : type - : " . filetype($doss_img . $file)."- image numéro - ".$j."</p>
</div>
</div>
";
$j++;
}
}
}
closedir($dh);
}
}
?>
<!-- contrôle droite et gauche-->
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Prev</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<?php include("page/footer.php");?>