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

<body bgcolor="#FFFFFF">
if ($banner == '1'){
echo $bannercode;
$useram = mysql_query("SELECT * FROM usr WHERE usr ='$user'");
$usera = mysql_fetch_array($useram);
$costm = mysql_query("SELECT cost, name, lc, mc, hc, fa, level FROM buildingtype WHERE buid ='$btype'");
$cost = mysql_fetch_array($costm);
$buildl = mysql_query("SELECT * FROM buildinglocation WHERE horz='$horz' and vert='$vert' and town ='$town'");
$buildloc = mysql_fetch_array($buildl);
if ($usera[1] != $password){
echo "incorrect password please log in again";
if ($usera[1] == $password){
	if ($usera[9] <= $cost[0]){
	echo "Not enough money to purchase land<br>You have $usera[9] money but the area costs $cost[0]<br>";
		echo"you are not a high enough level to build this, sorry<br>";
	if ($usera[9] >= $cost[0]){
	echo "You have enough money to Build a $cost[1]<br>";
	$owner2 = $owner;
		if ($owner2 == $user){
			echo "You own this land and can build here<br>";
			if ($buildloc[3] == '0'){
				$cb='1';//check to see if there are enough workers
				$townm = mysql_query("SELECT * FROM towns WHERE tid ='$town'");
				$towna = mysql_fetch_array($townm);
				if($uneploylc<$cost[2] OR $uneploymc<$cost[3] OR $uneployhc<$cost[4] OR $uneployfa<$cost[5]){
					echo"Not enough workers in the town<br>";
					$res = mysql_query("UPDATE buildinglocation SET buid ='$btype' where town='$town' and vert='$vert' and horz='$horz'");
					$umoney = $usera[9] - $cost[0];
					$res2 = mysql_query("UPDATE usr SET money='$umoney' where usr='$user'");
					$res2 = mysql_query("UPDATE towns SET lce='$newlc' where tid='$town'");
					$res2 = mysql_query("UPDATE towns SET mce='$newmc' where tid='$town'");
					$res2 = mysql_query("UPDATE towns SET hce='$newhc' where tid='$town'");
					$res2 = mysql_query("UPDATE towns SET fae='$newfa' where tid='$town'");
					echo "Congratulations, you have build a $cost[1] (id is $btype)<br>";
			if ($buildloc[3] != '0'){
			echo "This is not a construction site";
		if ($owner2 != $user){
		echo "Some one else owns this land, you can not build here<br>";
?> <br>
  <a href="/world/location.php?&map=<?echo $town;?>&vert=<?echo $vert;?>&horz=<?echo $horz;?>">Return 
  to the building location</a><br>
  <a href="/world/town.php?&map=<?echo $town;?>"">Return 
  to the town map </a> </p>
Return current item: Simuland