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
|
<?php
/* affichage des messages avec leur piece jointe pour les offres et les demandes
du plus récent au plus ancien */
include "config.inc.php";
//connection à la base
$conn =mysql_connect($host,$uname,$pwd);
mysql_select_db($db) or die ("Impossible d'accéder à la base");
$type=$_GET['type'];
if ($type=='D') {
echo "DEMANDES <br>";
}
else
echo "OFFRES <br>";
$requete=mysql_query("SELECT nom, email, datepost, sujet, msg, fichier
FROM deposer
WHERE type='$type'
ORDER BY datepost DESC");
while($resultat=mysql_fetch_array($requete,MYSQL_ASSOC))
{
$nom=$resultat['nom'];
$email=$resultat['email'];
$datepost=$resultat['datepost'];
$sujet=$resultat['sujet'];
$msg=$resultat['msg'];
$fichier=$resultat['fichier'];
$datepost =date("d/m/Y H:i:s", strtotime($datepost)); // date au format francais
echo "<br><table bordercolor=black border=1 width=900 height=120>";
echo "<tr>";
echo "<td heiht=30 width=300 align=left>";
echo ucfirst(strtolower($nom));
echo "</td>";
echo "<td align=left>";
echo "Sujet : ";
echo $sujet;
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td heiht=30 align=left >";
echo $datepost;
echo "</td>";
echo "<td align=left rowspan=3 >";
echo "<div style='width: 700; height: 90; overflow: auto;'>";
echo nl2br($msg); // tenir compte des sauts de ligne
echo "</div>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td heiht=30 align=left >";
echo $email;
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td heiht=30 align=left >";
echo "Pièce jointe :";
//ouverture dans une autre fenetre
?>
<A HREF="#" TARGET="nom" onclick="window.open('<? echo "http://blablabla/upload/$fichier"; ?>', 'nom', 'toolbar=0, menubar=1, location=0, scrollbars=1, width=100%, height=70%, top=10%, right=0, resizable=1')">
nom_du_fichier</A> <?
echo "</td>";
echo "</tr>";
echo "</table>";
}
?> |
Partager