Location: PHPKode > projects > Simuland > world/location/upgrade.php
<?
require "../../configmain.php";
require "../../global.php";
connectdb();?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<p><?
if ($banner == '1'){
echo $bannercode;
}
?>upgrade building screen<br>
  <br>
  <?
global $bupgrad;
$useram = mysql_query("SELECT * FROM usr WHERE usr ='$user'");
$usera = mysql_fetch_array($useram);
$buildl = mysql_query("SELECT * FROM buildinglocation WHERE horz='$horz' and vert='$vert' and town ='$town'");
$buildloc = mysql_fetch_array($buildl);
$costm = mysql_query("SELECT cost, name, upgradeid FROM buildingtype WHERE buid ='$buildloc[3]'");
$cost = mysql_fetch_array($costm);
if ($usera[1] != $password){
echo "incorrect password please log in again";
}
if ($usera[1] == $password){
	if ($bupgrad == ''){
		// list upgrade types and cost
		$bupgrad = $cost[2];
		if ($cost[2] != '0'){
?> </p>
<table width="500" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
  <tr align="center"> 
    <td width="99">upgrade id</td>
    <td width="184">upgrade name</td>
    <td width="107">cost</td>
    <td width="100">upgrade?</td>
  </tr>
<?
while ($bupgrad != '0'){
$bcostm = mysql_query("SELECT cost, name, upgradeid FROM buildingtype WHERE buid ='$bupgrad'");
$bcost = mysql_fetch_array($bcostm);
$tcost = $bcost[0] - ($cost[0] * '2' / '3');
?> 
  <tr align="center"> 
    <td width="99"><?echo $bupgrad;?></td>
    <td width="184"><?echo $bcost[1];?></td>
    <td width="107"><?echo $tcost;?></td>
    <td width="100"><a href="/world/location/upgrade2.php?&town=<?echo $town;?>&vert=<?echo $vert;?>&horz=<?echo $horz;?>&bupgrade=<?echo $bupgrad;?>">Upgrade 
      now</a></td>
  </tr>
<?
$bupgrad = $bcost[2];
}
$bupgrad= '0';
?>
</table>
<p><?
		}
		if ($cost[2] == '0'){
			echo "There are no current upgrades for this building";
		}
	}	
}
?> </p>
</body>
</html>
Return current item: Simuland