Skip to content
Permalink
219cf06276
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
121 lines (120 sloc) 3.05 KB
<?php
session_start();
?>
<html>
<head>
<title>
View Aircraft Scheduled for Maintenance
</title>
<style>
input {
border: 1.5px solid #030337;
border-radius: 4px;
padding: 7px 30px;
}
input[type=submit] {
background-color: #030337;
color: white;
border-radius: 4px;
padding: 7px 45px;
margin: 0px 390px
}
table {
border-collapse: collapse;
}
tr/*:nth-child(3)*/ {
border: solid thin;
}
</style>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link rel="stylesheet" href="font-awesome-4.7.0\css\font-awesome.min.css">
</head>
<body>
<img class="logo" src="images/shutterstock_22.jpg"/>
<h1 id="title">
ABC AIRLINES
</h1>
<div>
<ul>
<li><a href="admin_homepage.php"><i class="fa fa-home" aria-hidden="true"></i> Home</a></li>
<li><a href="admin_homepage.php"><i class="fa fa-desktop" aria-hidden="true"></i> Dashboard</a></li>
<li><a href="logout_handler.php"><i class="fa fa-sign-out" aria-hidden="true"></i> Logout</a></li>
</ul>
</div>
<h2>LIST OF Aircraft Scheduled for Maintenance</h2>
<?php
if(isset($_POST['Submit']))
{
$data_missing=array();
if(empty($_POST['Aircraft_no']))
{
$data_missing[]='Aircraft_no';
}
else
{
$flight_no=trim($_POST['Aircraft_no']);
}
if(empty($_POST['Scheduled_date']))
{
$data_missing[]='Scheduled_date';
}
else
{
$Scheduled_date=$_POST['Scheduled_date'];
}
if(empty($data_missing))
{
require_once('Database Connection file/mysqli_connect.php');
$query="SELECT pnr,date_of_reservation,class,no_of_passengers,payment_id,customer_id FROM Ticket_Details where flight_no=? and journey_date=? and booking_status='CONFIRMED' ORDER BY class";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",$flight_no,$departure_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$pnr,$date_of_reservation,$class,$no_of_passengers,$payment_id,$customer_id);
mysqli_stmt_store_result($stmt);
if(mysqli_stmt_num_rows($stmt)==0)
{
echo "<h3>No booked aircraft information is available!</h3>";
}
else
{
echo "<table cellpadding=\"10\"";
echo "<tr><th>PNR</th>
<th>Date of Reservation</th>
<th>Class</th>
</tr>";
while(mysqli_stmt_fetch($stmt)) {
echo "<tr>
<td>".$pnr."</td>
<td>".$date_of_reservation."</td>
<td>".$class."</td>
<td>".$no_of_passengers."</td>
<td>".$payment_id."</td>
<td>".$customer_id."</td>
</tr>";
}
echo "</table> <br>";
}
mysqli_stmt_close($stmt);
mysqli_close($dbc);
// else
// {
// echo "Submit Error";
// echo mysqli_error();
// }
}
else
{
echo "The following data fields were empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Submit request not received";
}
?>
</body>
</html>