Commit 70661721 by Ryo

Updated user_flight_search.php and user_login.php

parent 35e77e94
Showing with 13 additions and 447 deletions
......@@ -9,336 +9,7 @@ include('session_for_user_login.php');
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Query Search Up Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css);
* {
box-sizing: border-box;
}
.header {
border: 1px solid #DE584F;
padding: 15px;
}
.social a {
text-align: center;
width: 52px;
height: 52px;
float: left;
background: #fff;
border: 1px solid #ccc;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 0 50px rgba(0, 0, 0, 0.1);
border-radius: 24px;
margin: 0 10px 10px 0;
padding: 6px;
color: #000;
}
.twitter a:hover {
background: #00acee;
color: #fff;
}
.instagram a:hover {
background: #3f729b;
color: #fff;
}
.facebook a:hover {
background: #3b5998;
color: #fff;
}
.header {
border: 1px solid #DE584F;
padding: 15px;
}
.row::after {
content: "";
clear: both;
display: table;
}
/* Paralax animation*/
.parallax {
height: 100vh;
background-image: url(../Web-App/logo4-01.svg);
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center center;
}
.row::after {
content: "";
clear: both;
display: table;
}
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;
}
/* 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: 0;
}
.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: 100%;
text-align: center;
}
.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: #DE584F;
}
@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: 20px;
line-height: 40px;
color: #777;
height: 200vh;
background-image: linear-gradient(to top, gray, white 40%);
}
.container {
max-width: 600px;
margin: 0 auto;
position: relative;
}
#search input[type="firstName"],
#search input[type="lastName"],
#search input[type="email"],
#search button[type="submit"] {
font: 400 12px/16px "Roboto", Helvetica, Arial, sans-serif;
}
#search {
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);
}
#search h3 {
display: block;
font-size: 30px;
font-weight: 300;
margin-bottom: 10px;
}
#search 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%;
}
#search input[type="firstName"],
#search input[type="lastName"],
#search input[type="email"] {
width: 100%;
border: 1px solid #ccc;
background: #FFF;
margin: 0 0 5px;
padding: 10px;
}
#search input[type="firstName"]:hover,
#search input[type="lastName"]:hover,
#search input[type="email"] {
-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;
}
#search button[type="submit"] {
cursor: pointer;
width: 100%;
border: none;
background: #4CAF50;
color: #FFF;
margin: 0 0 5px;
padding: 10px;
font-size: 20px;
}
#search 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;
}
#search button[type="submit"]:active {
box-shadow: inset 0 1px rgba(0, 0, 0, 0.5);
}
#search input:focus,
#search 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;
}
[class*="button7"] {
background-color: #DE584F;
}
.button7 {
font-weight: 700;
color: white;
text-decoration: none;
padding: .8em 2em calc(.8em + 3px);
border-radius: 3px;
background: #DE584F(64, 199, 129);
box-shadow: 0 -3px #DE584F(53, 167, 110) inset;
transition: 0.2s;
}
.button7:hover {
background: #DE584F(206, 211, 208);
}
.button7:active {
background: rgb(33, 147, 90);
box-shadow: 0 3px rgb(33, 147, 90) inset;
}
</style>
<link rel="stylesheet" type="text/css" href="css/user_flight_search_style.css">
</head>
<body>
......@@ -357,7 +28,6 @@ include('session_for_user_login.php');
}
?>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="countrypage.html">Countries</a></li>
......@@ -385,90 +55,7 @@ include('session_for_user_login.php');
<input type="submit" name="submit" class="button7" value="Search" />
</form>
<?php
$con = mysqli_connect("anysql.itcollege.ee", "WT16", "iLtQlUerkT", "WT16");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$firstName = ($_POST["firstName"]);
$lastName = ($_POST["lastName"]);
$email = ($_POST["email"]);
}
$data = mysqli_query($con, "SELECT * FROM Passenger_Profile WHERE First_Name = '$firstName' AND Last_Name = '$lastName' AND Email_Address = '$email' ");
$record = array();
//And display the results
while ($row = mysqli_fetch_array( $data )) {
//echo "$row[1]". " " ."$row[2]". " " . "$row[3]". " " . "$row[4]". " ";
$record[] = $row;
foreach ($record as $rec) {
//echo $rec['Profile_Id'];
$data1 = mysqli_query($con, "SELECT * FROM Ticket_Info WHERE Profile_Id = '$rec[Profile_Id]'");
$record1 = array();
while ($row1 = mysqli_fetch_array( $data1 )) {
//echo $row1[Flight_Id];
$record1[] = $row1;
foreach ($record1 as $rec1) {
//echo $rec[Flight_Id]."<br>";
$data2 = mysqli_query($con, "SELECT * FROM FlightData WHERE Flight_Id = '$rec1[Flight_Id]'");
$record2 = array();
while ($row2 = mysqli_fetch_array( $data2 )) {
$record2[] = $row2;
foreach ($record2 as $rec2) {
//echo $rec2[Airline];
echo $rec2['Airline'] . " | " . $rec2['Flight_Number'] . " | " . $rec2['Departure'] . " | " . $rec2['Arrival'] . " | " . $rec2['Departure_Time'] . " | " . $rec2['Arrival_Time'];
echo "<br>";
}
}
}
}
}
}
//$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
$anymatches=mysqli_num_rows($data);
if ($anymatches == 0) {
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";
include('php_files/user_flight_search_database.php')
?>
</fieldset>
</div>
......
......@@ -55,43 +55,22 @@ if(isset($_SESSION['login_user'])){
<a href="#" class="social"><i class="fab fa-twitter fa-2x"></i></a>
<a href="#" class="social"><i class="fab fa-instagram fa-2x"></i></a>
</div>
<input id="FirstName" placeholder="First Name" type="first_name" name="First_Name" tabindex="1" required autofocus/>
<input id="LastName" placeholder="Last Name" type="last_name" name="Last_Name" tabindex="2" required/>
<input id="username" placeholder="username Address" type="username" name="username" tabindex="2" required/>
<input id="password" placeholder="Password" type="password" name="Password" tabindex="2" required/>
<input type="submit" name="submit" value="Register"/>
</form>
<?php
#echo "Insert new user";
// connect to the database
// Establishing Connection with Server by passing server_name, user_id and password as a parameter
$con = mysqli_connect("anysql.itcollege.ee", "WT16", "iLtQlUerkT", "WT16");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$data = mysqli_query($con, "INSERT INTO User_register (First_Name, Last_Name, username, Password)
VALUES ('$First_Name', '$Last_Name', '$username', '$Password')");
//mysql_query($sql1, $con);
mysqli_close($con);
echo "Your input:::::::::<br>";
echo "".$First_Name. "<br>";
echo "".$Last_Name. "<br>";
echo "".$username. "<br>";
echo "".$Password. "<br>";
include('php_files/userlogin_database.php')
?>
</div>
......@@ -104,10 +83,10 @@ if(isset($_SESSION['login_user'])){
<a href="#" class="social"><i class="fab fa-twitter fa-2x"></i></a>
<a href="#" class="social"><i class="fab fa-instagram fa-2x"></i></a>
</div>
<input id="username" name="username" placeholder="Username" type="email">
<input id="password" name="password" placeholder="Password" type="password">
<input name="submit" type="submit" class="button7" value=" Login ">
<span><?php echo $error; ?></span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment