All pastes #937051 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-10 20:19 UTC
rendered paste body
<?php
/**********************************************
        Tournament Mod
 Made by WiCKeD and DeathStar
                Copyright Mixed-Entertainment 2007
*************************************************/
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
print "Tournament Registration";
$tq=mysql_query("SELECT * FROM `users` WHERE `registered_tournament` = '1'",$c);
if(mysql_num_rows($tq) > 500)
{
print "I'm sorry the tournament is not accepted anymore people<br />
There is already <b>".mysql_num_rows($tq)."</b> Competitors, You need to wait for the next competition for more details.<br />
<a href='index.php'>Home</a>";
}
if($ir['money'] < 250000)
{
print "You do not have enough money to join the tournament<br />
You need \$250,000 to join the tournament<br />
<a href='index.php'>Home</a>";
} else if($ir['registered_tournament'] == 1)
{
print "I'm sorry, You have already registered in this tournament.";
} else {
if($_GET['confirmed'] = =1)
{
mysql_query("UPDATE `users` SET `registered_tournament` = '1', `money` = `money` - '250000' WHERE `userid` = '{$userid}'");
print "You have successfully entered the tournament<br />
If anytime you would like to view your current tournament status you can always
go in your menu and click 'Tournament Status' and then you can view who you are fighting.<br />
If you want to forfeit the competition a fee of \$250,000 will be charged and 30 minutes in hospital. Click 'Forfeit Tournament'.<br />
<a href='index.php'>Home</a><br />";
} else {
print "<center>Are you 100% sure you want to register in this tournament?<br />
It costs \$250,000 to enter the tournament.<br />
To compete you must accept the rules of the tournament.<br />
<table width=70% border=1><tr><th>Rules of the Tournament</th></tr>
<tr><td><li>You must respect your contender</li>
<li>If you forfeit, You cannot rejoin the current tournament.</li>
<li>You cannot force anybody to bet or join the tournament.</li>
<li>You must always respect the judges decision.</li>
</td></tr></table>
<form action='tourney_register.php' method='get'>
<input type='hidden' name='confirmed' value='1'><input type='submit' value='I accept rules and join tournament'></form><br />
<form action='tourney_register.php' method='get'><input type='submit' value='I decline rules and dont join tournament'></form><br />
</center>";
}
}
$h->endpage();
?>