diff --git a/air.jpg b/air.jpg new file mode 100644 index 0000000..9f6eba4 Binary files /dev/null and b/air.jpg differ diff --git a/authenticate.php b/authenticate.php new file mode 100644 index 0000000..a358cc1 --- /dev/null +++ b/authenticate.php @@ -0,0 +1,53 @@ +prepare('SELECT id, password FROM accounts WHERE username = ?')) { + // Bind parameters (s = string, i = int, b = blob, etc), in our case the username is a string so we use "s" + $stmt->bind_param('s', $_POST['username']); + $stmt->execute(); + // Store the result so we can check if the account exists in the database. + $stmt->store_result(); + if ($stmt->num_rows > 0) { + $stmt->bind_result($id, $password); + $stmt->fetch(); + // Account exists, now we verify the password. + // Note: remember to use password_hash in your registration file to store the hashed passwords. + if (password_verify($_POST['password'], $password)) { + // Verification success! User has logged-in! + // Create sessions, so we know the user is logged in, they basically act like cookies but remember the data on the server. + session_regenerate_id(); + $_SESSION['loggedin'] = TRUE; + $_SESSION['name'] = $_POST['username']; + $_SESSION['id'] = $id; + header('Location: home.php'); + } else { + // Incorrect password + echo 'Incorrect username and/or password!'; + } + } else { + // Incorrect username + echo 'Incorrect username and/or password!'; + } + + $stmt->close(); +} +?> + diff --git a/display.php b/display.php new file mode 100644 index 0000000..a5aad25 --- /dev/null +++ b/display.php @@ -0,0 +1,88 @@ + + + + + + + + ABC Air + + + + + + +
+

AirFrames ABC Air Services

+

This is the common dashboard where Airframes created will be displayed and can be updated if necessary

+

The Airframes created are displayed below

+
+ + + + + + + + + + + + + + + + + + + + + + + + '; + + } +} + +?> + + +
Sno.Maintenance TypeEngineer AssignedFlight HoursFlight NumberMaintenance Schedule DateOptions
'.$id.''.$name.''.$engg.''.$fhr.''.$fno.''.$date.' + + +
+
+ +
+ + +
+
+ + \ No newline at end of file diff --git a/home.php b/home.php new file mode 100644 index 0000000..334416c --- /dev/null +++ b/home.php @@ -0,0 +1,52 @@ + + + + + + + ABC + + + + + + +
+

Home Page

+
+
+
+ +
+ +
+

Welcome to ABC Air Official Website!

ABC Air is a small aircraft service company that carry out the aircraft maintenance for the civil operators. The + company records the total number of flying hours for each aircraft, servicing time, man-hours of the engineers + and related maintenance.

+
+ +
+

List of Engineers

+

Aeronautical Engineer ; ID : 100002 +
Aerospace Engineer ; ID : 100003 +
Astronautical Engineer ; ID : 100004 +
Avionics Engineer ; ID : 100005 +
Mechanical Engineer ; ID : 100006

+
+ + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..c1d3aae --- /dev/null +++ b/index.html @@ -0,0 +1,25 @@ + + + + + Login + + + + +
+

Login

+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/insert.php b/insert.php new file mode 100644 index 0000000..f71352d --- /dev/null +++ b/insert.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..8a8639f --- /dev/null +++ b/logout.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/logs.sql b/logs.sql new file mode 100644 index 0000000..5e23ade --- /dev/null +++ b/logs.sql @@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS `logs5` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `fhr5` varchar(50) NOT NULL, + `mt5` varchar(255) NOT NULL, + `eng5` varchar(100) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +INSERT INTO `logs5` (`id`, `fhr5`, `mt5`, `eng5`) VALUES (1, '750 - 900 Hours', '07/01/2022 : 12 PM - 8 PM', 'Avionic & Aerospace Engineer'); \ No newline at end of file diff --git a/password.txt b/password.txt new file mode 100644 index 0000000..6334a12 --- /dev/null +++ b/password.txt @@ -0,0 +1,2 @@ +test +$2y$10$SfhYIDtn.iOuCW7zfoFLuuZHX6lja4lF4XA4JqNmpiH/.P3zB8JCa \ No newline at end of file diff --git a/phplogin.sql b/phplogin.sql new file mode 100644 index 0000000..50e9c0a --- /dev/null +++ b/phplogin.sql @@ -0,0 +1,260 @@ +-- phpMyAdmin SQL Dump +-- version 5.1.1 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1 +-- Generation Time: Jan 03, 2022 at 05:00 AM +-- Server version: 10.4.22-MariaDB +-- PHP Version: 8.1.1 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `phplogin` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `accounts` +-- + +CREATE TABLE `accounts` ( + `id` int(11) NOT NULL, + `username` varchar(50) NOT NULL, + `password` varchar(255) NOT NULL, + `email` varchar(100) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `accounts` +-- + +INSERT INTO `accounts` (`id`, `username`, `password`, `email`) VALUES +(1, 'test', '$2y$10$SfhYIDtn.iOuCW7zfoFLuuZHX6lja4lF4XA4JqNmpiH/.P3zB8JCa', 'test@test.com'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `logs` +-- + +CREATE TABLE `logs` ( + `id` int(11) NOT NULL, + `airframe` varchar(50) NOT NULL, + `engineer` varchar(50) NOT NULL, + `fhr` varchar(50) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- +-- Dumping data for table `logs` +-- + +INSERT INTO `logs` (`id`, `airframe`, `engineer`, `fhr`) VALUES +(1, '1', 'e1', '100'), +(2, 'Airframe 6', 'Avionic Engineer', '600 - 700'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `logs1` +-- + +CREATE TABLE `logs1` ( + `id` int(11) NOT NULL, + `fhr1` varchar(50) NOT NULL, + `mt1` varchar(255) NOT NULL, + `eng1` varchar(100) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `logs1` +-- + +INSERT INTO `logs1` (`id`, `fhr1`, `mt1`, `eng1`) VALUES +(1, '400 - 600 Hours', '05/01/2022 : 12 PM - 6 PM', 'Aeronautical Engineer'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `logs2` +-- + +CREATE TABLE `logs2` ( + `id` int(11) NOT NULL, + `fhr2` varchar(50) NOT NULL, + `mt2` varchar(255) NOT NULL, + `eng2` varchar(100) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `logs2` +-- + +INSERT INTO `logs2` (`id`, `fhr2`, `mt2`, `eng2`) VALUES +(1, '400 - 600 Hours', '06/01/2022 : 12 PM - 6 PM', 'Aeronautical Engineer'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `logs3` +-- + +CREATE TABLE `logs3` ( + `id` int(11) NOT NULL, + `fhr3` varchar(50) NOT NULL, + `mt3` varchar(255) NOT NULL, + `eng3` varchar(100) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `logs3` +-- + +INSERT INTO `logs3` (`id`, `fhr3`, `mt3`, `eng3`) VALUES +(1, '600 - 700 Hours', '06/01/2022 : 12 PM - 8 PM', 'Mechanical Engineer'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `logs4` +-- + +CREATE TABLE `logs4` ( + `id` int(11) NOT NULL, + `fhr4` varchar(50) NOT NULL, + `mt4` varchar(255) NOT NULL, + `eng4` varchar(100) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `logs4` +-- + +INSERT INTO `logs4` (`id`, `fhr4`, `mt4`, `eng4`) VALUES +(1, '700 - 800 Hours', '07/01/2022 : 12 PM - 8 PM', 'Mechanical & Aerospace Engineer'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `logs5` +-- + +CREATE TABLE `logs5` ( + `id` int(11) NOT NULL, + `fhr5` varchar(50) NOT NULL, + `mt5` varchar(255) NOT NULL, + `eng5` varchar(100) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `logs5` +-- + +INSERT INTO `logs5` (`id`, `fhr5`, `mt5`, `eng5`) VALUES +(1, '750 - 900 Hours', '07/01/2022 : 12 PM - 8 PM', 'Avionic & Aerospace Engineer'); + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `accounts` +-- +ALTER TABLE `accounts` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `logs` +-- +ALTER TABLE `logs` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `logs1` +-- +ALTER TABLE `logs1` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `logs2` +-- +ALTER TABLE `logs2` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `logs3` +-- +ALTER TABLE `logs3` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `logs4` +-- +ALTER TABLE `logs4` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `logs5` +-- +ALTER TABLE `logs5` + ADD PRIMARY KEY (`id`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `accounts` +-- +ALTER TABLE `accounts` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + +-- +-- AUTO_INCREMENT for table `logs` +-- +ALTER TABLE `logs` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; + +-- +-- AUTO_INCREMENT for table `logs1` +-- +ALTER TABLE `logs1` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + +-- +-- AUTO_INCREMENT for table `logs2` +-- +ALTER TABLE `logs2` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + +-- +-- AUTO_INCREMENT for table `logs3` +-- +ALTER TABLE `logs3` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + +-- +-- AUTO_INCREMENT for table `logs4` +-- +ALTER TABLE `logs4` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + +-- +-- AUTO_INCREMENT for table `logs5` +-- +ALTER TABLE `logs5` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/profile.php b/profile.php new file mode 100644 index 0000000..a0a7aac --- /dev/null +++ b/profile.php @@ -0,0 +1,198 @@ +prepare('SELECT mt1, eng1 FROM logs1 WHERE id = ?'); +// In this case we can use the account ID to get the account info. +$stmt->bind_param('i', $_SESSION['id']); +$stmt->execute(); +$stmt->bind_result($mt1, $eng1); +$stmt->fetch(); +$stmt->close(); + +// We don't have the password or email info stored in sessions so instead we can get the results from the database. +$stmt = $con->prepare('SELECT mt2, eng2 FROM logs2 WHERE id = ?'); +// In this case we can use the account ID to get the account info. +$stmt->bind_param('i', $_SESSION['id']); +$stmt->execute(); +$stmt->bind_result($mt2, $eng2); +$stmt->fetch(); +$stmt->close(); + +// We don't have the password or email info stored in sessions so instead we can get the results from the database. +$stmt = $con->prepare('SELECT mt3, eng3 FROM logs3 WHERE id = ?'); +// In this case we can use the account ID to get the account info. +$stmt->bind_param('i', $_SESSION['id']); +$stmt->execute(); +$stmt->bind_result($mt3, $eng3); +$stmt->fetch(); +$stmt->close(); + +// We don't have the password or email info stored in sessions so instead we can get the results from the database. +$stmt = $con->prepare('SELECT mt4, eng4 FROM logs4 WHERE id = ?'); +// In this case we can use the account ID to get the account info. +$stmt->bind_param('i', $_SESSION['id']); +$stmt->execute(); +$stmt->bind_result($mt4, $eng4); +$stmt->fetch(); +$stmt->close(); + +// We don't have the password or email info stored in sessions so instead we can get the results from the database. +$stmt = $con->prepare('SELECT mt5, eng5 FROM logs5 WHERE id = ?'); +// In this case we can use the account ID to get the account info. +$stmt->bind_param('i', $_SESSION['id']); +$stmt->execute(); +$stmt->bind_result($mt5, $eng5); +$stmt->fetch(); +$stmt->close(); +?> + + + + + + MLP + + + + + +
+

Create Airframe Log

+
+
+ + +

+ + +

+ + +
+
+ +
+ +
+

Logs Display

+
+

Airframe 1 Log Details :

+ + + + + + + + + + + + + +
Flight Hours :400 - 600 Hours
Maintanence Date :
Assigned Engineer :
+
+
+ +
+
+

Airframe 2 Log Details :

+ + + + + + + + + + + + + +
Flight Hours400 - 600 Hours
Maintanence Date :
Assigned Engineer :
+
+
+ +
+
+

Airframe 3 Log Details :

+ + + + + + + + + + + + + +
Flight Hours600 - 700 Hours
Maintanence Date :
Assigned Engineer :
+
+
+ +
+
+

Airframe 4 Log Details :

+ + + + + + + + + + + + + +
Flight Hours700 - 800 Hours
Maintanence Date :
Assigned Engineer :
+
+
+ +
+
+

Airframe 5 Log Details :

+ + + + + + + + + + + + + +
Flight Hours750 - 900 Hours
Maintanence Date :
Assigned Engineer :
+
+
+ + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..ad037e2 --- /dev/null +++ b/style.css @@ -0,0 +1,128 @@ +* { + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, "segoe ui", roboto, oxygen, ubuntu, cantarell, "fira sans", "droid sans", "helvetica neue", Arial, sans-serif; + font-size: 16px; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +body { + background-color: #435165; +} +.login { + width: 400px; + background-color: #ffffff; + box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.3); + margin: 100px auto; +} +.login h1 { + text-align: center; + color: #5b6574; + font-size: 24px; + padding: 20px 0 20px 0; + border-bottom: 1px solid #dee0e4; +} +.login form { + display: flex; + flex-wrap: wrap; + justify-content: center; + padding-top: 20px; +} +.login form label { + display: flex; + justify-content: center; + align-items: center; + width: 50px; + height: 50px; + background-color: #3274d6; + color: #ffffff; +} +.login form input[type="password"], .login form input[type="text"] { + width: 310px; + height: 50px; + border: 1px solid #dee0e4; + margin-bottom: 20px; + padding: 0 15px; +} +.login form input[type="submit"] { + width: 100%; + padding: 15px; + margin-top: 20px; + background-color: #3274d6; + border: 0; + cursor: pointer; + font-weight: bold; + color: #ffffff; + transition: background-color 0.2s; +} +.login form input[type="submit"]:hover { + background-color: #2868c7; + transition: background-color 0.2s; +} +.navtop { + background-color: #2f3947; + height: 60px; + width: 100%; + border: 0; +} +.navtop div { + display: flex; + margin: 0 auto; + width: 1000px; + height: 100%; +} +.navtop div h1, .navtop div a { + display: inline-flex; + align-items: center; +} +.navtop div h1 { + flex: 1; + font-size: 24px; + padding: 0; + margin: 0; + color: #eaebed; + font-weight: normal; +} +.navtop div a { + padding: 0 20px; + text-decoration: none; + color: #c1c4c8; + font-weight: bold; +} +.navtop div a i { + padding: 2px 8px 0 0; +} +.navtop div a:hover { + color: #eaebed; +} +body.loggedin { + background-color: #f3f4f7; +} +.content { + width: 1000px; + margin: 0 auto; +} +.content h2 { + margin: 0; + padding: 25px 0; + font-size: 22px; + border-bottom: 1px solid #e0e0e3; + color: #4a536e; +} +.content > p, .content > div { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1); + margin: 25px 0; + padding: 25px; + background-color: #fff; +} +.content > p table td, .content > div table td { + padding: 5px; +} +.content > p table td:first-child, .content > div table td:first-child { + font-weight: bold; + color: #4a536e; + padding-right: 15px; +} +.content > div p { + padding: 5px; + margin: 0 0 10px 0; +} \ No newline at end of file