Commit 84d64673655862a144769d4331c8e26e95bf1158

Authored by henyxia
1 parent 9f36a4bc

New home screen

Showing 2 changed files with 1 additions and 48 deletions   Show diff stats
index.php
... ... @@ -25,7 +25,7 @@ require_once("creds.php");
25 25 <?php require_once("menu.php");?>
26 26 <div class="col-md-12 center-block">
27 27 <div class="col-md-12" id="mainContainer">
28   -<?php require_once("news.php");?>
  28 +<?php require_once("home.php");?>
29 29 </div>
30 30 </div>
31 31 </body>
... ...
news.php deleted
... ... @@ -1,47 +0,0 @@
1   -<?php
2   -require_once("creds.php");
3   -
4   -echo "<h2> News ";
5   -if(isset($_SESSION["admin"])&&$_SESSION["admin"])
6   - echo '<h3><button type="button" class="btn btn-primary" onClick="addNews();"><span class="glyphicon glyphicon-plus"></span> Nouvel article</button></h3>';
7   -echo "</h2>";
8   -
9   -$link = mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__)
10   - or die("Impossible de se connecter : " . mysql_error());
11   -
12   -
13   -if(!mysql_select_db('crep', $link)){
14   - echo 'Selection de la base de donnees impossible';
15   - exit;
16   -}
17   -mysql_query("SET NAMES 'utf8'");
18   -$requete = "select news.pk as pk, DATE_FORMAT(created,'%e-%m-%Y') AS created, title, content, users.realname as userName from news, users where news.fk_author=users.pk;";
19   -$resultat = mysql_query($requete);
20   -
21   -//Pour debugger
22   -if (!$resultat) {
23   - $message = 'Requete invalide : ' . mysql_error() . "\n";
24   - $message .= 'Requete complete : ' . $query;
25   - die($message);
26   -}
27   -
28   -while ($row = mysql_fetch_assoc($resultat)) {
29   - echo '<div class="panel panel-default">';
30   - echo '<div class="panel-heading">';
31   - echo '<h3 class="panel-title">'.$row['title'];
32   - if(isset($_SESSION["admin"])&&$_SESSION["admin"])
33   - echo ' <a href="#" onclick="editNews('.$row["pk"].')" class="glyphicon glyphicon-pencil"></a>';
34   - echo '</h3>';
35   - echo '</div>';
36   - echo '<div class="panel-body">';
37   - echo '<p>'.$row['content'].'</p>';
38   - echo '</div>';
39   - echo '<div class="panel-footer">';
40   - echo '<p>'.$row['userName'].', le '.$row['created'].'</p>';
41   - echo '</div></div>';
42   -}
43   -
44   -//On libere l'espace de resultat
45   -mysql_close($link);
46   -?>
47   -