Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ruzalo
/
airline-booking
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b07feecf
authored
May 07, 2020
by
Ryo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated php_files folder
parent
fa279161
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
144 deletions
php_files/admin_delete_record_database.php
php_files/booking_page_database.php
php_files/contact_database.php
php_files/loginform2_database.php
php_files/payment1_database.php
php_files/registration_database.php
php_files/user_flight_search_database.php
php_files/user_login_database.php
php_files/admin_delete_record_database.php
View file @
b07feecf
...
@@ -28,37 +28,12 @@ while($row2 = mysqli_fetch_array( $data2 )) {
...
@@ -28,37 +28,12 @@ while($row2 = mysqli_fetch_array( $data2 )) {
echo
$Flight_Id
;
echo
$Flight_Id
;
}
}
//And display the results
// while($row = mysqli_fetch_array( $data )) {
// echo "$row[0]". " ";
// echo "<br>";
//
// }
//This counts the number or results. If there aren't any, it gives the user a "no match" message
//This counts the number or results. If there aren't any, it gives the user a "no match" message
$anymatches
=
mysqli_num_rows
(
$data
);
$anymatches
=
mysqli_num_rows
(
$data
);
if
(
$anymatches
==
0
)
{
if
(
$anymatches
==
0
)
{
echo
"Sorry, but we can not find an entry to match your query<br><br>"
;
echo
"Sorry, but we can not find an entry to match your query<br><br>"
;
}
}
//And reminds the user what they searched for
// echo "<b>Searched For:</b> " . "$find";
// }
//break;
//
// if (isset($_GET['Passenger_Id#
// '])) {
//
// $Passenger_Id = $_GET['Passenger_Id'];
// echo $Passenger_Id;
// }
echo
"Your input:::::::::<br>"
;
echo
""
.
$First_Name
.
"<br>"
;
echo
""
.
$Last_Name
.
"<br>"
;
echo
""
.
$Flight_Number
.
"<br>"
;
$data4
=
mysqli_query
(
$con
,
"DELETE FROM Ticket_Info WHERE Profile_Id = '
$Profile_Id
' AND Flight_Id = '
$Flight_Id
'"
);
$data4
=
mysqli_query
(
$con
,
"DELETE FROM Ticket_Info WHERE Profile_Id = '
$Profile_Id
' AND Flight_Id = '
$Flight_Id
'"
);
if
(
mysqli_query
(
$con
,
$data4
))
{
if
(
mysqli_query
(
$con
,
$data4
))
{
echo
"Record deleted successfully"
;
echo
"Record deleted successfully"
;
...
@@ -76,15 +51,5 @@ else {
...
@@ -76,15 +51,5 @@ else {
echo
"Error deleting record: "
.
mysqli_error
(
$con
);
echo
"Error deleting record: "
.
mysqli_error
(
$con
);
}
}
// mysqli_query($con, "DELETE FROM Ticket_Info WHERE Passenger_fk = $row[0]");
// printf("Affected rows (DELETE): %d\n", mysqli_affected_rows($con));
// if (mysqli_query($con, $data)) {
// echo "Record deleted successfully";
// } else {
// echo "Error deleting record: " . mysqli_error($con);
// }
mysqli_close
(
$con
);
mysqli_close
(
$con
);
?>
?>
php_files/booking_page_database.php
View file @
b07feecf
...
@@ -24,12 +24,7 @@ if (isset($_POST['flight_search'])){
...
@@ -24,12 +24,7 @@ if (isset($_POST['flight_search'])){
$date_back
=
(
$_POST
[
"trip_back"
]);
$date_back
=
(
$_POST
[
"trip_back"
]);
}
}
//echo "$departure";
//echo "$arrival";
//Now we search for our search term, in the field the user specified
//Now we search for our search term, in the field the user specified
//if Morning_AfterNoon_Night = Morning
//$data = mysqli_query($con, "SELECT * FROM FlightData WHERE departure = '$departure' AND arrival = '$arrival'");
$int
=
0
;
$int
=
0
;
foreach
(
$_POST
[
'check_list'
]
as
$select
){
foreach
(
$_POST
[
'check_list'
]
as
$select
){
if
(
$int
>
0
){
if
(
$int
>
0
){
...
@@ -41,7 +36,6 @@ if (isset($_POST['flight_search'])){
...
@@ -41,7 +36,6 @@ if (isset($_POST['flight_search'])){
$int
=
$int
+
1
;
$int
=
$int
+
1
;
}
}
//$a = $a . ")";
if
(
isset
(
$_POST
[
'radio'
])){
if
(
isset
(
$_POST
[
'radio'
])){
echo
"You have selected :"
.
$_POST
[
'radio'
];
echo
"You have selected :"
.
$_POST
[
'radio'
];
...
@@ -53,8 +47,6 @@ if (isset($_POST['flight_search'])){
...
@@ -53,8 +47,6 @@ if (isset($_POST['flight_search'])){
$order
=
" ORDER BY Price"
;
$order
=
" ORDER BY Price"
;
}
}
//echo "SELECT * FROM FlightData WHERE departure = '$departure' AND arrival = '$arrival' " . "$a";
//$data = mysqli_query($con, "SELECT * FROM FlightData WHERE departure = '$departure' AND arrival = '$arrival'");
$data
=
mysqli_query
(
$con
,
"SELECT * FROM FlightData WHERE departure = '
$departure
' AND arrival = '
$arrival
' "
.
"
$filter
"
.
"
$order
"
);
$data
=
mysqli_query
(
$con
,
"SELECT * FROM FlightData WHERE departure = '
$departure
' AND arrival = '
$arrival
' "
.
"
$filter
"
.
"
$order
"
);
//And display the results
//And display the results
...
...
php_files/contact_database.php
View file @
b07feecf
...
@@ -20,11 +20,4 @@ VALUES ('$Contact_Name', '$Email', '$Subject', '$Message')");
...
@@ -20,11 +20,4 @@ VALUES ('$Contact_Name', '$Email', '$Subject', '$Message')");
mysqli_close
(
$con
);
mysqli_close
(
$con
);
echo
"Your input:::::::::<br>"
;
echo
""
.
$Contact_Name
.
"<br>"
;
echo
""
.
$Email
.
"<br>"
;
echo
""
.
$Subject
.
"<br>"
;
echo
""
.
$Message
.
"<br>"
;
?>
?>
php_files/loginform2_database.php
View file @
b07feecf
<?php
<?php
// $con = mysqli_connect(localhost,root, root, Airline_Booking, 8889);
//
// // Check connection
// if (mysqli_connect_errno()){
// echo "Failed to connect to MySQL: " . mysqli_connect_error();
// }
//
// if ($_SERVER["REQUEST_METHOD"] == "POST") {
// $username = ($_POST["username"]);
// $password = ($_POST["password"]);
// }
//
// $data = mysqli_query($con, "SELECT MemberID FROM User_register WHERE username = '$username' AND password = '$password' ");
// MemberID = $row[0]
// if (isset($_GET['MemberID'])) {
// $MemberID = $_GET['MemberID'];
// echo $MemberID;
// }
// session_start();
// if (isset($_GET['MemberID'])) {
// $MemberID = $_GET['MemberID'];
// $_SESSION['MemberID'] = $MemberID;
// }
session_start
();
session_start
();
if
(
isset
(
$_POST
[
'username'
]))
{
if
(
isset
(
$_POST
[
'username'
]))
{
...
...
php_files/payment1_database.php
View file @
b07feecf
...
@@ -28,16 +28,6 @@ mysqli_close($con1);
...
@@ -28,16 +28,6 @@ mysqli_close($con1);
<?php
<?php
#echo "Insert new user";
#echo "Insert new user";
// connect to the database
// connect to the database
// mysql_connect('localhost', 'root', 'root') or die(mysql_error());
// mysql_select_db("Airline_Booking") or die(mysql_error());
//
// $data1 = mysql_query("INSERT INTO Passenger_Profile (First_Name, Last_Name, Email_Address, Card_Type, Card_Number, Security_Code, Expiration_Month_Year,
// Passport_Number, Phone_Number, Home_Address)
// VALUES ('$First_Name', '$Last_Name', '$Email_Address', '$Card_Type', '$Card_Number', '$Security_Code','$Expiration_Month_Year', '$Passport_Number', '$Phone_Number', '$Home_Address')");
// $data2 = mysql_query("INSERT INTO Payment_Details (First_Name, Last_Name, Card_Type, Card_Number, Security_Code, Expiration_Month_Year)
// VALUES ('$First_Name', '$Last_Name', '$Card_Type', '$Card_Number', '$Security_Code','$Expiration_Month_Year')");
//mysql_query($sql1, $con);
$con
=
mysqli_connect
(
"anysql.itcollege.ee"
,
"WT16"
,
"iLtQlUerkT"
,
"WT16"
);
$con
=
mysqli_connect
(
"anysql.itcollege.ee"
,
"WT16"
,
"iLtQlUerkT"
,
"WT16"
);
...
@@ -46,22 +36,12 @@ if (mysqli_connect_errno()) {
...
@@ -46,22 +36,12 @@ if (mysqli_connect_errno()) {
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
}
}
// $Departure = strtoupper($_POST['Departure']);
// $Arrival = strtoupper($_POST['Arrival']);
// $data = mysqli_query($con, "INSERT INTO Passenger_Profile (First_Name, Last_Name, Email_Address, Card_Type, Card_Number, Security_Code, Expiration_Month_Year, Passport_Number, Phone_Number, Home_Address) VALUES ('$First_Name', '$Last_Name', '$Email_Address', '$Card_Type', '$Card_Number', '$Security_Code', '$Expiration_Month_Year', '$Passport_Number', '$Phone_Number', '$Home_Address')");
//Returning the id that was inserted
//Returning the id that was inserted
// $last_id = mysqli_insert_id($con);
// $data_2 = mysqli_query($con, "INSERT INTO Ticket_Info (Profile_Id, Flight_Id, First_Name, Last_Name)
// VALUES ('$last_id', '$Flight_Id', '$First_Name', '$Last_Name', '$Email_Address')");
$data1
=
mysqli_query
(
$con
,
"INSERT INTO Passenger_Profile (First_Name, Last_Name, Email_Address, Card_Type,
$data1
=
mysqli_query
(
$con
,
"INSERT INTO Passenger_Profile (First_Name, Last_Name, Email_Address, Card_Type,
Card_Number, Security_Code, Expiration_Month_Year, Passport_Number, Phone_Number, Home_Address)
Card_Number, Security_Code, Expiration_Month_Year, Passport_Number, Phone_Number, Home_Address)
VALUES ('
$First_Name
', '
$Last_Name
', '
$Email_Address
', '
$Card_Type
', '
$Card_Number
', '
$Security_Code
',
VALUES ('
$First_Name
', '
$Last_Name
', '
$Email_Address
', '
$Card_Type
', '
$Card_Number
', '
$Security_Code
',
'
$Expiration_Month_Year
', '
$Passport_Number
', '
$Phone_Number
', '
$Home_Address
')"
);
'
$Expiration_Month_Year
', '
$Passport_Number
', '
$Phone_Number
', '
$Home_Address
')"
);
// $data3 = mysqli_query($con, "INSERT INTO Ticket_Info (Flight_Number, Date_Going, Date_Back)
// VALUES ('$Flight_Number', '$Date_Going', '$Date_Back')");
//Returning the id that was inserted
//Returning the id that was inserted
$last_id
=
mysqli_insert_id
(
$con
);
$last_id
=
mysqli_insert_id
(
$con
);
...
@@ -71,17 +51,4 @@ echo $last_id;
...
@@ -71,17 +51,4 @@ echo $last_id;
mysqli_close
(
$con
);
mysqli_close
(
$con
);
echo
"Your input:::::::::<br>"
;
echo
""
.
$First_Name
.
"<br>"
;
echo
""
.
$Last_Name
.
"<br>"
;
echo
""
.
$Email_Address
.
"<br>"
;
echo
""
.
$Card_Type
.
"<br>"
;
echo
""
.
$Card_Number
.
"<br>"
;
echo
""
.
$Security_Code
.
"<br>"
;
echo
"::::"
.
$Expiration_Month_Year
.
"<br>"
;
echo
""
.
$Passport_Number
.
"<br>"
;
echo
""
.
$Phone_Number
.
"<br>"
;
echo
""
.
$Home_Address
.
"<br>"
;
echo
""
.
$last_id
.
"<br>"
;
?>
?>
php_files/registration_database.php
View file @
b07feecf
...
@@ -15,9 +15,4 @@ VALUES ('$First_Name', '$Last_Name', '$username', '$Password')");
...
@@ -15,9 +15,4 @@ VALUES ('$First_Name', '$Last_Name', '$username', '$Password')");
//mysql_query($sql1, $con);
//mysql_query($sql1, $con);
mysqli_close
(
$con
);
mysqli_close
(
$con
);
echo
"Your input:::::::::<br>"
;
echo
""
.
$First_Name
.
"<br>"
;
echo
""
.
$Last_Name
.
"<br>"
;
echo
""
.
$username
.
"<br>"
;
echo
""
.
$Password
.
"<br>"
;
?>
?>
php_files/user_flight_search_database.php
View file @
b07feecf
...
@@ -17,7 +17,6 @@ $data = mysqli_query($con, "SELECT * FROM Passenger_Profile WHERE First_Name = '
...
@@ -17,7 +17,6 @@ $data = mysqli_query($con, "SELECT * FROM Passenger_Profile WHERE First_Name = '
$record
=
array
();
$record
=
array
();
//And display the results
//And display the results
while
(
$row
=
mysqli_fetch_array
(
$data
))
{
while
(
$row
=
mysqli_fetch_array
(
$data
))
{
//echo "$row[1]". " " ."$row[2]". " " . "$row[3]". " " . "$row[4]". " ";
$record
[]
=
$row
;
$record
[]
=
$row
;
foreach
(
$record
as
$rec
)
{
foreach
(
$record
as
$rec
)
{
...
@@ -50,31 +49,6 @@ while ($row = mysqli_fetch_array( $data )) {
...
@@ -50,31 +49,6 @@ while ($row = mysqli_fetch_array( $data )) {
}
}
//$data1 = mysqli_query($con, "SELECT * FROM Ticket_Info WHERE Profile_Id = '$ID'");
// while($row1 = mysqli_fetch_array( $data1 )) {
//echo "$row[1]". " " ."$row[2]". " " . "$row[3]". " " . "$row[4]". " ";
// $ID1 = $row1[2];
// $data2 = mysqli_query($con, "SELECT * FROM FlightData WHERE Flight_Id = '$ID1'");
// if($row2 = mysqli_fetch_array( $data2 )) {
//echo "$row[1]". " " ."$row[2]". " " . "$row[3]". " " . "$row[4]". " ";
//$data1 = mysqli_query($con, "SELECT * FROM Ticket_Info WHERE Profile_Id = '$ID'");
// while($row1 = mysqli_fetch_array( $data1 )) {
// //echo "$row[1]". " " ."$row[2]". " " . "$row[3]". " " . "$row[4]". " ";
// $ID1 = $row1[2];
//
// $data2 = mysqli_query($con, "SELECT * FROM FlightData WHERE Flight_Id = '$ID1'");
// if($row2 = mysqli_fetch_array( $data2 )) {
// echo "$row[1]". " " ."$row[2]". " " . "$row[3]". " " . "$row[4]". " ";
// }
//This counts the number or results. If there aren't any, it gives the user a "no match" message
//This counts the number or results. If there aren't any, it gives the user a "no match" message
$anymatches
=
mysqli_num_rows
(
$data
);
$anymatches
=
mysqli_num_rows
(
$data
);
if
(
$anymatches
==
0
)
{
if
(
$anymatches
==
0
)
{
...
...
php_files/user_login_database.php
View file @
b07feecf
...
@@ -15,10 +15,4 @@ VALUES ('$First_Name', '$Last_Name', '$username', '$Password')");
...
@@ -15,10 +15,4 @@ VALUES ('$First_Name', '$Last_Name', '$username', '$Password')");
//mysql_query($sql1, $con);
//mysql_query($sql1, $con);
mysqli_close
(
$con
);
mysqli_close
(
$con
);
echo
"Your input:::::::::<br>"
;
echo
""
.
$First_Name
.
"<br>"
;
echo
""
.
$Last_Name
.
"<br>"
;
echo
""
.
$username
.
"<br>"
;
echo
""
.
$Password
.
"<br>"
;
?>
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment