Skip to content
Extraits de code Groupes Projets
Valider 284aad51 rédigé par Julie Choquet's avatar Julie Choquet
Parcourir les fichiers

voir les wins d'un autre user ok

parent 7df0c6d8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -14,6 +14,7 @@ DONE : ...@@ -14,6 +14,7 @@ DONE :
- plugin timeline DONE - plugin timeline DONE
- sécurité des mots de passe -> tout est modifié DONE - sécurité des mots de passe -> tout est modifié DONE
- mail anouar DONE - mail anouar DONE
- click photo utilisateur -> affichage profil
Refonte CSS : Refonte CSS :
- page gestion admin : mettre des boutons - page gestion admin : mettre des boutons
...@@ -22,9 +23,8 @@ Refonte CSS : ...@@ -22,9 +23,8 @@ Refonte CSS :
TO DO : TO DO :
- click photo utilisateur -> affichage profil
- ses wins - ses wins
- ses machins blabla
- replacer mon profil les champs quote et surnom par l'actuel - replacer mon profil les champs quote et surnom par l'actuel
TO DO LATER : TO DO LATER :
...@@ -38,12 +38,6 @@ TO DO LATER : ...@@ -38,12 +38,6 @@ TO DO LATER :
- changer nom / logo ? - changer nom / logo ?
TO CHECK
- Mes wins, mes identifications
- mes identifications
- mes wins
Base de données AJOUT DE CONTENU POUR TEST : Base de données AJOUT DE CONTENU POUR TEST :
- verifier si le script correspond OK - verifier si le script correspond OK
......
Le mode du fichier est passé de 100644 à 100755
<!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
<!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
...@@ -114,7 +114,7 @@ if(isset($_GET['identifiant'])) ...@@ -114,7 +114,7 @@ if(isset($_GET['identifiant']))
<?php include 'header.php'; ?> <?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 <?php
if($tabPhotos) if($tabPhotos)
......
...@@ -60,7 +60,7 @@ if(isset($_GET['identifiant'])) ...@@ -60,7 +60,7 @@ if(isset($_GET['identifiant']))
else else
{ {
$tabPhotos = getPhotosSesPosts($DB, $idprofil); $tabPhotos = getPhotosSesPosts($DB, $idprofil);
$surnom = surnomUser($DB, $idprofil); $surUser = surnomUser($DB, $idprofil);
} }
} }
...@@ -115,7 +115,7 @@ if(isset($_GET['identifiant'])) ...@@ -115,7 +115,7 @@ if(isset($_GET['identifiant']))
<?php include 'header.php'; ?> <?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 <?php
if($tabPhotos) if($tabPhotos)
......
...@@ -2,6 +2,79 @@ ...@@ -2,6 +2,79 @@
session_start(); 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(); ...@@ -28,11 +101,37 @@ session_start();
<script src="js/bootstrap.js"></script> <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 --> <!-- fichier css perso -->
<link rel="stylesheet" href="css/menu.css"> <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> </head>
<body> <body>
<?php include 'header.php'; ?> <?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
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter