Ejemplo n.º 1
0
 public static function saisie_dates_fermeture($year, $groupe_id, $new_date_debut, $new_date_fin, $code_erreur)
 {
     $PHP_SELF = $_SERVER['PHP_SELF'];
     $session = session_id();
     $return = '';
     $tab_date_debut = explode("/", $new_date_debut);
     // date au format d/m/Y
     $timestamp_date_debut = mktime(0, 0, 0, $tab_date_debut[1], $tab_date_debut[0], $tab_date_debut[2]);
     $date_debut_yyyy_mm_dd = $tab_date_debut[2] . "-" . $tab_date_debut[1] . "-" . $tab_date_debut[0];
     $tab_date_fin = explode("/", $new_date_fin);
     // date au format d/m/Y
     $timestamp_date_fin = mktime(0, 0, 0, $tab_date_fin[1], $tab_date_fin[0], $tab_date_fin[2]);
     $date_fin_yyyy_mm_dd = $tab_date_fin[2] . "-" . $tab_date_fin[1] . "-" . $tab_date_fin[0];
     $timestamp_today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
     // on construit le tableau de l'année considérée
     $tab_year = array();
     \hr\Fonctions::get_tableau_jour_fermeture($year, $tab_year, $groupe_id);
     $return .= '<form id="form-fermeture" class="form-inline" role="form" action="' . $PHP_SELF . '?session=' . $session . '&year=' . $year . '" method="POST">';
     $return .= '<div class="form-group">';
     $return .= '<label for="new_date_debut">' . _('divers_date_debut') . '</label><input type="text" class="form-control date" name="new_date_debut" value="' . $new_date_debut . '">';
     $return .= '</div>';
     $return .= '<div class="form-group">';
     $return .= '<label for="new date_fin">' . _('divers_date_fin') . '</label><input type="text" class="form-control date" name="new_date_fin" value="' . $new_date_fin . '">';
     $return .= '</div>';
     $return .= '<div class="form-group">';
     $return .= '<label for="id_type_conges">' . _('admin_jours_fermeture_affect_type_conges') . '</label>';
     $return .= '<select name="id_type_conges" class="form-control">';
     $return .= \hr\Fonctions::affiche_select_conges_id();
     $return .= '</select>';
     $return .= '</div>';
     $return .= '<hr/>';
     $return .= '<input type="hidden" name="groupe_id" value="' . $groupe_id . '">';
     $return .= '<input type="hidden" name="choix_action" value="commit_new_fermeture">';
     $return .= '<input class="btn btn-success" type="submit" value="' . _('form_submit') . '">';
     $return .= '</form>';
     return $return;
 }