Blame view

news.php 1.28 KB
02337ae1   Erwan Nanrocki   correction pour l...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <form class="form-horizontal" role="form">
  
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <div class="checkbox">
          <label>
            <input type="checkbox"> TEST
          </label>
        </div>
      </div>
    </div>
  
  </form>
  
bad01aa4   kevin   modification dans...
15
  <?php 
db8bf362   kevin   modif sur news.php
16
  	require_once("creds.php");
42f1792e   Jean Wasilewski   Credentials fixed
17
  	$link = mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__)
bad01aa4   kevin   modification dans...
18
  		or die("Impossible de se connecter : " . mysql_error());
1d10adb8   kevin   News.php modif Kevin
19
  	
bad01aa4   kevin   modification dans...
20
  	
db8bf362   kevin   modif sur news.php
21
  	if(!mysql_select_db('crep', $link)){
6c6296ae   kevin   modif news.php kevin
22
  		echo 'Selection de la base de donnees impossible';
db8bf362   kevin   modif sur news.php
23
24
25
  		exit;
  	}
  	
ce5e6320   kevin   News.php modif Kevin
26
  	$requete = "select title, content, users.realname as userName from news, users where news.fk_author=users.pk;";
bad01aa4   kevin   modification dans...
27
28
29
30
  	$resultat = mysql_query($requete);
  	
  	//Pour debugger
  	if (!$resultat) {
6c6296ae   kevin   modif news.php kevin
31
32
  		$message  = 'Requete invalide : ' . mysql_error() . "\n";
  		$message .= 'Requete complete : ' . $query;
bad01aa4   kevin   modification dans...
33
34
35
36
  		die($message);
  	}
  	
  	while ($row = mysql_fetch_assoc($resultat)) {
db8bf362   kevin   modif sur news.php
37
38
39
40
41
42
43
44
45
46
  		echo '<div class="panel panel-default">';
  		echo '<div class="panel-heading">';
  		echo '<h3 class="panel-title">'.$row['title'].'</h3>';
  		echo '</div>';
  		echo '<div class="panel-body">';
  		echo '<p>'.$row['content'].'</p>';
  		echo '</div>';
  		echo '<div class="panel-footer">';
  		echo '<p>'.$row['userName'].'</p>';
  		echo '</div></div>';
bad01aa4   kevin   modification dans...
47
48
  	}
  	
1d10adb8   kevin   News.php modif Kevin
49
  	//On libere l'espace de resultat
bad01aa4   kevin   modification dans...
50
51
  	mysql_close($link);
  ?>
db8bf362   kevin   modif sur news.php