Ejemplo n.º 1
0
include "../includes/layouts/nav.php";
?>




<?php 
if (isset($_GET["program_id"]) && !isset($_POST["submit"])) {
    list($date_fr, $date_fr_short, $date_fr_long, $date_fr_hr, $date_fr_short_hr, $date_fr_long_hr, $date_fr_full_hr) = date_fr($program["course_date"]);
    // GET request
    $fiedset_msg = " Client " . $program["pseudo"];
    $fiedset_msg .= " en date de " . $date_fr_short;
    $fiedset_msg .= " ID " . $_GET["program_id"];
    // validation warning
    $date_msg = get_warning_error_p(check_date_vs_now($program['course_date']), true);
    list($msg_pseudo_autres, $msg_nom_patient) = validate_pseudo($pseudo, $pseudo_autres, $nom_patient, true);
    $msg_bon_no = validate_pseudo_bon_no($pseudo, $bon_no, true);
    //    echo $msg_pseudo_autres;
    //    echo $msg_nom_patient;
    $msg_pseudo_autres = get_warning_error_p($msg_pseudo_autres, true);
    $msg_nom_patient = get_warning_error_p($msg_nom_patient, true);
    $msg_bon_no = get_warning_error_p($msg_bon_no, true);
    // non post from GET
    $missing = validate_presences_non_post($required_fields, $program, true);
    foreach ($program as $key => $val) {
        $msg_key = "msg_presence_warning_" . $key;
        $text = "<strong>&nbsp;&nbsp;  " . ucfirst($key) . "</strong> est à compléter";
        ${$msg_key} = array_key_exists($key, $missing) ? get_warning_error_p($text, true) : "";
        //    $$msg_key= array_key_exists ($key, $missing)? get_warning_error($missing[$key],true)  : "" ;
    }
} else {
Ejemplo n.º 2
0
 $chauffeur = mysql_prep($_POST["Chauffeur"]);
 $pseudo = mysql_prep($_POST["Pseudo"]);
 $pseudo_autres = mysql_prep($_POST["name"]);
 $nom_patient = mysql_prep($_POST["Nom_Patient"]);
 $heure_aller = mysql_prep($_POST["Heure"]);
 $aller_retour = mysql_prep($_POST["AllerRetour"]);
 if (isset($_POST['HeureRetour'])) {
     $heure_retour = mysql_prep($_POST["HeureRetour"]);
 } else {
     $heure_retour = "";
 }
 if ($heure_retour == "NA") {
     $heure_retour = "";
 }
 $type_transport = type_transport($pseudo);
 validate_pseudo($pseudo, $pseudo_autres, $nom_patient);
 validate_heure($heure_aller, $aller_retour, $heure_retour);
 validate_chauffeur_by_name($chauffeur);
 validation_pseudo_clients($pseudo);
 if (empty($errors)) {
     $to = '*****@*****.**';
     $subject = 'EDITION Detail de la course par ' . $_POST["Chauffeur"] . " saisie " . $todaytime;
     $message = "Subject:   {$subject}\r\n";
     $message .= "Date Course:  {$_POST['DateCourse']}\r\n\r\n";
     $message .= "Nom Client:   {$_POST['Pseudo']}\r\n";
     $message .= "Départ de:   {$_POST['Depart']}\r\n";
     $message .= "Arrivée à:   {$_POST['Arrivee']}\r\n";
     $message .= "Aller Retour:   {$_POST['AllerRetour']}\r\n";
     $message .= "Heure:  {$_POST['Heure']}\r\n\r\n";
     $message .= "Heure Retour:  {$_POST['HeureRetour']}\r\n\r\n";
     $message .= "Nom (autres):  {$_POST['name']}\r\n\r\n";
Ejemplo n.º 3
0
//
// Seuls les administrateurs peuvent ajouter ou supprimer un utilisateur
//
if (($mode == 'adduser' || $mode == 'deluser') && $admindata['admin_level'] != ADMIN) {
    $output->redirect('index.php', 4);
    $message = $lang['Message']['Not_authorized'];
    $message .= '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . sessid('./index.php') . '">', '</a>');
    $output->message($message);
}
if ($mode == 'adduser') {
    $new_login = !empty($_POST['new_login']) ? trim(strip_tags($_POST['new_login'])) : '';
    $new_email = !empty($_POST['new_email']) ? trim(strip_tags($_POST['new_email'])) : '';
    if (isset($_POST['submit'])) {
        require WA_ROOTDIR . '/includes/functions.validate.php';
        require WAMAILER_DIR . '/class.mailer.php';
        if (!validate_pseudo($new_login)) {
            $error = TRUE;
            $msg_error[] = $lang['Message']['Invalid_login'];
        } else {
            $sql = "SELECT COUNT(*) AS login_test \n\t\t\t\tFROM " . ADMIN_TABLE . " \n\t\t\t\tWHERE LOWER(admin_login) = '" . $db->escape(strtolower($new_login)) . "'";
            if (!($result = $db->query($sql))) {
                trigger_error('Impossible de tester le login', ERROR);
            }
            if ($result->column('login_test') > 0) {
                $error = TRUE;
                $msg_error[] = $lang['Message']['Double_login'];
            }
        }
        if (Mailer::validate_email($new_email) == false) {
            $error = TRUE;
            $msg_error[] = $lang['Message']['Invalid_email'];