Exemplo n.º 1
0
<?php

require_once 'core.php';
$name = getPost('NAME', '');
$location = getPost('LOCATION', '');
$summary = getPost('SUMMARY', '');
// See if the team already exists
$exists = getTeam($name);
if ($name != '' && $location != '' && $summary != '' && !$exists) {
    addTeam(new Team($name, $location, $summary));
}
header("Location: team.php?name={$name}");
Exemplo n.º 2
0
     }
     break;
     // ************ Funkcje obs3ugi Zespo3ów *********************//
 // ************ Funkcje obs3ugi Zespo3ów *********************//
 case "teammanager":
     //menager zespo3ów
     if ($pcat == 4) {
         teamManager();
     } else {
         admin();
     }
     break;
 case "addteam":
     //formularz dodawania zespo3u
     if ($pcat == 4) {
         addTeam();
     } else {
         admin();
     }
     break;
 case "saveteam":
     //zapisywanie dodanego zespo3u
     if ($pcat == 4) {
         saveTeam();
     } else {
         admin();
     }
     break;
 case "dellteam":
     //usuwanie zespo3u
     if ($pcat == 4) {
Exemplo n.º 3
0
<?php

include "connect.php";
include "functions.php";
header("Content-Type: application/json");
$response = [];
if (isset($_POST["team_number"]) && isset($_POST["team_name"])) {
    $success = addTeam($db, $_POST["team_number"], $_POST["team_name"], getSessionKey());
    if ($success) {
        http_response_code(201);
    } else {
        http_response_code(500);
        $response["error"] = "Error adding team.";
    }
} else {
    http_response_code(400);
    $response["error"] = "Team name name and team number are required.";
}
echo json_encode($response);
$db->close();
Exemplo n.º 4
0
    ?>
</td>
     <td><a href='scout-match.php?match=<?php 
    echo $match->ID . "'>" . $match->Number;
    ?>
</a></td>

<?php 
    //  <td class='red team'>%s</td>
    $games = $match->selectGames($con);
    addTeam($red->TeamOne, $highlight, "red", $match, $games);
    addTeam($red->TeamTwo, $highlight, "red", $match, $games);
    addTeam($red->TeamThree, $highlight, "red", $match, $games);
    addTeam($blue->TeamOne, $highlight, "blue", $match, $games);
    addTeam($blue->TeamTwo, $highlight, "blue", $match, $games);
    addTeam($blue->TeamThree, $highlight, "blue", $match, $games);
    ?>

      <td><?php 
    echo $red->Points;
    ?>
</td>
      <td><?php 
    echo $blue->Points;
    ?>
</td>
    </tr>    

<?php 
}
echo "</table>\n";