Commit b07feecf by Ryo

Updated php_files folder

parent fa279161
......@@ -28,37 +28,12 @@ while($row2 = mysqli_fetch_array( $data2 )) {
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
$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";
// }
//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'");
if (mysqli_query($con, $data4)) {
echo "Record deleted successfully";
......@@ -76,15 +51,5 @@ else {
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);
?>
......@@ -24,12 +24,7 @@ if (isset($_POST['flight_search'])){
$date_back = ($_POST["trip_back"]);
}
//echo "$departure";
//echo "$arrival";
//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;
foreach ($_POST['check_list'] as $select){
if ($int > 0){
......@@ -41,7 +36,6 @@ if (isset($_POST['flight_search'])){
$int = $int + 1;
}
//$a = $a . ")";
if(isset($_POST['radio'])){
echo "You have selected :".$_POST['radio'];
......@@ -53,8 +47,6 @@ if (isset($_POST['flight_search'])){
$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");
//And display the results
......
......@@ -20,11 +20,4 @@ VALUES ('$Contact_Name', '$Email', '$Subject', '$Message')");
mysqli_close($con);
echo "Your input:::::::::<br>";
echo "".$Contact_Name. "<br>";
echo "".$Email. "<br>";
echo "".$Subject. "<br>";
echo "".$Message. "<br>";
?>
<?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();
if (isset($_POST['username'])) {
......
......@@ -28,16 +28,6 @@ mysqli_close($con1);
<?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");
......@@ -46,22 +36,12 @@ 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);
......@@ -71,17 +51,4 @@ 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>";
?>
......@@ -15,9 +15,4 @@ 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>";
?>
......@@ -17,7 +17,6 @@ $data = mysqli_query($con, "SELECT * FROM Passenger_Profile WHERE First_Name = '
$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) {
......@@ -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
$anymatches=mysqli_num_rows($data);
if ($anymatches == 0) {
......
......@@ -15,10 +15,4 @@ 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>";
?>
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