<?
include ('logue.php'); 
include ('entete2.php');
include ('ressource.php');
include ('entete.php');

if($idlogin == "1") {
echo"
<BODY TEXT=\"#ffffff\">	
<BODY LINK=\"#ffffff\">	
<BODY VLINK=\"#ffffff\">	
<BODY ALINK=\"#ffffff\">
<body bgcolor=\"#000000\">
<style>
input {
border:1px solid #7E7E7E;
background-color:#000000;
font-family:'trebuchet ms',sans-serif;
color:white;
}
textarea {
border:1px solid #7E7E7E;
background-color:#000000;
font-family:'trebuchet ms',sans-serif;
color:white;
}
select, option {
background-color:#000000;
color:white;
}
</style>
<STYLE TYPE=text/css>
.Style1 {color: #0000FF}
.Style2 {color: #FF0000}
</STYLE>";
echo"<div align=\"center\"><form name=\"colo\" method=\"post\" action=\"colonie.php\" target=\"_parent\">
<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td width=\"100\" rowspan=\"2\" valign=\"middle\">
       <div align=\"center\">
         <input name=\"page\" value=\"" . $PHP_SELF . "\" type=\"hidden\" id=\"page\">
         <select name=\"idcolo\" onchange=submit()>";
include ('colo2.php'); 

echo"<br><table width=\"618\"  border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td colspan=\"2\">"; 
$req = "SELECT * FROM matgraph_mp ORDER BY id DESC";
$res = db_mysql_Query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$num = mysql_num_rows($res);
if ( $num > 0 ) {
  While ( $row = mysql_fetch_array($res) ) {
$sql2 = "SELECT login FROM matgraph_users WHERE id='$row[envoyeur]' ";
$res2 = db_mysql_Query($sql2)or die('erreur sql<br>'.$sql2.'<br>'.mysql_error());
$row2 = mysql_fetch_array($res2);  
$sql3 = "SELECT planete,galaxi,system,position FROM matgraph_users WHERE id='$row[planete_envoyeur]' ";
$res3 = db_mysql_Query($sql3)or die('erreur sql<br>'.$sql3.'<br>'.mysql_error());
$row3 = mysql_fetch_array($res3);    

$sql4 = "SELECT login,planete,galaxi,system,position FROM matgraph_users WHERE id='$row[planete_receveur]' ";
$res4 = db_mysql_Query($sql4)or die('erreur sql<br>'.$sql4.'<br>'.mysql_error());
$row4 = mysql_fetch_array($res4);   

  echo"<br><table width=\"618\"  border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td  colspan=\"2\"><font color=\"3399FF\">De : <b>$row2[login]</b> Pour <b>$row4[login]</b></font></td>
  </tr>
  <tr>
    <td>Envoyer le : </td>
    <td>$row[date]</td>
  </tr>
  <tr>
    <td width=\"85\">Sujet : </td>
    <td> $row[sujet] </td>
  </tr>
  <tr>
    <td rowspan=\"2\" valign=\"top\">Message : </td>
    <td valign=\"top\">$row[message]</td>
  </tr>
  </tr></form>
</table>"; 
}}	
	
echo"
</td>
  </tr>
 <form action=\"mp_lire.php\" method=\"post\" name=\"form1\" target=\"_parent\"> <tr>
  <td height=\"50\" colspan=\"2\" align=\"center\" valign=\"middle\"><input type=\"submit\" name=\"Submit2\" value=\"Fermer\"></td>
  </tr></form>
</table>"; }
else {
echo" Et toi ! C'est une zone réserver aux admins ca !!!"; }