-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththread.php
184 lines (147 loc) · 7.6 KB
/
thread.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Sujet</title>
<meta name="generator" content="Bootply" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="css/styles.css" rel="stylesheet">
</head>
<?php
session_start();
// $monid = $_SESSION['monid'];
//$cnx = mysql_connect ("127.0.0.1","root","") or die("Impossible de se connecter");
$cnx = mysql_connect ("localhost","root","") or die("Impossible de se connecter");
$db = "parlamenthon";
mysql_select_db($db,$cnx) or die("Impossible d'ouvrir la base");
?>
<body>
<div class="wrapper">
<div class="box">
<div class="row">
<!-- sidebar -->
<div class="column col-sm-3" id="sidebar">
<h2 style="color:white;">DirectDéputés</h2>
<ul class="nav">
<li><a href="#Message"><i class="glyphicon glyphicon-envelope"></i> Messages</a></li>
<li><a href="#Profile"><i class="glyphicon glyphicon-user"></i> Profile</a></li>
</ul>
<ul class="nav">
<li><a href="#Depute"><i class="glyphicon glyphicon-th-list"></i> List des deputés</a></li>
<li><a href="dashboard.php"><i class="glyphicon glyphicon-inbox"></i> Sujets</a></li>
</ul>
</div>
<!-- /sidebar -->
<!-- main -->
<div class="column col-sm-9" id="main">
<div class="padding">
<div class="full col-sm-9">
<!-- content -->
<div class="col-sm-12" id="featured">
<div class="page-header text-muted">
Aperçu du sujet
</div>
</div>
<?php
$id_sub=$_GET['id'];
$req2="select u.nom from users u,sujets s where u.id_user=s.usr";
$result2=mysql_query($req2);
while($data2 = mysql_fetch_array($result2))
{
//echo"<br>";
$nom=$data2['nom'];
//echo $data2['nom'];
}
$req="select * from sujets where id_sujet like '$id_sub'";
$result=mysql_query($req);
while($data = mysql_fetch_array($result))
{
//echo"";
$titre = $data['titre'];
//echo $data['titre'];
//echo"<br>";
$date = $data['dateC'];
//echo $data['dateC'];
//echo"<br>";
$votep = $data['votep'];
//echo $data['votep'];
//echo"<br>";
$votem = $data['votem'];
$contenu = $data['contenue'];
//echo $data['votem'];
echo "<!--/stories-->
<div class='row' style='height: 20%;''>
<div class='col-sm-10'>
<h3>".$titre."</h3>
<small class='text-muted'>".$date."</small><br>
<div class='col-sm-2' style='float:right;'>
<a href='suvotep.php?id=".$id_sub."'>
".$votep." <span class='glyphicon glyphicon-thumbs-up' style='display:inline;'></span></a>
<a href='suvotem.php?id=".$id_sub."'>
".$votem." <span class='glyphicon glyphicon-thumbs-down' style='display:inline;float:right;'></span></a>
</div>
</div>
<div class='col-sm-2'>
<a href='' class='pull-right' style='margin: 20px;'><img src='http://api.randomuser.me/portraits/thumb/men/86.jpg' class='img-circle'></a>
</div>
</div>";
echo "<div class='col-lg-12'>
<div class='well bs-component'>
<p>".$contenu."</p>
</div>
</div>";
}
?>
<div class="col-sm-12" id="featured">
<div class="page-header text-muted">
Les commentaires
</div>
</div>
<?php
$req_com="select * from commentaires where subj like '$id_sub'";
$result_com=mysql_query($req_com);
while($data_com = mysql_fetch_array($result_com))
{
echo "
<!--Commentaire-->
<div class='col-lg-12'>
<div class='panel panel-default'>
<div class='panel-heading'> User ".$data_com['usr']."
<div class='col-sm-2' style='float:right;'>
<span class='glyphicon glyphicon-thumbs-up' style='display:inline;'></span>
<span class='glyphicon glyphicon-thumbs-down' style='display:inline;float:right;'></span>
</div>
</div>
<div class='panel-body'> Commentaire : ".$data_com['contenue']."
</div>
</div>
</div>";
}
?>
<div class="col-lg-12">
<div class="form-group">
<input class="form-control input-lg" id="inputLarge" type="text" placeholder="Laissez un commentaire..">
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button type="submit" class="btn btn-primary" style="float:right;">Commenter</button><br><br>
</div>
</div>
</div>
</div><!-- /col-9 -->
</div><!-- /padding -->
</div>
<!-- /main -->
</div>
</div>
</div>
<!-- script references -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>