<?php
include ('logue.php');
include ('entete2.php');
$placettt = $row[place];
$planetettt = $row[planete];
$placelibre = $row[place] - $row[placepris];

include ('entete.php');
include ('ressource.php');


echo"
<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}
.Style3 {color: #00CC00}
</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');

$req = "SELECT * FROM matgraph_axxadmin 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 "<br><a href=\"admin/\" target=\"_blank\"> <b>Panneau d'administration</b></a><br><br>"; }


/*
echo"<div align=\"center\"><table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"40\"><DIV id=\"cligno1\"><strong>/ ! \</strong></DIV></td><td><a href=\"http://www.rof.tonsite.biz/SGU/viewtopic.php?p=1583#1583\" target=\"_blank\"> <b>Message Admins : J - 3  </b></a></td><td width=\"40\" align=\"right\"><DIV id=\"cligno2\"><strong>/ ! \</strong></DIV>
</tr></table><br><br>";
*/


$reqmmm = "SELECT * FROM matgraph_commentaires ORDER by id = 1 ";
$resmmm = db_mysql_Query($reqmmm) or die('Erreur SQL! <br>'.$reqmmm.'<br>'.mysql_error());
$rowmmm = mysql_fetch_array($resmmm);

if($rowmmm[onoff] == 1) { echo"$rowmmm[titre] : <br> $rowmmm[texte]<br><br>"; }


echo"<br><font color=\"FF9900\"><b>Acheter des ressources : </b><br>Cher habitant de l'Univers StarGate, Vu les difficultées finnancières que nous avons eut le mois dernier pour renouveller le serveur, nous avons décidé d'acceder a la demmande de certains membres : il est maintenant possible d'acheter des ressources : 100.000 d'un ressource contre 1 code allopass.
<br><div align=center><a href=\"achat.php\" target=\"_parent\">Acheter des ressources ou des eppz</a><div align=center>
<br><div align=left>Cordialement, Le Staff<br><br><div align=center>";
/*
echo"<br><font color=\"FF9900\"><b>La team recrute :</b> Nous recherchons des gens capable de faire des minis jeux flash ainsi que des codeurs (php, js) et des graphistes (pour refaire les images du jeu) quaifié.
Si vous etes intérésé utiliser <a href=\"recrutement.php\" target=\"_parent\">ce formulaire.</a><br><br>";
echo"<font color=\"FF0000\">Cher habitant de l'Univers StarGate, nous te rappellons que ce jeu est entiérement financer par les administrateurs. SGU a la vocation d'être gratuit ! N'hesite pas à <a href=\"dons.php\" target=\"_parent\">faire un don</a>. Merci !</font><br>";
//Vous pouvez aussi aller faire un petit clic de temps en temps sur des sites dans les rubriques de cet <a href=\"http://anu-ptimick62.indexurls.com/\" target=\"_blank\">annuaire</a>.
*/echo'<br><br><head>'; ?>
 <script type="text/javascript"><!--
google_ad_client = "pub-8607881244902263";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "B4D0DC";
google_color_bg = "ECF8FF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//--></script>
        <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
          </script><br><br>
<?php
echo"<table width=\"618\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>";
include 'Flotte_voir.php';
echo"</td></tr></table>";


if($row2[ally] !== "no") {
$req = "SELECT pts FROM matgraph_users WHERE ally='$row2[ally]' ORDER by id ASC";
$res = db_mysql_Query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$num = mysql_num_rows($res);
if ( $num > 0 ) {
  While ( $row = mysql_fetch_array($res) ) {
$pts+= ($row[pts]/1000);
}}
$requete = "UPDATE matgraph_ally SET pts_ally='$pts' WHERE id='$row2[ally]'";
$resultat = db_mysql_Query($requete)or die('erreur sql<br>'.$requete.'<br>'.mysql_error());
}


$pts = number_format(floor(($row2[pts] / 1000)), 0, ',', ' ');




$reponse  = db_mysql_Query("SELECT pts FROM matgraph_users WHERE id='$dataid[id]'");
$reponse2 = db_mysql_Query("SELECT COUNT(id) FROM matgraph_users WHERE pts>".mysql_result($reponse,0));
$classement=mysql_result($reponse2,0)+1;

