repositories
/
Project_webapp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Misc code cleanups and comment.
[Project_webapp.git]
/
lib
/
utils.php
diff --git
a/lib/utils.php
b/lib/utils.php
index 47c8bda2e0d0c1784fb129f09fb9709de4c99e1d..9955458cffd1c7b8420082dec60dd75c1ceb7496 100644
(file)
--- a/
lib/utils.php
+++ b/
lib/utils.php
@@
-1,5
+1,9
@@
<?php
<?php
+/**
+ * [is_post_request description]
+ * @return boolean [description]
+ */
function is_post_request()
{
if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') {
function is_post_request()
{
if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') {
@@
-9,6
+13,10
@@
function is_post_request()
}
}
}
}
+/**
+ * [is_get_request description]
+ * @return boolean [description]
+ */
function is_get_request()
{
if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'GET') {
function is_get_request()
{
if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'GET') {
@@
-18,6
+26,11
@@
function is_get_request()
}
}
}
}
+/**
+ * [chk_account description]
+ * @param [type] $email [description]
+ * @return [type] [description]
+ */
function chk_account($email)
{
global $connection;
function chk_account($email)
{
global $connection;
@@
-35,6
+48,12
@@
function chk_account($email)
}
}
}
}
+/**
+ * [chk_password description]
+ * @param [type] $email [description]
+ * @param [type] $password [description]
+ * @return [type] [description]
+ */
function chk_password($email, $password)
{
global $connection;
function chk_password($email, $password)
{
global $connection;
@@
-52,6
+71,11
@@
function chk_password($email, $password)
}
}
}
}
+/**
+ * [get_client_id description]
+ * @param [type] $email [description]
+ * @return [type] [description]
+ */
function get_client_id($email)
{
global $connection;
function get_client_id($email)
{
global $connection;
@@
-65,6
+89,12
@@
function get_client_id($email)
return $row[0][0];
}
return $row[0][0];
}
+/**
+ * [nb_booked description]
+ * @param [type] $client_id [description]
+ * @param [type] $flight_id [description]
+ * @return [type] [description]
+ */
function nb_booked($client_id, $flight_id)
{
global $connection;
function nb_booked($client_id, $flight_id)
{
global $connection;
@@
-78,6
+108,10
@@
function nb_booked($client_id, $flight_id)
return $row[0][0];
}
return $row[0][0];
}
+/**
+ * [chk_logged_in description]
+ * @return [type] [description]
+ */
function chk_logged_in()
{
if (isset($_SESSION['email']) && isset($_SESSION['IP_address'])) {
function chk_logged_in()
{
if (isset($_SESSION['email']) && isset($_SESSION['IP_address'])) {
@@
-87,6
+121,12
@@
function chk_logged_in()
}
}
}
}
+/**
+ * [redirect description]
+ * @param [type] $url [description]
+ * @param [type] $delay [description]
+ * @return [type] [description]
+ */
function redirect($url, $delay)
{
header("refresh:$delay; url=$url");
function redirect($url, $delay)
{
header("refresh:$delay; url=$url");