Exemplo n.º 1
0
<?php

/**
 * match.php
 *
 * Riccardo Crippa
 * therickys93@gmail.com
 *
 * this file display the matches 
 */
// require all the files
require_once 'Matchup.inc.php';
require_once 'session.php';
// create an instanceof MUMatch
$match = new MUMatch();
// check if the submit button is pressed
if (isset($_POST["submit"])) {
    // create the maches for the tournament
    $match->createMatches($_POST["tournament_id"], $_POST["tournament_type"]);
    // get all the matches from the tournament
    $allMatches = $match->getAllMatchesFromTournament($_POST["tournament_id"]);
} else {
    if (isset($_POST["aggiorna"])) {
        if ($_GET["tipo"] === "eliminazione diretta") {
            $match->updateScoreForEliminazioneDiretta($_POST["match_id"], $_POST["score"], $_POST["torneo_id"], $_POST["turno"]);
            $allMatches = $match->getAllMatchesFromTournament($_GET["tournament"]);
        } else {
            // update the score
            $match->updateScore($_POST["match_id"], $_POST["score"]);
            // get all the matches from the tournament
            $allMatches = $match->getAllMatchesFromTournament($_GET["tournament"]);
<?php

require_once 'Matchup.inc.php';
if (isset($_POST["submit"])) {
    MUDebug($_POST);
    $match = new MUMatch();
    if ($match->createMatchesForFreeTournament($_POST["tournament_id"], $_POST["day"], $_POST["players"])) {
        $tournament = new MUTournaments();
        $type = $tournament->getType($_POST["tournament_id"]);
        header("location: match.php?tournament=" . $_POST["tournament_id"] . "&tipo=" . $type);
        exit;
    }
}
Exemplo n.º 3
0
<?php

/**
 * rank.php
 *
 * Riccardo Crippa
 * therickys93@gmail.com
 *
 * this file display the rank for a tournament
 */
// require all the files
require_once 'Matchup.inc.php';
require_once 'session.php';
// create an instanceof MUMatch
$match = new MUMatch();
// get the rank for a tournament
$rank = $match->getRank($_GET["tournament"]);
?>
 <!DOCTYPE html>
 <html>
 <head>
     <title>Classifica</title>
     <link rel="stylesheet" type="text/css" href="css/style.css" />
 </head>
 <body>
     <div class="header">
		<div class="content_left"><b>MatchUp</b></div>
		<div class="content_right">
			<ul>
				<li><a href="home.php">Profilo</a></li>
				<li><a href="tournaments.php">Torneo</a></li>