$reqtotal = "SELECT * FROM matgraph_users WHERE id=idjoueur";
$restotal = db_mysql_Query($reqtotal) or die('Erreur SQL! <br>'.$reqtotal.'<br>'.mysql_error());
$numtotal = mysql_num_rows($restotal);

$date = date("d-m-Y");
$heure = date("H:i");



// La variable de condition
$liste_id = "(0";

$reqtmpid = "SELECT id FROM matgraph_users WHERE idjoueur = $idlogin";
$restmpid = db_mysql_Query($reqtmpid) or die('Erreur SQL! <br>'.$reqtmpid.'<br>'.mysql_error());
while( $rowtmpid = mysql_fetch_array($restmpid) ) {
	$liste_id = $liste_id." OR receveur = $rowtmpid[id]";
}
$liste_id = $liste_id.")";

$reqmp = "SELECT * FROM matgraph_mp WHERE $liste_id AND lu='non' ORDER BY id DESC";
$resmp = db_mysql_Query($reqmp) or die('Erreur SQL! <br>'.$reqmp.'<br>'.mysql_error());
$nummp = mysql_num_rows($resmp);
if ( $nummp > 0 ) {
$nbremp = $nummp ; }
else {
$nbremp = 0 ; }

$reqcontreespio = "SELECT * FROM matgraph_contreespio WHERE $liste_id AND lu='non' ORDER BY id DESC";
$rescontreespio = db_mysql_Query($reqcontreespio) or die('Erreur SQL! <br>'.$reqcontreespio.'<br>'.mysql_error());
$numcontreespio = mysql_num_rows($rescontreespio);
if ( $numcontreespio > 0 ) {
$nbrecontreespio = $numcontreespio ; }
else {
$nbrecontreespio = 0 ; }

$reqcombat = "SELECT * FROM matgraph_bataille WHERE $liste_id AND lu='non' ORDER BY id DESC";
$rescombat = db_mysql_Query($reqcombat) or die('Erreur SQL! <br>'.$reqcombat.'<br>'.mysql_error());
$numcombat = mysql_num_rows($rescombat);
if ( $numcombat > 0 ) {
$nbrecombat = $numcombat ; }
else {
$nbrecombat = 0 ; }

$reqmsg = "SELECT * FROM matgraph_msg WHERE $liste_id AND lu='non' ORDER BY id DESC";
$resmsg = db_mysql_Query($reqmsg) or die('Erreur SQL! <br>'.$reqmsg.'<br>'.mysql_error());
$nummsg = mysql_num_rows($resmsg);
if ( $nummsg > 0 ) {
$nbremsg = $nummsg ; }
else {
$nbremsg = 0 ; }

$reqmsgally = "SELECT * FROM matgraph_msgally WHERE $liste_id AND lu='non' ORDER BY id DESC";
$resmsgally = db_mysql_Query($reqmsgally) or die('Erreur SQL! <br>'.$reqmsgally.'<br>'.mysql_error());
$nummsgally = mysql_num_rows($resmsgally);
if ( $nummsgally > 0 ) {
$nbremsgally = $nummsgally ; }
else {
$nbremsgally = 0 ; }

$nbremsgfinal = $nbremp + $nbrecontreespio + $nbremsg + $nbremsgally + $nbrecombat;

if($nbremsgfinal != "0") {
echo("<a href=\"mp_lire.php\" target=\"_parent\"><p class=\"Style1\"><div align=\"center\">Vous avez $nbremsgfinal nouveau(x) message(s).</p></div></a>"); }

