<?php
require_once '../../classes/dao.php';


if (isset($_GET['function'])) {
    if ($_GET['function'] == "save_scores")
        save_scores();
} else
    show_error();

function save_scores()
{
    if (isset($_GET['lines']) && isset($_GET['team'])) {
        $dao = new Dao();
        $dao->save_scores($_GET['lines'], $_GET['team']);
        echo "Réussite";
    } else
        show_error();
}

function show_error() {
    echo "Échec : ";
    var_dump($_GET);
}
