From 7b83a3f3a10ab4a306e8414ce861d403063e29ef Mon Sep 17 00:00:00 2001
From: Julie Choquet <julie.choquet@ensiie.fr>
Date: Mon, 9 May 2016 00:56:05 +0200
Subject: [PATCH] =?UTF-8?q?ajout=20des=20pages=20pas=20encore=20cod=C3=A9e?=
 =?UTF-8?q?s..?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Timeline/admin_add_concours.php  | 63 ++++++--------------------------
 Timeline/admin_stop_concours.php | 53 +++++++++++++++++++++++++++
 Timeline/concours.php            | 42 +++++++++++++++++++++
 Timeline/script_modal.php        | 37 +------------------
 4 files changed, 107 insertions(+), 88 deletions(-)
 create mode 100755 Timeline/admin_stop_concours.php
 create mode 100755 Timeline/concours.php

diff --git a/Timeline/admin_add_concours.php b/Timeline/admin_add_concours.php
index 3952a14..9eaf754 100755
--- a/Timeline/admin_add_concours.php
+++ b/Timeline/admin_add_concours.php
@@ -19,13 +19,13 @@
   <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" />
+    <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" />
      
 	 <!-- jquery -->
 	 <script src="js/jquery_library.js"></script>
@@ -33,14 +33,11 @@
 	 <!-- Latest compiled and minified JavaScript -->
 	 <script src="js/bootstrap.js"></script>
 
-	 <!-- JS validation formulaire -->
-	 <script src="js/validate_add_concours.js"></script>
-
-   	 <!-- Latest compiled and minified CSS -->
-   	 <link rel="stylesheet" href="css/bootstrap.css">
+   <!-- Latest compiled and minified CSS -->
+   	<link rel="stylesheet" href="css/bootstrap.css">
 	 <!-- fichier css menu -->
 	 <link rel="stylesheet" href="css/menu.css">
-	 <link rel="stylesheet" href="css/admin_add_soiree.css">
+	 <link rel="stylesheet" href="css/acceuil.css">
 
 </head>
 
@@ -49,46 +46,8 @@
 
  <?php include 'header.php'; ?>
 
-	 	<h3 class="page-header"> Gestion administrateur - Ajout d'un concours</h3>
-
-	 	<div id="addSoiree" class="form-horizontal" >
-
-			<div class="form-group">
-		        <label class="control-label col-sm-3" for="nom" > nom : </label>
-		            <div class="col-sm-5">
-		   				<input class="form-control" id="nom" type="text" name="nom"  />
-        			</div>
-        			<div class="col-sm-4 errors" id="nomerror"></div> 
-		   </div>
-
-
-		   <div class="form-group">
-		        <label class="control-label col-sm-3" for="description" > Description : </label>
-		            <div class="col-sm-5">
-		   				<textarea class="form-control" id="description" name="description"  ></textarea>
-        			</div>
-        			<div class="col-sm-4 errors" id="descrierror"></div> 
-		   </div>
-
-		   <div class="form-group">
-		        <label class="control-label col-sm-3" for="mdp" > Mot de passe : </label>
-		            <div class="col-sm-5">
-		   				<input type="password" class="form-control" id="mdp" name="mdp" />
-        			</div>
-        			<div class="col-sm-4 errors" id="mdperror"></div> 
-		   </div>
-		   
-		    <div class="form-group">
-		      <div class="col-sm-offset-3 col-sm-5">          
-		        <button class="btn btn-default btn-block" type="submit" id="submit" name="submit">Ajouter</button>
-		        <span class="errors" id="formerror"></span>
-        		<span class="correct" id="formcorrect"></span>
-		      </div>
-		    </div>
-
-		</div>
-
-
-   
-
- <?php include 'footer.php'; ?>
\ No newline at end of file
+	 	<h3 class="page-header">Gestion administrateur - Début d'un concours</h3>
+
+    		Indisponible pour le moment !
+
+ <?php include 'footer.php'; ?>
diff --git a/Timeline/admin_stop_concours.php b/Timeline/admin_stop_concours.php
new file mode 100755
index 0000000..f6910c2
--- /dev/null
+++ b/Timeline/admin_stop_concours.php
@@ -0,0 +1,53 @@
+<?php
+  session_start();
+
+  /* On traite le cas où user lambda accède à la partie admin */
+
+  $id=$_SESSION['login'];
+
+  if($id != "administrat")
+  {
+  	header('location: connexion.php');
+  }
+
+  
+
+?>
+
+<!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 -->
+    <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" />
+     
+	 <!-- 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">
+	 <!-- fichier css menu -->
+	 <link rel="stylesheet" href="css/menu.css">
+	 <link rel="stylesheet" href="css/acceuil.css">
+
+</head>
+
+<html>
+<body>
+
+ <?php include 'header.php'; ?>
+
+	 	<h3 class="page-header">Gestion administrateur - Fin d'un concours</h3>
+
+    		Indisponible pour le moment !
+
+ <?php include 'footer.php'; ?>
diff --git a/Timeline/concours.php b/Timeline/concours.php
new file mode 100755
index 0000000..912cf73
--- /dev/null
+++ b/Timeline/concours.php
@@ -0,0 +1,42 @@
+<?php
+  session_start();
+
+?>
+
+<!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 -->
+    <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" />
+     
+	 <!-- 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">
+	 <!-- fichier css menu -->
+	 <link rel="stylesheet" href="css/menu.css">
+
+
+</head>
+
+<html>
+<body>
+
+ <?php include 'header.php'; ?>
+
+	 	<h3 class="page-header"> Concours </h3>
+
+    Indisponible pour le moment !
+
+ <?php include 'footer.php'; ?>
diff --git a/Timeline/script_modal.php b/Timeline/script_modal.php
index 37b281c..5dd689e 100755
--- a/Timeline/script_modal.php
+++ b/Timeline/script_modal.php
@@ -21,22 +21,6 @@
 		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 */
@@ -46,25 +30,6 @@
        $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;
 
     }
@@ -74,7 +39,7 @@
     }
 
 
-	$array = array($commentaires, $nblike, $trashResult);
+	$array = array($commentaires, $nblike);
 
 	echo json_encode($array);
 
-- 
GitLab