function confirmer($p_num, $onglet, $DEBUG = FALSE) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); // Récupération des informations $sql1 = 'SELECT p_login, p_date_deb, p_demi_jour_deb, p_date_fin, p_demi_jour_fin, p_nb_jours, p_commentaire, p_etat, p_num FROM conges_periode where p_num = \'' . SQL::quote($p_num) . '\''; $ReqLog1 = SQL::query($sql1); // AFFICHAGE TABLEAU echo '<form NAME="dem_conges" action="' . $PHP_SELF . '" method="POST">'; echo "<table class=\"table table-responsive\">\n"; echo '<thead>'; // affichage première ligne : titres echo "<tr>\n"; echo "<td>" . _('divers_debut_maj_1') . "</td>\n"; echo "<td>" . _('divers_fin_maj_1') . "</td>\n"; echo "<td>" . _('divers_nb_jours_maj_1') . "</td>\n"; echo "<td>" . _('divers_comment_maj_1') . "</td>\n"; echo "</tr>\n"; echo '</thead>'; echo '<tbody>'; // affichage 2ieme ligne : valeurs actuelles echo "<tr>\n"; while ($resultat1 = $ReqLog1->fetch_array()) { $sql_date_deb = eng_date_to_fr($resultat1["p_date_deb"]); $sql_demi_jour_deb = $resultat1["p_demi_jour_deb"]; if ($sql_demi_jour_deb == "am") { $demi_j_deb = _('divers_am_short'); } else { $demi_j_deb = _('divers_pm_short'); } $sql_date_fin = eng_date_to_fr($resultat1["p_date_fin"]); $sql_demi_jour_fin = $resultat1["p_demi_jour_fin"]; if ($sql_demi_jour_fin == "am") { $demi_j_fin = _('divers_am_short'); } else { $demi_j_fin = _('divers_pm_short'); } $sql_nb_jours = $resultat1["p_nb_jours"]; $aff_nb_jours = affiche_decimal($sql_nb_jours); $sql_commentaire = $resultat1["p_commentaire"]; $sql_etat = $resultat1["p_etat"]; echo "<td>{$sql_date_deb} _ {$demi_j_deb}</td><td>{$sql_date_fin} _ {$demi_j_fin}</td><td>{$aff_nb_jours}</td><td>{$sql_commentaire}</td>\n"; $compte = ""; if ($_SESSION['config']['rempli_auto_champ_nb_jours_pris']) { $compte = 'onChange="compter_jours();return false;"'; } $text_debut = "<input class=\"form-control date\" type=\"text\" name=\"new_debut\" size=\"10\" maxlength=\"30\" value=\"" . revert_date($sql_date_deb) . "\">"; if ($sql_demi_jour_deb == "am") { $radio_deb_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"am\" checked> " . _('form_am'); $radio_deb_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"pm\"> " . _('form_pm'); } else { $radio_deb_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"am\">" . _('form_am'); $radio_deb_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"pm\" checked>" . _('form_pm'); } $text_fin = "<input class=\"form-control date\" type=\"text\" name=\"new_fin\" size=\"10\" maxlength=\"30\" value=\"" . revert_date($sql_date_fin) . "\">"; if ($sql_demi_jour_fin == "am") { $radio_fin_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"am\" checked>" . _('form_am'); $radio_fin_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"pm\">" . _('form_pm'); } else { $radio_fin_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"am\">" . _('form_am'); $radio_fin_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"pm\" checked>" . _('form_pm'); } if ($_SESSION['config']['disable_saise_champ_nb_jours_pris']) { $text_nb_jours = "<input class=\"form-control\" type=\"text\" name=\"new_nb_jours\" size=\"5\" maxlength=\"30\" value=\"{$sql_nb_jours}\" style=\"background-color: #D4D4D4; \" readonly=\"readonly\">"; } else { $text_nb_jours = "<input class=\"form-control\" type=\"text\" name=\"new_nb_jours\" size=\"5\" maxlength=\"30\" value=\"{$sql_nb_jours}\">"; } $text_commentaire = "<input class=\"form-control\" type=\"text\" name=\"new_comment\" size=\"15\" maxlength=\"30\" value=\"{$sql_commentaire}\">"; } echo "</tr>\n"; // affichage 3ieme ligne : saisie des nouvelles valeurs echo "<tr>\n"; echo "<td>{$text_debut}<br>{$radio_deb_am} / {$radio_deb_pm}</td><td>{$text_fin}<br>{$radio_fin_am} / {$radio_fin_pm}</td><td>{$text_nb_jours}</td><td>{$text_commentaire}</td>\n"; echo "</tr>\n"; echo '</tbody>'; echo "</table>\n"; echo '<hr/>'; echo "<input type=\"hidden\" name=\"p_num_to_update\" value=\"{$p_num}\">\n"; echo "<input type=\"hidden\" name=\"p_etat\" value=\"{$sql_etat}\">\n"; echo "<input type=\"hidden\" name=\"session\" value=\"{$session}\">\n"; echo '<input type="hidden" name="user_login" value="' . $_SESSION['userlogin'] . '">'; echo "<input type=\"hidden\" name=\"onglet\" value=\"{$onglet}\">\n"; echo '<p id="comment_nbj" style="color:red"> </p>'; echo "<input class=\"btn btn-success\" type=\"submit\" value=\"" . _('form_submit') . "\">\n"; echo "<a class=\"btn\" href=\"{$PHP_SELF}?session={$session}&onglet=demandes_en_cours\">" . _('form_cancel') . "</a>\n"; echo "</form>\n"; }
public static function confirmer($p_num, $onglet) { $PHP_SELF = $_SERVER['PHP_SELF']; $session = session_id(); $return = ''; include ROOT_PATH . 'fonctions_javascript.php'; // Récupération des informations $sql1 = 'SELECT p_login, p_date_deb, p_demi_jour_deb, p_date_fin, p_demi_jour_fin, p_nb_jours, p_commentaire, p_etat, p_num FROM conges_periode where p_num = "' . \includes\SQL::quote($p_num) . '"'; $ReqLog1 = \includes\SQL::query($sql1); // AFFICHAGE TABLEAU $return .= '<form NAME="dem_conges" action="' . $PHP_SELF . '" method="POST">'; $return .= '<table class="table table-responsive">'; $return .= '<thead>'; // affichage première ligne : titres $return .= '<tr>'; $return .= '<td>' . _('divers_debut_maj_1') . '</td>'; $return .= '<td>' . _('divers_fin_maj_1') . '</td>'; $return .= '<td>' . _('divers_nb_jours_maj_1') . '</td>'; $return .= '<td>' . _('divers_comment_maj_1') . '</td>'; $return .= '</tr>'; $return .= '</thead>'; $return .= '<tbody>'; // affichage 2ieme ligne : valeurs actuelles $return .= '<tr>'; while ($resultat1 = $ReqLog1->fetch_array()) { $sql_date_deb = eng_date_to_fr($resultat1["p_date_deb"]); $sql_demi_jour_deb = $resultat1["p_demi_jour_deb"]; if ($sql_demi_jour_deb == "am") { $demi_j_deb = _('divers_am_short'); } else { $demi_j_deb = _('divers_pm_short'); } $sql_date_fin = eng_date_to_fr($resultat1["p_date_fin"]); $sql_demi_jour_fin = $resultat1["p_demi_jour_fin"]; if ($sql_demi_jour_fin == "am") { $demi_j_fin = _('divers_am_short'); } else { $demi_j_fin = _('divers_pm_short'); } $sql_nb_jours = $resultat1["p_nb_jours"]; $aff_nb_jours = affiche_decimal($sql_nb_jours); $sql_commentaire = $resultat1["p_commentaire"]; $sql_etat = $resultat1["p_etat"]; $return .= '<td>' . $sql_date_deb . '_' . $demi_j_deb . '</td><td>' . $sql_date_fin . '_' . $demi_j_fin . '</td><td>' . $aff_nb_jours . '</td><td>' . $sql_commentaire . '</td>'; $compte = ""; if ($_SESSION['config']['rempli_auto_champ_nb_jours_pris']) { $compte = 'onChange="compter_jours();return false;"'; } $text_debut = "<input class=\"form-control date\" type=\"text\" name=\"new_debut\" size=\"10\" maxlength=\"30\" value=\"" . revert_date($sql_date_deb) . "\">"; if ($sql_demi_jour_deb == "am") { $radio_deb_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"am\" checked> " . _('form_am'); $radio_deb_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"pm\"> " . _('form_pm'); } else { $radio_deb_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"am\">" . _('form_am'); $radio_deb_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_deb\" value=\"pm\" checked>" . _('form_pm'); } $text_fin = "<input class=\"form-control date\" type=\"text\" name=\"new_fin\" size=\"10\" maxlength=\"30\" value=\"" . revert_date($sql_date_fin) . "\">"; if ($sql_demi_jour_fin == "am") { $radio_fin_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"am\" checked>" . _('form_am'); $radio_fin_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"pm\">" . _('form_pm'); } else { $radio_fin_am = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"am\">" . _('form_am'); $radio_fin_pm = "<input type=\"radio\" {$compte} name=\"new_demi_jour_fin\" value=\"pm\" checked>" . _('form_pm'); } if ($_SESSION['config']['disable_saise_champ_nb_jours_pris']) { $text_nb_jours = "<input class=\"form-control\" type=\"text\" name=\"new_nb_jours\" size=\"5\" maxlength=\"30\" value=\"{$sql_nb_jours}\" style=\"background-color: #D4D4D4; \" readonly=\"readonly\">"; } else { $text_nb_jours = "<input class=\"form-control\" type=\"text\" name=\"new_nb_jours\" size=\"5\" maxlength=\"30\" value=\"{$sql_nb_jours}\">"; } $text_commentaire = "<input class=\"form-control\" type=\"text\" name=\"new_comment\" size=\"15\" maxlength=\"30\" value=\"{$sql_commentaire}\">"; } $return .= '</tr>'; // affichage 3ieme ligne : saisie des nouvelles valeurs $return .= '<tr>'; $return .= '<td>' . $text_debut . '<br>' . $radio_deb_am . '/' . $radio_deb_pm . '</td><td>' . $text_fin . '<br>' . $radio_fin_am . '/' . $radio_fin_pm . '</td><td>' . $text_nb_jours . '</td><td>' . $text_commentaire . '</td>'; $return .= '</tr>'; $return .= '</tbody>'; $return .= '</table>'; $return .= '<hr/>'; $return .= '<input type="hidden" name="p_num_to_update" value="' . $p_num . '">'; $return .= '<input type="hidden" name="p_etat" value="' . $sql_etat . '">'; $return .= '<input type="hidden" name="session" value="' . $session . '">'; $return .= '<input type="hidden" name="user_login" value="' . $_SESSION['userlogin'] . '">'; $return .= '<input type="hidden" name="onglet" value="' . $onglet . '">'; $return .= '<p id="comment_nbj" style="color:red"> </p>'; $return .= '<input class="btn btn-success" type="submit" value="' . _('form_submit') . '">'; $return .= '<a class="btn" href="' . $PHP_SELF . '?session=' . $session . '&onglet=demandes_en_cours">' . _('form_cancel') . '</a>'; $return .= '</form>'; return $return; }