diff --git a/Timeline/PicPopUpBody.php b/Timeline/PicPopUpBody.php deleted file mode 100755 index 53179d6cb22b53d2314df82ae4a48c126ba49d58..0000000000000000000000000000000000000000 --- a/Timeline/PicPopUpBody.php +++ /dev/null @@ -1,136 +0,0 @@ - <?php - - # Need variable $pics refering to the id of the photo in the DB - $pic = $GLOBALS["PicPopUp_pic"]; - #$pic = "1.png"; - - # Need variable $db refering to the argument of pg_connect in order to access to the DB - $db = $GLOBALS["PicPopUp_db"]; - #$db = ""; - - $connection = pg_connect ($db); - - # List of idconcours, nom, description, Nbvotes for each challenge - $concours = pg_fetch_all( pg_query($connection, " - SELECT concours.idconcours, nom, description, COUNT (concours.idconcours) as Nbvotes - FROM concours LEFT OUTER JOIN vote - ON concours.idconcours = vote.idconcours - WHERE encours AND (vot.idphoto = $pic) - GROUP BY concours.idconcours ; - ")); - $commentaires = pg_fetch_all( pg_query($connection, " - SELECT surnom, date_post, heure_post, contenu - FROM commentaire - INNER JOIN utilisateur - ON identifiant = idauteur - WHERE idphoto = $pic; - ")); - - - pg_close($connection); - - #Test=========================================== - #$com1 = array ( - # "surnom" => "bob", - # "date_post" => "16/05/16", - # "heure_post" =>"20:12", - # "contenu" => "lol !" - # ); - #$com2 = array ( - # "surnom" => "tom", - # "date_post" => "15/05/16", - # "heure_post" => "19:42", - # "contenu" => "enorme on dirait un elephant" - # ); - #$com3 = array ( - # "surnom" => "luc", - # "date_post" => "16/05/16", - # "heure_post" => "20:14", - # "contenu" => "j'aime les hamsters" - # ); - #$com4 = array ( - # "surnom" => "bob", - # "date_post" => "17/05/16", - # "heure_post" =>"21:12", - # "contenu" => "moi aussi" - # ); - #$com5 = array ( - # "surnom" => "tom", - # "date_post" => "17/05/16", - # "heure_post" => "22:42", - # "contenu" => "like moi, je partage" - # ); - #$com6 = array ( - # "surnom" => "luc", - # "date_post" => "18/05/16", - # "heure_post" => "20:14", - # "contenu" => "Quel boulet ce mec ..." - # ); - #$commentaire = array($com1,$com2,$com3,$com4,$com5,$com6); - #===================================================== - - - #Tri des commentaires par date - function cmp($a,$b) { - if ($a[date_post] == $b[date_post]){ - return ($a[heure_post] < $b[heure_post]) ? -1 : 1; - } - return ($a[date_post] < $b[date_post]) ? -1 : 1 ; - }; - uasort($commentaire,'cmp'); - - - #Test================================================ - #$line1 = array( - # "nom" => "like", - # "description" => "nombre de like", - # "Nbvotes" => "5" - # ); - #$line2 = array( - # "nom" => "trash", - # "description" => "la photo la plus hard", - # "Nbvotes" => "3" - # ); - #$concours = array($line1, $line2); - #============================================================= - - - - - - - echo '<div class="row">'; - echo '<div class="col-sm-8">'; - - echo "<img src='$pic' style='width:570px;height:380px;'>"; - echo '<br><br>'; - - #Printing buttons (features: badge with actual number of votes, tooltip(hover over) with description of each challenge) - # TODO : link of the button (update the vote value by sql query, AJAX ?) - foreach ($concours as $line) - { - echo "<button class='btn btn-primary' data-toggle='tooltip' title='$line[description]'>$line[nom] <span class='badge'>$line[Nbvotes]</span></button> "; - } - echo '</div>'; - - - - - - echo '<div class="col-sm-4">'; - echo '<h2>Commentaires</h2><br>'; - echo '<div style="overflow:scroll; height:340px" >'; - foreach ($commentaire as $com){ - echo "<p>[$com[heure_post]] $com[surnom] : $com[contenu]</p>"; - }; - echo '</div>'; - - echo '</div>'; - - - - echo '</div>'; - ?> - -</body> -</html> diff --git a/Timeline/TODO.txt b/Timeline/TODO.txt index f08cc14bc3ef188c5957cf2ff4ae15576b2ffe46..39e4e91c9d36c34cc04a2448d8f5a8adc783adee 100755 --- a/Timeline/TODO.txt +++ b/Timeline/TODO.txt @@ -15,24 +15,25 @@ DONE : - sécurité des mots de passe -> tout est modifié DONE - mail anouar DONE - click photo utilisateur -> affichage profil - +- replacer mon profil les champs quote et surnom par l'actuel DONE +- affichage nombre like Refonte CSS : - page gestion admin : mettre des boutons -- carroussel REFONTE affichage gris moche +- (carroussel REFONTE affichage gris moche ) TO DO : -- ses wins -- replacer mon profil les champs quote et surnom par l'actuel + TO DO LATER : - boutons j'aime, vote, et ajout commentaire sur click photo +- faire le bouton j'aime qui marche +- page de garde +- identification de personnes rajouter un bouton -- identification de personnes - -- start : oui ou non, navigation liens en haut à droite +- start : oui ou non, navigation liens en haut à droite,page - ajout concours admin, fin concours admin - creation soiree : creer en mm temps trash love - changer nom / logo ? diff --git a/Timeline/admin_add_concours.php b/Timeline/admin_add_concours.php old mode 100644 new mode 100755 diff --git a/Timeline/carousel_click_profil.php b/Timeline/carousel_click_profil.php deleted file mode 100755 index 8473a2d3622e0aaadf888255c5179776ef32f363..0000000000000000000000000000000000000000 --- a/Timeline/carousel_click_profil.php +++ /dev/null @@ -1,284 +0,0 @@ -<?php - - /*partie pour l'affichage des posts du profil visité*/ - - function getPhotosSesPosts($db,$idprofil) { - - $id=$idprofil; - $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 getPathSesPosts($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 panelSesPosts($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_ses_posts($tabPhotos) - { - - $photos = getPathSesPosts($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;">'; - - panelSesPosts($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>'; - } - - - - - - - - - /*partie pour l'affichage des identification du profil visité*/ - - function getPhotosSesIdentifications($db,$idprofil) { - - $id=$idprofil; - $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 getPathSesIdentifications($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 panelSesIdentifications($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_ses_identifications($tabPhotos) - { - - $photos = getPathSesIdentifications($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;">'; - - panelSesPosts($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/click_profil.php b/Timeline/click_profil.php deleted file mode 100755 index 63f2f91367602ec862bba84f0447855d67eea1bb..0000000000000000000000000000000000000000 --- a/Timeline/click_profil.php +++ /dev/null @@ -1,181 +0,0 @@ -<?php - - session_start(); - - include 'carousel_click_profil.php'; - - try{ - - $DB = new PDO("pgsql:host=localhost;dbname=projet_web", "postgres", "root"); - $IdProfil = ""; - - $tabPhotosPosts = getPhotosSesPosts($DB,$IProfil); - $tabPhotosIdentifications = getPhotosSesIdentifications($DB,$IdProfil); - - $DB = null; - - } - - catch(PDOException $e){ - echo "Database Error"; - } - -?> - -<!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/click_profil.css"> ???*/ - <link rel="stylesheet" href="css/buttonLink.css"> - - <script> - - //Code nécessaire pour le carroussel - 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> - - <body> - <?php include 'header.php'; - include 'carousel_click_profil.php'; - include 'script_mes_wins.php'; - include 'PicPopUp.php'; - ?> - - - - <div class="container-fluid" style="overflow:scroll"> /*menu déroulant*/ - - /*diviser en 2 colone*/ - <h3>Son Profil</h3> - <div classe="raw"> - <div classe="col-sm-4"> - <img src=<?php echo "SELECT avatar FROM utilisateur WHERE identifiant=$IdProfil ;"?> alt='Echec chargement image > - </div> - <div classe="col-sm-4"> - <ul style="list-style-type:none"> - <li>Nom</li> - <li>Prenom</li> - <li>Surnom</li> - <li>Promo</li> - </ul> - </div> - <div classe="col-sm-4"> - <ul style="list-style-type:none"> - <li><?php echo "SELECT nom FROM utilisateur WHERE identifiant=$IdProfil ;"?></li> - <li><?php echo "SELECT prenom FROM utilisateur WHERE identifiant=$IdProfil ;"?></li> - <li><?php echo "SELECT Surnom FROM utilisateur WHERE identifiant=$IdProfil ;"?></li> - <li><?php echo "SELECT Promo FROM utilisateur WHERE identifiant=$IdProfil ;"?></li> - </ul> - </div> - </div> - - </br> - - <h3>Ses Identifications</h3> - - <?php - if($tabPhotosIdentifications) - { - carousel_ses_identificatons($tabPhotosIdentifications); - } - else - { - echo "<div class='container-fluid'>"; - echo "<p class='nothing'>Cette tanche n'est identifiée nul part !<p>"; - } - ?> - - </br> - - <h3>Ses Posts</h3> - - <?php - if($tabPhotosPosts) - { - carousel_ses_posts($tabPhotosPosts); - } - else - { - echo "<div class='container-fluid'>"; - echo "<p class='nothing'>Cette tanche n'a encore rien poster !<p>"; - } - ?> - - </br> - - <h3>Ses Wins</h3> - - <?php - $result = selectMesWins("dbname=projet_web_2016_h", $IdProfil); - foreach($result1 as $vic){ - echo "<div class='row'>"; - echo "<h4>Concours $vic[name] / $vic[year] / $vic[theme] </h4>"; - - /*Lien PicPopUp*/ - $idPopUp = "$vic[Pic]_$vic[name]"; - PicPopUp ($idPopUp,$vic[substr(Pic,0,-4)], "projet_web_2016_h"); - echo "<a data-toggle='modal' data-target='$idPopUp'>"; - echo "<img src='$vic[Pic]' alt='Echec chargement image'/>"; - echo "</a>"; - echo "</div>"; - } - ?> - - - - - - - - - </div> - - - </body> -</html> - diff --git a/Timeline/css/dashboard.css b/Timeline/css/dashboard.css deleted file mode 100755 index e0e3632b89a33dc5c7ca7b5c28a4d6f83f874bf6..0000000000000000000000000000000000000000 --- a/Timeline/css/dashboard.css +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Base structure - */ - -/* Move down content because we have a fixed navbar that is 50px tall */ -body { - padding-top: 50px; -} - - -/* - * Global add-ons - */ - -.sub-header { - padding-bottom: 10px; - border-bottom: 1px solid #eee; -} - -/* - * Top navigation - * Hide default border to remove 1px line. - */ -.navbar-fixed-top { - border: 0; -} - -/* - * Sidebar - */ - -/* Hide for mobile, show later */ -.sidebar { - display: none; -} -@media (min-width: 768px) { - .sidebar { - position: fixed; - top: 51px; - bottom: 0; - left: 0; - z-index: 1000; - display: block; - padding: 20px; - overflow-x: hidden; - overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ - background-color: #f5f5f5; - border-right: 1px solid #eee; - } -} - -/* Sidebar navigation */ -.nav-sidebar { - margin-right: -21px; /* 20px padding + 1px border */ - margin-bottom: 20px; - margin-left: -20px; -} -.nav-sidebar > li > a { - padding-right: 20px; - padding-left: 20px; -} -.nav-sidebar > .active > a, -.nav-sidebar > .active > a:hover, -.nav-sidebar > .active > a:focus { - color: #fff; - background-color: #428bca; -} - - -/* - * Main content - */ - -.main { - padding: 20px; -} -@media (min-width: 768px) { - .main { - padding-right: 40px; - padding-left: 40px; - } -} -.main .page-header { - margin-top: 0; -} - - -/* - * Placeholder dashboard ideas - */ - -.placeholders { - margin-bottom: 30px; - text-align: center; -} -.placeholders h4 { - margin-bottom: 0; -} -.placeholder { - margin-bottom: 20px; -} -.placeholder img { - display: inline-block; - border-radius: 50%; -} diff --git a/Timeline/css/docs.css b/Timeline/css/docs.css deleted file mode 100755 index 0046832ac95fd004f20118b0e15e1be40b01d005..0000000000000000000000000000000000000000 --- a/Timeline/css/docs.css +++ /dev/null @@ -1,44 +0,0 @@ - - -/* Jumbotrons --------------------------------------------------- */ - -.jumbotron { - position: center; - padding: 400px 400; - color: #126ab5; - text-align: center; - text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075); - background: #020031; /* Old browsers */ - background: -moz-linear-gradient(45deg, #020031 0%, #2eb9dc 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#020031), color-stop(100%,#2eb9dc)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(45deg, #020031 0%,#2eb9dc 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(45deg, #020031 0%,#2eb9dc 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(45deg, #020031 0%,#2eb9dc 100%); /* IE10+ */ - background: linear-gradient(45deg, #020031 0%,#2eb9dc 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020031', endColorstr='#6d3353',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ - -webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); - -moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); - box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); -} - -.jumbotron p { - font-size: 240px; - font-weight: 300; - line-height: 1.25; - margin-bottom: 30px; -} - -/* Link styles */ -.jumbotron a { - color: #fff; - color: rgba(255,255,255,.5); - -webkit-transition: all .2s ease-in-out; - -moz-transition: all .2s ease-in-out; - transition: all .2s ease-in-out; -} -.jumbotron a:hover { - color: #fff; - text-shadow: 0 0 10px rgba(255,255,255,.25); -} - diff --git a/Timeline/css/index.css b/Timeline/css/index.css index 068fe687e7b2f9089a12096580aa388201978490..875cdfd9be1c9a5cf6c65afa44bc5b49f3b50e92 100755 --- a/Timeline/css/index.css +++ b/Timeline/css/index.css @@ -1,9 +1,41 @@ -body{ +body { margin:0; padding:0; -background: url('fonts/photo1.jpg') no-repeat center fixed; +background: url('../fonts/background.jpg') no-repeat center fixed; -webkit-background-size: cover; /* pour Chrome et Safari */ -moz-background-size: cover; /* pour Firefox */ -o-background-size: cover; /* pour Opera */ -background-size: cover; /* version standard */ -} \ No newline at end of file +background-size: cover; /* version standardisée */ +font-family: 'Open Sans', sans-serif; +} + +.form-group { + margin-top:30%; +} + +.start1 { + position: center; + padding: 400px 400; + text-align: center; + } + +.start1 p { + font-size: 240px; + font-weight: 300; + line-height: 1.25; + margin-bottom: 30px; +} + + +.start1 a { + color: #fff; + color: rgba(255,255,255,.5); + -webkit-transition: all .2s ease-in-out; + -moz-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.start1 a:hover { + color: #fff; + text-shadow: 0 0 10px rgba(255,255,255,.25); +} + diff --git a/Timeline/css/start1.css b/Timeline/css/start1.css deleted file mode 100644 index a6ee85c00bad4e8545c1b759c9adf17616a699c7..0000000000000000000000000000000000000000 --- a/Timeline/css/start1.css +++ /dev/null @@ -1,29 +0,0 @@ - - - -.start1 { - position: center; - padding: 400px 400; - text-align: center; - } - -.start1 p { - font-size: 240px; - font-weight: 300; - line-height: 1.25; - margin-bottom: 30px; -} - -/* Link styles (used on .masthead-links as well) */ -.start1 a { - color: #fff; - color: rgba(255,255,255,.5); - -webkit-transition: all .2s ease-in-out; - -moz-transition: all .2s ease-in-out; - transition: all .2s ease-in-out; -} -.start1 a:hover { - color: #fff; - text-shadow: 0 0 10px rgba(255,255,255,.25); -} - diff --git a/Timeline/fonts/background.jpg b/Timeline/fonts/background.jpg new file mode 100755 index 0000000000000000000000000000000000000000..9b1f26a55fd0dbb734d4a92eaf7bf6344d262733 Binary files /dev/null and b/Timeline/fonts/background.jpg differ diff --git a/Timeline/fonts/icone.png b/Timeline/fonts/icone.png deleted file mode 100755 index 7d0eef8788fe017bd44c32534648ddf402839178..0000000000000000000000000000000000000000 Binary files a/Timeline/fonts/icone.png and /dev/null differ diff --git a/Timeline/fonts/logo.JPG b/Timeline/fonts/logo.JPG deleted file mode 100755 index fd500c86c05b8cb219ce5c17f78d1aec15e9c994..0000000000000000000000000000000000000000 Binary files a/Timeline/fonts/logo.JPG and /dev/null differ diff --git a/Timeline/fonts/photo1.jpg b/Timeline/fonts/photo1.jpg deleted file mode 100755 index 1f98e4615fb25d9a29e7cbed0aab06bff86cfaba..0000000000000000000000000000000000000000 Binary files a/Timeline/fonts/photo1.jpg and /dev/null differ diff --git a/Timeline/fonts/photo2.jpg b/Timeline/fonts/photo2.jpg deleted file mode 100755 index ffea92e2ed3382cbe826c25720c0c004199d1aac..0000000000000000000000000000000000000000 Binary files a/Timeline/fonts/photo2.jpg and /dev/null differ diff --git a/Timeline/index.php b/Timeline/index.php index 64d90068982d458e03944733360edb5ea86d9c34..d36e53230d2fe1d0c254af3428158daaa9219c60 100755 --- a/Timeline/index.php +++ b/Timeline/index.php @@ -1,47 +1,52 @@ -<!DOCTYPE html > -<html lang="fr"> - <head> - <meta charset="utf-8"/> - <title>TIMELINE</title> - - <!-- pour les moteurs de recherche --> - <metaname="description" lang="fr" content="plateforme de timeline photo pour soirée et évènement" /> - <metaname="keywords" lang="fr" content="photos, soirée, timeline, ENSIIE, iiens" /> - - <!-- icone du titre de la page --> - <link rel="shortcut icon" href="fonts/icone2.jpg"> - - <!-- 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/index.css"> - - </head> -<body> -<div class="container-fluid "> - - <div class="tab-content " > - <form id="co" class="col-md-offset-4 col-md-4 pull-right" role="form"> - - <div class="form-group "> - <div class="thumbnail "> - <h4><center> Bienvenue sur TimeLine</center></h4> - <p><center>"Cheese, clic & share."</center></p> - <img alt="logo" src="fonts/logo.png"/> - <button class="btn btn-primary btn-block btn-md" type="submit" name="Connexion"><a href="index.php">Se connecter</a></button> - <button class="btn btn-success btn-block btn-md" type="submit" name="Inscription"><a href="index.php">Inscription</a></button> - </div> - </div> - </form> - </div> - -</div> -</body> +<!DOCTYPE html > +<html lang="fr"> + <head> + <meta charset="utf-8"/> + + + <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" /> + + <!-- jquery --> + <script src="js/jquery_library.js"></script> + + <!-- Latest compiled and minified JavaScript --> + <script src="js/bootstrap.js"></script> + + <!-- Latest compiled and minified CSS --> + <link rel="stylesheet" href="css/bootstrap.css"> + <link rel="stylesheet" href="css/index.css"> + + +</head> + +<body > + +<div class="start1"> +<div class="container-fluid "> + <div class="tab-content " > + <form id="co" class="col-lg-offset-4 col-lg-4" role="form"> + <div class="form-group "> + <div class="thumbnail "> + + <h4><center>Bienvenue sur TimeLine</center></h4> + <p><center>"Cheese, clic & share."</center></p> + <img alt="logo" src="fonts/logo.png"/> + <button class="btn btn-primary btn-block btn-md" type="submit" name="Connexion"><a href="connexion.php">Se connecter</a></button> + <button class="btn btn-success btn-block btn-md" type="submit" name="Inscription"><a href="inscription.php">S'inscrire</a></button> + + </div> + </div> + </form> + + </div> +</div> +</div> + + +</body> </html> \ No newline at end of file diff --git a/Timeline/js/modal.js b/Timeline/js/modal.js index cc72ba2acb186187975f8e7529bc1b1b7bb6562d..0ef4b10b0d48c44015fbe32a6c8ae5e49cb65e1a 100755 --- a/Timeline/js/modal.js +++ b/Timeline/js/modal.js @@ -51,10 +51,11 @@ $(document).ready(function (){ $('.media-list').append('<li class="media">'+photo+'<div class="container media-body"><div class="well well-lg">'+titre+date+printContenu+'</div></div></li>'); - - } + var like = resultObj[1][0]; + $('.like').html(like); + } else { diff --git a/Timeline/js/validate_add_concours.js b/Timeline/js/validate_add_concours.js old mode 100644 new mode 100755 diff --git a/Timeline/js/validate_ins.js~ b/Timeline/js/validate_ins.js~ deleted file mode 100755 index bdeaf7a756352281bc8ed95df1394b07da1c8aaf..0000000000000000000000000000000000000000 --- a/Timeline/js/validate_ins.js~ +++ /dev/null @@ -1,155 +0,0 @@ -$(document).ready(function(){ - - /* variables inscription */ - - var nom = ""; - var prenom = ""; - var promo = ""; - var id = ""; - var mdp = ""; - var cmdp = ""; - - /* Vérification format formulaire inscription */ - - $("#nom").keyup(function() { - - var tmp = $(this).val(); - - /* test vide */ - if(tmp == "") - { - $("#nomerror").html("Entrez votre nom "); - nom = ""; - } - else - { - $("#nomerror").html(""); - nom = tmp; - } - }); - - $("#prenom").keyup(function() { - - var tmp = $(this).val(); - - /* test vide */ - if(tmp == "") - { - $("#prenerror").html("Entrez votre prénom "); - prenom = ""; - } - else - { - $("#prenerror").html(""); - prenom = tmp; - } - }); - - $("#promo").keyup(function() { - - - var tmp = $(this).val(); - - /* test vide */ - if(tmp == "") - { - $("#promoerror").html("Entrez votre promo"); - promo = 0; - } - else if (tmp.length != 4) - { - $("#promoerror").html("Format : YYYY"); - promo = ""; - } - else if (tmp > 2018 || tmp < 1990) - { - $("#promoerror").html("Promo entre 1990 et 2018"); - promo = ""; - } - else - { - $("#promoerror").html(""); - promo = tmp; - } - }); - - $("#identifiant").keyup(function() { - - - var tmp = $(this).val(); - - /* test vide */ - if(tmp == "" || tmp.length != 11) - { - $("#idcorrect").html(""); - $("#iderror").html("Format : 11 caractères"); - - id = ""; - } - else - { - $.ajax({ - - type:'POST', - url:'script.php', - data:"identifiant="+tmp, - success:function(msg){ - - if(msg == "existe") - { - $("#idcorrect").html(""); - $("#iderror").html("Identifiant déjà pris"); - id = ""; - } - else if(msg == "Database error") - { - $("#iderror").html("Database error"); - $("#idcorrect").html(""); - id = ""; - } - else - { - $("#iderror").html(""); - $("#idcorrect").html("OK"); - id = tmp; - } - } - }); - - } - }); - - $("#mdp").keyup(function() { - - var tmp = $(this).val(); - - if(tmp == "" || (tmp.length < 8)) - { - $("#mdperror").html("Taille minimale de 8 caractères"); - mdp = ""; - } - else - { - $("#mdperror").html(""); - mdp = tmp; - } - }); - - $("#cmdp").keyup(function() { - - var tmp = $(this).val(); - - /* test vide */ - if(tmp == "" || (mdp !== tmp)) - { - $("#cmdperror").html("Mots de passe différents"); - cmdp = ""; - } - else - { - $("#cmdperror").html(""); - cmdp = tmp; - } - }); - -}); diff --git a/Timeline/mes_posts.php b/Timeline/mes_posts.php index a55b98e7e8a6a7e2cf311d8e03db7c6b4ae4fcce..a93b4589d766011dc9792ad6821674d6eaff2968 100755 --- a/Timeline/mes_posts.php +++ b/Timeline/mes_posts.php @@ -59,6 +59,7 @@ <!-- Js carousel --> <script src="js/carousel.js"></script> <script type="text/javascript" src="js/modal.js"></script> + <scrip type="text/javascript" src="js/validate_add_comment.js"></script> <!-- fichier css perso --> <link rel="stylesheet" href="css/menu.css"> diff --git a/Timeline/modal.php b/Timeline/modal.php index e027a75e8e7bd95a5187de4efaa40b2fbcd114e9..8881ff5527fc542feebe3d41be29b50e9d563b9f 100755 --- a/Timeline/modal.php +++ b/Timeline/modal.php @@ -34,7 +34,7 @@ echo '</div>'; echo '<div class="tab-pane" id="add-comment">'; echo '<form action="#" method="post" class="form-horizontal" id="commentForm" role="form">'; echo '<div class="form-group">'; -echo '<label for="email" class="col-sm-2 control-label">Commentaire</label>'; +echo '<label for="addComment" class="col-sm-2 control-label">Commentaire</label>'; echo '<div class="col-sm-10">'; echo '<textarea class="form-control" name="addComment" id="addComment" rows="5"></textarea>'; echo '</div>'; @@ -42,6 +42,8 @@ echo '</div>'; echo '<div class="form-group">'; echo '<div class="col-sm-offset-2 col-sm-10">'; echo '<button class="btn btn-success btn-circle text-uppercase" type="submit" id="submitComment"><span class="glyphicon glyphicon-send"></span>Envoyer</button>'; +echo '<span class="errors" id="formerror"></span>'; +echo '<span class="correct" id="formcorrect"></span>'; echo '</div>'; echo '</div>'; echo '</form>'; @@ -59,9 +61,9 @@ echo '</div>'; echo '</div>'; echo '<div class="modal-footer">'; -echo '<button class="btn btn-primary vote" data-toggle="tooltip" title="Vote pour la photo la plus trash">Trash<span class="badge">15</span></button>'; -echo '<button class="btn btn-primary vote" data-toggle="tooltip" title="Vote pour la photo où ça pécho sec">Love<span class="badge">15</span></button>'; -echo '<button class="btn btn-primary vote" data-toggle="tooltip" title="Photo de toute beauté">Like<span class="badge">15</span></button>'; +echo '<button class="btn btn-primary vote" data-toggle="tooltip" title="Vote pour la photo la plus trash">Trash<span class="badge trash">0</span></button>'; +echo '<button class="btn btn-primary vote" data-toggle="tooltip" title="Vote pour la photo où ça pécho sec">Love<span class="badge love">0</span></button>'; +echo '<button class="btn btn-primary vote" data-toggle="tooltip" title="Photo de toute beauté">Like<span class="badge like">0</span></button>'; echo '</div>'; echo '</div>'; diff --git a/Timeline/monprofil.php b/Timeline/monprofil.php index 053b17d3e060a26ae6b620498fb1c5f11d52b7af..eab7848a1dd36322fa8b99c2fd95f04156944371 100755 --- a/Timeline/monprofil.php +++ b/Timeline/monprofil.php @@ -2,6 +2,35 @@ session_start(); + $id=$_SESSION['login']; + + function quoteUser($db, $id) { + + /* On ne prépare pas la requête car l'id est déjà safe */ + + $stmt = $db->query("SELECT quote FROM utilisateur WHERE identifiant='$id'"); + $stmt->setFetchMode(PDO::FETCH_OBJ); + $stmt = $stmt->fetch(); + return $stmt->quote; + + } + + try + { + + /* Connexion à la base de données avec PDO */ + + $DB = new PDO("pgsql:host=localhost;dbname=projet_web", "postgres", "root"); + + $quote = quoteUser($DB, $id); + + $DB = null; + + } + catch(PDOException $e){ + echo "Database Error"; + } + ?> <!DOCTYPE html > @@ -51,7 +80,7 @@ <div class="form-group"> <label class="control-label col-sm-3" for="surnom" > Modifier mon surnom : </label> <div class="col-sm-5"> - <input type="text" class="form-control" id="surnom" /> + <input type="text" class="form-control" id="surnom" placeholder="<?php echo $surnom; ?>" /> </div> <div class="col-sm-4 errors" id="surerror"></div> </div> @@ -60,7 +89,7 @@ <div class="form-group"> <label class="control-label col-sm-3" for="quote" class >Modifier ma quote : </label> <div class="col-sm-5"> - <textarea class="form-control" id="quote"></textarea> + <textarea class="form-control" id="quote" placeholder="<?php echo $quote; ?>"></textarea> </div> <div class="col-sm-4 errors" id="quoteerror"></div> </div> diff --git a/Timeline/script_add_concours.php b/Timeline/script_add_concours.php old mode 100644 new mode 100755 diff --git a/Timeline/script_modal.php b/Timeline/script_modal.php index 920456291e09b1fd08afaf6d33e4bb6664af2650..37b281c1ab04962440fff6a7b87df1f1542198ba 100755 --- a/Timeline/script_modal.php +++ b/Timeline/script_modal.php @@ -14,6 +14,29 @@ return $result; } + function getLike($db,$idphoto) { + $stmt = $db->query("SELECT nblike FROM photo WHERE idphoto='$idphoto'"); + $stmt->setFetchMode(PDO::FETCH_NUM); + $result = $stmt->fetchAll(); + return $result; + } + + function concoursEncours($db, $nameConcours, $idsoiree) { + $stmt = $db->prepare("SELECT winner, encours, idconcours FROM concours WHERE nom=:nom AND idsoiree='$idsoiree'"); + $stmt->bindParam(':nom', $nameConcours); + $stmt->execute(); + $stmt->setFetchMode(PDO::FETCH_NUM); + $result = $stmt->fetchAll(); + return $result; + } + + function getVote($db, $idphoto, $idconcours, $idsoiree) { + $stmt = $db->query("SELECT compteur.nbre_votes FROM compteur WHERE idconcours='$idconcours' AND idphoto='$idphoto'"); + $stmt->setFetchMode(PDO::FETCH_NUM); + $result = $stmt->fetchAll(); + return $result; + } + try{ /* Connexion à la base de données avec PDO */ @@ -21,7 +44,27 @@ $DB = new PDO("pgsql:host=localhost;dbname=projet_web", "postgres", "root"); $commentaires = getComment($DB, $idphoto); - + $nblike = getLike($DB, $idphoto); + + $trashActu = concoursEncours($DB, "Trash", $idsoiree); + $loveActu = concoursEncours($DB, "Love", $idsoiree); + + if (($trashActu[0][0] == 0) && ($trashActu[0][1]) ) + { + $voteTrash = getVote($DB, $idphoto, $trashActu[0][2], $idsoiree); + if($voteTrash) + { + $trashResult = $voteTrash; + } + else + { + $trashResult = 0; + } + } + else + { + $trashResult = -1; + } $DB = null; } @@ -31,7 +74,7 @@ } - $array = array($commentaires); + $array = array($commentaires, $nblike, $trashResult); echo json_encode($array); diff --git a/Timeline/start1.php b/Timeline/start1.php deleted file mode 100755 index 8e45728b435e2f18a7be40feed16188777a14d3f..0000000000000000000000000000000000000000 --- a/Timeline/start1.php +++ /dev/null @@ -1,69 +0,0 @@ -<!DOCTYPE html > -<html lang="fr"> - <head> - <meta charset="utf-8"/> - <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" /> - - <!-- icone du titre de la page --> - <link rel="shortcut icon" href="fonts/icone2.jpg"> - - - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="css/bootstrap.css"> - <link href="css/start1.css" rel="stylesheet"> - - - - <!-- jquery --> - <script src="jquery_library.js"></script> - - <!-- Latest compiled and minified JavaScript --> - <script src="js/bootstrap.js"></script> - - <!-- fichier css perso --> - <link rel="stylesheet" href="css/index.css"> - - <!-- fichier JS validation formulaire --> - <script src="js/validate.js"></script> - - <style> -body{ -margin:0; -padding:0; -background: url('fonts/photo1.jpg') no-repeat center fixed; // changer la photo du fond qui s'adapte à la taille de l'écran --webkit-background-size: cover; /* pour Chrome et Safari */ --moz-background-size: cover; /* pour Firefox */ --o-background-size: cover; /* pour Opera */ -background-size: cover; /* version standardisée */ -} -</style> - -</head> -<body > - -<div class="start1"> -<div class="container-fluid "> - <div class="tab-content " > - <form id="co" class="col-md-offset-4 col-md-4" role="form"> - <div class="form-group "> - <div class="thumbnail "> - - <h4><center><FONT face="Segoe Script"> Bienvenue sur TimeLine</FONT></center></h4> - <p><center><FONT face="Segoe Script">"Cheese, clic & share."</FONT></center></p> - <img alt="logo" src="fonts/logo.png"/> - <button class="btn btn-primary btn-block btn-md" type="submit" name="Connexion"><a href="connexion.php">Se connecter</button> - <button class="btn btn-success btn-block btn-md" type="submit" name="Inscription"><a href="inscription.php">Inscription</a></button> - - </div> - </div> - </form> - -</div> -</div> -</div> -</body> -</html> \ No newline at end of file diff --git a/Timeline/start2.php b/Timeline/start2.php deleted file mode 100755 index ddc56f6631686551de156b8de375a22e7b5c14a6..0000000000000000000000000000000000000000 --- a/Timeline/start2.php +++ /dev/null @@ -1,61 +0,0 @@ -<!DOCTYPE html> -<html lang="fr"> - <head> -<meta charset="utf-8"/> - <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" /> - - <!-- icone du titre de la page --> - <link rel="shortcut icon" href="fonts/icone2.jpg"> - - - <!-- Latest compiled and minified CSS --> - <link rel="stylesheet" href="css/bootstrap.css"> - <link href="css/docs.css" rel="stylesheet"> - - - <!-- jquery --> - <script src="jquery_library.js"></script> - - <!-- Latest compiled and minified JavaScript --> - <script src="js/bootstrap.js"></script> - - <!-- fichier css perso --> - <link rel="stylesheet" href="css/index.css"> - - <!-- fichier JS validation formulaire --> - <script src="js/validate.js"></script> - - </head> - - <body data-spy="scroll" data-target=".bs-docs-sidebar"> - - -<!-- ================================================== --> - - -<div class="jumbotron masthead"> - <div class="container-fluid"> - - <div class="tab-content "> - <form id="co" class="col-md-offset-4 col-md-4 " role="form"> - - <div class="form-group "> - <div class="thumbnail "> - <h4><center><FONT face="Segoe Script"> Bienvenue sur TimeLine</FONT></center></h4> - <p><center><FONT face="Segoe Script">"Cheese, clic & share."</FONT></center></p> - <img alt="logo" src="fonts/logo.png"/> - <button class="btn btn-primary btn-block btn-sm" type="submit" name="Connexion"><a href="connexion.php">Se connecter</a></button> - <button class="btn btn-success btn-block btn-sm" type="submit" name="Inscription"><a href="inscription.php">Inscription</a></button> - </div> - </div> - </form> - </div> - - </div> -</div> -</body> -</html> \ No newline at end of file diff --git a/Timeline/test.php b/Timeline/test.php deleted file mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000