diff --git a/Timeline/TODO.txt b/Timeline/TODO.txt index 0968c6b8ab6de5911b925167c6d29ec073dc7cf9..f08cc14bc3ef188c5957cf2ff4ae15576b2ffe46 100755 --- a/Timeline/TODO.txt +++ b/Timeline/TODO.txt @@ -14,6 +14,7 @@ DONE : - plugin timeline DONE - sécurité des mots de passe -> tout est modifié DONE - mail anouar DONE +- click photo utilisateur -> affichage profil Refonte CSS : - page gestion admin : mettre des boutons @@ -22,9 +23,8 @@ Refonte CSS : TO DO : -- click photo utilisateur -> affichage profil - ses wins -- ses machins blabla + - replacer mon profil les champs quote et surnom par l'actuel TO DO LATER : @@ -38,12 +38,6 @@ TO DO LATER : - changer nom / logo ? -TO CHECK - -- Mes wins, mes identifications - -- mes identifications -- mes wins Base de données AJOUT DE CONTENU POUR TEST : - verifier si le script correspond OK diff --git a/Timeline/css/docs.css b/Timeline/css/docs.css old mode 100644 new mode 100755 diff --git a/Timeline/start1.php b/Timeline/start1.php new file mode 100755 index 0000000000000000000000000000000000000000..36e2afaf0f64f14acb588d153e4d3fa3e1142e6f --- /dev/null +++ b/Timeline/start1.php @@ -0,0 +1,65 @@ +<!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"> + + <!-- 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"> + + <!-- 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="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><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</a></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> +</body> +</html> \ No newline at end of file diff --git a/Timeline/start2.php b/Timeline/start2.php new file mode 100755 index 0000000000000000000000000000000000000000..4460a74f93a6e6ee46b81a7f69d54a7a21058ff7 --- /dev/null +++ b/Timeline/start2.php @@ -0,0 +1,59 @@ +<!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/view_profil_ident.php b/Timeline/view_profil_ident.php index f2ee5471ac0d570793bc65d5038c5cdcb287e9d8..0169400354e2388380e71bea28089a13bc49c93d 100755 --- a/Timeline/view_profil_ident.php +++ b/Timeline/view_profil_ident.php @@ -114,7 +114,7 @@ if(isset($_GET['identifiant'])) <?php include 'header.php'; ?> - <h3 class="page-header">Posts de <?php echo $surUser; ?></h3> + <h3 class="page-header">Identifications de <?php echo $surUser; ?></h3> <?php if($tabPhotos) diff --git a/Timeline/view_profil_post.php b/Timeline/view_profil_post.php index 30eeb9dafdf7a301e1fd0306a083a8d52279148d..278aaa73fec0db558c5f53f1cbe74a353088b2a4 100755 --- a/Timeline/view_profil_post.php +++ b/Timeline/view_profil_post.php @@ -60,7 +60,7 @@ if(isset($_GET['identifiant'])) else { $tabPhotos = getPhotosSesPosts($DB, $idprofil); - $surnom = surnomUser($DB, $idprofil); + $surUser = surnomUser($DB, $idprofil); } } @@ -115,7 +115,7 @@ if(isset($_GET['identifiant'])) <?php include 'header.php'; ?> - <h3 class="page-header">Posts de <?php echo $surnom; ?></h3> + <h3 class="page-header">Posts de <?php echo $surUser; ?></h3> <?php if($tabPhotos) diff --git a/Timeline/view_profil_wins.php b/Timeline/view_profil_wins.php index 1e180ca30e6db7e41de3acf1c2613f0150e97c58..d43918db6d4bf18e913e36c88211b6f54a0ac172 100755 --- a/Timeline/view_profil_wins.php +++ b/Timeline/view_profil_wins.php @@ -2,6 +2,79 @@ session_start(); +include 'carousel.php'; + +$id = $_SESSION['login']; + +function checkIdentifiantUser($db,$id){ + + /* On prépare la requête pour éviter les injections SQL */ + + $stmt = $db->prepare("SELECT COUNT(*) FROM utilisateur WHERE identifiant=:id"); + $stmt->bindParam(':id', $id); + $stmt->execute(); + return $stmt->fetchColumn(); +} + +function surnomUser($db, $idprofil) { + + $stmt = $db->prepare("SELECT surnom FROM utilisateur WHERE identifiant=:id"); + $stmt->bindParam(':id', $idprofil); + $stmt->setFetchMode(PDO::FETCH_OBJ); + $stmt->execute(); + $stmt = $stmt->fetch(); + return $stmt->surnom; + +} + +function getPhotosSesWins($db, $idprofil) { + + $stmt = $db->prepare("SELECT soiree.annee, soiree.name, photo.idphoto, photo.extension, photo.composteur, concours.nom, soiree.idsoiree, soiree.theme, compteur.nbre_votes FROM concours + INNER JOIN soiree ON concours.idsoiree = soiree.idsoiree + INNER JOIN photo ON photo.idphoto = concours.winner + INNER JOIN compteur ON concours.idconcours = compteur.idconcours AND photo.idphoto = compteur.idphoto + WHERE photo.idposteur=:id AND NOT encours"); + $stmt->bindParam(':id', $idprofil); + $stmt->execute(); + $stmt->setFetchMode(PDO::FETCH_NUM); + $result = $stmt->fetchAll(); + return $result; +} + +if(isset($_GET['identifiant'])) +{ + /* On vérifie que l'identifiant existe avec une requete préparée sinon page d'acceuil logout */ + + $idprofil = $_GET['identifiant']; + + try{ + + $DB = new PDO("pgsql:host=localhost;dbname=projet_web", "postgres", "root"); + + if(checkIdentifiantUser($DB,$idprofil) == 1) + { + + if($id == $idprofil) + { + + header('location: mes_wins.php'); + } + else + { + $tabPhotos = getPhotosSesWins($DB, $idprofil); + $surUser = surnomUser($DB, $idprofil); + } + + } + $DB = null; + + } + + catch(PDOException $e){ + echo "Database Error"; + } + +} ?> @@ -28,11 +101,37 @@ session_start(); <script src="js/bootstrap.js"></script> + <!-- Js carousel --> + <script src="js/carousel.js"></script> + <script type="text/javascript" src="js/modal.js"></script> + + <!-- fichier css perso --> <link rel="stylesheet" href="css/menu.css"> - <link rel="stylesheet" href="css/view_profil_wins.css"> + <link rel="stylesheet" href="css/mes_posts.css"> + <link rel="stylesheet" type="text/css" href="css/modal.css"> + </head> <body> - <?php include 'header.php'; ?> \ No newline at end of file + <?php include 'header.php'; ?> + + <h3 class="page-header">Wins de <?php echo $surUser; ?></h3> + + <?php + if($tabPhotos) + { + carousel($tabPhotos,2); + } + else + { + echo "<div class='container-fluid'>"; + echo "<p class='nothing'>Cette tanche n'a encore rien gagné !<p>"; + echo '</div>'; + } + ?> + + <?php include 'modal.php'; ?> + + <?php include 'footer.php'; ?> \ No newline at end of file