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

if($row2[ally] == "no") {

	$req = "SELECT * FROM matgraph_ally_recrut WHERE idjoueur = $idlogin";
	$res = db_mysql_Query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
	$num = mysql_num_rows($res);

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

	echo"<form action=\"ally_recrut_envoi.php\" method=\"post\" name=\"form1\" 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 width=\"30%\">Tag de l'alliance demmander : </td>
	      <td width=\"70%\"><input name=\"tag\" type=\"text\" maxlength=\"6\"></td>
	    </tr>
	    <tr>
	      <td>Message de recrutement : </td>
	      <td><textarea name=\"msg\"></textarea></td>
	    </tr>
	    <tr style =\"background-color:#222222;\">
	      <td colspan=\"2\"><div align=\"center\">
	        <input type=\"submit\" name=\"Submit\" value=\"Envoyer\">
	      </div></td>
	    </tr>
	  </table>
	</form>";
	exit;
}
else {
	echo '<script language="javascript" type="text/javascript">
	<!--
	window.location.replace("ally_index.php");
	-->
	</script>';
	exit;
}	
?>


