diff --git a/Project/addairframe.php b/Project/addairframe.php new file mode 100644 index 0000000..c335efa --- /dev/null +++ b/Project/addairframe.php @@ -0,0 +1,33 @@ +prepare("select * from users where email=?"); + $stmt->execute([$email]); + + if ($stmt->rowCount() === 1) + { + $user = $stmt->fetch(); + + $user_id = $user['id']; + $user_full_name = $user['full_name']; + $user_email = $user['email']; + $user_password = $user['password']; + + if ($email === $user_email) + { + if (password_verify($password, $user_password)) + { + $_SESSION['user_id'] = $user_id; + $_SESSION['user_email'] = $user_email; + $_SESSION['user_full_name'] = $user_full_name; + + header("Location: index.php"); + }else + { + header("Location: login.php?error=Incorrect Username or Password&email=$email"); + } + }else + { + header("Location: login.php?error=Incorrect Username or Password&email=$email"); + } + }else + { + header("Location: login.php?error=Incorrect Username or Password&email=$email"); + } + } +} \ No newline at end of file diff --git a/Project/db_conn.php b/Project/db_conn.php new file mode 100644 index 0000000..8b403c7 --- /dev/null +++ b/Project/db_conn.php @@ -0,0 +1,14 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +}catch(PDOException $e){ + echo "Connection failed : ". $e->getMessage(); +} \ No newline at end of file diff --git a/Project/home.php b/Project/home.php new file mode 100644 index 0000000..ca6afa9 --- /dev/null +++ b/Project/home.php @@ -0,0 +1,186 @@ +query("select af_name, af_id from airframe"); + $eng_list = $mysqli->query("select full_name from users where role='eng'"); + $task_list = $mysqli->query("select task_name from task"); + $log_hr = $mysqli->query("select af_name, af_num, af_flight_hr from airframe"); +?> + + + +
+ + + +