Files
TravianZ/Templates/Build/17_edit.tpl
T
novgorodschi catalin 55e6dd60b5 Refactor + BugFix
1. Fix a bug in Admin Panel that you can edit by yourself your rank, now you cannot edit your rank anymore.

2. Now Alliance Leader can edit his own Position

3. Fix negative value on Demolition Building, now in database at lvl is appear new level not -1

4. Refactor Ajax map, now all is alligned (Ajax folder and Map folder)

5. Fix bug from Palace (when change capital now Automation recount population automaticaly on old capital and new capital)
2026-05-18 09:18:35 +03:00

63 lines
3.1 KiB
Smarty

<?php
// 17_edit.tpl - MARKETPLACE / EDIT ROUTES
global $database;
$routeid = isset($_POST['routeid'])? (int)$_POST['routeid'] : 0;
$edited_route = $database->getTradeRoute2($routeid);
$wood = (int)($edited_route['wood']??0);
$clay = (int)($edited_route['clay']??0);
$iron = (int)($edited_route['iron']??0);
$crop = (int)($edited_route['crop']??0);
$start = (int)($edited_route['start']??0);
$deliveries = (int)($edited_route['deliveries']??1);
?>
<form action="build.php" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="editRoute2">
<input type="hidden" name="routeid" value="<?php echo $routeid;?>">
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
<thead>
<tr><th colspan="2"><?php echo EDIT_TRADE_ROUTES;?></th></tr>
</thead>
<tbody>
<tr>
<th><?php echo RESOURCES;?>:</th>
<td>
<?php $res = [
['r1', $wood, '1', LUMBER],
['r2', $clay, '2', CLAY],
['r3', $iron, '3', IRON],
['r4', $crop, '4', CROP],
];
foreach ($res as $r):?>
<img src="../../<?php echo GP_LOCATE;?>img/r/<?php echo $r[2];?>.gif" alt="<?php echo $r[3];?>" title="<?php echo $r[3];?>">
<input class="text" type="text" name="<?php echo $r[0];?>" id="<?php echo $r[0];?>" value="<?php echo $r[1];?>" maxlength="5" tabindex="1" style="width:50px;">
<?php endforeach;?>
</td>
</tr>
<tr>
<th><?php echo START_TIME_TRADE;?>:</th>
<td>
<select name="start">
<?php for ($i = 0; $i <= 23; $i++):?>
<option value="<?php echo $i;?>" <?php if($i === $start) echo 'selected';?>><?php echo str_pad($i,2,'0',STR_PAD_LEFT);?></option>
<?php endfor;?>
</select>
</td>
</tr>
<tr>
<th><?php echo DELIVERIES;?>:</th>
<td>
<select name="deliveries">
<?php for ($i = 1; $i <= 3; $i++):?>
<option value="<?php echo $i;?>" <?php if($i === $deliveries) echo 'selected';?>><?php echo $i;?></option>
<?php endfor;?>
</select>
</td>
</tr>
</tbody>
</table>
</div></div>
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
</form>