示例#1
0
<?php

// Controller for main page
include 'vendor/autoload.php';
include 'db_config.php';
// Grab all our models
include './models/injuries.php';
include './models/franchises.php';
include './models/games.php';
// Collect data
$franchiseModel = new Franchise($db);
$injuryModel = new Injury($db);
$gameModel = new Game($db);
$maxWeek = $gameModel->getMaxWeek();
$injuries = $injuryModel->getAll($maxWeek);
$franchises = $franchiseModel->getAll();
// Display template
include './templates/injury_management.php';
示例#2
0
require_once 'models/rosters.php';
require_once 'models/franchises.php';
$task = "list";
$roster = new Roster($db);
$franchise = new Franchise($db);
define(YEAR, "16");
if (isset($_GET['task'])) {
    $task = $_GET['task'];
}
if (isset($_POST['task'])) {
    $task = $_POST['task'];
}
if ($task == "draft") {
    $id = 0;
    $round = array("1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th");
    $team_list = $franchise->getAll();
    if (isset($_GET['id'])) {
        $id = (int) $_GET['id'];
    }
    if ($id != 0) {
        $details = $roster->getById($id);
        $tig_name = $details['tig_name'];
        // Now, we can display the form to let them assign the player to a team
        require 'templates/draft/form.php';
    } else {
        print "Invalid player ID<br>";
        $task = "list";
    }
}
if ($task == "do_draft") {
    // update rosters database by drafting a player