Example #1
0
function saisie($year_calendrier_saisie, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    // si l'année n'est pas renseignée, on prend celle du jour
    if ($year_calendrier_saisie == 0) {
        $year_calendrier_saisie = date("Y");
    }
    // on construit le tableau des jours feries de l'année considérée
    $tab_year = array();
    get_tableau_jour_feries($year_calendrier_saisie, $tab_year, $DEBUG);
    if ($DEBUG) {
        echo "tab_year = ";
        print_r($tab_year);
        echo "<br>\n";
    }
    //calcul automatique des jours feries
    if ($_SESSION['config']['calcul_auto_jours_feries_france']) {
        $tableau_jour_feries = fcListJourFeries($year_calendrier_saisie);
        if ($DEBUG) {
            echo "tableau_jour_feries = ";
            print_r($tableau_jour_feries);
            echo "<br>\n";
        }
        foreach ($tableau_jour_feries as $i => $value) {
            if (!in_array("{$value}", $tab_year)) {
                $tab_year[] = $value;
            }
        }
    }
    if ($DEBUG) {
        echo "tab_year = ";
        print_r($tab_year);
        echo "<br>\n";
    }
    echo '<a href="' . ROOT_PATH . "admin/admin_index.php?session={$session}\" class=\"admin-back\"><i class=\"fa fa-arrow-circle-o-left\"></i>Retour mode admin</a>\n";
    echo "<form action=\"{$PHP_SELF}?session={$session}&year_calendrier_saisie={$year_calendrier_saisie}\" method=\"POST\">\n";
    echo "<div class=\"calendar\">\n";
    $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
    foreach ($months as $month) {
        echo "<div class=\"month\">\n";
        echo "<div class=\"wrapper\">\n";
        echo affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, $month, $tab_year);
        echo "</div>\n";
        echo "</div>";
    }
    echo "</div>";
    echo "<div class=\"actions\">";
    echo "<input type=\"hidden\" name=\"choix_action\" value=\"commit\">\n";
    echo "<input class=\"btn\" type=\"submit\" value=\"" . _('form_submit') . "\">  \n";
    echo "</div>";
    echo "</form>\n";
}
function saisie($year_calendrier_saisie, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    // si l'année n'est pas renseignée, on prend celle du jour
    if ($year_calendrier_saisie == 0) {
        $year_calendrier_saisie = date("Y");
    }
    // on construit le tableau des jours feries de l'année considérée
    $tab_year = array();
    get_tableau_jour_feries($year_calendrier_saisie, $tab_year, $DEBUG);
    if ($DEBUG) {
        echo "tab_year = ";
        print_r($tab_year);
        echo "<br>\n";
    }
    //calcul automatique des jours feries
    if ($_SESSION['config']['calcul_auto_jours_feries_france']) {
        $tableau_jour_feries = fcListJourFeries($year_calendrier_saisie);
        if ($DEBUG) {
            echo "tableau_jour_feries = ";
            print_r($tableau_jour_feries);
            echo "<br>\n";
        }
        foreach ($tableau_jour_feries as $i => $value) {
            if (!in_array("{$value}", $tab_year)) {
                $tab_year[] = $value;
            }
        }
    }
    if ($DEBUG) {
        echo "tab_year = ";
        print_r($tab_year);
        echo "<br>\n";
    }
    header_popup();
    echo "<h1>" . _('admin_jours_chomes_titre') . "</h1>\n";
    echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n";
    // table contenant le fieldset
    echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
    echo "<tr align=\"center\">\n";
    echo "<td>\n";
    echo "<fieldset class=\"cal_saisie\">\n";
    // tableau contenant les mois
    echo "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">\n";
    // ligne des boutons de défilement
    echo "<tr align=\"center\">\n";
    $year_calendrier_saisie_prec = $year_calendrier_saisie - 1;
    $year_calendrier_saisie_suiv = $year_calendrier_saisie + 1;
    // recul d'un an
    echo "<td align=\"center\" class=\"big\">\n";
    echo "<a href=\"{$PHP_SELF}?session={$session}&year_calendrier_saisie={$year_calendrier_saisie_prec}\"> \n";
    echo "<img src=\"" . TEMPLATE_PATH . "img/simfirs.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . _('admin_jours_chomes_annee_precedente') . "\" title=\"" . _('admin_jours_chomes_annee_precedente') . "\"> \n";
    echo "</a>\n";
    echo "</td>\n";
    echo "<td colspan=\"2\" align=\"center\" class=\"big\">{$year_calendrier_saisie}</td>\n";
    //echo "<td align=\"center\" class=\"big\">&nbsp;</td>\n";
    // avance d'un an
    echo "<td align=\"center\" class=\"big\">\n";
    echo "<a href=\"{$PHP_SELF}?session={$session}&year_calendrier_saisie={$year_calendrier_saisie_suiv}\"> \n";
    echo "<img src=\"" . TEMPLATE_PATH . "img/simlast.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . _('admin_jours_chomes_annee_suivante') . "\" title=\"" . _('admin_jours_chomes_annee_suivante') . "\"> \n";
    echo "</a>\n";
    echo "</td>\n";
    echo "</tr>\n";
    // ligne janvier / fevrier / mars / avril
    echo "<tr align=\"center\" valign=\"top\">\n";
    echo "<td>\n";
    // janvier
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "01", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // fevrier
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "02", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // mars
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "03", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // avril
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "04", $tab_year);
    echo "</td>\n";
    echo "</tr>\n";
    // ligne mai / juin / juillet / aout
    echo "<tr align=\"center\" valign=\"top\">\n";
    echo "<td>\n";
    // mai
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "05", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // juin
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "06", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // juillet
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "07", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // aout
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "08", $tab_year);
    echo "</td>\n";
    echo "</tr>\n";
    // ligne septembre / octobre / novembre / decembre
    echo "<tr align=\"center\" valign=\"top\">\n";
    echo "<td>\n";
    // septembre
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "09", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // octobre
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "10", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // novembre
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "11", $tab_year);
    echo "</td>\n";
    echo "<td>\n";
    // décembre
    affiche_calendrier_saisie_jours_chomes($year_calendrier_saisie, "12", $tab_year);
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    echo "</fieldset>\n";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    //table contenant les bountons
    echo "<table cellpadding=\"2\" cellspacing=\"3\" border=\"0\" >\n";
    echo "<tr align=\"center\">\n";
    echo "<td>\n";
    echo "<input type=\"hidden\" name=\"choix_action\" value=\"confirm\">\n";
    echo "<input type=\"submit\" value=\"" . _('form_submit') . "\">  \n";
    echo "<input type=\"button\" value=\"" . _('form_cancel') . "\" onClick=\"javascript:window.close();\">\n";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    echo "</form>\n";
    bottom();
}