-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmessagerie.php
90 lines (85 loc) · 4.82 KB
/
messagerie.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
<?php
include_once("./includes.php");
entete("Messagerie");
verif_connexion();
?>
<div class="container">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">Messagerie</a></li>
<li><a href="#tab2" data-toggle="tab">Envoyer un MP</a></li>
</ul>
<div class="tab-content">
<!---- MESSAGERIE ----->
<div class="tab-pane active" id="tab1">
<form class="well form-horizontal" method="post" action="./messageprive.php">
<table class="table table-bordered table-condensed">
<thead>
<tr class="row">
<th></th>
<th><h4>Sujets</h4></th>
<th><h4>Auteur</h4></th>
<th><h4>Sélection</h4></th>
</tr>
</thead>
<tbody>
<?php
$req_connexion=query("SELECT * FROM messageprive,utilisateur WHERE messageprive.auteurId=utilisateur.idUtil AND destinataireId='".$_SESSION['idUtil']."'");
while ($row = mysql_fetch_array($req_connexion, MYSQL_NUM)) {
echo "<tr class='row'>
<td></td>
<td><a href=./messageprive.php?id=".$row[0].">".$row[1]."</a></td>";
$req2_connexion=query("SELECT pseudo FROM messageprive,utilisateur WHERE messageprive.auteurId=utilisateur.idUtil AND auteurId=".$row[4]."");
$auteur_result=mysql_fetch_array($req2_connexion);
$auteur=$auteur_result[0];
echo "
<td>".$auteur."</td>
<td></td>
</tr>";
}
?>
</tbody>
</table>
</form>
</div>
<!---- ENVOI MP ----->
<div class="tab-pane" id="tab2">
<form method="post"class="well form-horizontal" method="post" action="./sendMessagePrive.php">
<div class="control-group">
<label class="control-label" for="inputdestinateur"><b>Destinataire</b></label>
<div class="controls">
<?php
echo"<input type='hidden' id='session' name='session' value='".$_SESSION['idUtil']."'>";
$util_connexion=query("SELECT pseudo FROM utilisateur");
$liste = '"';
while ($user = mysql_fetch_array($util_connexion, MYSQL_NUM)) {
$liste = $liste.$user[0].'","';
}
$liste = $liste.'"';
?>
<input type="text" class="input-medium" data-provide="typeahead" id="destinataire" name="destinataire" data-items="4" data-source='[<?php echo $liste ?>]'>
</div>
</div>
<div class="control-group">
<label class="control-label" for="input01"><b>Sujet</b></label>
<div class="controls">
<input type="text" class="input-medium" id="titre" name="titre">
</div>
</div>
<div class="control-group">
<label class="control-label" for="textcorps"><b>Corps</b></label>
<div class="controls">
<textarea name="envoie" style="width:50%" id="envoie"></textarea>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-success">Envoyer</button>
<button type="reset" class="btn btn-warning">Annuler</button>
</div>
</form>
</div>
</div>
</div>
<?php
pied();
?>