Exemple #1
0
<?php

require_once 'functions.php';
require_once 'db.php';
$title = "Tagpro.me Advanced Stats Tracker :: Reporting Game " . $_GET['game'];
require_once 'header.php';
if (isset($_POST['report'])) {
    $gameno = mysql_real_escape_string($_POST['gameno']);
    $type = mysql_real_escape_string($_POST['type']);
    $reason = mysql_real_escape_string($_POST['reason']);
    $addreport = query("INSERT INTO reports (reportid,gameno,type,reason) VALUES (NULL," . $gameno . "," . $type . ",'" . $reason . "')");
    killpage("Your report has been received. The game may not disappear immediately as I examine it, or possibly leave it up for longer study, but I do go through the reports regularly. Please do not submit multiple reports for the same game.");
} else {
    ?>

<div style="clear:both; padding:10px 0; width:100%">
<form method="post" action="">
<table align="center">
	<tr>
    	<td>Select reason for report:</td>
        <td>
        	<select name="type">
            	<option value="1">Duplicate Game</option>
                <option value="2">Hacked Game</option>
                <option value="3">Buggy Game Results</option>
            </select>
        </td>
    </tr>
    <tr>
    	<td>Comments: (Optional, limit 140 chars.</td>
        <td><input type="text" maxlength="140" name="reason" /></td>
Exemple #2
0
	<p align="center">
<?php 
$checkcollision = query("SELECT host FROM games WHERE gameno=" . mysql_real_escape_string($_GET['id']) . " GROUP BY host");
if (mysql_num_rows($checkcollision) > 1) {
    $maptoupdate = mysql_result($checkcollision, 0);
    $q_mostrecentgame = query("SELECT MAX(gameno) FROM games LIMIT 1");
    $mostrecentgame = mysql_result($q_mostrecentgame, 0);
    $mostrecentgame++;
    $update = query("UPDATE games SET gameno=" . $mostrecentgame . " WHERE gameno=" . mysql_real_escape_string($_GET['id']) . " AND host='" . $maptoupdate . "'");
    echo "<script>location.reload();</script>";
}
$nan = 0;
$ebug = 0;
$gettime = query("SELECT teamcaps, oppcaps, timestamp, win, map, host FROM games WHERE gameno = " . mysql_real_escape_string($_GET['id']) . " LIMIT 1");
if (mysql_num_rows($gettime) == 0) {
    killpage("That game does not exist in the database. It may have been deleted as a duplicate, a hacked game, or you're getting clever with the GET string.");
}
$row = mysql_fetch_assoc($gettime);
echo "Game " . $_GET['id'] . ", recorded " . $row['timestamp'] . " EST on " . $row['host'] . ".<br /><br />";
if ($row['win'] == 2) {
    $winner = 'Tied ';
} elseif ($row['win'] == 1) {
    $winner = 'Red wins ';
} else {
    $winner = 'Blue wins ';
}
$score = $row['teamcaps'] == $row['oppcaps'] ? $row['teamcaps'] . "-" . $row['oppcaps'] : $row['teamcaps'] > $row['oppcaps'] ? $row['teamcaps'] . "-" . $row['oppcaps'] : $row['oppcaps'] . "-" . $row['teamcaps'];
echo $winner . $score . " on " . substr($row['map'], 5) . "<br /><br />";
?>