<?php
include "globals.php";
?>
<head>
<style type="text/css">
#dhtmltooltip{
position: absolute;
width: 150px;
border: 2px solid black;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}
</style>
</head>
<?php
Include "map_functions.php";
$q=$db->query("SELECT u.*,c.* FROM users u LEFT JOIN cities c ON u.location=c.cityid WHERE u.userid=$userid");
$r=$db->fetch_row($q);
$_GET['to'] = abs((int) $_GET['to']);
if(!$_GET['to'])
{
print "Welcome to the Monorail Station. It costs \$1000 for a ticket.<br> <u><b>Please be aware that you will still be charged if you choose to travel to a location that you are already in. <br>You are Currently in {$r['cityname']}</b></u></br> <br />
Where would you like to travel today?<br />";
$q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}");
//code for the imagemap
map_Start("http://murdercountry.com/murdercountrymap.jpg");
map_Entry("This is one place on the map", "white", 98, 496, 10, 10, "monorail.php?to=1", 500);
map_entry("This is Thugville", "white", 141, 200, 10, 10, "monorail.php?to=2", 150);
map_entry("This is Gangsterville", "white", 218, 49, 10, 10, "monorail.php?to=3", 150);
map_End();
//end code for imagemap
while($r=$db->fetch_row($q))
{
}
}
else
{
if($ir['money'] < 1000)
{
print "You don't have enough money.";
}
else if( ((int) $_GET['to']) != $_GET['to'])
{
print "Invalid city ID";
}
else
{
$q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']}");
if(!$db->num_rows($q))
{
print "Error, this city either does not exist or you are not a high enough level to go there.";
}
else
{
$db->query("UPDATE users SET money=money-1000,location={$_GET['to']} WHERE userid=$userid");
$r=$db->fetch_row($q);
print "Congratulations, you paid \$1000 and travelled to {$r['cityname']} on the monorail!";
}
}
}
$h->endpage();
?>
<body>
<div id="dhtmltooltip"></div>
<script type="text/javascript" src="tooltip.js"></script>
</body>