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

$sql = "SELECT vruines,vruines2,vruines3 FROM matgraph_vaisseauxruines WHERE id='$planete' AND (vruines + vruines2 + vruines3) > 0";
$res = db_mysql_Query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error());
$num = mysql_num_rows($res);
if ($num > 0 ) {

$row = mysql_fetch_array($res); }

echo"
<script type='text/javascript'>
function Maxvruines() {
	var total = Math.round('$row[vruines]');
  	document.getElementsByName('vruines')[0].value = total;
}
function Maxvruines2() {
	var total = Math.round('$row[vruines2]');
  	document.getElementsByName('vruines2')[0].value = total;
}
function Maxvruines3() {
	var total = Math.round('$row[vruines3]');
  	document.getElementsByName('vruines3')[0].value = total;
}
</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'); 


if ($num > 0 ) {


echo"<div align=\"center\">
<table width=\"618\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
    <tr>
      <td colspan=\"3\" align=\"center\"><b>Mission Recyclage :</b>
<br><br>

La mission recyclage consiste à ramener des ressources disponible enorbite d'une planète.
</td>
    </tr>
  </table><br><br>
<form name=\"form1\" method=\"post\" action=\"flotte_ruines_envoi.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=\"4\"><div align=\"center\">Entrez les coordonn&eacute;es du champs de ruines visé</div></td>
    </tr>
    <tr style =\"background-color:#111111;\">
      <td width=\"203\"><div align=\"center\">Galaxie</div></td>
      <td width=\"203\"><div align=\"center\">Systeme Solaire </div></td>
      <td width=\"204\" colspan='2'><div align=\"center\">Position </div></td>
    </tr>
    <tr>
      <td><div align=\"center\">
        <input name=\"galaxi\" id=\"galaxi\" type=\"text\" value=\"$galaxi\">
      </div></td>
      <td><div align=\"center\">
        <input name=\"system\" id=\"system\" type=\"text\" value=\"$system\">
      </div></td>
      <td colspan='2'><div align=\"center\">
        <input name=\"position\" id=\"position\" type=\"text\" value=\"$position\">
      </div></td>
    </tr>
    <tr>
      <td rowspan=\"2\">Vaisseaux Ruines : </td>
      <td height=\"39\"><div align=\"left\">Prototype Vaisseau Ruines : 
        <input name=\"vruines\" type=\"text\" id=\"vruines\" value=\"0\">  <a href=\"javascript:Maxvruines();\"> Max </a>
      </div></td>
      <td>X-303B Vaisseau Ruines : 
      <input name=\"vruines2\" type=\"text\" id=\"vruines2\" value=\"0\"> <a href=\"javascript:Maxvruines2();\"> Max </a></td>
	  <td>BC-304B Vaisseau Ruines : 
      <input name=\"vruines3\" type=\"text\" id=\"vruines3\" value=\"0\"> <a href=\"javascript:Maxvruines3();\"> Max </a></td>
    </tr>
    <tr style =\"background-color:#111111;\">
      <td colspan=\"4\" height=\"40\"><div align=\"center\">
        <input type=\"submit\" name=\"Submit\" value=\"Envoyer la sonde\">
      </div></td>
    </tr>
  </table>
</form></div>";

}
else {
echo"<br><br>Vous n'avez pas de vaisseau ruines sur cette planete."; } 
?>