<?php
include ('logue.php'); 
include ('entete2.php');
include ('ressource.php');
include ('entete.php');
echo"<script type=\"text/javascript\">
<!--
function smiley(codedusmiley)
{
window.document.rep.msg.value += codedusmiley+' ';
}
// -->
</script>
<STYLE TYPE=text/css>
.Style1 {color: #0000FF}
.Style2 {color: #FF0000}
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>";
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'); 

$sql2 = "SELECT ally,statut FROM matgraph_users WHERE id='$idlogin'";
$res2 = db_mysql_Query($sql2)or die('erreur sql<br>'.$sql2.'<br>'.mysql_error());
$row2 = mysql_fetch_array($res2);

$sql_options = "SELECT mailcollectif FROM matgraph_ally_statut WHERE id='$row2[statut]'";
$res_options = db_mysql_Query($sql_options)or die('erreur sql<br>'.$sql_options.'<br>'.mysql_error());
$row_options = mysql_fetch_array($res_options); 

if($row2[ally] == "no") {
	echo '<script language="javascript" type="text/javascript">
	<!--
	window.location.replace("ally_index.php");
	-->
	</script>';
	exit;
}

if($row2[statut] !== "0" AND $row_options[mailcollectif] == "1" OR $row2[statut] == "-1") {

	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=\"ally_mail_collectif_envoi.php\" target=\"_parent\">
	  <table width=\"460\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" bordercolor=\"#000000\" style=\"font-family:trebuchet ms,sans-serif; font-size: 9pt ;\">
	    <tr style =\"background-color:#222222;\">
	      <td width=\"113\" height=\"31\">Sujet : </td>
	      <td width=\"381\"><div align=\"center\">
	        <input name=\"sujet\" type=\"text\" size=\"50\" maxlength=\"130\">
	      </div></td>
	    </tr>
	    <tr>
	      <td colspan=\"2\">Message : </td>
	    </tr>
	    <tr style =\"background-color:#222222;\">
	      <td height=\"103\" colspan=\"2\"><div align=\"center\">
	        <textarea name=\"msg\" cols=\"50\" rows=\"8\" id=\"msg\"></textarea>
	      </div></td>
	    </tr>
	    <tr>
	      <td height=\"48\" colspan=\"2\"><div align=\"center\">
	        <input type=\"submit\" name=\"Submit\" value=\"Envoyer\">
	      </div></td>
	    </tr>
	  </table>
	</form>";
}
else {
	echo '<script language="javascript" type="text/javascript">
	<!--
	window.location.replace("ally_index.php");
	-->
	</script>';
}
?>
