login}'");
/* ------------------------- */ ?>
#
id
auto
schade
Prijs
= 0) ? $_GET['p']*30 : 0;
if($_GET['s'] == "ID")
$dbres = mysql_query("SELECT `id`,`naam`,`waarde`,`tekoop`,`schade` FROM `garage` WHERE
`tekoop`==1 ORDER BY `id` ASC LIMIT $begin,30");
else if($_GET['s'] == "schade")
$dbres = mysql_query("SELECT `id`,`naam`,`waarde`,`tekoop`,`schade` FROM `garage` WHERE
`tekoop`==1 ORDER BY `schade` ASC LIMIT $begin,30");
else if($_GET['s'] == "auto")
$dbres = mysql_query("SELECT `id`,`naam`,`waarde`,`tekoop`,`schade` FROM `garage` WHERE
`tekoop`==1 ORDER BY `naam` ASC LIMIT $begin,30");
else if($_GET['s'] == "money")
$dbres = mysql_query("SELECT `id`,`naam`,`waarde`,`tekoop`,`schade` FROM `garage` WHERE
`tekoop`==1 ORDER BY `tekoop` DESC LIMIT $begin,30");
else
$dbres = mysql_query("SELECT `id`,`naam`,`waarde`,`tekoop`,`schade` FROM `garage` WHERE
`tekoop`==1 ORDER BY `tekoop` DESC, `schade` ASC LIMIT $begin,30");
$user = $_SESSION['login'];
for($j=$begin+1; $info = mysql_fetch_object($dbres); $j++)
{
print <<$j.
$info->id
$info->naam
$info->schaad%
$info->tekoop
ENDHTML;
}
if($_GET['s'] == "online" && $data->level == 0x01)
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE
UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
else
$dbres = mysql_query("SELECT `id` FROM `garage` WHERE `tekoop`=1");
print "
\n\n\n ";
if(mysql_num_rows($dbres) <= 30)
print "< 1 >
\n";
else
{
if($begin/30 == 0)
print "<< ";
else
print "<< ";
for($i=0; $i".
($i+1) ." ";
}
if($begin+30 >= mysql_num_rows($dbres))
print ">> ";
else
print ">> ";
}
if (isset($_POST['koop'])) {
$koop1 = mysql_query("SELECT * FROM `garage` WHERE `id`='{$_POST['ID']}'");
if ($koop = mysql_fetch_object($koop1)){
if($koop->tekoop >= $data->bank)
print "
===>> U heeft te weinig geld. <<===
\n";
else if($data->login == $koop->login)
print "
===>> Deze auto is al van u! <<===
\n";
else {
mysql_query("UPDATE `[users]` SET `bank`=`bank`-{$koop->tekoop} WHERE
`login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `bank`=`bank`+{$koop->tekoop} WHERE
`login`='{$koop->login}'");
mysql_query("UPDATE `garage` SET `login`='{$data->login}',`tekoop`='0' WHERE
`id`={$_POST['ID']}");
print <<
===>> U heeft de auto met succes gekocht. <<===
ENDHTML;
}
}
}
print <<
ENDHTML;
/* ------------------------- */ ?>