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


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

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

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