$req = "SELECT * FROM matgraph_explorer WHERE receveur = $idlogin AND lu='non' ORDER BY id DESC";
$res = db_mysql_Query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$num = mysql_num_rows($res);
if ( $num > 0 ) {
echo"<a href=\"commerce.php\" target=\"_parent\"><p class=\"Style1\"><div align=\"center\">Vous avez $num proposition(s) de pacte(s) de la par de :"; }
$req = "SELECT * FROM matgraph_explorer WHERE receveur = $idlogin AND lu='non' ORDER BY id DESC";
$res = db_mysql_Query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$num = mysql_num_rows($res);
if ( $num > 0 ) {
  While ( $row = mysql_fetch_array($res) ) {
$sql3 = "SELECT login,galaxi,system,position FROM matgraph_users WHERE id='$row[planete_envoyeur]' ";
$res3 = db_mysql_Query($sql3)or die('erreur sql<br>'.$sql3.'<br>'.mysql_error());
$row3 = mysql_fetch_array($res3);
 echo" $row3[login] ([$row3[galaxi]:$row3[system]:$row3[position]]) "; }
}
$req = "SELECT * FROM matgraph_explorer WHERE receveur = $idlogin AND lu='non' ORDER BY id DESC";
$res = db_mysql_Query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$num = mysql_num_rows($res);
if ( $num > 0 ) {
 echo".</p></div></a>"; }
echo"<div align=\"center\"><table width=\"638\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr style =\"background-color:#222222;\">
    <td width=\"171\">Points : </td>
    <td align=\"center\" colspan=\"2\">$pts </td>
  </tr>
  <tr>
    <td>Classement : </td>
    <td align=\"center\" colspan=\"2\">$classement / $numtotal</td>
  </tr>";
