Example #1
0
			$sqlPlayer = "SELECT player_id from $playerstable where name = '$playerName'";
			$result = mysql_query($sqlPlayer);
			$rows = mysql_num_rows($result);
			if ($rows != 1) {
				echo doParagraph("Error: Player ".doBold($playerName)." found ".$rows." times in database.".$back);
			} else {
				$row = mysql_fetch_array($result);
				$playerId = $row['player_id'];
							
				$sqlInsert = "INSERT INTO $minitournamenttable (ID, PLAYER_ID, LINK) ".
					"VALUES ('', '$playerId', '$forumLink')";
				}
				$result = mysql_query($sqlInsert);
				echo doParagraph("Inserting tournament win for ".doBold($playerName)." - Result: ".doBold($result));
				
				echo doParagraph('Please check the <a href="'.$forumLink
					.'">forum link</a> and the <a href="/tournaments.php">tournaments page</a> to see if everything is correct.'); 
			}
		} else {
?>
 
	<?php 
echo getBoxTop("Report", "", false, null);
?>
	<form method="post" action="reportMini.php?submit=1" name="formReport">
    <table class="formtable">
    <tr>
	    <td>Tournament winner</td>
	    <td><select class="width150" size="1" name="playerName">		
		<option></option>
    <?php 
$sortby = "name ASC";
Example #2
0
		$gamesquery = "select * from $gamestable " .
				"WHERE (winner = '$name' OR winner2 = '$name' OR loser = '$name' OR loser2 = '$name') " .
				"AND deleted = 'no' " .
				"AND dateday = '$day' " .
				"ORDER BY date DESC";
				
		$playergames = mysql_query($gamesquery);
		$gamescount = mysql_num_rows($playergames);
		
		$playerquery = "SELECT mail, sendGamesMail from $playerstable ".
				"WHERE name = '$name'";
	
		$player = mysql_query($playerquery);
		$playerresult = mysql_fetch_array($player);
		
		$resultMsg .= doParagraph("Player: ".doBold($name));
	
		while ($row_game = mysql_fetch_array($playergames)) {
				
				$gameId = $row_game['game_id'];
				$gameDate = $row_game['date'];
				$gametime = date("h:i a", $gameDate);
				
				$winpoints = $row_game['winpoints'];
				$winner = $row_game['winner'];
				$winner2 = $row_game['winner2'];			
				if (strlen($winner2) > 0) {
					$winnerDisplay = $winner."/".$winner2;
				} else {
					$winnerDisplay = $winner;
				}
                if (!$copywork) {
                    echo "<p>Upload failed.</p>" . $contact;
                } else {
                    chmod("../Cup/" . $picturename, 0644);
                    $updateDate = time();
                    if (empty($slotId)) {
                        $sql = "update {$tournamenttable} set extension = '{$ext}', updateDate = '{$updateDate}' where id='{$tournamentId}'";
                        mysql_query($sql);
                    } else {
                        $sql = "update {$tournamentimagestable} set ext = '{$ext}', user = '******', updateDate='{$updateDate}' where slot='{$slotId}' and id='{$tournamentId}'";
                        mysql_query($sql);
                    }
                    echo '<p>Upload of ' . $picturename . ' successful.</p><p>' . 'Please check the <a href="/tournaments.php">tournaments page</a> to see ' . 'if everything went correctly.</p>';
                    if (!empty($slotId)) {
                        $linkUrl = $directory . '/tournaments.php?cup=' . $getParam . "#" . $slotId;
                        echo doParagraph('Direct link to image on tournament page: <a href="' . $linkUrl . '">' . $linkUrl . '</a>');
                    }
                }
            }
            // image too big
        }
        // empty file
    } else {
        echo getBoxTop("Upload", "", false, null);
        ?>

		 <form method="post" action="<? $_SERVER['PHP_SELF'] ?>" enctype="multipart/form-data">

         <table class="formtable">
		 <tr>
		 <td>Image Slot</td>