diff --git a/Timeline/.~lock.TODO.txt# b/Timeline/.~lock.TODO.txt# deleted file mode 100755 index baf31062c00cb01a04714f85e8b463886991126c..0000000000000000000000000000000000000000 --- a/Timeline/.~lock.TODO.txt# +++ /dev/null @@ -1 +0,0 @@ -,PC-JULIE/julie,,08.05.2016 09:06,file:///C:/Users/julie/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/Timeline/carousel.php b/Timeline/carousel.php index 0f5c8350179aa110ab4b8c66c9c957d3157a7f5d..ccab2c27a076914383139b6dd2578024fb74253d 100755 --- a/Timeline/carousel.php +++ b/Timeline/carousel.php @@ -1,38 +1,28 @@ <?php + /* Fonction qui va retourner la chaine avec le path des photos à afficher */ + + function getPath($tab){ - function getPhotosMesPosts($db) { + $photos = array(); - $id=$_SESSION['login']; - $stmt = $db->query("SELECT soiree.annee, soiree.name, photo.idphoto, photo.extension, photo.composteur, soiree.theme FROM photo INNER JOIN soiree ON photo.idsoiree=soiree.idsoiree WHERE photo.idposteur='$id'"); - $stmt->setFetchMode(PDO::FETCH_NUM); - $result = $stmt->fetchAll(); - return $result; - } - - /* Fonction qui va retourner la chaine avec le path des photos à afficher */ - - function getPathMesPosts($tab){ + foreach($tab as $a) + { + $annee=$a[0]; + $name=$a[1]; + $idphoto=$a[2]; + $ext=$a[3]; - $photos = array(); + $photoPath = "photos/{$annee}/{$name}/{$idphoto}.{$ext}"; + $photos[] = $photoPath; + } - foreach($tab as $a) - { - $annee=$a[0]; - $name=$a[1]; - $idphoto=$a[2]; - $ext=$a[3]; - - $photoPath = "photos/{$annee}/{$name}/{$idphoto}.{$ext}"; - $photos[] = $photoPath; - } - - return $photos; + return $photos; } /* Fonction qui va crée le texte afficher à côté de chaque photo dans le carousel */ - function panelMesPosts($tab){ + function panelCarousel($tab){ $i=0; foreach($tab as $a) @@ -49,14 +39,6 @@ } } - // function test ($tab){ - - // foreach($tab as $a) - // { - // echo $a. PHP_EOL; - // } - // } - /* Carousel de base */ function carousel($photos) { @@ -115,7 +97,7 @@ function carousel2($tabPhotos) { - $photos = getPathMesPosts($tabPhotos); + $photos = getPath($tabPhotos); $first = 0; @@ -170,7 +152,7 @@ echo '<div class="col-sm-4" id="carousel-text"></div>'; echo '<div id="slide-content" style="display: none;">'; - panelMesPosts($tabPhotos); + panelCarousel($tabPhotos); echo'</div>'; echo'</div>'; diff --git a/Timeline/carousel_mes_identifications.php b/Timeline/carousel_mes_identifications.php deleted file mode 100755 index d0f01ca3059c3ae72ab5de7e24e6df6c206ea1b2..0000000000000000000000000000000000000000 --- a/Timeline/carousel_mes_identifications.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php - - - function getPhotosMesIdentifications($db) { - - $id=$_SESSION['login']; - $stmt = $db->query("SELECT soiree.annee, soiree.name, photo.idphoto, photo.extension, photo.composteur, soiree.theme FROM photo INNER JOIN soiree ON photo.idsoiree=soiree.idsoiree INNER JOIN identification ON photo.idphoto=utilisateur.idphoto WHERE identification.idutilisateur='$id'"); - $stmt->setFetchMode(PDO::FETCH_NUM); - $result = $stmt->fetchAll(); - return $result; - } - - /* Fonction qui va retourner la chaine avec le path des photos à afficher */ - - function getPathMesIdentifications($tab){ - - $photos = array(); - - foreach($tab as $a) - { - $annee=$a[0]; - $name=$a[1]; - $idphoto=$a[2]; - $ext=$a[3]; - - $photoPath = "photos/{$annee}/{$name}/{$idphoto}.{$ext}"; - $photos[] = $photoPath; - } - - return $photos; - } - - /* Fonction qui va crée le texte afficher à côté de chaque photo dans le carousel */ - - function panelMesIdentifications($tab){ - - $i=0; - foreach($tab as $a) - { - $annee=$a[0]; - $com=$a[4]; - $theme=$a[5]; - echo "<div class='side-text' id='slide-content-".$i."'>"; - echo '<h3>'.$annee.' / '.$theme.'</h3>'; - echo '<p>'.$com.'</p>'; - echo '<p class="sub-text"></p>'; - echo '</div>'; - $i=$i+1; - } - } - - /* Carousel avec texte à droite + petites images en dessous */ - - function carousel_mes_identifications($tabPhotos) - { - - $photos = getPathMesIdentifications($tabPhotos); - - $first = 0; - - echo '<div class="container">'; - - echo '<div id="main_area">'; - - // Slider - echo '<div class="row border">'; - echo '<div class="col-xs-12" id="slider">'; - //Top part of the slider - echo '<div class="row">'; - echo '<div class="col-sm-8" id="carousel-bounding-box">'; - echo '<div class="carousel slide" id="myCarousel">'; - - // Carousel items - echo '<div class="carousel-inner">'; - - $n = count($photos); - $i=0; - foreach ($photos as $pic) - { - if($i == 0) - { - echo "<div class='active item' data-slide-number='$i'>"; - } - else - { - echo "<div class='item' data-slide-number='$i'>"; - } - echo "<img src='$pic' class='img-responsive img-rounded' style='margin:0px auto;max-height:350px;'/>"; - echo '</div>'; - $i=$i+1; - } - - echo "</div>"; - - // Carousel controlers (left, right) - echo '<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">'; - echo '<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>'; - echo '<span class="sr-only">Previous</span>'; - echo'</a>'; - echo'<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">'; - echo'<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>'; - echo'<span class="sr-only">Next</span>'; - echo'</a>'; - - echo'</div>'; - echo'</div>'; - - // carousel right panel with texts - echo '<div class="col-sm-4" id="carousel-text"></div>'; - echo '<div id="slide-content" style="display: none;">'; - - panelMesIdentifications($tabPhotos); - - echo'</div>'; - echo'</div>'; - echo'</div>'; - echo'</div>'; - - // Row of thumbnails - echo '<div class="row hidden-xs hidden-sm" id="slider-thumbs">'; - echo '<ul class="hide-bullets">'; - - $i=0; - foreach ($photos as $pic) - { - echo '<li class="col-sm-2">'; - echo "<a class='thumbnail' id='carousel-selector-{$i}'><img src='$pic' class='img-responsive img-rounded' style='margin:0px auto;max-height:100px;'></a>"; - echo '</li>'; - $i=$i+1; - } - - echo '</ul>'; - - echo'</div>'; - echo'</div>'; - echo'</div>'; - } -?> - diff --git a/Timeline/header.php b/Timeline/header.php index 2892bb748cb458d0f4e3303453290fd711e0c3b7..6b36939977e236c5e85b8f5830a2a32338cccf75 100755 --- a/Timeline/header.php +++ b/Timeline/header.php @@ -119,8 +119,8 @@ <ul class="nav nav-sidebar"> <li><a href="monprofil.php"><span class="glyphicon glyphicon-user"></span>Mon profil</a></li> <li><a href="mes_posts.php"><span class="glyphicon glyphicon-camera"></span>Mes posts</a></li> - <li><a href="#"><span class="glyphicon glyphicon-pushpin"></span>Mes identifications</a></li> - <li><a href="#"><span class="glyphicon glyphicon-star"></span>Mes wins</a></li> + <li><a href="mes_identifications.php"><span class="glyphicon glyphicon-pushpin"></span>Mes identifications</a></li> + <li><a href="mes_wins.php"><span class="glyphicon glyphicon-star"></span>Mes wins</a></li> </ul> <ul class="nav nav-sidebar navbar-static-bottom" id="d"> <li><a href="logout.php"><span class="glyphicon glyphicon-off"></span>Déconnexion</a></li> diff --git a/Timeline/js/carousel.js b/Timeline/js/carousel.js new file mode 100755 index 0000000000000000000000000000000000000000..67430c1f84288e34ad5cfc47722512aaf88d0ab6 --- /dev/null +++ b/Timeline/js/carousel.js @@ -0,0 +1,22 @@ +//Code nécessaire pour le carroussel 2 +jQuery(document).ready(function($) { + + $('#myCarousel').carousel({ + interval: 10000 + }); + + $('#carousel-text').html($('#slide-content-0').html()); + + //Handles the carousel thumbnails + $('[id^=carousel-selector-]').click( function(){ + var id = this.id.substr(this.id.lastIndexOf("-") + 1); + var id = parseInt(id); + $('#myCarousel').carousel(id); + }); + + // When the carousel slides, auto update the text + $('#myCarousel').on('slid.bs.carousel', function (e) { + var id = $('.item.active').data('slide-number'); + $('#carousel-text').html($('#slide-content-'+id).html()); + }); +}); \ No newline at end of file diff --git a/Timeline/mes_identifications.php b/Timeline/mes_identifications.php index cf8d35143ef8eeaa6715daba6ecf08c7b45a66f8..286ac10dff3c523cd953b7a72942b829f75870a0 100755 --- a/Timeline/mes_identifications.php +++ b/Timeline/mes_identifications.php @@ -2,7 +2,15 @@ session_start(); - include 'carousel_mes_identifications.php'; + include 'carousel.php'; + + function getPhotosMesIdentifications($db) { + $id=$_SESSION['login']; + $stmt = $db->query("SELECT soiree.annee, soiree.name, photo.idphoto, photo.extension, photo.composteur, soiree.theme FROM photo INNER JOIN soiree ON photo.idsoiree=soiree.idsoiree INNER JOIN identification ON photo.idphoto=identification.idphoto WHERE identification.idutilisateur='$id'"); + $stmt->setFetchMode(PDO::FETCH_NUM); + $result = $stmt->fetchAll(); + return $result; + } try{ @@ -17,82 +25,57 @@ catch(PDOException $e){ echo "Database Error"; } -?> +?> <!DOCTYPE html > <html lang="fr"> <head> - <meta charset="utf-8"> - <title>TIMELINE</title> + <meta charset="utf-8"/> + - <!-- icone du titre de la page --> - <link rel="shortcut icon" href="fonts/icone2.jpg"> - + <link rel="shortcut icon" href="fonts/icone.ico"> + <title>TIMELINE</title> + <!-- pour les moteurs de recherche --> - <meta name="description" lang="fr" content="plateforme de timeline photo pour soirée et évènement" /> - <meta name="keywords" lang="fr" content="photos, soirée, timeline, ENSIIE, iiens" /> + <meta name="description" lang="fr" content="plateforme de timeline photo pour soirée et évènement" /> + <meta name="keywords" lang="fr" content="photos, soirée, timeline, ENSIIE, iiens" /> - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="css/bootstrap.css"> - - <!-- jquery --> - <script src="js/jquery_library.js"></script> - - <!-- Latest compiled and minified JavaScript --> - <script src="js/bootstrap.js"></script> - - <!-- fichier css perso --> - <link rel="stylesheet" href="css/menu.css"> - <link rel="stylesheet" href="css/mes_idenifications.css"> - <link rel="stylesheet" href="css/buttonLink.css"> - - <script> - - //Code nécessaire pour le carroussel 2 - jQuery(document).ready(function($) { - - $('#myCarousel').carousel({ - interval: 10000 - }); - - $('#carousel-text').html($('#slide-content-0').html()); - - //Handles the carousel thumbnails - $('[id^=carousel-selector-]').click( function(){ - var id = this.id.substr(this.id.lastIndexOf("-") + 1); - var id = parseInt(id); - $('#myCarousel').carousel(id); - }); - - // When the carousel slides, auto update the text - $('#myCarousel').on('slid.bs.carousel', function (e) { - var id = $('.item.active').data('slide-number'); - $('#carousel-text').html($('#slide-content-'+id).html()); - }); - }); - </script> + + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="css/bootstrap.css"> - + <!-- jquery --> + <script src="js/jquery_library.js"></script> + + <!-- Latest compiled and minified JavaScript --> + <script src="js/bootstrap.js"></script> + + <!-- Js carousel --> + <script src="js/carousel.js"></script> + + <!-- fichier css perso --> + <link rel="stylesheet" href="css/menu.css"> + <link rel="stylesheet" href="css/mes_posts.css"> - </head> +</head> <body> <?php include 'header.php'; ?> - <?php include 'carousel.php'; ?> - <h3 class="page-header">Mes Identifications</h3> + <h3 class="page-header">Mes identifications</h3> <?php if($tabPhotos) { - carousel_mes_identifications($tabPhotos); + carousel2($tabPhotos); } else { echo "<div class='container-fluid'>"; - echo "<p class='nothing'>Tanche ! Tu n'es encore identifié nul part !<p>"; + echo "<p class='nothing'>Tanche ! Tu n'es encore identifié nulle part !<p>"; + echo "</div>"; } ?> diff --git a/Timeline/mes_posts.php b/Timeline/mes_posts.php index d155d198d88f6b2e5a69f8a6395e1184728ed115..cbe00901b5dfba05c07232f48a3bf1d842f64a4c 100755 --- a/Timeline/mes_posts.php +++ b/Timeline/mes_posts.php @@ -4,6 +4,17 @@ include 'carousel.php'; + + function getPhotosMesPosts($db) { + + $id=$_SESSION['login']; + $stmt = $db->query("SELECT soiree.annee, soiree.name, photo.idphoto, photo.extension, photo.composteur, soiree.theme FROM photo INNER JOIN soiree ON photo.idsoiree=soiree.idsoiree WHERE photo.idposteur='$id'"); + $stmt->setFetchMode(PDO::FETCH_NUM); + $result = $stmt->fetchAll(); + return $result; + } + + try{ $DB = new PDO("pgsql:host=localhost;dbname=projet_web", "postgres", "root"); @@ -45,36 +56,12 @@ <!-- Latest compiled and minified JavaScript --> <script src="js/bootstrap.js"></script> + <!-- Js carousel --> + <script src="js/carousel.js"></script> + <!-- fichier css perso --> <link rel="stylesheet" href="css/menu.css"> <link rel="stylesheet" href="css/mes_posts.css"> - <link rel="stylesheet" href="css/buttonLink.css"> - - <script> - - //Code nécessaire pour le carroussel 2 - jQuery(document).ready(function($) { - - $('#myCarousel').carousel({ - interval: 10000 - }); - - $('#carousel-text').html($('#slide-content-0').html()); - - //Handles the carousel thumbnails - $('[id^=carousel-selector-]').click( function(){ - var id = this.id.substr(this.id.lastIndexOf("-") + 1); - var id = parseInt(id); - $('#myCarousel').carousel(id); - }); - - // When the carousel slides, auto update the text - $('#myCarousel').on('slid.bs.carousel', function (e) { - var id = $('.item.active').data('slide-number'); - $('#carousel-text').html($('#slide-content-'+id).html()); - }); - }); - </script> </head> diff --git a/Timeline/modal.php b/Timeline/modal.php deleted file mode 100755 index 2f0f38d95c7f293bf3535a2beab2fe378611f27c..0000000000000000000000000000000000000000 --- a/Timeline/modal.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -function modal ($button_name, $modal_header, $modal_body, $modal_footer){ - echo '<div class="container">'; - - #Trigger the modal with a button - echo "<button type='button' class='btn btn-info btn-lg' data-toggle='modal' data-target='#myModal'>$button_name</button>"; - - #Modal - echo '<div class="modal fade" id="myModal" role="dialog">'; - echo '<div class="modal-dialog">'; - - #Modal content - echo '<div class="modal-content">'; - echo '<div class="modal-header">'; - include $modal_header; - echo '</div>'; - echo '<div class="modal-body">'; - include $modal_body; - echo '</div>'; - echo '<div class="modal-footer">'; - include $modal_footer; - echo '</div>'; - echo'</div>'; - - echo '</div>'; - echo '</div>'; - - echo '</div>'; -} - -#usage : modal ("click me", "header.php", "body.php", "footer.php"); - -?> diff --git a/Timeline/view_profil.php b/Timeline/view_profil.php index c1b39fe1b6e3c15e0338dfae8e91e71a9ee5f5cd..7b311704a539553444699bbe8284d89d06d81ad6 100755 --- a/Timeline/view_profil.php +++ b/Timeline/view_profil.php @@ -107,9 +107,9 @@ if(isset($_GET['identifiant'])) <div class="row"> <div class="col-xs-12" id="nav_photos"> <ul> - <li><span class="glyphicon glyphicon-pushpin"></span>Ses identifications</li> - <li><span class="glyphicon glyphicon-camera"></span>Ses posts</li> - <li><span class="glyphicon glyphicon-star"></span>Ses Wins</li> + <li><span class="glyphicon glyphicon-pushpin"></span><a href="view_profil_ident.php?identifiant=<?php echo $idprofil; ?>">Ses identifications</a></li> + <li><span class="glyphicon glyphicon-camera"></span><a href="view_profil_post.php?identifiant=<?php echo $idprofil; ?>">Ses posts</a></li> + <li><span class="glyphicon glyphicon-star"></span><a href="view_profil_wins.php?identifiant=<?php echo $idprofil; ?>">Ses Wins</a></li> </ul> </div> </div> diff --git a/Timeline/view_profil_ident.php b/Timeline/view_profil_ident.php new file mode 100755 index 0000000000000000000000000000000000000000..1b3a388b4b07815a97c978fd4ceb10562cf3a710 --- /dev/null +++ b/Timeline/view_profil_ident.php @@ -0,0 +1,38 @@ +<?php + +session_start(); + + +?> + +<!DOCTYPE html > +<html lang="fr"> + <head> + <meta charset="utf-8"> + <title>TIMELINE</title> + + <!-- icone du titre de la page --> + <link rel="shortcut icon" href="fonts/icone2.jpg"> + + <!-- pour les moteurs de recherche --> + <meta name="description" lang="fr" content="plateforme de timeline photo pour soirée et évènement" /> + <meta name="keywords" lang="fr" content="photos, soirée, timeline, ENSIIE, iiens" /> + + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="css/bootstrap.css"> + + <!-- jquery --> + <script src="js/jquery_library.js"></script> + + <!-- Latest compiled and minified JavaScript --> + <script src="js/bootstrap.js"></script> + + + <!-- fichier css perso --> + <link rel="stylesheet" href="css/menu.css"> + <link rel="stylesheet" href="css/view_profil_ident.css"> + </head> + +<body> + + <?php include 'header.php'; ?> \ No newline at end of file diff --git a/Timeline/view_profil_post.php b/Timeline/view_profil_post.php new file mode 100755 index 0000000000000000000000000000000000000000..fb49664720e281899ea14afd9eb8191c7b824b6a --- /dev/null +++ b/Timeline/view_profil_post.php @@ -0,0 +1,38 @@ +<?php + +session_start(); + + +?> + +<!DOCTYPE html > +<html lang="fr"> + <head> + <meta charset="utf-8"> + <title>TIMELINE</title> + + <!-- icone du titre de la page --> + <link rel="shortcut icon" href="fonts/icone2.jpg"> + + <!-- pour les moteurs de recherche --> + <meta name="description" lang="fr" content="plateforme de timeline photo pour soirée et évènement" /> + <meta name="keywords" lang="fr" content="photos, soirée, timeline, ENSIIE, iiens" /> + + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="css/bootstrap.css"> + + <!-- jquery --> + <script src="js/jquery_library.js"></script> + + <!-- Latest compiled and minified JavaScript --> + <script src="js/bootstrap.js"></script> + + + <!-- fichier css perso --> + <link rel="stylesheet" href="css/menu.css"> + <link rel="stylesheet" href="css/view_profil_post.css"> + </head> + +<body> + + <?php include 'header.php'; ?> \ No newline at end of file diff --git a/Timeline/view_profil_wins.php b/Timeline/view_profil_wins.php new file mode 100755 index 0000000000000000000000000000000000000000..1e180ca30e6db7e41de3acf1c2613f0150e97c58 --- /dev/null +++ b/Timeline/view_profil_wins.php @@ -0,0 +1,38 @@ +<?php + +session_start(); + + +?> + +<!DOCTYPE html > +<html lang="fr"> + <head> + <meta charset="utf-8"> + <title>TIMELINE</title> + + <!-- icone du titre de la page --> + <link rel="shortcut icon" href="fonts/icone2.jpg"> + + <!-- pour les moteurs de recherche --> + <meta name="description" lang="fr" content="plateforme de timeline photo pour soirée et évènement" /> + <meta name="keywords" lang="fr" content="photos, soirée, timeline, ENSIIE, iiens" /> + + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="css/bootstrap.css"> + + <!-- jquery --> + <script src="js/jquery_library.js"></script> + + <!-- Latest compiled and minified JavaScript --> + <script src="js/bootstrap.js"></script> + + + <!-- fichier css perso --> + <link rel="stylesheet" href="css/menu.css"> + <link rel="stylesheet" href="css/view_profil_wins.css"> + </head> + +<body> + + <?php include 'header.php'; ?> \ No newline at end of file