Esempio n. 1
0
        $distance = new distance();
        $distance_utilisateur = $distance->distance_lineaire($id_evenement, $id_internaute, $dbh);
        //Tableau des variables pour la requête SQL.
        $array_variables = [":id_relation" => NULL, ":id_evenement" => $id_evenement, ":id_participant" => $id_internaute, ":distance" => $distance_utilisateur, ":commentaires" => " "];
        //Création de la requête SQL.
        $sql_inscription_prepare = "INSERT INTO `" . PREFIXE . "relations`(`id_relation`, `id_evenement`, `id_participant`,`distance`, `commentaire`) " . "VALUES (:id_relation,:id_evenement,:id_participant,:distance,:commentaires)";
        //Exécution de la requête.
        $resultat_inscription = $dbh->prepare($sql_inscription_prepare);
        try {
            $resultat_inscription->execute($array_variables);
            //Suppression de la variable qui permet l'inscription
            unset($_SESSION['inscription']);
            //Envoi de l'alerte par email.
            if ($envoi_alerte == 1) {
                $tableau_email = ["expediteur" => "Wigowiz - AddicTerra <*****@*****.**>", "destinataire" => $email_alerte, "sujet" => $LANG_mail_alerte, "message" => $LANG_mail_alerte_contenu];
                $email = new email();
                $email->send_email($tableau_email);
            }
            //Redirection vers la page permettant d'afficher la carte une fois inscrit.
            header("location:./index.php?a=carte&include=default&m=" . $_SESSION['evenement']['code']);
            //echo "inscrit";
        } catch (Exception $ex) {
            echo "échec <br />";
            echo $ex;
        }
    } else {
        header("location:./index.php?a=carte&include=default&m=" . $_SESSION['evenement']['code']);
    }
} else {
    header("location:./index.php?a=carte&include=default&m=" . $_SESSION['evenement']['code']);
}
Esempio n. 2
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
include "classes/users.class.php";
include "classes/airport.class.php";
if (isset($_POST['go'])) {
    $message = " <div   style=background-image:url(images/ticket.jpg); width:959px;height:500px;><strong>Print ticket<strong>\n\t   <img input type=image src=images/print.png height=40px width=40px onClick=window.print()/>\n\t<form id=CheckOutForm action=survey.php method=post >\n\t<div style=margin-left:400px;>\n\t<tr><br/><br/><br/><br/>\n\t<strong><td>First Name</td></strong>\n\t<?\techo {$_POST['First_N']}\t?>\n\t</br>\n\t\n\t<strong><td>Last Name</td></strong>\n\t<?\techo {$_POST['Last_N']}\t?>\n\t</br>\n\t\n\t<strong><td>Email</td></strong>\n\t<?\techo {$_POST['email']}\t?>\n\t</br>\n\t\n\t<strong><td>Your Flight ID: </td></strong>\n\t<?\techo {$this_id}\t?>\n\t</br>\n\t\n\t<!-- ONLY DOES FOR 1 SEAT SELECTED -->\n\t<strong><td>Your Seat(s) ID: </td></strong>\n\t<?\techo {$_SESSION['seat_id']};\t?>\n\t</br>\n\t\n\t<strong><td>From: </td></strong>\n\t<? echo {$a}\t?>\n\t</br>\n\t\n\t<strong><td>TO: </td></strong>\n\t<? echo {$b}\t?>\n\t</br>\n\t\n\t<strong><td>Departure Time: </td></strong>\n\t<? echo {$d_date}\t?>\n\t</br>\n\t\n\t<strong><td>Arrival Time: </td></strong>\n\t<? echo {$a_date}\t?>\n\t</br>\n\t\n\t<button><input type=submit id =Sumbit class=button1 value=Take quick survey><button>\n\t\n\t</div>";
    $email = new email($_POST['email'], $message, "Password Recovery (GA)");
    $email->send_email();
}
$users = new users();
$num = trim($_SESSION['leave_ids']);
$id_array = explode("_", $num);
$this_id = $id_array[0];
$seat = $_SESSION['seat_id'];
$flight = $users->get_specific_flight($this_id);
$d_time = $flight[0]['e_depart_time'];
$a_time = $flight[0]['e_arrival_time'];
//echo $this_id;
$a = Airport::get_name_by_id($flight[0]['org_id'], $users);
$b = Airport::get_name_by_id($flight[0]['dest_id'], $users);
$d_date = date('M j, Y - g:ia', $d_time);
$a_date = date('M j, Y - g:ia', $a_time);
//$d_date = $_SESSION['d_time'];
//$a_date = $_SESSION['a_time'];
$record = array();
//$record['seat_id'] = $seat;
if (isset($_SESSION['leave_ids'])) {
    if (isset($_SESSION['loggedIn'])) {