function form_saisie($action, $new_mois, $new_year) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); header_popup(); if ($action == "imprim") { ouvre_calendrier($new_mois, $new_year); } echo "<center>\n"; echo "<h3>" . _('imprim_calendrier_titre') . "</h3>\n"; echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n"; echo "<table>\n"; // choix du mois et annee echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "<b>" . _('divers_mois') . " : </b>\n"; $mois_default = date("m"); affiche_selection_new_mois($mois_default); // la variable est $new_mois echo "</td>\n"; echo "<td align=\"center\">\n"; echo "<b>" . _('divers_annee') . " : </b>\n"; $year_default = date("Y"); affiche_selection_new_year($year_default - 5, $year_default + 5, $year_default); // la variable est $new_year echo "</td>\n"; echo "</tr>\n"; // ligne vide echo "<tr>\n"; echo "<td colspan=\"2\"> \n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td colspan=\"2\" align=\"center\">\n"; echo "\t<input type=\"hidden\" name=\"action\" value=\"imprim\">\n"; echo "\t<input type=\"submit\" value=\"" . _('form_submit') . "\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td colspan=\"2\" align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; bottom(); }
public static function form_saisie($user, $date_debut, $date_fin) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); $date_today = date("d-m-Y"); if ($date_debut == "") { $date_debut = $date_today; } if ($date_fin == "") { $date_fin = $date_today; } $huser = hash_user($user); header_popup(); echo "<center>\n"; echo "<h1>" . _('export_cal_titre') . "</h1>\n"; echo _('button_export_2') . "<br>"; echo " <a href='" . ROOT_PATH . "export/ics_export.php?usr="******"'>" . $_SESSION['config']['URL_ACCUEIL_CONGES'] . "/export/ics_export.php?usr="******"<a>"; bottom(); }
function affichage($user, $date_debut, $date_fin, $opt_debut, $opt_fin, $DEBUG = FALSE) { if ($DEBUG) { echo "user = {$user}, date_debut = {$date_debut}, date_fin = {$date_fin}, opt_debut = {$opt_debut}, opt_fin = {$opt_fin}<br>\n"; } $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); $comment = " "; header_popup(); echo "<h1>{$user}</h1>\n"; echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n"; echo "<table>\n"; echo "<tr>\n"; // calcul : // $nb_jours=compter($user, $date_debut, $date_fin, $opt_debut, $opt_fin, $comment, $DEBUG); $nb_jours = compter($user, "", $date_debut, $date_fin, $opt_debut, $opt_fin, $comment, $DEBUG); echo "<td align=\"center\"><h2>" . _('calcul_nb_jours_nb_jours') . " <b>{$nb_jours}</b></h2></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\"><i><font color=\"red\">{$comment}<font/></i></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\"><i>" . _('calcul_nb_jours_reportez') . " \"" . _('saisie_conges_nb_jours') . "\" " . _('calcul_nb_jours_form') . ".</i></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\"> </td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo " <input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; if ($_SESSION['config']['rempli_auto_champ_nb_jours_pris']) { if ($comment == " " && $DEBUG == FALSE) { echo "<script>envoi('{$nb_jours}'); window.close()</script>"; } else { echo "<script>envoi('{$nb_jours}')</script>"; } } bottom(); }
function propose_config() { $session = session_id(); header_popup('PHP_CONGES : Installation'); // affichage du titre echo "<center>\n"; echo "<br><H1><img src=\"" . TEMPLATE_PATH . "img/tux_config_32x32.png\" width=\"32\" height=\"32\" border=\"0\" title=\"" . _('install_install_phpconges') . "\" alt=\"" . _('install_install_phpconges') . "\"> " . _('install_index_titre') . "</H1>\n"; echo "<br><br>\n"; echo "<h2>" . _('install_configuration') . " :</h2>\n"; echo "<h3>\n"; echo "<table border=\"0\">\n"; echo "<tr><td>-> <a href=\"configure.php?session={$session}\">" . _('install_config_appli') . "</a></td></tr>\n"; echo "<tr><td>-> <a href=\"config_type_absence.php?session={$session}\">" . _('install_config_types_abs') . "</a></td></tr>\n"; echo "<tr><td>-> <a href=\"config_mail.php?session={$session}\">" . _('install_config_mail') . "</a></td></tr>\n"; echo "<tr><td>-> <a href=\"javascript:void(0);\" onClick=\"javascript:OpenPopUp('test_mail.php?session={$session}','testmail',800,350);\">" . _('install_test_mail') . "</a></td></tr>\n"; echo "<tr><td>-> <a href=\"config_logs.php?session={$session}\">" . _('config_logs') . "</a></td></tr>\n"; echo "<tr><td> </td></tr>\n"; echo "<tr><td>-> <a href=\"../\">" . _('install_acceder_appli') . "</a></td></tr>\n"; echo "</table>\n"; echo "</h3><br><br>\n"; echo '<a href="' . ROOT_PATH . 'deconnexion.php?session=' . $session . '" target="_top">' . '<img src="' . TEMPLATE_PATH . 'img/exit.png" width="22" height="22" border="0" title="' . _('button_deconnect') . '" alt="' . _('button_deconnect') . '">' . _('button_deconnect') . '</a>'; bottom(); }
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *************************************************************************************************/ define('ROOT_PATH', '../'); require_once ROOT_PATH . 'define.php'; include_once ROOT_PATH . 'fonctions_conges.php'; include_once INCLUDE_PATH . 'fonction.php'; include ROOT_PATH . 'version.php'; $PHP_SELF = $_SERVER['PHP_SELF']; //recup de la langue $lang = isset($_GET['lang']) ? $_GET['lang'] : (isset($_POST['lang']) ? $_POST['lang'] : ""); // recup des parametres $action = isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : ""); $version = isset($_GET['version']) ? $_GET['version'] : (isset($_POST['version']) ? $_POST['version'] : ""); $etape = isset($_GET['etape']) ? $_GET['etape'] : (isset($_POST['etape']) ? $_POST['etape'] : 0); if ($version == 0) { // la version à mettre à jour dans le formulaire de index.php n'a pas été choisie : renvoit sur le formulaire redirect(ROOT_PATH . 'install/index.php?lang=' . $lang); } header_popup(' PHP_CONGES : ' . _('install_maj_titre_1')); // affichage du titre echo "<center>\n"; echo "<br><H1><img src=\"" . TEMPLATE_PATH . "img/tux_config_32x32.png\" width=\"32\" height=\"32\" border=\"0\" title=\"" . _('install_install_phpconges') . "\" alt=\"" . _('install_install_phpconges') . "\"> " . _('install_maj_titre_2') . "</H1>\n"; echo "<br><br>\n"; // $config_php_conges_version est fourni par include_once ROOT_PATH .'version.php' ; \install\Fonctions::lance_maj($lang, $version, $config_php_conges_version, $etape); bottom();
along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *************************************************************************************************/ defined( '_PHP_CONGES' ) or die( 'Restricted access' ); $choix_groupe = getpost_variable('choix_groupe'); $cloture_users = getpost_variable('cloture_users'); $cloture_globale = getpost_variable('cloture_globale'); $cloture_groupe = getpost_variable('cloture_groupe'); $tab_cloture_users = getpost_variable('tab_cloture_users'); $tab_commentaire_saisie = getpost_variable('tab_commentaire_saisie'); /*************************************/ header_popup( $_SESSION['config']['titre_resp_index'] ); /*************************************/ /*** suite de la page ***/ /*************************************/ /** initialisation des tableaux des types de conges/absences **/ // recup du tableau des types de conges (conges et congesexceptionnels) // on concatene les 2 tableaux $tab_type_cong = ( recup_tableau_types_conges( $DEBUG) + recup_tableau_types_conges_exceptionnels( $DEBUG) ); // titre echo "<H2>". _('resp_cloture_exercice_titre') ."</H2>\n\n"; if($cloture_users=="TRUE")
function commit_saisie($tab_checkbox_j_chome, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); header_popup(); echo "<h1>" . _('admin_jours_chomes_titre') . "</h1>\n"; if ($DEBUG) { echo "tab_checkbox_j_chome : <br>\n"; print_r($tab_checkbox_j_chome); echo "<br>\n"; } // si l'année est déja renseignée dans la database, on efface ttes les dates de l'année if (verif_year_deja_saisie($tab_checkbox_j_chome, $DEBUG)) { $result = delete_year($tab_checkbox_j_chome, $DEBUG); } // on insert les nouvelles dates saisies $result = insert_year($tab_checkbox_j_chome, $DEBUG); // on recharge les jours feries dans les variables de session init_tab_jours_feries($DEBUG); if ($result) { echo "<br>" . _('form_modif_ok') . ".<br><br>\n"; } else { echo "<br>" . _('form_modif_not_ok') . " !<br><br>\n"; } $date_1 = key($tab_checkbox_j_chome); $tab_date = explode('-', $date_1); $comment_log = "saisie des jours chomés pour " . $tab_date[0]; log_action(0, "", "", $comment_log, $DEBUG); echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n"; echo "<table>\n"; echo "<tr><td align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td></tr>\n"; echo "</table>\n"; echo "</form>\n"; bottom(); }
/** * Encapsule le comportement du module de l'édition papier * * @param string $session * * @return void * @access public * @static */ public static function editPapierModule($session) { /*************************************/ // recup des parametres reçus : // GET / POST $user_login = getpost_variable('user_login'); $edit_id = getpost_variable('edit_id', 0); $return = ''; /*************************************/ if ($user_login != $_SESSION['userlogin'] && !is_hr($_SESSION['userlogin']) && !is_resp_of_user($_SESSION['userlogin'], $user_login)) { redirect(ROOT_PATH . 'deconnexion.php'); exit; } /************************************/ $css = '<link href="' . TEMPLATE_PATH . 'style_calendar_edition.css" rel="stylesheet" type="text/css">'; header_popup(_('editions_etat_conges') . ' : ' . $user_login, $css); if ($edit_id == 0) { // si c'est une nouvelle édition, on insert dans la base avant d'éditer et on renvoit l'id de l'édition $edit_id = \edition\Fonctions::enregistrement_edition($user_login); } $return .= \edition\Fonctions::edition_papier($user_login, $edit_id); $comment_log = "edition papier (num_edition = {$edit_id}) ({$user_login}) "; log_action(0, "", $user_login, $comment_log); $return .= '<br><script type="text/javascript" language="javascript1.2"> if (typeof(window.print) != \'undefined\') { window.print(); } </script>'; return $return; }
verif_droits_user($session, "is_admin", $DEBUG); /*** initialisation des variables ***/ /*************************************/ // recup des parametres reçus : // 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 == "") {
} $script = '<script language=javascript> function afficher(id) { el = document.getElementById(id); el.style.display = "block"; } function cacher(id) { el = document.getElementById(id); el.style.display = "none"; } </script>'; $css = '<link href="' . TEMPLATE_PATH . 'style_calendar_edition.css" rel="stylesheet" media="screen, print" type="text/css"><style type="text/css" media="print">@media print{@page {size: landscape}}</style>'; header_popup($_SESSION['config']['titre_calendrier'], $script . $css); /*************************************/ // recup des parametres reçus : // SERVER $PHP_SELF = $_SERVER['PHP_SELF']; // GET / POST $selected = getpost_variable('selected'); $printable = getpost_variable('printable', 0); $year = getpost_variable('year', date("Y")); $mois = getpost_variable('mois', date("n")); $first_jour = getpost_variable('first_jour', 1); // $first_load = getpost_variable('first_load', "Y") ; $select_groupe = getpost_variable('select_groupe', 0); /*************************************/ // on initialise le tableau global des jours fériés s'il ne l'est pas déjà : if (!isset($_SESSION["tab_j_feries"])) {
public static function choix_save_restore() { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); $return = ''; header_popup(); $return .= '<h1>' . _('admin_sauve_db_titre') . '</h1>'; $return .= '<form action="' . $PHP_SELF . '?session=' . $session . '" method="POST">'; $return .= '<table>'; $return .= '<tr>'; $return .= '<th colspan="2">' . _('admin_sauve_db_choisissez') . ' :</th>'; $return .= '</tr>'; $return .= '<tr>'; $return .= '<td><input type="radio" name="choix_action" value="sauvegarde" checked></td>'; $return .= '<td><b>' . _('admin_sauve_db_sauve') . '</b></td>'; $return .= '</tr>'; $return .= '<tr>'; $return .= '<td><input type="radio" name="choix_action" value="restaure" /></td>'; $return .= '<td><b>' . _('admin_sauve_db_restaure') . '</b></td>'; $return .= '</tr>'; $return .= '<tr>'; $return .= '<td colspan="2" align="center">'; $return .= ' '; $return .= '</td>'; $return .= '</tr>'; $return .= '<tr>'; $return .= '<td colspan=2" align="center">'; $return .= '<input type="submit" value="' . _('form_submit') . '">'; $return .= '</td>'; $return .= '</tr>'; $return .= '<tr>'; $return .= '<td colspan="2" align="center">'; $return .= '<input type="button" value="' . _('form_cancel') . '" onClick="javascript:window.close();">'; $return .= '</td></tr></table></form>'; echo $return; bottom(); }
function restaure($fichier_restaure_name, $fichier_restaure_tmpname, $fichier_restaure_size, $fichier_restaure_error, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); header_popup(); echo "<h1>" . _('admin_sauve_db_titre') . "</h1>\n"; if ($fichier_restaure_error != 0 || $fichier_restaure_size == 0) { //message d'erreur et renvoit sur la page précédente (choix fichier) echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n"; echo "<table>\n"; echo "<tr>\n"; echo "<th> " . _('admin_sauve_db_bad_file') . " : <br>{$fichier_restaure_name}</th>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "\t<input type=\"hidden\" name=\"choix_action\" value=\"restaure\">\n"; echo "\t<input type=\"submit\" value=\"" . _('form_redo') . "\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_cancel') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; } else { $result = execute_sql_file($fichier_restaure_tmpname, $DEBUG); echo "<form action=\"\" method=\"POST\">\n"; echo "<table>\n"; echo "<tr>\n"; echo "<th>" . _('admin_sauve_db_restaure_ok') . " !</th>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\"> </td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; } bottom(); }
function form_saisie($user, $date_debut, $date_fin, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); $date_today = date("d-m-Y"); if ($date_debut == "") { $date_debut = $date_today; } if ($date_fin == "") { $date_fin = $date_today; } header_popup(); echo "<center>\n"; echo "<h1>" . _('export_cal_titre') . "</h1>\n"; echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n"; echo "<table>\n"; // saisie des dates echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "<b>" . _('export_cal_from_date') . "</b> <input type=\"text\" name=\"date_debut\" size=\"10\" maxlength=\"10\" value=\"{$date_debut}\" style=\"background-color: #D4D4D4; \" readonly=\"readonly\"> \n"; echo "<a href=\"javascript:void(0);\" onClick=\"javascript:OpenPopUp('fonctions_export.php?session={$session}&champ_date=date_debut','calendardebut',250,220);\">\n"; echo "<img src=\"" . TEMPLATE_PATH . "img/1day.png\" border=\"0\" title=\"" . _('export_cal_saisir_debut') . "\" alt=\"" . _('export_cal_saisir_debut') . "\"></a>\n"; echo "</td>\n"; echo "<td align=\"center\">\n"; echo "<b>" . _('export_cal_to_date') . "</b> <input type=\"text\" name=\"date_fin\" size=\"10\" maxlength=\"10\" value=\"{$date_fin}\" style=\"background-color: #D4D4D4; \" readonly=\"readonly\"> \n"; echo "<a href=\"javascript:void(0);\" onClick=\"javascript:OpenPopUp('fonctions_export.php?session={$session}&champ_date=date_fin','calendarfin',250,220);\">\n"; echo "<img src=\"" . TEMPLATE_PATH . "img/1day.png\" border=\"0\" title=\"" . _('export_cal_saisir_fin') . "\" alt=\"" . _('export_cal_saisir_fin') . "\"></a>\n"; echo "</td>\n"; echo "</tr>\n"; // ligne vide echo "<tr>\n"; echo "<td colspan=\"2\"> \n"; echo "</td>\n"; echo "</tr>\n"; // saisie du format echo "<tr>\n"; echo "<td colspan=\"2\">\n"; echo "<table align=\"center\"><tr>\n"; echo "<td><b>" . _('export_cal_format') . "</b> : </td>\n"; echo "<td align=\"left\"><b>ical</b><input type=\"radio\" name=\"choix_format\" value=\"ical\" checked> </td>\n"; echo "<td align=\"right\"> <b>vcal</b><input type=\"radio\" name=\"choix_format\" value=\"vcal\"></td>\n"; echo "</tr></table>\n"; echo "</td>\n"; echo "<tr>\n"; echo "<td align=\"center\"> </td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td colspan=\"2\" align=\"center\">\n"; echo "\t<input type=\"hidden\" name=\"action\" value=\"export\">\n"; echo "\t<input type=\"submit\" value=\"" . _('form_submit') . "\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td colspan=\"2\" align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; bottom(); }
public static function confirm_saisie($tab_checkbox_j_chome) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); $return = ''; header_popup(); $return .= '<h1>' . _('admin_jours_chomes_titre') . '</h1>'; $return .= '<form action="' . $PHP_SELF . '?session=' . $session . '&onglet=jours_chomes" method="POST">'; $return .= '<table>'; $return .= '<tr>'; $return .= '<td align="center">'; foreach ($tab_checkbox_j_chome as $key => $value) { $date_affiche = eng_date_to_fr($key); $return .= $date_affiche . '<br>'; $return .= '<input type="hidden" name="tab_checkbox_j_chome[' . $key . ']" value="' . $value . '">'; } $return .= '<input type="hidden" name="choix_action" value="commit">'; $return .= '<input type="submit" value="' . _('admin_jours_chomes_confirm') . '">'; $return .= '</td>'; $return .= '</tr>'; $return .= '<tr>'; $return .= '<td align="center">'; $return .= '<input type="button" value="' . _('form_cancel') . '" onClick="javascript:window.close();">'; $return .= '</td>'; $return .= '</tr>'; $return .= '</table>'; $return .= '</form>'; bottom(); }
// SERVER $PHP_SELF = $_SERVER['PHP_SELF']; $HTTP_REFERER = $_SERVER['HTTP_REFERER']; // GET / POST $year = getpost_variable('year', date("Y")); $mois = getpost_variable('mois', date("n")); $champ_date = getpost_variable('champ_date'); /*************************************/ // ATTENTION ne pas mettre cet appel avant les include car plantage sous windows !!! $script = '<script language="javascript"> function envoi_date(valeur) { window.opener.document.forms[0].' . $champ_date . '.value=valeur; window.close() } </script>'; header_popup('calendar', $script); $jour_today = date("j"); $mois_timestamp = mktime(0, 0, 0, $mois, 1, $year); $nom_mois = date_fr("F", $mois_timestamp); // AFFICHAGE PAGE echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"; echo "<tr>\n"; echo " <td align=\"center\">\n"; echo " <h3>{$nom_mois} {$year}</h3>\n"; echo " </td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo " <td align=\"center\">\n"; // AFFICHAGE TABLEAU (CALENDRIER) affiche_calendar($year, $mois, $DEBUG); echo " </td>\n";
if ($_SESSION['config']['how_to_connect_user'] == "ldap" && $session_username != "admin" && ($session_username != "conges" || !$_SESSION['config']['responsable_virtuel'])) { $username_ldap = authentification_ldap_conges($session_username, $session_password); if ($username_ldap != $session_username) { $session = ""; $session_username = ""; $session_password = ""; $erreur = "login_passwd_incorrect"; // appel du formulaire d'intentification (login/password) session_saisie_user_password($erreur, $session_username, $session_password); exit; } else { if (valid_ldap_user($session_username)) { // on initialise la nouvelle session session_create($session_username); } else { header_popup(); echo _('session_pas_de_compte_dans_dbconges') . "<br>\n"; echo _('session_contactez_admin') . "\n"; bottom(); exit; } } } elseif ($_SESSION['config']['how_to_connect_user'] == "dbconges" || $session_username == "admin" || $session_username != "conges" && !$_SESSION['config']['responsable_virtuel']) { $username_conges = autentification_passwd_conges($session_username, $session_password); if ($username_conges != $session_username) { $session = ""; $session_username = ""; $session_password = ""; $erreur = "login_passwd_incorrect"; // appel du formulaire d'intentification (login/password) session_saisie_user_password($erreur, $session_username, $session_password);
include INCLUDE_PATH . 'session.php'; //$DEBUG = TRUE ; $DEBUG = FALSE; /*************************************/ // recup des parametres reçus : // GET / POST $user_login = getpost_variable('user_login'); $edit_id = getpost_variable('edit_id', 0); /*************************************/ if ($user_login != $_SESSION['userlogin'] && !is_hr($_SESSION['userlogin']) && !is_resp_of_user($_SESSION['userlogin'], $user_login)) { redirect(ROOT_PATH . 'deconnexion.php'); exit; } /************************************/ $css = '<link href="' . TEMPLATE_PATH . 'style_calendar_edition.css" rel="stylesheet" type="text/css">'; header_popup(_('editions_etat_conges') . ' : ' . $user_login, $css); $session = session_id(); if ($edit_id == 0) { // si c'est une nouvelle édition, on insert dans la base avant d'éditer et on renvoit l'id de l'édition $edit_id = enregistrement_edition($user_login, $DEBUG); } if ($edit_id != "0101010") { edition($user_login, $edit_id, $session, $DEBUG); } else { edition_year($user_login, $edit_id, $session, $DEBUG); } $comment_log = "edition papier (num_edition = {$edit_id}) ({$user_login}) "; log_action(0, "", $user_login, $comment_log, $DEBUG); ?> <br> <script type="text/javascript" language="javascript1.2">
/** * Encapsule le comportement du module de cloture d'exercice * * @return void * @access public * @static */ public static function clotureExerciceModule() { $choix_groupe = getpost_variable('choix_groupe'); $cloture_users = getpost_variable('cloture_users'); $cloture_globale = getpost_variable('cloture_globale'); $cloture_groupe = getpost_variable('cloture_groupe'); $tab_cloture_users = getpost_variable('tab_cloture_users'); $tab_commentaire_saisie = getpost_variable('tab_commentaire_saisie'); $return = ''; /*************************************/ header_popup($_SESSION['config']['titre_resp_index']); /*************************************/ /*** suite de la page ***/ /*************************************/ /** initialisation des tableaux des types de conges/absences **/ // recup du tableau des types de conges (conges et congesexceptionnels) // on concatene les 2 tableaux $tab_type_cong = recup_tableau_types_conges() + recup_tableau_types_conges_exceptionnels(); // titre $return .= '<H2>' . _('resp_cloture_exercice_titre') . '</H2>'; if ($cloture_users == "TRUE") { $return .= \responsable\Fonctions::cloture_users($tab_type_cong, $tab_cloture_users, $tab_commentaire_saisie); } elseif ($cloture_globale == "TRUE") { $return .= \responsable\Fonctions::cloture_globale($tab_type_cong); } elseif ($cloture_groupe == "TRUE") { $return .= \responsable\Fonctions::cloture_globale_groupe($choix_groupe, $tab_type_cong); } else { $return .= \responsable\Fonctions::saisie_cloture($tab_type_cong); } return $return; }
$PHP_SELF = $_SERVER['PHP_SELF']; $DEBUG = FALSE; //$DEBUG=TRUE; //recup de la langue $lang = isset($_GET['lang']) ? $_GET['lang'] : (isset($_POST['lang']) ? $_POST['lang'] : ""); /* $tab_lang_file = glob("lang/lang_".$lang.'_*.php'); if( $DEBUG ) { echo "lang = $lang # fichier de langue = ".$tab_lang_file[0]."<br>\n"; } include$tab_lang_file[0] ; */ if ($DEBUG) { echo "SESSION = <br>\n"; print_r($_SESSION); echo "<br><br>\n"; } header_popup('PHP_CONGES : Installation'); // affichage du titre echo "<center>\n"; echo "<br><H1><img src=\"" . TEMPLATE_PATH . "img/tux_config_32x32.png\" width=\"32\" height=\"32\" border=\"0\" title=\"" . _('install_install_phpconges') . "\" alt=\"" . _('install_install_phpconges') . "\"> " . _('install_install_titre') . "</H1>\n"; echo "<br><br>\n"; lance_install($lang, $DEBUG); bottom(); /*****************************************************************************/ /* FONCTIONS */ // install la nouvelle version dans une database vide ... et config function lance_install($lang, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; include CONFIG_PATH . 'dbconnect.php'; include ROOT_PATH . 'version.php'; //verif si create / alter table possible !!!
function restaure($fichier_restaure_name, $fichier_restaure_tmpname, $fichier_restaure_size, $fichier_restaure_error, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); header_popup(); echo "<h1>" . _('admin_sauve_db_titre') . "</h1>\n"; if ($fichier_restaure_error != 0 || $fichier_restaure_size == 0) { //message d'erreur et renvoit sur la page précédente (choix fichier) echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n"; echo "<table>\n"; echo "<tr>\n"; echo "<th> " . _('admin_sauve_db_bad_file') . " : <br>{$fichier_restaure_name}</th>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "\t<input type=\"hidden\" name=\"choix_action\" value=\"restaure\">\n"; echo "\t<input type=\"submit\" value=\"" . _('form_redo') . "\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_cancel') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; } else { //affichage du contenu : //readfile($fichier_restaure_tmpname); $result = execute_sql_file($fichier_restaure_tmpname, $DEBUG); /* // on lit le fichier et on met chaque ligne dans un tableau $tab_lines = file ($fichier_restaure_tmpname); // puis parcourt du tableau : // si la ligne n'est pas un commentaire (commence par # (après avoir enlevé les espaces de debut de chaine)) // on l'ajoute a la requete sql ) $sql2=""; foreach ($tab_lines as $line_num => $line) { $line=trim($line); if(substr($line,0,1)=="#") { //echo "#<b>$line_num</b> $line<br>\n"; } else { //echo "$line<br>\n"; //execution de la requete sql: $sql2=$line; //echo "$sql2<br>"; $ReqLog = SQL::query($sql2) ; } } */ echo "<form action=\"\" method=\"POST\">\n"; echo "<table>\n"; echo "<tr>\n"; echo "<th>" . _('admin_sauve_db_restaure_ok') . " !</th>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\"> </td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; } bottom(); }
function install($lang, $DEBUG = FALSE) { // soit, c'est une install complète , soit c'est une mise à jour d'une version non déterminée header_popup('PHP_CONGES : Installation'); // affichage du titre echo "<center>\n"; echo "<br><H1><img src=\"" . TEMPLATE_PATH . "img/tux_config_32x32.png\" width=\"32\" height=\"32\" border=\"0\" title=\"" . _('install_install_phpconges') . "\" alt=\"" . _('install_install_phpconges') . "\"> " . _('install_index_titre') . "</H1>\n"; echo "<br><br>\n"; echo "<table border=\"0\">\n"; echo "<tr align=\"center\">\n"; echo "<td colspan=\"3\"><h2>" . _('install_no_prev_version_found') . ".<br>" . _('install_indiquez') . " ...</h2><br><br></td>\n"; echo "</tr>\n"; echo "<tr align=\"center\">\n"; echo "<td valign=top>\n"; echo "\n"; echo "<h3>... " . _('install_nouvelle_install') . "</h3>\n"; echo "<br>\n"; // Formulaire : lance install.php echo "<form action=\"install.php\" method=\"POST\">\n"; echo "<input type=\"hidden\" name=\"lang\" value=\"{$lang}\">\n"; echo "<input type=\"submit\" value=\"" . _('form_start') . "\">\n"; echo "</form>\n"; echo "</td>\n"; echo "<td><img src=\"" . TEMPLATE_PATH . "img/shim.gif\" width=\"100\" height=\"10\" border=\"0\" vspace=\"0\" hspace=\"0\"></td>\n"; echo "<td valign=top>\n"; echo "<h3>... " . _('install_mise_a_jour') . "</h3><b>" . _('install_indiquez_pre_version') . " :</b><br><br>\n"; // Formulaire : lance mise_a_jour.php echo "<form action=\"mise_a_jour.php\" method=\"POST\">\n"; // affichage de la liste des versions ... echo "<select name=\"version\">\n"; echo "<option value=\"0\">" . _('install_installed_version') . "</option>\n"; echo "<option value=\"1.0\">v1.0.x</option>\n"; echo "<option value=\"0.10\">v0.10.x</option>\n"; echo "<option value=\"0.9\">v0.9.x</option>\n"; echo "<option value=\"0.8\">v0.8.x</option>\n"; echo "<option value=\"0.7\">v0.7.x</option>\n"; echo "<option value=\"0.6\">v0.6.x</option>\n"; echo "<option value=\"0.5\">v0.5.x</option>\n"; echo "<option value=\"0.4\">v0.4</option>\n"; echo "</select>\n"; echo "<br>\n"; echo "<input type=\"hidden\" name=\"lang\" value=\"{$lang}\">\n"; echo "<input type=\"submit\" value=\"" . _('form_start') . "\">\n"; echo "</form>\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; bottom(); }
include 'fonctions_edition.php'; //$DEBUG = TRUE ; $DEBUG = FALSE; /*************************************/ // recup des parametres reçus : // SERVER $PHP_SELF = $_SERVER['PHP_SELF']; // GET / POST $user_login = getpost_variable('user_login', $_SESSION['userlogin']); /*************************************/ if ($user_login != $_SESSION['userlogin'] && !is_hr($_SESSION['userlogin']) && !is_resp_of_user($_SESSION['userlogin'], $user_login)) { redirect(ROOT_PATH . 'deconnexion.php'); exit; } /************************************/ header_popup(_('editions_titre') . ' : ' . $user_login); affichage($user_login, $DEBUG); bottom(); /**************************************************************************************/ /******** FONCTIONS ******/ /**************************************************************************************/ function affichage($login, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); $sql1 = 'SELECT u_nom, u_prenom, u_quotite FROM conges_users where u_login = \'' . SQL::quote($login) . '\''; $ReqLog1 = SQL::query($sql1); // if ($ReqLog1->num_rows == 0) // exit ('todo'. __FILE__ .' ( ' .__LINE__ .' ) '); while ($resultat1 = $ReqLog1->fetch_array()) { $sql_nom = $resultat1["u_nom"];
function confirm_saisie($tab_checkbox_j_chome, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); header_popup(); echo "<h1>" . _('admin_jours_chomes_titre') . "</h1>\n"; echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n"; echo "<table>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; foreach ($tab_checkbox_j_chome as $key => $value) { $date_affiche = eng_date_to_fr($key); echo "{$date_affiche}<br>\n"; echo "<input type=\"hidden\" name=\"tab_checkbox_j_chome[{$key}]\" value=\"{$value}\">\n"; } echo "<input type=\"hidden\" name=\"choix_action\" value=\"commit\">\n"; echo "<input type=\"submit\" value=\"" . _('admin_jours_chomes_confirm') . "\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align=\"center\">\n"; echo "\t<input type=\"button\" value=\"" . _('form_cancel') . "\" onClick=\"javascript:window.close();\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; bottom(); }
function session_saisie_user_password($erreur, $session_username, $session_password) { $PHP_SELF = $_SERVER['PHP_SELF']; $config_php_conges_version = $_SESSION['config']['php_conges_version']; $config_url_site_web_php_conges = $_SESSION['config']['url_site_web_php_conges']; $config_stylesheet_file = $_SESSION['config']['stylesheet_file']; $return_url = getpost_variable('return_url', false); // verif si on est dans le repertoire install if (substr(dirname($_SERVER["SCRIPT_FILENAME"]), -6, 6) == "config") { // verif si on est dans le repertoire install $config_dir = TRUE; } else { $config_dir = FALSE; } $add = '<script language="JavaScript" type="text/javascript"> <!-- // Les cookies sont obligatoires if (! navigator.cookieEnabled) { document.write("<font color=\'#FF0000\'><br><br><center>' . _('cookies_obligatoires') . '</center></font><br><br>"); } //--> </script> <noscript> <font color="#FF0000"><br><br><center>' . _('javascript_obligatoires') . '</center></font><br><br> </noscript>'; header_popup('', $add); include TEMPLATE_PATH . 'login_form.php'; bottom(); exit; }