Пример #1
0
 public static function ajout_conges($tab_champ_saisie, $tab_commentaire_saisie)
 {
     $PHP_SELF = $_SERVER['PHP_SELF'];
     $session = session_id();
     $return = '';
     foreach ($tab_champ_saisie as $user_name => $tab_conges) {
         foreach ($tab_conges as $id_conges => $user_nb_jours_ajout) {
             $user_nb_jours_ajout_float = (double) $user_nb_jours_ajout;
             $valid = verif_saisie_decimal($user_nb_jours_ajout_float);
             //verif la bonne saisie du nombre décimal
             if ($valid) {
                 if ($user_nb_jours_ajout_float != 0) {
                     /* Modification de la table conges_users */
                     $sql1 = "UPDATE conges_solde_user SET su_solde = su_solde+{$user_nb_jours_ajout_float} WHERE su_login='******' AND su_abs_id = {$id_conges} ";
                     /* On valide l'UPDATE dans la table ! */
                     $ReqLog1 = \includes\SQL::query($sql1);
                     /*			// Enregistrement du commentaire relatif à l'ajout de jours de congés
                                     $comment = $tab_commentaire_saisie[$user_name];
                                     $sql1 = "INSERT INTO conges_historique_ajout (ha_login, ha_date, ha_abs_id, ha_nb_jours, ha_commentaire)
                                     VALUES ('$user_name', NOW(), $id_conges, $user_nb_jours_ajout_float , '$comment')";
                                     $ReqLog1 = SQL::query($sql1) ;
                          */
                     // on insert l'ajout de conges dans la table periode
                     $commentaire = _('resp_ajout_conges_comment_periode_user');
                     \responsable\Fonctions::insert_ajout_dans_periode($user_name, $user_nb_jours_ajout_float, $id_conges, $commentaire);
                 }
             }
         }
     }
     $return .= ' ' . _('form_modif_ok') . '<br><br>';
     /* APPEL D'UNE AUTRE PAGE au bout d'une tempo de 2secondes */
     $return .= '<META HTTP-EQUIV=REFRESH CONTENT="2; URL=' . $PHP_SELF . '?session=' . $session . '">';
     return $return;
 }