fix: warnings and errors when creating Natars

#384
This commit is contained in:
Martin Ambrus
2017-11-26 21:20:46 +01:00
parent cb60226297
commit 89e14abd5e
3 changed files with 45 additions and 39 deletions
+20 -16
View File
@@ -1,4 +1,4 @@
<?php
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
@@ -11,12 +11,14 @@
?>
<?php
$wood = round($village->getProd("wood"));
$clay = round($village->getProd("clay"));
$iron = round($village->getProd("iron"));
$crop = round($village->getProd("crop"));
$totalproduction = $village->allcrop; // all crops + bakery + grain mill
?>
// Natars cration script does not have village initialized
if (!empty($village)) {
$wood = round( $village->getProd( "wood" ) );
$clay = round( $village->getProd( "clay" ) );
$iron = round( $village->getProd( "iron" ) );
$crop = round( $village->getProd( "crop" ) );
$totalproduction = $village->allcrop; // all crops + bakery + grain mill
?>
<div id="res">
<div id="resWrap">
@@ -36,18 +38,18 @@ $totalproduction = $village->allcrop; // all crops + bakery + grain mill
<td title="<?php echo $crop; ?>"><?php echo "0/".$village->maxcrop; ?></td>
<?php } ?>
<td><img src="img/x.gif" class="r5" alt="<?php echo CROP_COM; ?>" title="<?php echo CROP_COM; ?>" /></td>
<td><?php echo ($village->pop+$technology->getUpkeep($village->unitall,0))."/".$totalproduction.""; ?></td>
<td><?php echo $village->pop+$technology->getUpkeep($village->unitall,0))."/".$totalproduction.""; ?></td>
</tr>
</table>
<table cellpadding="1" cellspacing="1">
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td></td>
<td><?php
<td><?php
if($session->gold <= 1){
echo '<font color="#B3B3B3"><img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Remaining gold" title="You currently have: '.$session->gold.' gold"/> '.$session->gold.' <span><span>G</span><span>o</span><span>l</span><span>d</span></span></font>';
}
@@ -56,11 +58,13 @@ $totalproduction = $village->allcrop; // all crops + bakery + grain mill
}
?>
</td>
</tr>
</table>
</div>
</div>
</div>
<?php
}