<?	
include ('logue.php'); 
include ('entete2.php');
include ('ressource.php');
include ('entete.php');
require_once ('include/general.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); 

echo"<script type=\"text/javascript\">
<!--
function AddText(startTag,defaultText,endTag) {
if (document.rep.message.createTextRange){
	var text;
    document.rep.message.focus(document.rep.message.caretPos);
    document.rep.message.caretPos = document.selection.createRange().duplicate();
    if(document.rep.message.caretPos.text.length>0){
         document.rep.message.caretPos.text = startTag + document.rep.message.caretPos.text + endTag;
    }else{
        document.rep.message.caretPos.text = startTag+defaultText+endTag;
    }

}else document.rep.message.value += startTag+defaultText+endTag;
}
function smiley(codedusmiley){
	var reg=new RegExp('[ ]', 'g');
	var tabs=codedusmiley.split(reg);
	if(tabs.length>=2 && tabs.length<=3){
		AddText(tabs[0],' ',tabs[1]);
	}else{
		AddText(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=\"colonies.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=\"mp_envoi\" type=\"hidden\" id=\"page\">
         <select name=\"idcolo\" onchange=submit()>";
include ('colo2.php'); 
$idreceveur = htmlentities ($_POST["idreceveur"]); 
$galaxi = htmlentities ($_POST["galaxi"]);
$system = htmlentities ($_POST["system"]) ;
$position = htmlentities ($_POST["position"]) ;

$sql3 = "SELECT login FROM matgraph_users WHERE id='$idreceveur' ";
$res3 = db_mysql_Query($sql3)or die('erreur sql<br>'.$sql3.'<br>'.mysql_error());
$row3 = mysql_fetch_array($res3);  

$sql2 = "SELECT id 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);   

$idenvoyeur = $row2[id];

  echo"
  <div align=\"center\" style=\"width:610px;height:35px;\" id=\"bbcode\">
  	<a href=\"javascript:smiley('[i] [/i]');\"><img src=\"images/rte-italic.png\" alt=\"Mettre en Italique\" /></a>	
	<a href=\"javascript:smiley('[b] [/b]');\"><img src=\"images/rte-bold.png\" alt=\"Mettre en Gras\" /></a>
	<a href=\"javascript:smiley('[u] [/u]');\"><img src=\"images/rte-underlined.png\" alt=\"Souligner\" /></a>
	<a href=\"javascript:smiley('[img] [/img]');\"><img src=\"images/rte-image.png\" alt=\"Mettre une Image\" /></a>
	<a href=\"javascript:smiley('[URL=l\'url de le page]Visitez ce site[/URL]');\"><img src=\"images/rte-url.png\" alt=\"Mettre une URL\" /></a>
	<a href=\"javascript:smiley('[align=left] [/align]');\"><img src=\"images/rte-align-left.png\" alt=\"Gauche\" /></a>
	<a href=\"javascript:smiley('[align=center] [/align]');\"><img src=\"images/rte-align-center.png\" alt=\"Centrer\" /></a>
	<a href=\"javascript:smiley('[align=right] [/align]');\"><img src=\"images/rte-align-right.png\" alt=\"Droite\" /></a>
	<select>
		<option>Couleur de texte</option>
		<option onclick=\"javascript:smiley('[color=red] [/color]');\" style=\"color: red\">Rouge</option>
		<option onclick=\"javascript:smiley('[color=green] [/color]');\" style=\"color: green\">Vert</option>
		<option onclick=\"javascript:smiley('[color=blue] [/color]');\" style=\"color: blue\">Bleu</option>
		<option onclick=\"javascript:smiley('[color=#8B0000] [/color]');\" style=\"color:#8B0000;\">Rouge sombre</option>
		<option onclick=\"javascript:smiley('[color=#00008B] [/color]');\" style=\"color:#00008B;\">Bleu sombre</option>
		<option onclick=\"javascript:smiley('[color=#FFA500] [/color]');\" style=\"color:#FFA500;\">Orange</option>
		<option onclick=\"javascript:smiley('[color=#A52A2A] [/color]');\" style=\"color:#A52A2A;\">Marron</option>
		<option onclick=\"javascript:smiley('[color=#FFFF00] [/color]');\" style=\"color:#FFFF00;\">Jaune</option>
		<option onclick=\"javascript:smiley('[color=#EE82EE] [/color]');\" style=\"color:#EE82EE;\">Violet</option>
		<option onclick=\"javascript:smiley('[color=#808000] [/color]');\" style=\"color:#808000;\">Olive</option>
		<option onclick=\"javascript:smiley('[color=#00FFFF] [/color]');\" style=\"color:#00FFFF;\">Cyan</option>
		<option onclick=\"javascript:smiley('[color=#4B0082] [/color]');\" style=\"color:#4B0082;\">Indigo</option>
		<option onclick=\"javascript:smiley('[color=#FFFFFF] [/color]');\" style=\"color:#FFFFFF;\">Blanc</option>
	</select>
</div>

<form name=\"rep\" method=\"post\" action=\"mp_envoi2.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 : $row3[login] [$galaxi:$system:$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\" 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=\"idenvoyeur\" type=\"hidden\" value=\"$idenvoyeur\">
		<input name=\"idreceveur\" type=\"hidden\" value=\"$idreceveur\">
        <input type=\"submit\" name=\"Submit3\" value=\"Envoyer\">
      </div></td>
    </tr>
  </table>
</form>"; 
  
?>