Ok so I "recoded" this monorail. It is more of a visual "recode" please rate +
Call this travel.php
<?php
include "globals.php";
print "<font face='Arial' size='4'>Travel</font><hr width='85%'>";
$_GET['to'] = abs((int) $_GET['to']);
if(!$_GET['to'])
{
print "Welcome to the train station. Tickets cost $10,000.
Where would you like to travel?<hr width=85%>
";
$q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}");
print "<table border='0' width=85% bgcolor=#DEDEDE><tr bgcolor=#999999>
<TH>City</TH>
<TH>Description</TH>
<TH>Min Level</TH>
<TH>Travel?</TH>
<tr>";
while($r=$db->fetch_row($q))
{
print "
<TD>{$r['cityname']}</TD>
<TD>{$r['citydesc']}</TD>
<TD>{$r['cityminlevel']}</TD>
<TD>[url='travel.php?to={$r[']Travel[/url]</TD></tr>";
}
print "</table>
";
print "<hr width='85%'>> [url='city.php']Back[/url]<hr width='85%'>";
}
else
{
if($ir['money'] < 10000)
{
print " Sorry you don't have enough money.";
print "<hr width='85%'>> [url='city.php']Back[/url]<hr width='85%'>";
}
else if( ((int) $_GET['to']) != $_GET['to'])
{
print "Sorry invalid city ID";
print "<hr width='85%'>> [url='city.php']Back[/url]<hr width='85%'>";
}
else
{
$q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']}");
if(!$db->num_rows($q))
{
print "Sorry this city does not exist.";
print "<hr width='85%'>> [url='city.php']Back[/url]<hr width='85%'>";
}
else
{
$db->query("UPDATE users SET money=money-10000,location={$_GET['to']} WHERE userid=$userid");
$r=$db->fetch_row($q);
print "You paid \$10,000 and travelled to {$r['cityname']} on the train, congratulations.";
print "<hr width='85%'>> [url='city.php']Back[/url]<hr width='85%'>";
}
}
}
$h->endpage();
?>
I only changed the visual looks so give the credit to DBS please :)
Thanks, CJ
Screenies:
White line to separate screenies. :P
Thanks again, CJ