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
a702f4a6
authored
May 07, 2020
by
Ryo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update payment1.php
parent
90408065
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
328 deletions
payment1.php
payment1.php
View file @
a702f4a6
...
...
@@ -8,250 +8,8 @@ include('session.php');
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<title>
Payment
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css2.css"
>
<style>
/* * {
box-sizing: border-box;
}
.header {
border: 1px solid green;
padding: 15px;
}
.row::after {
content: "";
clear: both;
display: table;
}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/payment1_style.css"
>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
[class*="col-"] {
float: left;
padding: 15px;
border: 3px solid blue;
}
/* This is allocating layout spaces for how the website is going to be allocated the spaces for different contencts. */
/* .col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,600,400italic);
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
body {
font-family: "Roboto", Helvetica, Arial, sans-serif;
font-weight: 100;
font-size: 15px;
line-height: 30px;
color: #777;
background: #ffffff;
}
.container {
max-width: 400px;
width: 100%;
margin: 0 auto;
position: relative;
} */
*/
#contact
input
[
type
=
"first_name"
],
#contact
input
[
type
=
"last_name"
],
#contact
input
[
type
=
"card_type"
],
#contact
input
[
type
=
"card_number"
],
#contact
input
[
type
=
"security_code"
],
#contact
input
[
type
=
"date"
],
#contact
input
[
type
=
"passport"
],
#contact
input
[
type
=
"phone_number"
],
#contact
input
[
type
=
"email"
],
#contact
textarea
,
#contact
button
[
type
=
"submit"
]
{
font
:
400
12px
/
16px
"Roboto"
,
Helvetica
,
Arial
,
sans-serif
;
}
#contact
{
background
:
#F9F9F9
;
padding
:
25px
;
margin
:
15px
0
;
box-shadow
:
0
0
20px
0
rgba
(
0
,
0
,
0
,
0.2
),
0
5px
5px
0
rgba
(
0
,
0
,
0
,
0.24
);
}
#contact
h3
{
display
:
block
;
font-size
:
30px
;
font-weight
:
300
;
margin-bottom
:
10px
;
}
#contact
h4
{
margin
:
5px
0
15px
;
display
:
block
;
font-size
:
13px
;
font-weight
:
400
;
}
fieldset
{
border
:
medium
none
!important
;
margin
:
0
0
10px
;
min-width
:
100%
;
padding
:
0
;
width
:
100%
;
}
#contact
input
[
type
=
"first_name"
],
#contact
input
[
type
=
"last_name"
],
#contact
input
[
type
=
"card_type"
],
#contact
input
[
type
=
"card_number"
],
#contact
input
[
type
=
"security_code"
],
#contact
input
[
type
=
"date"
],
#contact
input
[
type
=
"passport"
],
#contact
input
[
type
=
"phone_number"
],
#contact
input
[
type
=
"email"
],
#contact
textarea
{
width
:
100%
;
border
:
1px
solid
#ccc
;
background
:
#FFF
;
margin
:
0
0
5px
;
padding
:
10px
;
}
#contact
input
[
type
=
"first_name"
]
:hover
,
#contact
input
[
type
=
"last_name"
]
:hover
,
#contact
input
[
type
=
"card_type"
]
:hover
,
#contact
input
[
type
=
"card_number"
]
:hover
,
#contact
input
[
type
=
"security_code"
]
:hover
,
#contact
input
[
type
=
"date"
]
:hover
,
#contact
input
[
type
=
"passport"
]
:hover
,
#contact
input
[
type
=
"phone_number"
]
:hover
,
#contact
input
[
type
=
"eamil"
]
:hover
,
#contact
textarea
:hover
{
-webkit-transition
:
border-color
0.3s
ease-in-out
;
-moz-transition
:
border-color
0.3s
ease-in-out
;
transition
:
border-color
0.3s
ease-in-out
;
border
:
1px
solid
#aaa
;
}
#contact
textarea
{
height
:
100px
;
max-width
:
100%
;
resize
:
none
;
}
#contact
button
[
type
=
"submit"
]
{
cursor
:
pointer
;
width
:
100%
;
border
:
none
;
background
:
#4CAF50
;
color
:
#FFF
;
margin
:
0
0
5px
;
padding
:
10px
;
font-size
:
20px
;
}
#contact
button
[
type
=
"submit"
]
:hover
{
background
:
#43A047
;
-webkit-transition
:
background
0.3s
ease-in-out
;
-moz-transition
:
background
0.3s
ease-in-out
;
transition
:
background-color
0.3s
ease-in-out
;
}
#contact
button
[
type
=
"submit"
]
:active
{
box-shadow
:
inset
0
1px
3px
rgba
(
0
,
0
,
0
,
0.5
);
}
#contact
input
:focus
,
#contact
textarea
:focus
{
outline
:
0
;
border
:
1px
solid
#aaa
;
}
::-webkit-input-placeholder
{
color
:
#888
;
}
:-moz-placeholder
{
color
:
#888
;
}
::-moz-placeholder
{
color
:
#888
;
}
:-ms-input-placeholder
{
color
:
#888
;
}
</style>
</head>
<body>
...
...
@@ -361,92 +119,8 @@ include('session.php');
<br>
<p>
Please confirm your order. If you would like to cancel the order please click on the "Logout" button on the top right hand corner.
</p>
<?php
// Otherwise we connect to the database
$con1
=
mysqli_connect
(
"anysql.itcollege.ee"
,
"WT16"
,
"iLtQlUerkT"
,
"WT16"
);
// Check connection
if
(
mysqli_connect_errno
()){
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
}
$flight_data
=
mysqli_query
(
$con1
,
"SELECT * FROM FlightData WHERE Flight_Id = '
$Flight_Id
' "
);
//And display the results
while
(
$row
=
mysqli_fetch_array
(
$flight_data
))
{
echo
"
$row[1]
"
.
" | "
.
"
$row[2]
"
.
" | "
.
"
$row[3]
"
.
" | "
.
"
$row[4]
"
.
" | "
.
"
$row[5]
"
.
" | "
.
"
$row[6]
"
.
" | "
.
"
$row[7]
"
.
" | "
.
"
$row[8]
"
.
" | "
.
"
$row[9]
"
.
" "
;
echo
"<br>"
;
}
$anymatches
=
mysqli_num_rows
(
$flight_data
);
if
(
$anymatches
==
0
){
echo
"Sorry, but we can not find an entry to match your query<br><br>"
;
}
mysqli_close
(
$con1
);
include
(
'php_files/payment1_database.php'
);
?>
<br>
<input
type=
"submit"
name=
"submit"
value=
"Submit"
/>
</form>
<?php
#echo "Insert new user";
// 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"
);
// Check connection
if
(
mysqli_connect_errno
())
{
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
// $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,
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
')"
);
// $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
$last_id
=
mysqli_insert_id
(
$con
);
$data2
=
mysqli_query
(
$con
,
"INSERT INTO Ticket_Info (Profile_Id, Flight_Id, First_Name, Last_Name)
VALUES ('
$last_id
', '
$Flight_Id
', '
$First_Name
', '
$Last_Name
')"
);
echo
$last_id
;
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>"
;
?>
</fieldset>
</div>
...
...
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