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

$sql2 = "SELECT hangarfer_lvl,hangarfer_evolution,hangaror_lvl,hangaror_evolution,hangarada_lvl,hangarada_evolution,hangaror_lvl,hangarura_lvl,hangarura_evolution FROM matgraph_users WHERE id='$planete' ";
$res2 = db_mysql_Query($sql2)or die('erreur sql<br>'.$sql2.'<br>'.mysql_error());
$row2 = mysql_fetch_array($res2); 

$pts = floor(($row[pts] / 1000)) ;
$Total_energie_consom = $row[fer_energie] + $row[or_energie] + $row[exfer_energie] + $row[exor_energie] + $row[ada_energie] + $row[ura_energie] ;
$Total_energie_reste =  round(($New_central_energie + $New_fission_energie + $Total_energie_consom),0);
$Total_energie_prod = round(($New_central_energie + $New_fission_energie),0);
$Total_energie_reste2 =  number_format(round(($New_central_energie + $New_fission_energie + $Total_energie_consom),0), 0, ',', ' ');
$Total_energie_prod2 = number_format(round(($New_central_energie + $New_fission_energie),0), 0, ',', ' ');

echo"<script type=\"text/javascript\">
<!--
function smiley(codedusmiley)
{
window.document.rep.message.value += codedusmiley+' ';
}
// -->
</script>
<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'); 

$Ex_envoyeur = $_POST["Ex_envoyeur"]; 
$Ex_planete_envoyeur = $_POST["Ex_planete_envoyeur"]; 
$Ex_sujet = $_POST["Ex_sujet"]; 
$Ex_msg = $_POST["Ex_msg"];
$Ex_date = $_POST["Ex_date"] ;
$New_envoyeur = $idlogin ;

$sql2 = "SELECT login FROM matgraph_users WHERE id='$Ex_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='$Ex_planete_envoyeur' ";
$res3 = db_mysql_Query($sql3)or die('erreur sql<br>'.$sql3.'<br>'.mysql_error());
$row3 = mysql_fetch_array($res3);    

  echo"<a href=\"javascript:smiley('[i][/i]');\"><em>Mettre en Italic </em> </a>	
	<a href=\"javascript:smiley('[b][/b]');\"><b>Mettre en Gras </b> </a>
	<a href=\"javascript:smiley('[u][/u]');\"><u>Souligner </u> </a>
	<a href=\"javascript:smiley('[img][/img]');\">Image </a>
	<a href=\"javascript:smiley('[URL=l\'url de le page]Visitez ce site[/URL]');\">Lien</a>
	<select>
<option onclick=\"javascript:smiley('[align=left][/align]');\">Gauche </option>
<option onclick=\"javascript:smiley('[align=center][/align]');\">Centrer </option>
<option onclick=\"javascript:smiley('[align=right][/align]');\">Droite </option>
</select>
<select>
<option onclick=\"javascript:smiley('[color=red][/color]');\">Rouge </option>
<option onclick=\"javascript:smiley('[color=green][/color]');\">Green </option>
<option onclick=\"javascript:smiley('[color=blue][/color]');\">Blue </option>
</select>
  <form name=\"rep\" method=\"post\" action=\"mp_rep.php\" target=\"_parent\">
    <table width=\"618\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" bordercolor=\"#000000\" style=\"font-family:trebuchet ms,sans-serif; font-size: 9pt ;\">
    <tr style =\"background-color:#222222;\">
      <td colspan=\"3\">A : $row2[login] sur $row3[planete] [$row3[galaxi]:$row3[system]:$row3[position]]</td>
    </tr>
    <tr style =\"background-color:#111111;\">
      <td width=\"98\">Sujet : </td>
      <td colspan=\"2\"> 
        <div align=\"left\">
          <input name=\"sujet\" type=\"text\" id=\"sujet\" value=\"Re : ".htmlentities(stripslashes($Ex_sujet))."\" size=\"55\" maxlength=\"254\">
        </div></td>
    </tr>
    <tr style =\"background-color:#111111;\">
      <td rowspan=\"2\" valign=\"top\">Message : </td>
      <td colspan=\"2\"><textarea name=\"message\" cols=\"70\" rows=\"4\" id=\"message\"></textarea></td>
    </tr>
    <tr style =\"background-color:#111111;\">
      <td width=\"514\" align=\"center\" valign=\"top\"><div align=\"center\">
        <input name=\"receveur\" type=\"hidden\" id=\"receveur\" value=\"$Ex_envoyeur\">
		<input name=\"planete_receveur\" type=\"hidden\" id=\"receveur\" value=\"$Ex_planete_envoyeur\">
        <input type=\"submit\" name=\"Submit3\" value=\"Envoyer\">
      </div></td>
    </tr>
  </table>
</form>
<table width=\"618\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" bordercolor=\"#000000\" style=\"font-family:trebuchet ms,sans-serif; font-size: 9pt ;\">
  <tr style =\"background-color:#111111;\">
    <td colspan=\"3\">Envoyer le : $Ex_date</td>
  </tr>
  <tr>
    <td width=\"110\" rowspan=\"2\">Ancien message : </td>
    <td colspan=\"2\">".htmlentities($Ex_msg)."</td>
  </tr>
</table>"; 
  
?>