Location: PHPKode > projects > Alliances Manager > vistas/am_aldeas.php
<?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/>.
*/


if (!isset($aldea))
{
	$aldea['x']= "";
	$aldea['y']= "";
	$aldea['nombre']= "";
	$aldea['tipo']= "";
	$aldea['residencia']= "";
	$aldea['muralla']= "";
	$aldea['granero']= "";
	$aldea['descripcion']= "";
	$aldea['es_capital'] = 0;
	$aldea['es_principal'] = 0;
}
cabecera("",$titulo);
?>
</head>
<body>
<div id="top"><?php include("libs/top.php") ?></div>
<div id="contenido">
<div id="left"><?php $top="panel"; include("libs/menu.php"); ?></div>
<div id="cuerpo">
	<form name=<?=$accion ?> method="post" action=<?=$direccion ?> />
	<input name="accion" type="hidden" value=<?=$accion ?>/>
	<input name="aldeax" type="hidden" value=<?=$aldea['x'] ?> />
	<input name="aldeay" type="hidden" value=<?=$aldea['y'] ?> />
	<table width="380" height="290" border="1" cellpadding="0" cellspacing="0" bordercolor="#FF0000" class="create_tabla" align="center">
 	 <tr class="encabezado1"><td colspan="2" nowrap="nowrap"><?=$titulo?></td></tr>
  	<tr>
    	<td width="168" nowrap="nowrap"><?=self::$texto->get('nombre')?></td>
    	<td width="206"><input type="text" name="nombre" size="25" value="<?=$aldea['nombre']?>" maxlength="26" tabindex="1"/></td>
  	</tr>
  	<tr>
    	<td nowrap="nowrap"><?=self::$texto->get('coordenadas')?></td>
    	<td>(
          <input name="x" type="text" id="x" size="2" value="<?=$aldea['x']?>" maxlength="4" tabindex="2"/>
	   |
	   <input name="y" type="text" id="y" size="2" value="<?=$aldea['y']?>" maxlength="4" tabindex="3"/>
	    )</td>
  	</tr>
  	<tr>
  	  <td nowrap="nowrap"><?=self::$texto->get('es_capital')?></td>
  	  <td><input name="capital" type="checkbox" <?php echo (($aldea['es_capital']) ? "checked=\"checked\"" : "") ?> tabindex="4"></td>
	  </tr>
  	<tr>
  	  <td nowrap="nowrap"><?=self::$texto->get('es_principal')?></td>
  	  <td><input name="principal" type="checkbox" id="principal" tabindex="4" <?php echo (($aldea['es_principal']) ? "checked=\"checked\"" : "") ?> ></td>
	  </tr>
  	<tr>
	<?php 
		$aux = array("","","","","","");
switch($aldea['tipo'])
{
	case 'Normal': $aux[0] = " selected=\"selected\"";
		break;
	case 'Madera': $aux[1] = " selected=\"selected\"";
		break;
	case 'Barro': $aux[2] = " selected=\"selected\"";
		break;
	case 'Hierro': $aux[3] = " selected=\"selected\"";
		break;
	case '15c': $aux[4] = " selected=\"selected\"";
		break;
	case '9c': $aux[4] = " selected=\"selected\"";
		break;
}
?>
    	<td nowrap="nowrap"><?=self::$texto->get('tipo_aldea')?></td>
    	<td>
    	  <select name="t_aldea" tabindex="5">
    	    <option value="<?=self::$texto->get('normal')?>"<?=$aux[0]?>><?=self::$texto->get('normal')?></option>
    	    <option value="<?=self::$texto->get('madera')?>"<?=$aux[1]?>><?=self::$texto->get('madera')?></option>
    	    <option value="<?=self::$texto->get('barro')?>"<?=$aux[2]?>><?=self::$texto->get('barro')?></option>
    	    <option value="<?=self::$texto->get('hierro')?>"<?=$aux[3]?>><?=self::$texto->get('hierro')?></option>
    	    <option value="<?=self::$texto->get('15c')?>"<?=$aux[4]?>><?=self::$texto->get('15c')?></option>
    	    <option value="<?=self::$texto->get('9c')?>"<?=$aux[5]?>><?=self::$texto->get('9c')?></option>
          </select>		</td>
  	</tr>
  	<tr>
      <td nowrap="nowrap"><?=self::$texto->get('capgranero')?></td>
  	  <td><input type="text" name="granero" size="9" maxlength="9" tabindex="6" value=<?=$aldea['granero']?>></td>
    </tr>
  	<tr>
      <td nowrap="nowrap"><?=self::$texto->get('lvl.res.pal')?></td>
  	    <td><select name="n_rp" tabindex="7" value=<?=$aldea['residencia']?>> 
<?php
   for ($i=0; $i<=20; $i++) {
  	    if ( $aldea['residencia']==$i ) echo "<option value=\"".$i."\" selected=\"selected\">".$i."</option>";
		else echo "<option value=\"".$i."\">".$i."</option>";
	}
?>
	      </select>	    </td>
	  </tr>
  	 <tr>
      <td nowrap="nowrap"><?=self::$texto->get('lvl.muralla')?></td>
  	  <td><select name="muro" tabindex="8" value=<?=$aldea['muralla']?>>
<?php
     for ($i=0; $i<=20; $i++) {
  	    if ( $aldea['muralla']==$i ) echo "<option value=\"".$i."\" selected=\"selected\">".$i."</option>";
		else echo "<option value=\"".$i."\">".$i."</option>";
	}
?>
      </select></td>
	  </tr>
<?php
$aux = array("","","","");
switch($aldea['descripcion'])
{
	case 'Ofensiva': $aux[0] = " selected=\"selected\"";
		break;
	case 'Defensiva': $aux[1] = " selected=\"selected\"";
		break;
	case 'Productora': $aux[2] = " selected=\"selected\"";
		break;
	case 'Mixta': $aux[3] = " selected=\"selected\"";
		break;
}
?>
  	<tr>
      <td nowrap="nowrap"><?=self::$texto->get('descripcion')?></td>
  	  <td><select name="descrip" tabindex="9">
  	    <option value="<?=self::$texto->get('ofensiva')?>" <?=$aux[0]?>><?=self::$texto->get('ofensiva')?></option>
  	    <option value="<?=self::$texto->get('defensiva')?>"<?=$aux[1]?>><?=self::$texto->get('defensiva')?></option>
  	    <option value="<?=self::$texto->get('productora')?>"<?=$aux[2]?>><?=self::$texto->get('productora')?></option>
		<option value="<?=self::$texto->get('mixta')?>" <?=$aux[3]?>><?=self::$texto->get('mixta')?></option>
	</select>  	  </td>
	  </tr>
	  <tr><td colspan="2" nowrap="nowrap" class="encabezado1">
			 <table width="200" border="0" align="center" cellpadding="2" cellspacing="0" class="encabezado1">
			  <tr>
                <td><input type="submit" class="boton" value="<?=self::$texto->get('aceptar')?>" tabindex="10" /></td>
			    <td><input type="button" class="boton" onClick="parent.location='?ctrl=Aldeas&mod=aldeas'" value="<?=self::$texto->get('cancelar')?>" /></td>
			  </tr>
			</table>
		</td>
	   </tr>
  </table>
</form>
<br>

</div>
</div>
</body>
</html>
Return current item: Alliances Manager