<?php
/*
* Alliances Manager (Gestionador de Alianzas) - Travian
* Copyright (C) 2008-12 Viva Mayer, Francisco MesÃas <hide@address.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
cabecera("",self::$texto->get('HEAD18'));
$radio[1] = ''; $radio[2] = ''; $radio[3] = '';
$wood = 0; $clay = 0; $iron = 0; $crop = 0;
if (isset($_POST['raza']))
{
$radio[$_POST['raza']] = 'checked="checked"';
$wood = (int) $_POST['wood'];
$clay = (int) $_POST['clay'];
$iron = (int) $_POST['iron'];
$crop = (int) $_POST['crop'];
}
?>
</head>
<body>
<div id="top"><?php include("libs/top.php") ?></div>
<div id="contenido">
<div id="left">
<?php $top = 'extras'; include("libs/menu.php") ?>
</div>
<div id="cuerpo">
<form action="./?ctrl=Extras&mod=npc" method="post">
<table width="400" border="0" cellspacing="1" cellpadding="2" align="center" style="text-align:center;">
<tr>
<td><h3><?=self::$texto->get('tu.raza')?></h3></td>
<td><h3><?=self::$texto->get('rec.exist')?></h3></td>
</tr>
<tr>
<td align="left">
<table width="111" height="91" border="0" align="center" cellpadding="2" cellspacing="1" class="tb">
<tr> <td align="left"><input name="raza" type="radio" <?=$radio[1]?> value="1" /> <?=self::$texto->get('R1U')?></td></tr>
<tr><td align="left"><input name="raza" type="radio" <?=$radio[2]?> value="2" /><?=self::$texto->get('R2U')?></td>
</tr>
<tr><td align="left"><input name="raza" type="radio" <?=$radio[3]?> value="3" /><?=self::$texto->get('R3U')?></td>
</tr>
</table>
</td>
<td>
<table width="150" border="0" align="center" cellpadding="2" cellspacing="1" class="tb">
<tr>
<td><img src="imagenes/recursos/1.gif" alt="<?=self::$texto->get('madera')?>" width="18" height="12" /></td>
<td><input name="wood" type="text" value="<?=$wood?>" size="10" /></td>
</tr>
<tr>
<td><img src="imagenes/recursos/2.gif" alt="<?=self::$texto->get('barro')?>" width="18" height="12" /></td>
<td><input name="clay" type="text" value="<?=$clay?>" size="10" /></td>
</tr>
<tr>
<td><img src="imagenes/recursos/3.gif" alt="<?=self::$texto->get('hierro')?>" width="18" height="12" /></td>
<td><input name="iron" type="text" value="<?=$iron?>" size="10" /></td>
</tr>
<tr>
<td><img src="imagenes/recursos/4.gif" alt="<?=self::$texto->get('cereal')?>" width="18" height="12" /></td>
<td><input name="crop" type="text" value="<?=$crop?>" size="10" /></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"><input type="submit" class="boton" value="<?=self::$texto->get('calcular')?>" /></td>
</tr>
</table>
</form>
<br />
<?php if (!empty($rows)) {?>
<table border="0" align="center" cellpadding="2" cellspacing="1" class="tabla2">
<tr class="E2">
<td width="50" rowspan="2"><?=self::$texto->get('unidad')?></td>
<td colspan="4"><?=self::$texto->get('rec.npc')?></td>
<td width="100" rowspan="2"><?=self::$texto->get('#tropas')?></td>
</tr>
<tr class="E2">
<td width="110"><img src="imagenes/recursos/1.gif" alt="Madera" width="18" height="12" /></td>
<td width="110"><img src="imagenes/recursos/2.gif" alt="Barro" width="18" height="12" /></td>
<td width="110"><img src="imagenes/recursos/3.gif" alt="Hierro" width="18" height="12" /></td>
<td width="110"><img src="imagenes/recursos/4.gif" alt="Cereal" width="18" height="12" /></td>
</tr>
<?php
$i = 0; $alter = 0;
while ( $i < 10 )
{
if ($alter%2 == 0) echo "<tr class=\"c1\">\n\t";
else echo "<tr class=\"c2\">\n\t";
++$alter;
$raza = self::$texto->get('R'.$rows[$i][0].'L');
$idtropa = ($rows[$i][0]*10)+$i;
$NombreTropa = self::$texto->get($raza, $idtropa);
echo "<td><img src=\"imagenes/tropas/".$raza."/".$idtropa.".gif\" title=\"".$NombreTropa."\" width=\"16\" height=\"16\" /></td>";
echo "<td>".$rows[$i][1]."</td>";
echo "<td>".$rows[$i][2]."</td>";
echo "<td>".$rows[$i][3]."</td>";
echo "<td>".$rows[$i][4]."</td>";
echo "<td>".$rows[$i][5]."</td>";
echo "</tr>";
++$i;
}
?>
</table>
<?php } ?>
</div>
</div>
</body>
</html>