if($row2[ally] !== "no") {

$sqlally2 = "SELECT defcon FROM matgraph_ally WHERE id='$row2[ally]'";
$resally2 = db_mysql_Query($sqlally2)or die('erreur sql<br>'.$sqlally2.'<br>'.mysql_error());
$rowally2 = mysql_fetch_array($resally2);
if($rowally2[defcon] == "5") { $defcon = "<font color=\"009900\">Niveau 5 : Préparation normale en temps de paix.</font>"; }
if($rowally2[defcon] == "4") { $defcon = "<font color=\"999933\">Niveau 4 : Renseignement accru et mesures de sécurité renforcées.</font>"; }
if($rowally2[defcon] == "3") { $defcon = "<font color=\"FFFF00\">Niveau 3 : Accroissement de la préparation des forces.</font>"; }
if($rowally2[defcon] == "2") { $defcon = "<font color=\"FF9900\">Niveau 2 : Accroissement supplémentaire dans la préparation des forces, mais inférieure à la préparation maximale.</font>"; }
if($rowally2[defcon] == "1") { $defcon = "<font color=\"FF0000\">Niveau 1 : Etat de guerre !! Préparation maximale des forces.</font>"; }
echo"<tr style =\"background-color:#222222;\">
    <td>DEFCON : </td>
    <td align=\"center\" colspan=\"2\">$defcon</td>
  </tr>"; }
echo"<tr>
    <td colspan=\"3\">&nbsp;</td>
  </tr>
  <tr>
    <td width=\"200\" colspan=\"2\" align=\"center\" valign=\"middle\"><img src=\"imgs/planete/$row2[planete_img].jpg\" width=\"200\" height=\"200\"></td>
    <td><div align=\"center\">";

echo"<table width=\"204\"  border=\"0\" cellspacing=\"2\" cellpadding=\"0\">
<tr>";
$reqimg1 = "SELECT id,planete,planete_img FROM matgraph_users WHERE idjoueur='$dataid[id]' ORDER BY id ASC";
$resimg1 = db_mysql_Query($reqimg1) or die('Erreur SQL! <br>'.$reqimg1.'<br>'.mysql_error());
$numimg1 = mysql_num_rows($resimg1);
if ( $numimg1 > 0 )
{
  $i=1;
  While ( $rowimg1 = mysql_fetch_array($resimg1) ) {
if($i == 1 || $i == 2 || $i == 3 || $i == 4 )	{
$planete = $rowimg1[id] ;
include ('ressourceapercu.php');

$sqlinfo = "SELECT fer_ressource,or_ressource,ada_ressource,ura_ressource FROM matgraph_users WHERE id=$planete";
$resinfo = db_mysql_Query($sqlinfo)or die('erreur sql<br>'.$sqlinfo.'<br>'.mysql_error());
$rowinfo = mysql_fetch_array($resinfo);

$fer = number_format(floor($rowinfo[fer_ressource]), 0, ',', ' ');
$or = number_format(floor($rowinfo[or_ressource]), 0, ',', ' ');
$ada = number_format(floor($rowinfo[ada_ressource]), 0, ',', ' ');
$ura = number_format(floor($rowinfo[ura_ressource]), 0, ',', ' ');
$evolution = "";
$ressource = "Fer : $fer ; Or : $or ; Cristal : $ada ; Naquadah : $ura";

$evolution.="$ressource";
$fer="";
$or ="";
$ada ="";
$ura="";


echo"<form name=\"colo\" method=\"post\" action=\"colonies.php\" target=\"_parent\"><input name=\"idcolo\" type=\"hidden\" id=\"idcolo\" value=\"$rowimg1[id]\"><input name=\"page\" value=\"apercu\" type=\"hidden\" id=\"page\"><td align=\"center\">$rowimg1[planete]<br><INPUT type=\"image\" src=\"imgs/planete/$rowimg1[planete_img].jpg\" title=\"$evolution\" width=\"100\" height=\"100\" onClick=\"submit()\"></td></form>"; }
  $i++;}
}
echo"</tr>
<tr>";
$reqimg2 = "SELECT id,planete,planete_img FROM matgraph_users WHERE idjoueur='$dataid[id]' ORDER BY id ASC";
$resimg2 = db_mysql_Query($reqimg2) or die('Erreur SQL! <br>'.$reqimg2.'<br>'.mysql_error());
$numimg2 = mysql_num_rows($resimg2);
if ( $numimg2 > 0 )
{
  $i=1;
  While ( $rowimg2 = mysql_fetch_array($resimg2) ) {
if($i == 5 || $i == 6 || $i == 7 || $i == 8)	{
$planete = $rowimg2[id] ;
include ('ressourceapercu.php');
$sqlinfo = "SELECT fer_ressource,or_ressource,ada_ressource,ura_ressource FROM matgraph_users WHERE id=$planete";
$resinfo = db_mysql_Query($sqlinfo)or die('erreur sql<br>'.$sqlinfo.'<br>'.mysql_error());
$rowinfo = mysql_fetch_array($resinfo);

$fer = number_format(floor($rowinfo[fer_ressource]), 0, ',', ' ');
$or = number_format(floor($rowinfo[or_ressource]), 0, ',', ' ');
$ada = number_format(floor($rowinfo[ada_ressource]), 0, ',', ' ');
$ura = number_format(floor($rowinfo[ura_ressource]), 0, ',', ' ');
$evolution = "";
$ressource = "Fer : $fer ; Or : $or ; Cristal : $ada ; Naquadah : $ura";

$evolution.="$ressource";
$fer="";
$or ="";
$ada ="";
$ura="";

echo"<form name=\"colo\" method=\"post\" action=\"colonies.php\" target=\"_parent\"><input name=\"idcolo\" type=\"hidden\" id=\"idcolo\" value=\"$rowimg2[id]\"><input name=\"page\" value=\"apercu\" type=\"hidden\" id=\"page\"><td align=\"center\">$rowimg2[planete]<br><INPUT type=\"image\" src=\"imgs/planete/$rowimg2[planete_img].jpg\" title=\"$evolution\" width=\"100\" height=\"100\" onClick=\"submit()\"></td></form>"; }
  $i++;}
}
echo"</tr>
<tr>";
$reqimg3 = "SELECT id,planete,planete_img FROM matgraph_users WHERE idjoueur='$dataid[id]' ORDER BY id ASC";
$resimg3 = db_mysql_Query($reqimg3) or die('Erreur SQL! <br>'.$reqimg3.'<br>'.mysql_error());
$numimg3 = mysql_num_rows($resimg3);
if ( $numimg3 > 0 )
{
  $i=1;
  While ( $rowimg3 = mysql_fetch_array($resimg3) ) {
if($i == 9 || $i == 10 || $i == 11 || $i == 12)	{
$planete = $rowimg3[id] ;
include ('ressourceapercu.php');
$sqlinfo = "SELECT fer_ressource,or_ressource,ada_ressource,ura_ressource FROM matgraph_users WHERE id=$planete";
$resinfo = db_mysql_Query($sqlinfo)or die('erreur sql<br>'.$sqlinfo.'<br>'.mysql_error());
$rowinfo = mysql_fetch_array($resinfo);

$fer = number_format(floor($rowinfo[fer_ressource]), 0, ',', ' ');
$or = number_format(floor($rowinfo[or_ressource]), 0, ',', ' ');
$ada = number_format(floor($rowinfo[ada_ressource]), 0, ',', ' ');
$ura = number_format(floor($rowinfo[ura_ressource]), 0, ',', ' ');
$evolution = "";
$ressource = "Fer : $fer ; Or : $or ; Cristal : $ada ; Naquadah : $ura";

$evolution.="$ressource";
$fer="";
$or ="";
$ada ="";
$ura="";

echo"<form name=\"colo\" method=\"post\" action=\"colonies.php\" target=\"_parent\"><input name=\"idcolo\" type=\"hidden\" id=\"idcolo\" value=\"$rowimg3[id]\"><input name=\"page\" value=\"apercu\" type=\"hidden\" id=\"page\"><td align=\"center\">$rowimg3[planete]<br><INPUT type=\"image\" src=\"imgs/planete/$rowimg3[planete_img].jpg\" title=\"$evolution\" width=\"100\" height=\"100\" onClick=\"submit()\"></td></form>"; }
  $i++;}
}

include ('entete2.php');

echo"</tr>
</table>";

	echo"</div></td>
  </tr>
  <tr style =\"background-color:#222222;\">
    <td>Planete : </td>
    <td align=\"center\" colspan=\"2\">$planetettt (<a href=\"changename.php\" target=\"_parent\">Changer de nom</a>";
if($planete !== $idlogin) { echo" - <a href=\"colo_del.php\" target=\"_parent\">Supprimer</a>"; } echo")</td>
  </tr>
  <tr>
    <td>Place disponible sur la planete : </td>
    <td align=\"center\" colspan=\"2\">$placelibre / $placettt</td>
  </tr>";

$sqlinfo = "SELECT * FROM matgraph_users WHERE id=$idlogin";
$resinfo = db_mysql_Query($sqlinfo)or die('erreur sql<br>'.$sqlinfo.'<br>'.mysql_error());
$row = mysql_fetch_array($resinfo);

if($row[techinfra_evolution] != "0000-00-00 00:00:00") {
$techinfra_evolution = "<br>Technologie d'infrastructure des Vaisseaux"; }
if (!empty($techinfra_evolution) )
  $technologies.="$techinfra_evolution";

if($row[techenergie_evolution] != "0000-00-00 00:00:00") {
$techenergie_evolution = "<br>Technologie de maîtrise de l'Energie"; }
if (!empty($techenergie_evolution) )
  $technologies.="$techenergie_evolution";

if($row[techlaser_evolution] != "0000-00-00 00:00:00") {
$techlaser_evolution = "<br>Technologie de Laser"; }
if (!empty($techlaser_evolution) )
  $technologies.="$techlaser_evolution";

if($row[techions_evolution] != "0000-00-00 00:00:00") {
$techions_evolution = "<br>Technologie d'ions"; }
if (!empty($techions_evolution) )
  $technologies.="$techions_evolution";

if($row[techplasma_evolution] != "0000-00-00 00:00:00") {
$techplasma_evolution = "<br>Technologie de plasma"; }
if (!empty($techplasma_evolution) )
  $technologies.="$techplasma_evolution";

if($row[techordi_evolution] != "0000-00-00 00:00:00") {
$techordi_evolution = "<br>Technologie Salle de contrôle"; }
if (!empty($techordi_evolution) )
  $technologies.="$techordi_evolution";

if($row[techcombustion_evolution] != "0000-00-00 00:00:00") {
$techcombustion_evolution = "<br>Réacteur à combustion"; }
if (!empty($techcombustion_evolution) )
  $technologies.="$techcombustion_evolution";

if($row[techAsgaards_evolution] != "0000-00-00 00:00:00") {
$techAsgaards_evolution = "<br>Réacteurs Asgards"; }
if (!empty($techAsgaards_evolution) )
  $technologies.="$techAsgaards_evolution";

if($row[techhyperespace_evolution] != "0000-00-00 00:00:00") {
$techhyperespace_evolution = "<br>Technologie des Réacteur hyperespace"; }
if (!empty($techhyperespace_evolution) )
  $technologies.="$techhyperespace_evolution";

if($row[techespio1_evolution] != "0000-00-00 00:00:00") {
$techespio1_evolution = "<br>Technologie Espionnage de Type 1"; }
if (!empty($techespio1_evolution) )
  $technologies.="$techespio1_evolution";

if($row[techespio2_evolution] != "0000-00-00 00:00:00") {
$techespio2_evolution = "<br>Technologie Espionnage de Type 2"; }
if (!empty($techespio2_evolution) )
  $technologies.="$techespio2_evolution";

if($row[techArmement_evolution] != "0000-00-00 00:00:00") {
$techArmement_evolution = "<br>Technologie de l'Armement"; }
if (!empty($techArmement_evolution) )
  $technologies.="$techArmement_evolution";

if($row[techBouclier_evolution] != "0000-00-00 00:00:00") {
$techBouclier_evolution = "<br>Technologie Bouclier de protection"; }
if (!empty($techBouclier_evolution) )
  $technologies.="$techBouclier_evolution";

if($row[techcoque_evolution] != "0000-00-00 00:00:00") {
$techcoque_evolution = "<br>Technologie de renforcement de la coque"; }
if (!empty($techcoque_evolution) )
  $technologies.="$techcoque_evolution";

if($row[techproAsgaard_evolution] != "0000-00-00 00:00:00") {
$techproAsgaard_evolution = "<br>Technologie Asgard"; }
if (!empty($techproAsgaard_evolution) )
  $technologies.="$techproAsgaard_evolution";

if($row[techproAncien_evolution] != "0000-00-00 00:00:00") {
$techproAncien_evolution = "<br>Technologie \"Les Anciens\""; }
if (!empty($techproAncien_evolution) )
  $technologies.="$techproAncien_evolution";

if($row[technaqua_evolution] != "0000-00-00 00:00:00") {
$technaqua_evolution = "<br>Technologie de Naquadah"; }
if (!empty($technaqua_evolution) )
  $technologies.="$technaqua_evolution";

if($row[techanti_evolution] != "0000-00-00 00:00:00") {
$techanti_evolution = "<br>Technologie Champs Anti-gravité"; }
if (!empty($techanti_evolution) )
  $technologies.="$techanti_evolution";

if (empty($technologies) ) {
echo"<tr style =\"background-color:#222222;\">
    <td>Technologie en cours : </td>
    <td align=\"center\" colspan=\"2\"> Aucune</td>
  </tr>"; }
else {
include ('entete2.php');
include ('calcullabo.php');
$sqlinfo = "SELECT * FROM matgraph_users WHERE id=$idlogin";
$resinfo = db_mysql_Query($sqlinfo)or die('erreur sql<br>'.$sqlinfo.'<br>'.mysql_error());
$row = mysql_fetch_array($resinfo);

if ($row[techinfra_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechinfra2 ; $construction = "techinfra" ; }
if ($row[techenergie_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechenergie2 ; $construction = "techenergie" ; }
if ($row[techlaser_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechlaser2 ; $construction = "techlaser" ; }
if ($row[techions_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechions2 ; $construction = "techions" ; }
if ($row[techplasma_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechenergie2 ; $construction = "techenergie" ; }
if ($row[techordi_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechordi2 ; $construction = "techordi" ; }
if ($row[techcombustion_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechcombustion2 ; $construction = "techcombustion" ; }
if ($row[techAsgaards_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechAsgaards2 ; $construction = "techAsgaards" ; }
if ($row[techhyperespace_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechhyperespace2 ; $construction = "techhyperespace" ; }
if ($row[techespio1_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechespio12 ; $construction = "techespio1" ; }
if ($row[techespio2_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechespio22 ; $construction = "techespio2" ; }
if ($row[techArmement_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechArmement2 ; $construction = "techArmement" ; }
if ($row[techBouclier_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechBouclier2 ; $construction = "techBouclier" ; }
if ($row[techcoque_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechcoque2 ; $construction = "techcoque" ; }
if ($row[techproAsgaard_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechproAsgaard2 ; $construction = "techproAsgaard" ; }
if ($row[techproAncien_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechproAncien2 ; $construction = "techproAncien" ; }
if ($row[technaqua_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechnaqua2 ; $construction = "technaqua" ; }
if ($row[techanti_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechanti2 ; $construction = "techanti" ; }
$tempsevolution = $tempsevo;
$eminevo = $tempsevolution / 60;

if ( floor($eminevo) != $eminevo )
  $esecevo = floor( ($eminevo - floor( $eminevo )) * 60);

  if ( $eminevo > 60 ) {

    $ehourevo = floor( $eminevo / 60 );
    $eminevo = $eminevo - ( 60 * $ehourevo );

    if ( $ehourevo > 24 ) {
      $edayevo = floor( $ehourevo / 24);
      $ehourevo = $ehourevo - ( 24 * $edayevo );
    }

  }

$tempsevolution ="";

if (empty($edayevo) )
  $edayevo = 0;

if (empty($ehourevo) )
  $ehourevo = 0;

if (empty($esecevo) )
  $esecevo = 0;

$emin2evo = floor($eminevo) ;
$nom="evo";
$tempsevolution = "<body onLoad=chrono($edayevo,$ehourevo,$emin2evo,$esecevo,'$nom')>
<span id=\"ligne_$nom\">Fini dans : $edayevo:$ehourevo:$emin2evo:$esecevo</span>";
echo"
<script language=\"javascript\">

function chrono(jours,heures,minutes,secondes,champs) {

  if (secondes > 0) {
    secondes--;
  }
  else {
    secondes = 59;

    if (minutes > 0) {
      minutes--;
    }
    else {
      minutes = 59;

      if (heures > 0) {
        heures--;
        jours--;
      }
      else {
        heures = 23;
      }
    }
  }

  if ( minutes == 59 && secondes == 59 && heures == 23 ) {
    window.history.go(0);
     }
  else {
    seconde = secondes;
    minute = minutes;
    text = '';
    if (jours > 0) {
      text +=jours + 'j ';
    }
    if (heures > 0) {
      text +=heures + 'h ';
    }
    if (minutes < 10) {
      minute = '0' + minutes;
    }
    if (seconde < 10) {
      seconde = '0' + secondes;
    }
      text +=minute + 'm ' + seconde + 's';

  document.getElementById('ligne_' + champs).innerHTML = 'Fini dans : <font color=#800000>'+ text +'</font>';
  setTimeout(\"chrono(\" + jours + \",\" + heures + \",\" + minutes + \",\" + secondes + \",'\" + champs + \"')\", 1000);
         }
    }
</script>";
echo"<tr style =\"background-color:#222222;\">
    <td valign=\"bottom\">Technologie en cours : </td>
    <td align=\"center\" colspan=\"2\">$technologies $tempsevolution</td>
  </tr>"; }
echo"
  <tr>
    <td colspan=\"3\"><div align=\"center\">Nous sommes le $date et il est $heure</div></td>
  </tr>
</table>
";
/*
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
function clignotement()
{
	if (document.getElementById("cligno1").style.color=="black")
		document.getElementById("cligno1").style.color="red" ;
	else
		document.getElementById("cligno1").style.color="black" ;
	if (document.getElementById("cligno2").style.color=="black")
		document.getElementById("cligno2").style.color="red" ;
	else
		document.getElementById("cligno2").style.color="black" ;

	}
// mise en place de l appel régulier de la fonction toutes les 0.5 secondes
Periode = setInterval("clignotement()", 500) ;
</script>
*/

/*
include ('entete2.php');
include ('Aller_assaut.php') ;
include ('Retour_flotte.php') ;
include ('Baser_flotte.php') ;
mysql_close($connect);
*/
?>
