<?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('HEAD12'));
?>
</head>
<body>
<div id="top"><?php include("libs/top.php") ?></div>
<div id="contenido">
<div id="left"><?php $top = "admin"; include("libs/menu.php") ?></div>
<div id="cuerpo">
<div id="total">
<div id="du_sup">
<div id="b_jugador">
<table width="220" height="150" border="0" align="center" cellpadding="2" cellspacing="1" class="t_jugador">
<tr class="E1">
<td colspan="2"><?=$DP['nombre']?></td>
</tr>
<tr>
<td width="66" height="23"><strong>Grupo</strong></td>
<td width="121"><?=$DP['grupo'][1]?><?php if ($_SESSION['gestion']==2) { ?><a href="javascript:;"><img src="imagenes/botones/edit.png" alt="Editar" width="16" height="16" border="0" align="texttop" /></a><?php } ?></td>
</tr>
<tr>
<td colspan="2"><strong>Permisos</strong> <?php if ($_SESSION['gestion']==2) { ?><a href="javascript:;"><img src="imagenes/botones/edit.png" alt="Editar" width="16" height="16" border="0" align="texttop" /></a><?php } ?></td>
</tr>
<tr>
<td>Tropas</td>
<td><?=$DP['permisos'][0]?></td>
</tr>
<tr>
<td>Gestión</td>
<td><?=$DP['permisos'][1]?></td>
</tr>
<tr>
<td>Buscador</td>
<td><?=$DP['permisos'][2]?></td>
</tr>
<tr>
<td>Grupo</td>
<td><?=$DP['permisos'][3]?></td>
</tr>
</table>
</div>
<div id="b_aldeas">
<table width="80%" border="0" align="center" cellpadding="2" cellspacing="1" class="t_aldeas">
<tr class="E1">
<td colspan="3">Aldeas <a href="javascript:;"><img src="imagenes/botones/mas.png" alt="Detalles" width="17" height="17" border="0" align="texttop" title="Ver En Detalle" /></a></td>
</tr>
<tr>
<td colspan="3">Total</td>
</tr>
<tr>
<td>15c: <?=$aldeas[0]?></td>
<td>9c: <?=$aldeas[1]?></td>
<td>Normal: <?=$aldeas[2]?></td>
</tr>
<tr>
<td>Madera: <?=$aldeas[3]?></td>
<td>Barro: <?=$aldeas[4]?></td>
<td>Hierro: <?=$aldeas[5]?></td>
</tr>
</table>
</div>
</div>
<br />
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" class="t_tropas">
<tr class="E1">
<td height="23" colspan="12">Total de Tropas por Aldea <a href="javascript:;"><img src="imagenes/botones/mas.png" alt="Detalles" width="17" height="17" border="0" align="texttop" title="Ver En Detalle" /></a></td>
</tr>
<tr class="E2">
<td width="150">Aldea</td>
<?php
foreach ( self::$texto->get($DP['raza']) as $id => $nombre)
echo "<td><img src=\"imagenes/tropas/".$DP['raza']."/".$id.".gif\" alt=\"".$nombre."\" width=\"16\" height=\"16\" title=\"".$nombre."\"/></td> \n\t\t ";
?>
<td width="100">Consumo</td>
</tr>
<?php
$alter = 0; // Permite alterar los colores de las filas en la tabla
$cont = 0; $tot_filas = count($tropas);
$total = array ( 0=>0, 1=>0, 2=>0, 3=>0, 4=>0, 5=>0, 6=>0, 7=>0, 8=>0, 9=>0);
if (!empty($tropas))
{
while ($cont < $tot_filas)
{
// Alternamos los colores de las filas
if ($alter%2 == 0) echo "<tr class=\"c1\">";
else echo "<tr class=\"c2\">";
++$alter;
// Escapamos los datos de la aldea
echo "<td title=\"( ".$tropas[$cont]['x']." | ".$tropas[$cont]['y']." )\" align=\"left\">".$tropas[$cont]['aldea']."</td>\n";
// Metemos las cantidades de tropas y acumulamos
for ($i=0; $i<10; $i++) {
echo "<td>".$tropas[$cont]['t'.$i]."</td>";
$total[$i] += $tropas[$cont]['t'.$i];
}
// Escapamos el consumo de las tropas
echo "<td> ········ </td>";
echo "</tr>\n";
$cont++;
} //fin mientras
echo "<tr class=\"E2\"><td>TOTAL</td>";
for ($i=0; $i<10; $i++)
echo "<td>".$total[$i]."</td>";
echo "<td> </td></tr>";
} else {
echo "<tr><td colspan=\"14\"> El jugador no posee tropas </td></tr>\n";
}
?>
</table>
</div>
</div>
</div>
</body>
</html>