//****later- also add logic to prevent non captains of the matches from inputting score.
////form should send user to doEnterMatchScore.php
if (!isset($_POST) || !isset($_POST['matchId'])) {
    $errorMsg = urlencode("invalid match");
    header("Location: match.php?status={$errorMsg}");
}
$matchId = $_POST['matchId'];
?>

<body>
<div class="container">
    <h3>Enter Match Score</h3>
    <br>
    <?php 
$matchUI = new Presentation\MatchUI();
echo $matchUI->listMatchInfo(null, $matchId);
?>
    <p>
        <form id="enterMatchScore" action="php/doEnterMatchScore.php" method="post">

        <div class="form-group">
            <label for="homeTeamScore">Home Team Score</label>
            <br>
            <input name="homeTeamScore" id="homeTeamScore" type="text">
        </div>

        <div class="form-group">
            <label for="awayTeamScore">Away Team Score</label>
            <br>
            <input name="awayTeamScore" id="awayTeamScore" type="text">
        </div>
include 'includes/header.php';
spl_autoload_register(function ($class_name) {
    include '/Users/montanawong/Sites/RecDawgs/src/' . str_replace('\\', '/', $class_name) . '.php';
});
use edu\uga\cs\recdawgs\presentation as Presentation;
?>


<body>
    <div class="container">
        <h3>Resolve Match Score</h3>
        <br>

        <?php 
$matchUI = new Presentation\MatchUI();
echo $matchUI->listMatchInfo(null, $_POST['matchId']);
?>

        <p>
            <form id="resolveMatchScore" action="php/doResolveMatchScore.php" method="post">

            <div class="form-group">
                <label for="homeTeamScore">New Home Team Score</label>
                <br>
                <input name="homeTeamScore" id="homeTeamScore" type="text">
            </div>

            <div class="form-group">
                <label for="awayTeamScore">New Away Team Score</label>
                <br>
                <input name="awayTeamScore" id="awayTeamScore" type="text">
Exemple #3
0
?>

<body>


    <?php 
$matchUI = new Presentation\MatchUI();
$homePoints = -1;
$awayPoints = -1;
if ($numScoreReports >= 2) {
    $scores = $scoreReportUI->getScores($_POST['matchId']);
    $homePoints = intval($scores[0]['homeScore']);
    $awayPoints = intval($scores[0]['awayScore']);
    //die(var_dump($scores));
}
echo $matchUI->listMatchInfo(null, $_POST['matchId'], $homePoints, $awayPoints);
echo $scoreReportUI->showMatchReports($_POST['matchId']);
if ($_SESSION['userType'] == 0 && $numScoreReports <= 1) {
    echo "<h2>Enter match score</h2> <br/>\n    <form action='enterMatchScore.php' method='post'>\n        <input type = 'hidden' name = 'matchId' value = '{$_POST['matchId']}'>\n    <input type='submit' name='Click here to input match score' id='enterMatchScore'>\n    </form>\n    <br/>";
}
?>



    <?php 
if ($_SESSION['userType'] == 1 && $numScoreReports >= 2) {
    //  $scores = $scoreReportUI->getScores($_POST['matchId']);
    //if($scores[0]['homeScore'] != $scores[1]['homeScore'] && $scores[0]['awayScore'] != $scores[1]['awayScore']) {
    $matchUI = new Presentation\MatchUI();
    echo "<h3>Resolve match score</h3>";
    echo $matchUI->listResolveMatchScoreButton($_POST['matchId']);