diff --git a/Timeline/.~lock.TODO.txt# b/Timeline/.~lock.TODO.txt# new file mode 100755 index 0000000000000000000000000000000000000000..baf31062c00cb01a04714f85e8b463886991126c --- /dev/null +++ b/Timeline/.~lock.TODO.txt# @@ -0,0 +1 @@ +,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_click_profil.php b/Timeline/carousel_click_profil.php old mode 100644 new mode 100755 diff --git a/Timeline/click_profil.php b/Timeline/click_profil.php old mode 100644 new mode 100755 diff --git a/Timeline/css/view_profil.css b/Timeline/css/view_profil.css new file mode 100755 index 0000000000000000000000000000000000000000..50bb793fcaaeb4e8c891ebd8c9747a1ab5830bf9 --- /dev/null +++ b/Timeline/css/view_profil.css @@ -0,0 +1,26 @@ +ul { + list-style-type:none; +} + +#infos { + margin-top : 5%; +} +#infos li{ + padding :10px; +} + +#infos li .etiquette{ + font-weight :bold; + padding-right:3px; +} + +#nav_photos li .glyphicon{ + padding-right: 15px; + padding-bottom: 20px; +} + +#nav_photos li { + font-size : 1.2em; + font-weight: bold; +} + diff --git a/Timeline/js/modal.js b/Timeline/js/modal.js index 1160b991725f290ac67c53795d5539456a243e2d..5bb45d3d8bc2e716ff5c2e88ebc6e55fa37e5da1 100755 --- a/Timeline/js/modal.js +++ b/Timeline/js/modal.js @@ -43,7 +43,7 @@ $(document).ready(function (){ var identifiant = com[5]; var ext = com[6]; - var photo = '<a class="pull-left" href="#"><img class="media-object" src="users/avatar/'+identifiant+'.'+ext+'" alt="profile"></a>'; + var photo = '<a class="pull-left" href="view_profil.php?identifiant='+identifiant+'"><img class="media-object" src="users/avatar/'+identifiant+'.'+ext+'" alt="profile"></a>'; var titre = '<h4 class="media-heading text-uppercase reviews">'+surnom+'</h4><p class="media-date text-uppercase reviews ">'; var date = date_post+' '+heure_post2+'</p>'; var printContenu ='<p class="media-comment">'+contenu+'</p>'; diff --git a/Timeline/test.php b/Timeline/test.php new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Timeline/view_profil.php b/Timeline/view_profil.php new file mode 100755 index 0000000000000000000000000000000000000000..c1b39fe1b6e3c15e0338dfae8e91e71a9ee5f5cd --- /dev/null +++ b/Timeline/view_profil.php @@ -0,0 +1,119 @@ +<?php + +session_start(); + +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 getInfosUser($db, $id) { + + $stmt = $db->prepare("SELECT avatar, nom, prenom, surnom, promo, quote FROM utilisateur WHERE identifiant='$id'"); + $stmt->bindParam(':id', $id); + $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) + { + + $infos = getInfosUser($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/view_profil.css"> + </head> + +<body> + + <?php include 'header.php'; ?> + + <div class="container-fluid"> + <div class="row"> + <div class="col-xs-12 col-sm-6 col-lg-4"> + <div class="thumbnail"> + <img src="users/avatar/<?php echo $idprofil.".".$infos[0][0]; ?>" alt='avatar' > + </div> + </div> + <div class="col-xs-12 col-sm-6 col-lg-4" id="infos"> + <ul> + <li><span class="etiquette">Nom :</span><?php echo $infos[0][1]; ?></li> + <li><span class="etiquette">Prénom :</span><?php echo $infos[0][2]; ?></li> + <li><span class="etiquette">Surnom :</span><?php echo $infos[0][3]; ?></li> + <li><span class="etiquette">Promo :</span><?php echo $infos[0][4]; ?></li> + </ul> + </div> + <blockquote class="col-xs-12" id="quote_block"> + <?php echo $infos[0][5]; ?> + </blockquote> + + </div> + + <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> + </ul> + </div> + </div> + + </div> + + <?php include 'footer.php'; ?> \ No newline at end of file