This is trainheast
<?php
session_start();
?>
<script type='text/javascript' src='timer.js'></script>
<?
include_once 'includes/functions.php';
include_once "includes/jail_check.php";
if ($info->last_script_check < time()){
include_once "scriptcheck.php";
}
logincheck();
$page="trainhiest.php";
?>
<script type="text/javascript">
if(!top || top.frames.length < 4) { top.location="/logged_in.php";}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/select.js"></script>
<style type="text/css">
td {
padding: 2px;
</style>
</head>
<?
$user=mysql_fetch_object(mysql_query("SELECT username,money,location,th_time,rankpoints,crew FROM users WHERE username='$username'"));
$choice=$_POST['radiobutton'];
if($user->th_time > time()){
$left= $user->th_time - time();
print"<center>You must wait <span id='train'></span><script type='text/javascript'>setTimer('train','$left', { 0: function () { window.location = 'trainheist.php' }}); </script>!</center>";
include_once"footer_bottom.php";
exit();
}
if ($choice > "7"){
echo "Error";
}elseif ($choice <= "7"){
if($choice){
if($user->th_time > $time){
}else{
if($choice == "1"){
$to="England";
}elseif($choice == "2"){
$to="Spain";
}elseif($choice == "3"){
$to="Italy";
}elseif($choice == "4"){
$to="France";
}elseif($choice == "5"){
$to="Sweden";
}elseif($choice == "6"){
$to="Portugal";
}elseif($choice == "7"){
$to="USA";
}
$wtf=rand(1,6);
$ti=900;
$tim = time() + 900;
$cash_win=rand(20000,50000);
if($wtf == "1" || $wtf == "2"){
$newrp=rand(7,13);
$newrps=$user->rankpoints+$newrp;
mysql_query("UPDATE users SET rankpoints='$newrps' WHERE username='$username'");
if($user->crew != '0'){
mysql_query("UPDATE crews SET xp=xp+$newrp WHERE name='$user->crew'"); }
mysql_query("UPDATE users SET th_time='$tim' WHERE username='$username'");
print"<p class='warning'>You failed to board the train!</p>";
}elseif($wtf == "3"){
$nerp=rand(7,15);
$newrps=$user->rankpoints+$newrp;
mysql_query("UPDATE users SET location='$to' WHERE username='$username'");
mysql_query("UPDATE users SET rankpoints='$newrps' WHERE username='$username'");
mysql_query("UPDATE users SET th_time='$tim' WHERE username='$username'");
print"<p class='warning'>You got stuck in the train and arrived in $to!</p>";
}elseif($wtf == "4"){
$newrp=rand(6,14);
$newrps=$user->rankpoints+$newrp;
$muni=$user->money+$cash_win;
mysql_query("UPDATE users SET money='$muni' WHERE username='$username'");
mysql_query("UPDATE users SET rankpoints='$newrps' WHERE username='$username'");
if($user->crew != '0'){
mysql_query("UPDATE crews SET xp=xp+$newrp WHERE name='$user->crew'"); }
mysql_query("UPDATE users SET th_time='$tim' WHERE username='$username'");
print"<p class='success'>You stole £".makecomma($cash_win)." from the train!</p>";
}elseif($wtf == "5"){
$nerp=rand(7,14);
$newrps=$user->rankpoints+$newrp;
$muni=$user->money+$cash_win;
mysql_query("UPDATE users SET location='$to' WHERE username='$username'");
mysql_query("UPDATE users SET money='$muni' WHERE username='$username'");
mysql_query("UPDATE users SET rankpoints='$newrps' WHERE username='$username'");
mysql_query("UPDATE users SET th_time='$tim' WHERE username='$username'");
print"<p class='success'>You stole £".makecomma($cash_win)." from the train but you got stuck and arrived in $to!</p>";
}elseif($wtf == "6"){
$length=rand(100,120) + time();
$newrp=rand(5,8);
$newrps=$user->rankpoints+$newrp;
mysql_query("UPDATE users SET rankpoints='$newrps' WHERE username='$username'");
if($user->crew != '0'){
mysql_query("UPDATE crews SET xp=xp+$newrp WHERE name='$user->crew'"); }
mysql_query("UPDATE users SET th_time='$tim' WHERE username='$username'");
mysql_query("INSERT INTO `jail` (`id`,`username`, `time_left`,`reason`,`location`) VALUES ('', '$username', '$length', 'Train Hiest', '$user->location');") or die (mysql_error());
print"<p class='warning'>You were caught trying to board the train and you were put in jail!</p>";
}
}}}
?>
<body><form id="form1" name="form1" method="post" action="">
<input type="hidden" name="radiobutton" id="select" value="0">
<table width="300" align="center" border="0" cellpadding="0" cellspacing="0" class="table">
<tr class="thinline">
<td>
Train Heist</td>
</tr>
<tr><td align=center>[img=images/trainheist.png]</td></tr>
<tr>
<? if($user->location != "England"){ ?>
<tr class="select" id="1" onClick="SelectOption(this.id);" align="center"><td>Heist a train to England</td></tr>
<? } ?>
<? if($user->location != "Spain"){ ?>
<tr class="select" id="2" onClick="SelectOption(this.id);" align="center"><td>Heist a train to Spain</td></tr>
<? } ?>
<? if($user->location != "Italy"){ ?>
<tr class="select" id="3" onClick="SelectOption(this.id);" align="center"><td>Heist a train to Italy</td></tr>
<? } ?>
<? if($user->location != "France"){ ?>
<tr class="select" id="4" onClick="SelectOption(this.id);" align="center"><td>Heist a train to France</td></tr>
<? } ?>
<? if($user->location != "Sweden"){ ?>
<tr class="select" id="5" onClick="SelectOption(this.id);" align="center"><td>Heist a train to Sweden</td></tr>
<? } ?>
<? if($user->location != "Portugal"){ ?>
<tr class="select" id="6" onClick="SelectOption(this.id);" align="center"><td>Heist a train to Portugal</td></tr>
<? } ?>
<? if($user->location != "USA"){ ?>
<tr class="select" id="7" onClick="SelectOption(this.id);" align="center"><td>Heist a train to USA</td></tr>
<? } ?>
<tr>
<th colspan="2" scope="row">
<input type="submit" name="Submit" class="button" value="Attempt Heist" />
</th>
</tr>
</table> </form>
<? include_once"footer_bottom.php"; ?>
</body>
</html>
<? include_once'footer.php'; ?>