Exemple #1
0
// SERVER
$PHP_SELF = $_SERVER['PHP_SELF'];
// GET / POST
$action = getpost_variable('action');
$tab_new_values = getpost_variable('tab_new_values');
/*************************************/
if ($DEBUG) {
    print_r($tab_new_values);
    echo "<br>\n";
    echo "{$action}<br>\n";
}
header_popup('CONGES : Configuration');
/*********************************/
/*********************************/
if ($action == "modif") {
    commit_modif($tab_new_values, $session, $DEBUG);
}
affichage($tab_new_values, $session, $DEBUG);
/*********************************/
/*********************************/
bottom();
/**************************************************************************************/
/**********  FONCTIONS  ***************************************************************/
function affichage($tab_new_values, $session, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    if ($session == "") {
        $URL = "{$PHP_SELF}";
    } else {
        $URL = "{$PHP_SELF}?session={$session}";
    }
/*************************************/
if ($DEBUG) {
    print_r($tab_new_values);
    echo "<br>\n";
    echo "{$action}<br>\n";
    echo "{$id_to_update}<br>\n";
}
header_popup('CONGES : Configuration');
/*********************************/
/*********************************/
if ($action == "new") {
    commit_ajout($tab_new_values, $session, $DEBUG);
} elseif ($action == "modif") {
    modifier($tab_new_values, $session, $id_to_update, $DEBUG);
} elseif ($action == "commit_modif") {
    commit_modif($tab_new_values, $session, $id_to_update, $DEBUG);
} elseif ($action == "suppr") {
    supprimer($session, $id_to_update, $DEBUG);
} elseif ($action == "commit_suppr") {
    commit_suppr($session, $id_to_update, $DEBUG);
} else {
    affichage($tab_new_values, $session, $DEBUG);
}
/*********************************/
/*********************************/
bottom();
/**************************************************************************************/
/**********  FONCTIONS  ***************************************************************/
function affichage($tab_new_values, $session, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];