fix: undefined variables

This commit is contained in:
Martin Ambrus
2017-10-28 12:04:28 +02:00
parent 25a657e60f
commit 2340c3821c
3 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -124,8 +124,8 @@ class Units {
if($disabled != "" && $post['c'] == 3){
$form->addError("error","You can't attack this village/oasis with normal attack");
}
if( !$post['t1'] && !$post['t2'] && !$post['t3'] && !$post['t4'] && !$post['t5'] &&
!$post['t6'] && !$post['t7'] && !$post['t8'] && !$post['t9'] && !$post['t10'] && !$post['t11']){
if(empty($post['t1']) && empty($post['t2']) && empty($post['t3']) && empty($post['t4']) && empty($post['t5']) &&
empty($post['t6']) && empty($post['t7']) && empty($post['t8']) && empty($post['t9']) && empty($post['t10']) && empty($post['t11'])){
$form->addError("error","You need to mark min. one troop");
}
+5 -5
View File
@@ -20,7 +20,7 @@ $to = array('x'=>$coor['x'], 'y'=>$coor['y']);
$fastertroops = 1;
}
$time = round($generator->procDistanceTime($from,$to,300,0)/$fastertroops);
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
@@ -143,7 +143,7 @@ $end = ($tribe*10);
<td><?php echo $process[1]; ?></td>
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>"><?php echo $actionType." to ".$process['1']; ?></td>
<td colspan="<?php if(!empty($process['t11'])){ echo"11"; }else{ echo"10"; } ?>"><?php echo $actionType." to ".$process['1']; ?></td>
</tr>
@@ -157,7 +157,7 @@ $end = ($tribe*10);
<?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 ($process['t11'] != ''){
} if (!empty($process['t11'])){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}?>
@@ -420,7 +420,7 @@ $end = ($tribe*10);
$fastertroops = 1;
}
$time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
@@ -436,7 +436,7 @@ $end = ($tribe*10);
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>">
<td colspan="<?php if(!empty($process['t11'])){ echo"11"; }else{ echo"10"; } ?>">
<div class="in">in <?php echo $generator->getTimeFormat($time); ?></div>
+4 -4
View File
@@ -1,11 +1,11 @@
<table id="coords" cellpadding="1" cellspacing="1">
<input type="hidden" name="disabledr" value="<?php echo $disabledr; ?>">
<input type="hidden" name="disabled" value="<?php echo $disabled; ?>">
<input type="hidden" name="disabledr" value="<?php echo (isset($disabledr) ? $disabledr : ''); ?>">
<input type="hidden" name="disabled" value="<?php echo (isset($disabled) ? $disabled : ''); ?>">
<tbody><tr>
<td class="sel">
<label>
<input class="radio" name="c" <?php if (!$checked) {?> checked=checked <?php }?>value="2" type="radio" <?php echo $disabledr; ?>>
<input class="radio" name="c" <?php if (!isset($checked) || !$checked) {?> checked=checked <?php }?>value="2" type="radio" <?php echo (isset($disabledr) ? $disabledr : ''); ?>>
Reinforcement
</label>
</td>
@@ -29,7 +29,7 @@
<tr>
<td class="sel">
<label>
<input class="radio" name="c" <?php echo $checked; ?> value="4" type="radio">
<input class="radio" name="c" <?php echo (isset($checked) ? $checked : ''); ?> value="4" type="radio">
Raid
</label>
</td>