Additions

+Added the possibility to send units to another villages (spy,
reinforcement, normal attack and raid)
+Added the possibility to set the spying type and the catapult targets
+Some changes in the DB
This commit is contained in:
iopietro
2018-09-20 12:52:47 +02:00
parent 62d6e19ee9
commit 0065cb3970
17 changed files with 774 additions and 576 deletions
+102 -315
View File
@@ -1,330 +1,117 @@
<?php
$ckey = $generator->generateRandStr(6);
{$attackType = [1 => $smarty.const.U14, $smarty.const.REINFORCE, $smarty.const.NORMALATTACK, $smarty.const.RAID]}
<input name="ckey" value="{$ckey}" type="hidden">
if (!isset($process['t1']) || $process['t1'] == ''){ $t1 = 0; }else{ $t1 = $process['t1']; }
if (!isset($process['t2']) || $process['t2'] == ''){ $t2 = 0; }else{ $t2 = $process['t2']; }
if (!isset($process['t3']) || $process['t3'] == ''){ $t3 = 0; }else{ $t3 = $process['t3']; if ($session->tribe == 3) $scout=1; }
if (!isset($process['t4']) || $process['t4'] == ''){ $t4 = 0; }else{ $t4 = $process['t4']; if ($session->tribe == 1 || $session->tribe == 2 || $session->tribe == 4 || $session->tribe == 5) $scout=1; }
if (!isset($process['t5']) || $process['t5'] == ''){ $t5 = 0; }else{ $t5 = $process['t5']; }
if (!isset($process['t6']) || $process['t6'] == ''){ $t6 = 0; }else{ $t6 = $process['t6']; }
if (!isset($process['t7']) || $process['t7'] == ''){ $t7 = 0; }else{ $t7 = $process['t7']; }
if (!isset($process['t8']) || $process['t8'] == ''){ $t8 = 0; }else{ $t8 = $process['t8']; }
if (!isset($process['t9']) || $process['t9'] == ''){ $t9 = 0; }else{ $t9 = $process['t9']; }
if (!isset($process['t10']) || $process['t10'] == ''){ $t10 = 0; }else{ $t10 = $process['t10']; }
if (!isset($process['t11']) || $process['t11'] == ''){ $t11 = 0; }else{ $t11 = $process['t11']; $showhero=1; }
{$colspan = 10}
{if $units[11] > 0}
{$colspan = 11}
{/if}
for($i = 1; $i <= 11; $i++){
$totalunits += (($i != 3 && $session->tribe == 3) ||
($i != 4 && $session->tribe != 3)) ? (!empty($process['t'.$i]) ? $process['t'.$i] : 0) : 0;
}
if (isset($scout) && $scout == 1 && isset($totalunits) && $totalunits == 0 && $process['c'] != 2) {
$process['c'] = 1;
}
$id = $database->addA2b($ckey, time(), $process['0'], $t1, $t2, $t3, $t4, $t5, $t6, $t7, $t8, $t9, $t10, $t11, $process['c']);
$actionType = (["Scout", "Reinforcement", "Normal attack", "Raid"])[$process['c'] - 1];
$uid = $session->uid;
$tribe = $session->tribe;
$start = ($tribe - 1) * 10 + 1;
$end = $tribe * 10;
?>
<h1><?php echo $actionType." to ".$process[1]; ?></h1>
<form method="post" action="a2b.php">
<table id="short_info" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<th>Destination:</th>
<td><a href="karte.php?d=<?php echo $process[0]; ?>&c=<?php echo $generator->getMapCheck($process[0]); ?>"><?php echo $process[1]; ?> (<?php echo $coor['x']; ?>|<?php echo $coor['y']; ?>)</a></td>
</tr>
<tr>
<th>Owner:</th>
<td><a href="spieler.php?uid=<?php echo $process['2']; ?>"><?php echo $database->getUserField($process['2'],'username',0); ?></a></td>
</tr>
</tbody>
</table>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td><?php echo $process[1]; ?></td>
<td colspan="<?php if(!empty($process['t11'])){ echo"11"; }else{ echo"10"; } ?>"><?php echo $actionType." to ".$process['1']; ?></td>
</tr>
</thead>
<tbody class="units">
<tr>
<td></td>
<?php
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
} if (!empty($process['t11'])){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}?>
</tr>
<tr>
<th>Troops</th>
<td <?php if (!isset($process['t1']) || $process['t1'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t1'];} ?></td>
<td <?php if (!isset($process['t2']) || $process['t2'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t2'];} ?></td>
<td <?php if (!isset($process['t3']) || $process['t3'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t3'];} ?></td>
<td <?php if (!isset($process['t4']) || $process['t4'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t4'];} ?></td>
<td <?php if (!isset($process['t5']) || $process['t5'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t5'];} ?></td>
<td <?php if (!isset($process['t6']) || $process['t6'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t6'];} ?></td>
<td <?php if (!isset($process['t7']) || $process['t7'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t7'];} ?></td>
<td <?php if (!isset($process['t8']) || $process['t8'] == ''){ echo "class=\"none\">0"; }else{ $kata='1'; echo ">".$process['t8'];} ?></td>
<td <?php if (!isset($process['t9']) || $process['t9'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t9'];} ?></td>
<td <?php if (!isset($process['t10']) || $process['t10'] == ''){ echo "class=\"none\">0"; }else{ echo ">".$process['t10'];} ?></td>
<?php if (!isset($process['t11']) || $process['t11'] == ''){ echo ""; }else{ echo "<td>".$process['t11']."</td>";} ?>
</tr>
</tbody>
<?php if ($process['c']==1){
?>
<tbody class="options">
<tr>
<th>Options</th>
<td colspan="<?php if(!empty($process['t11'])){ echo"11"; }else{ echo"10"; } ?>"><input class="radio" name="spy" value="1" checked="checked" type="radio">Scout resources and troops<br>
<input class="radio" name="spy" value="2" type="radio">Scout defences and troops </td>
</tr>
</tbody>
<?php } ?>
<?php if(isset($kata) && $process['c'] != 2){?><tr>
<?php if($process['c']== 3){ ?><tbody class="cata">
<tr>
<th>Destination:</th>
<td colspan="<?php echo !empty($process['t11']) ? 11 : 10; ?>">
<select name="ctar1" class="dropdown">
<option value="0">Random</option>
<?php if($building->getTypeLevel(16) >= 5) { ?>
<optgroup label="Resources">
<option value="1">Woodcutter</option>
<option value="2">Clay Pit</option>
<option value="3">Iron Mine</option>
<option value="4">Cropland</option>
<option value="5">Sawmill</option>
<option value="6">Brickyard</option>
<option value="7">Iron Foundry</option>
<option value="8">Grain Mill</option>
<option value="9">Bakery</option>
</optgroup>
<?php } ?>
<?php if($building->getTypeLevel(16) >= 3) { ?>
<optgroup label="Infrastructure">
<option value="10">Warehouse</option>
<option value="11">Granary</option>
<?php if($building->getTypeLevel(16) >= 10) { ?>
<option value="15">Main building</option>
<option value="17">Marketplace</option>
<option value="18">Embassy</option>
<option value="24">Townhall</option>
<option value="25">Residence</option>
<option value="26">Palace</option>
<option value="27">Treasury</option>
<option value="28">Trade office</option>
<option value="35">Brewery</option>
<?php } ?>
<option value="38">Great warehouse</option>
<option value="39">Great granary</option>
<option value="40">Wonder of the World</option>
</optgroup>
<?php } ?>
<?php if($building->getTypeLevel(16) >= 10) { ?>
<optgroup label="Military">
<option value="12">Blacksmith</option>
<option value="13">Armoury</option>
<option value="14">Tournament square</option>
<option value="16">Rally point</option>
<option value="19">Barracks</option>
<option value="20">Stable</option>
<option value="21">Workshop</option>
<option value="22">Academy</option>
<option value="29">Great barracks</option>
<option value="30">Great stable</option>
<option value="37">Hero's mansion</option>
</optgroup>
<?php } ?>
</select>
<?php if($building->getTypeLevel(16) == 20 && $process['t8'] >= 20) { ?>
<select name="ctar2" class="dropdown">
<option value="0">-</option>
<option value="99">Random</option>
<?php if($building->getTypeLevel(16) >= 5) { ?>
<optgroup label="Resources">
<option value="1">Woodcutter</option>
<option value="2">Clay Pit</option>
<option value="3">Iron Mine</option>
<option value="4">Cropland</option>
<option value="5">Sawmill</option>
<option value="6">Brickyard</option>
<option value="7">Iron Foundry</option>
<option value="8">Grain Mill</option>
<option value="9">Bakery</option>
</optgroup>
<?php } ?>
<?php if($building->getTypeLevel(16) >= 3) { ?>
<optgroup label="Infrastructure">
<option value="10">Warehouse</option>
<option value="11">Granary</option>
<?php if($building->getTypeLevel(16) >= 10) { ?>
<option value="15">Main building</option>
<option value="17">Marketplace</option>
<option value="18">Embassy</option>
<option value="24">Townhall</option>
<option value="25">Residence</option>
<option value="26">Palace</option>
<option value="27">Treasury</option>
<option value="28">Trade office</option>
<option value="35">Brewery</option>
<?php } ?>
<option value="38">Great warehouse</option>
<option value="39">Great granary</option>
<option value="40">Wonder of the World</option>
</optgroup>
<?php } ?>
<?php if($building->getTypeLevel(16) >= 10) { ?>
<optgroup label="Military">
<option value="12">Blacksmith</option>
<option value="13">Armoury</option>
<option value="14">Tournament square</option>
<option value="16">Rally point</option>
<option value="19">Barracks</option>
<option value="20">Stable</option>
<option value="21">Workshop</option>
<option value="22">Academy</option>
<option value="29">Great barracks</option>
<option value="30">Great stable</option>
<option value="37">Hero's mansion</option>
</optgroup>
<?php } ?>
</select>
<?php }?>
<span class="info">(will be attacked by catapult(s))</span>
</td>
</tr>
</tbody><?PHP
}
else if($process['c']=='4')
{
?><tbody class="infos">
<table id="short_info" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<th>Destination:</th>
<td colspan="<?php echo !empty($process['t11']) ? 11 : 10; ?>">
<?php
echo"Warning: Catapult will <b>ONLY</b> shoot with a normal attack (they dont shoot with raids!)";
?>
</td>
<th>{$smarty.const.DESTINATION}:</th>
<td>
<a href="karte.php?d={$targetVillageVref}&c={$targetVillageMapCheck}">{$targetVillageName} ({$targetVillageCoordinates['x']}|{$targetVillageCoordinates['y']})</a>
</td>
</tr>
<?php
}
?>
<?php } ?>
<tbody class="infos">
<tr>
<th>Arrived:</th>
<?php
$troopsTime = $database->getWalkingTroopsTime($village->wid, $process[0], $session->uid, $session->tribe, $process, 1, 't');
$time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime);
?>
<td colspan="<?php echo !empty($process['t11']) ? 11 : 10; ?>">
<div class="in">in <?php echo $generator->getTimeFormat($time); ?></div>
<div class="at">at <span id="tp2"> <?php echo $generator->procMtime(date('U') + $time, 9)?></span><span> hours</span></div>
</td>
<tr>
<th>{$smarty.const.OWNER}:</th>
<td>
<a href="spieler.php?uid={$targetOwnerId}">{$targetOwnerUsername}</a>
</td>
</tr>
</tbody>
</table>
<input name="timestamp" value="<?php echo time(); ?>" type="hidden">
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td>{$targetVillageName}</td>
<td colspan="{$colspan}">{$attackType[$c]} {$smarty.const.TO} {$targetVillageName}</td>
</tr>
<input name="timestamp_checksum" value="<?php echo $ckey; ?>" type="hidden">
</thead>
<input name="ckey" value="<?php echo $id; ?>" type="hidden">
<tbody class="units">
<tr>
<td></td>
{foreach $villagePresentUnits.unitsArray as $type => $unit}
<td>
<img src="assets/img/x.gif" class="unit u{if $type <= 10}{($tribe - 1) * 10 + $type}{else}hero{/if}" title="{if $type <= 10}{$unit.name}{else}{$smarty.const.HERO}{/if}" alt="{if $type <= 10}{$unit.name}{else}{$smarty.const.HERO}{/if}" />
</td>
{/foreach}
</tr>
<tr>
<th>{$smarty.const.TROOPS}</th>
<input name="id" value="39" type="hidden">
{for $i = 1 to 11}
{if $i == 11 && $units[$i] == 0}
{continue}
{/if}
{if $units[$i] == 0}
<td class="none">
0
</td>
{else}
<td>
{$units[$i]}
</td>
{/if}
{/for}
<input name="a" value="533374" type="hidden">
<input name="c" value="3" type="hidden">
</tr>
<?php
if($database->hasBeginnerProtection($village->wid) == 1 && $database->hasBeginnerProtection($process['0']) == 0){
echo"<span style=\"color: #DD0000\"><b>Caution:</b> Attacking a player will lose the protection!</span>";
}
if($database->hasBeginnerProtection($process['0']) == 1) {
echo"<b>User presently has beginners protection</b>";
} else {
?>
<p class="btn"><input value="ok" name="s1" id="btn_ok"
</tbody>
class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.disabled==false) {document.getElementsByTagName('form')[0].submit();} this.disabled=true;" onLoad="this.disabled=false;"></p>
{if !empty($catapultTargetBuildings)}
<tbody class="cata">
<tr>
<th>{$smarty.const.DESTINATION}:</th>
<td colspan="{$colspan}">
{$targetName = 'ctar1'}
{$randomTargetValue = 0}
{include file=$smarty.const.TEMPLATES_DIR|cat:'sendUnits/catapultTargets.tpl'}
<?php } ?>
</form>
</div>
{if $units[8] >= 20}
{$targetName = 'ctar2'}
{$randomTargetValue = -1}
{include file=$smarty.const.TEMPLATES_DIR|cat:'sendUnits/catapultTargets.tpl'}
{/if}
</td>
</tr>
</tbody>
{/if}
{if $c == 1}
<tbody class="options">
<tr>
<th>{$smarty.const.OPTIONS}</th>
<td colspan="{$colspan}">
<input class="radio" name="spy" value="1" checked="checked" type="radio">{$smarty.const.SCOUT_RES_AND_UNITS}<br>
<input class="radio" name="spy" value="2"type="radio">{$smarty.const.SCOUT_DEF_AND_UNITS}</td>
</tr>
</tbody>
{/if}
<tbody class="infos">
<tr>
<th>{$smarty.const.ARRIVED}</th>
<td colspan="{$colspan}">
<div class="in">{$smarty.const.IN} {$arrivalTime[0]}</div>
<div class="at">
{$smarty.const.AT} <span id="tp2"> {$arrivalTime[1]}</span>
<span> {$smarty.const.HOURS}</span>
</div>
</td>
</tr>
</tbody>
</table>
{if $underBeginnerProtection}
<span style="color: #DD0000">{$smarty.const.WARNING_UNDER_PROTECTION}</span>
{/if}
<p class="btn">
<button value="sendUnits" name="action" id="btn_ok" class="trav_buttons"> {$smarty.const.OK} </button>
</p>
+17
View File
@@ -0,0 +1,17 @@
{$groupNames = [$smarty.const.RESOURCES, $smarty.const.INFRASTRUCTURE, $smarty.const.MILITARY]}
<select name="{$targetName}" class="dropdown">
{if $randomTargetValue < 0}
<option value="{$randomTargetValue + 1}">-</option>
{/if}
<option value="{$randomTargetValue}">{$smarty.const.RANDOM}</option>
{foreach $groupNames as $type => $groupName}
{if !empty($catapultTargetBuildings[$type])}
<optgroup label="{$groupName}">
{foreach $catapultTargetBuildings[$type] as $building}
<option value="{$building.id}">{$building.name}</option>
{/foreach}
</optgroup>
{/if}
{/foreach}
</select>
+4 -4
View File
@@ -3,7 +3,7 @@
<tr>
<td class="sel">
<label>
<input class="radio" name="c" value="2" type="radio"> {$smarty.const.REINFORCEMENT}
<input class="radio" name="c" value="2" type="radio" {if !isset($c) || $c == 2}checked="checked"{/if}> {$smarty.const.REINFORCEMENT}
</label>
</td>
@@ -14,7 +14,7 @@
<tr>
<td class="sel">
<label>
<input class="radio" name="c" value="3" type="radio"> {$smarty.const.NORMALATTACK}
<input class="radio" name="c" value="3" type="radio" {if isset($c) && $c == 3}checked="checked"{/if}> {$smarty.const.NORMALATTACK}
</label>
</td>
<td class="or">{$smarty.const.OR}</td>
@@ -22,7 +22,7 @@
<tr>
<td class="sel">
<label>
<input class="radio" name="c" value="4" type="radio"> {$smarty.const.RAID}
<input class="radio" name="c" value="4" type="radio" {if isset($c) && $c == 4}checked="checked"{/if}> {$smarty.const.RAID}
</label>
</td>
@@ -36,4 +36,4 @@
</tbody>
</table>
<br />
<button value="prepareUnitsToSend" name="action" id="btn_ok" class="trav_buttons" onclick="this.disabled=true;this.form.submit();"> {$smarty.const.OK} </button>
<button value="prepareUnitsToSend" name="action" id="btn_ok" class="trav_buttons"> {$smarty.const.OK} </button>
+38 -160
View File
@@ -1,161 +1,39 @@
<h1>{$smarty.const.SEND_TROOPS}</h1>
<table id="troops" cellpadding="1" cellspacing="1">
<tbody>
{$quantity = [[1, 4, 7 ,9], [2, 5, 8 ,10], [3, 6, 11]]}
{$quantityCount = count($quantity) - 1}
{$class = [
1 => 'line-first column-first large',
4 => 'line-first large',
7 => 'line-first regular',
9 => 'line-first column-last small',
2 => 'column-first large',
5 => 'large',
8 => 'regular',
10 => 'column-last small',
3 => 'line-last column-first large',
6 => 'line-last large',
11 => 'line-last regular'
]}
<input name="b" value="1" type="hidden">
<table id="troops" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td class="line-first column-first large"><img class="unit u1"
src="img/x.gif" title="Legionnaire"
onclick="document.snd.t1.value=''; return false;" alt="Legionnaire">
<input class="text"
<?php if ($village->unitarray['u1']<=0) {echo ' disabled="disabled"';}?>
name="t1" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u1'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t1.value=" . $village->unitarray['u1'] . "; return false;\">(" . $village->unitarray['u1'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="line-first large"><img class="unit u4" src="img/x.gif"
title="Equites Legati" alt="Equites Legati"> <input class="text"
<?php if ($village->unitarray['u4']<=0) {echo ' disabled="disabled"';}?>
name="t4" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u4'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t4.value=" . $village->unitarray['u4'] . "; return false;\">(" . $village->unitarray['u4'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="line-first regular"><img class="unit u7" src="img/x.gif"
title="Battering Ram" alt="Battering Ram"> <input class="text"
<?php if ($village->unitarray['u7']<=0) {echo ' disabled="disabled"';}?>
name="t7" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u7'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t7.value=" . $village->unitarray['u7'] . "; return false;\">(" . $village->unitarray['u7'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="line-first column-last small"><img class="unit u9"
src="img/x.gif" title="Senator" alt="Senator"> <input class="text"
<?php if ($village->unitarray['u9']<=0) {echo ' disabled="disabled"';}?>
name="t9" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u9'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t9.value=" . $village->unitarray['u9'] . "; return false;\">(" . $village->unitarray['u9'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
</tr>
<tr>
<td class="column-first large"><img class="unit u2" src="img/x.gif"
title="Praetorian" alt="Praetorian"> <input class="text"
<?php if ($village->unitarray['u2']<=0) {echo ' disabled="disabled"';}?>
name="t2" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u2'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t2.value=" . $village->unitarray['u2'] . "; return false;\">(" . $village->unitarray['u2'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="large"><img class="unit u5" src="img/x.gif"
title="Equites Imperatoris" alt="Equites Imperatoris"> <input
class="text"
<?php if ($village->unitarray['u5']<=0) {echo ' disabled="disabled"';}?>
name="t5" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u5'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t5.value=" . $village->unitarray['u5'] . "; return false;\">(" . $village->unitarray['u5'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="regular"><img class="unit u8" src="img/x.gif"
title="Fire Catapult" alt="Fire Catapult"> <input class="text"
<?php if ($village->unitarray['u8']<=0) {echo ' disabled="disabled"';}?>
name="t8" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u8'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t8.value=" . $village->unitarray['u8'] . "; return false;\">(" . $village->unitarray['u8'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="column-last small"><img class="unit u10" src="img/x.gif"
title="Settler" alt="Settler"> <input class="text"
<?php if ($village->unitarray['u10']<=0) {echo ' disabled="disabled"';}?>
name="t10" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u10'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t10.value=" . $village->unitarray['u10'] . "; return false;\">(" . $village->unitarray['u10'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
</tr>
<tr>
<td class="line-last column-first large"><img class="unit u3"
src="img/x.gif" title="Imperian" alt="Imperian"> <input
class="text"
<?php if ($village->unitarray['u3']<=0) {echo ' disabled="disabled"';}?>
name="t3" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u3'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t3.value=" . $village->unitarray['u3'] . "; return false;\">(" . $village->unitarray['u3'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="line-last large"><img class="unit u6" src="img/x.gif"
title="Equites Caesaris" alt="Equites Caesaris"> <input
class="text"
<?php if ($village->unitarray['u6']<=0) {echo ' disabled="disabled"';}?>
name="t6" value="" maxlength="6" type="text">
<?php
if ($village->unitarray['u6'] > 0) {
echo "<a href=\"#\" onclick=\"document.snd.t6.value=" . $village->unitarray['u6'] . "; return false;\">(" . $village->unitarray['u6'] . ")</a></td>";
} else {
echo "<span class=\"none\">(0)</span></td>";
}
?>
<td class="line-last regular"><?php
if ($village->unitarray['hero'] > 0) {
echo "<img class=\"unit uhero\" src=\"img/x.gif\" title=\"Hero\" alt=\"Hero\"> <input class=\"text\" name=\"t11\" value=\"\" maxlength=\"6\" type=\"text\"> ";
echo "<a href=\"#\" onclick=\"document.snd.t11.value=".$village->unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")</a></td>";
}
?></td>
<td class="line-last column-last"></td>
</tr>
</tbody>
</table>
{for $i = 0 to $quantityCount}
<tr>
{for $j = 0 to count($quantity[$i]) - 1}
{$type = $quantity[$i][$j]}
{if $type == 11 && $villagePresentUnits.unitsArray[$type].amount == 0}
{continue}
{/if}
<td class="{$class[$type]}">
<img class="unit u{if $type <= 10}{($tribe - 1) * 10 + $type}{else}hero{/if}" src="assets/img/x.gif" onclick="document.getElementsByName('units[{$type}]')[0].value=''; return false;" title="{if $type <= 10}{$villagePresentUnits.unitsArray[$type].name}{else}{$smarty.const.U0}{/if}" alt="{if $type <= 10}{$villagePresentUnits.unitsArray[$type].name}{else}{$smarty.const.U0}{/if}">
<input class="text" {if $villagePresentUnits.unitsArray[$type].amount == 0}disabled="disabled"{/if} name="units[{$type}]" maxlength="6" type="text" {if $units[$type] > 0}value="{$units[$type]}"{/if}>
{if $villagePresentUnits.unitsArray[$type].amount > 0}
<a href="#" onclick="document.getElementsByName('units[{$type}]')[0].value={$villagePresentUnits.unitsArray[$type].amount}; return false;">({$villagePresentUnits.unitsArray[$type].amount})</a>
{else}
<span class="none">(0)</span>
{/if}
</td>
{/for}
</tr>
{/for}
</tbody>
</table>
+1 -1
View File
@@ -3,7 +3,7 @@
{if !isset($parameters['t'])}
{include file=$smarty.const.TEMPLATES_DIR|cat:'village/buildings/rallyPoint/movements.tpl'}
{elseif $parameters['t'] == 1}
{include file=$smarty.const.TEMPLATES_DIR|cat:'sendUnits/search.tpl'}
{include file=$smarty.const.TEMPLATES_DIR|cat:'village/buildings/rallyPoint/sendUnits.tpl'}
{elseif $parameters['t'] == 2}
{include file=$smarty.const.TEMPLATES_DIR|cat:'simulator/.tpl'}
{elseif $parameters['t'] == 3}
@@ -0,0 +1,11 @@
{if !isset($prepareUnits)}
<form method="POST" action="build.php?id={$parameters['id']}&t=1">
{include file=$smarty.const.TEMPLATES_DIR|cat:'sendUnits/units.tpl'}
{include file=$smarty.const.TEMPLATES_DIR|cat:'sendUnits/search.tpl'}
{include file=$smarty.const.TEMPLATES_DIR|cat:'error.tpl'}
</form>
{else}
<form method="POST" action="build.php?id={$parameters['id']}">
{include file=$smarty.const.TEMPLATES_DIR|cat:'sendUnits/attack.tpl'}
</form>
{/if}