<?php
+/**
+ * [is_post_request description]
+ * @return boolean [description]
+ */
function is_post_request()
{
if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') {
}
}
+/**
+ * [is_get_request description]
+ * @return boolean [description]
+ */
function is_get_request()
{
if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'GET') {
}
}
+/**
+ * [chk_account description]
+ * @param [type] $email [description]
+ * @return [type] [description]
+ */
function chk_account($email)
{
global $connection;
}
}
+/**
+ * [chk_password description]
+ * @param [type] $email [description]
+ * @param [type] $password [description]
+ * @return [type] [description]
+ */
function chk_password($email, $password)
{
global $connection;
}
}
+/**
+ * [get_client_id description]
+ * @param [type] $email [description]
+ * @return [type] [description]
+ */
function get_client_id($email)
{
global $connection;
return $row[0][0];
}
-function nb_booked($client_id, $flight_id)
+/**
+ * [nb_booked description]
+ * @param [type] $client_id [description]
+ * @param [type] $flight_id [description]
+ * @return [type] [description]
+ */
+function nb_booked($client_id, $flight_id, $class_name)
{
global $connection;
- $sql_pquery = "select SUM(NbPlaces) from RESERVATIONS where NumCl = ? and NumVol = ?";
+ $sql_pquery = "select sum(NbPlaces) from RESERVATIONS where NumCl = ? and NumVol = ? and Classe = ?";
$connection->prepare_query($sql_pquery);
- $connection->prepared_query_bind_param("is", array($client_id, $flight_id));
+ $connection->prepared_query_bind_param("iss", array($client_id, $flight_id, $class_name));
$connection->run_prepared_query();
$connection->get_pquery_result();
$row = $connection->get_result_array();
return $row[0][0];
}
+/**
+ * [chk_logged_in description]
+ * @return [type] [description]
+ */
function chk_logged_in()
{
if (isset($_SESSION['email']) && isset($_SESSION['IP_address'])) {
}
}
+/**
+ * [redirect description]
+ * @param [type] $url [description]
+ * @param [type] $delay [description]
+ * @return [type] [description]
+ */
function redirect($url, $delay)
{
header("refresh:$delay; url=$url");