include ("../includelayar.php"); if (isset($_GET['add']) ) { $add = true; } if (isset($_COOKIE["hash"])) { $hash = $_COOKIE["hash"]; $q = "SELECT * from players where hash = '".$hash."' "; $result = mysql_query( $q ); if (!$player = mysql_fetch_assoc($result) ) { setcookie('hash',$hash,time()-3600*24*30, '/',''); unset($hash); header ("location: new.php"); } $q = "SELECT * from biennialfield, country where biennialfield.countryid = country.id and type <> '' and biennialfield.playerid = '".$player['id']."' "; $result = mysql_query( $q ); $active = false; $pavilions = array(); while ($pavilion = mysql_fetch_assoc($result) ) { $pavilions[] = $pavilion; $active = true; } $count = sizeOf($pavilions); //echo "(".$player['id'].$hash.")"; } else { header("location: new.php"); } if (isset($_POST['country']) ) { $country = makesafe($_POST['country']); } if (isset($_POST['fieldid']) ) { $fieldid = makesafe($_POST['fieldid']); } if (isset($_POST['type']) ) { $type = makesafe($_POST['type']); } if (isset($_POST['step']) ) { $step = makesafe($_POST['step']); } if (isset($_GET['step']) ) { $step = makesafe($_GET['step']); } if (isset($step) && $step == 4) { $q = "update biennialfield set playerid = ".$player['id'].", since = NOW(), last = NOW(), views = 0, type = '".$type."', countryid = ".$country. " where id = ".$fieldid; // echo $q; mysql_query( $q ); $q = "SELECT * from country where id = ".$country; $result = mysql_query( $q ); $pavilion = mysql_fetch_assoc($result); $q = "INSERT into biennialevents (playerid,message,moment,fieldid,action) VALUES (0,'Pavilion ".$pavilion['printable_name']." added ', NOW(), ".$fieldid.",'ins' )"; // echo $q; mysql_query( $q ); $step = 5; } else { // nog toevoegen: niet de reeds in gebruik zijnde pavs $q = "SELECT * from country where active ='y' "; $result = mysql_query( $q ); $rows = array(); while ($row = mysql_fetch_assoc($result) ) { $available[] = $row; $size = count($available); } $q = "SELECT * from biennialfield where type = '' order by y, x"; $fieldsresults = mysql_query( $q ); } ?>
} else if ($step == 2) {
$random = floor(rand(0,$size));
$id = $available[$random]['id'];
?>
} else if ($step == 3) {
?>
}
} else { // non active;
?>
| YOUR SCORE: if (isset($_GET['test']) || sizeOf($pavilions) < 5) { ?> REFRESH SCORE } ?> | |
|
ADD ANOTHER PAVILION
Your pavilion(s) inside the Giardini: |
|
| Placed: | |