mostly done ui left draft

main
Grim0o5 6 months ago
parent 6c7169c5b6
commit 4a38e5fa7b
  1. 6
      .htaccess
  2. 56
      ManageJob.css
  3. 227
      Untitled-1.html
  4. 1
      YOLO
  5. 23
      aboutus.css
  6. 35
      aboutus.php
  7. 115
      alljobs.php
  8. 12
      connect.php
  9. 50
      contactus.css
  10. 31
      contactus.php
  11. 8
      createAccount.css
  12. 77
      createAccount.php
  13. 65
      employe.css
  14. 47
      employerdash.php
  15. 84
      employerprofile.php
  16. 32
      footer.css
  17. 28
      footer.php
  18. 9
      home.php
  19. 144
      index.css
  20. 77
      index.php
  21. 138
      job_applications.php
  22. 121
      job_details.php
  23. 63
      jobseekerdash.css
  24. 39
      jobseekerdash.php
  25. 113
      jobseekerprofile.css
  26. 114
      jobseekerprofile.php
  27. 58
      login.css
  28. 24
      login.html
  29. 62
      login.php
  30. 7
      logout.php
  31. 187
      manage_applications.php
  32. 144
      managejob.php
  33. 92
      navbar.css
  34. 76
      navbar.php
  35. BIN
      pic/Cleaner.jpg
  36. BIN
      pic/Factoryworker.jpg
  37. BIN
      pic/Job seek.jpg
  38. BIN
      pic/login.png
  39. 122
      register.php
  40. 94
      updateemployeeprofile.php
  41. 101
      updateprofile.php
  42. 109
      viewjobs.php

@ -0,0 +1,6 @@
RewriteEngine On
# Remove .php extension for all URLs (for lowercase letters only)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([a-z-]+)$ $1.php [L]

@ -0,0 +1,56 @@
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
width: 80%;
margin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.post-job input, .post-job textarea {
width: 100%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
.post-job button {
padding: 10px 20px;
background-color: #28a745;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
.post-job button:hover {
background-color: #218838;
}
#jobsList {
margin-top: 20px;
}
.job {
background-color: #f9f9f9;
padding: 15px;
margin-bottom: 10px;
border: 1px solid #ddd;
border-radius: 4px;
}
.job h3 {
margin: 0;
font-size: 18px;
}
.job p {
margin: 5px 0;
}

@ -1,227 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PartTime Profession - Lets find your next part-time profession</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
body {
background-color: beige;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 2px solid #eee;
background-color: white;
}
.logo {
display: flex;
align-items: center;
gap: 1rem;
font-size: 1.5rem;
font-weight: bolder;
color: #00416A;
}
.logo img {
height: 50px;
width: auto;
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-links a {
text-decoration: none;
color: #333;
font-size: 1rem;
padding: 0.5rem 1rem;
}
.nav-links a:hover {
color: #00416A;
}
.search-container {
max-width: 800px;
margin: 2rem auto;
padding: 0 1rem;
}
.search-bar {
width: 100%;
padding: 1rem;
border: 2px solid #ddd;
border-radius: 25px;
font-size: 1rem;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.section-title {
font-size: 1.5rem;
color: #00416A;
margin: 2rem 1rem;
}
.featured-jobs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
padding: 0 1rem;
}
.job-card {
background-color: white;
border-radius: 8px;
padding: 1.5rem;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.job-title {
font-size: 1.2rem;
color: #00416A;
margin-bottom: 0.5rem;
}
.job-location {
color: #666;
margin-bottom: 1rem;
}
.job-description {
color: #333;
font-size: 0.9rem;
line-height: 1.5;
}
.categories {
display: flex;
gap: 2rem;
padding: 2rem;
flex-wrap: wrap;
}
.category {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
text-decoration: none;
color: #00416A;
}
.category-icon {
width: 80px;
height: 80px;
background: #f5f5f5;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.category-icon img {
width: 100%;
height: 100%;
object-fit: cover;
}
footer {
margin-top: 3rem;
padding: 2rem;
background: #00416A;
color: white;
display: flex;
justify-content: space-between;
}
footer ul {
list-style: none;
}
footer ul li {
margin-bottom: 1rem;
}
footer a {
text-decoration: none;
color: white;
font-size: 0.9rem;
}
</style>
</head>
<body>
<header class="header">
<div class="logo">
<img src="TEMPHIRE_LOGO.png" alt="TEMPHIRE LOGO">
<span>PartTime Profession</span>
</div>
<nav class="nav-links">
<a href="#">Home</a>
<a href="#">Job Listings</a>
<a href="#">User Account</a>
</nav>
</header>
<div class="search-container">
<input type="text" class="search-bar" placeholder="Search for part-time jobs...">
</div>
<h2 class="section-title">Featured Jobs</h2>
<div class="featured-jobs">
<div class="job-card">
<h3 class="job-title">Care Taker</h3>
<div class="job-location">Location: Balaju, Kathmandu</div>
<p class="job-description">Take care of dogs for two days. Experience with pets required.</p>
</div>
<div class="job-card">
<h3 class="job-title">Old Aged Helper</h3>
<div class="job-location">Location: Bouddha, Kathmandu</div>
<p class="job-description">Take care of elderly people for 3 days. Prior experience preferred.</p>
</div>
</div>
<h2 class="section-title">Job Categories</h2>
<div class="categories">
<a href="#" class="category">
<div class="category-icon">
<img src="Pet-care-taker.jpg" alt="Dog Care">
</div>
<span>Dog Care Taker</span>
</a>
<a href="#" class="category">
<div class="category-icon">
<img src="old-aged-people-care-taker.jpeg" alt="Elderly Care">
</div>
<span>Old Aged Care Taker</span>
</a>
</div>
<footer>
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Privacy Policy</a></li>
</ul>
<ul>
<li><a href="#">Jobs</a></li>
<li><a href="#">Companies</a></li>
<li><a href="#">Support</a></li>
</ul>
</footer>
</body>
</html>

@ -1 +0,0 @@
Subproject commit 4bdb85bff7567151b15e51566ccf08447e97cd68

@ -0,0 +1,23 @@
.content {
padding: 40px 20px;
max-width: 800px;
margin: 0 auto;
}
.content h1 {
text-align: center;
color: rgb(49, 61, 231);
margin-bottom: 20px;
}
.content h2 {
text-align: center;
margin-bottom: 20px;
color: rgb(49, 61, 231);
}
.content p {
line-height: 1.6;
margin: 15px 0;
text-align: center;
}

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About Us - Part-Time Job</title>
<link rel="stylesheet" href="aboutus.css">
</head>
<body>
<?php include 'navbar.php'?>
<div class="content">
<h1>Welcome to Temphire</h1>
<p>
At part-time job, we are dedicated to connecting job seekers with meaningful part-time opportunities that suit their skills, schedules, and aspirations. Our platform is designed to provide a seamless experience for both employers and job seekers, making it easier to find the right match.
</p>
<p>
Whether you are a student, a stay-at-home parent, or someone looking to supplement your income, our platform offers a diverse range of job listings from various industries and locations. From flexible hours to remote work options, we strive to cater to the unique needs of our users.
</p>
<h2>Our Mission</h2>
<p>
Our mission is to empower individuals by providing access to quality part-time job opportunities and to support businesses by helping them find talented and motivated part-time employees. We believe in creating a community where everyone can thrive through meaningful work.
</p>
<h2>Why Choose Us?</h2>
<p>
- A wide variety of part-time job listings across multiple sectors.<br>
- User-friendly platform for easy navigation and application.<br>
- Tools to filter and customize your job search to find the perfect fit.<br>
- Dedicated support to assist you every step of the way.
</p>
</div>
<?php include 'footer.php'?>
</body>
</html>

@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>All Jobs</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.2/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="min-h-screen bg-base-200">
<?php include 'navbar.php'; ?>
<main class="container mx-auto px-4 py-8">
<!-- Breadcrumb -->
<div class="text-sm breadcrumbs mb-6">
<ul>
<li><a href="index.php">Home</a></li>
<li class="text-primary">All Jobs</li>
</ul>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<?php
include 'connect.php';
// Check if the user is logged in
if (!isset($_SESSION['email'])) {
// If not logged in, redirect to login page
header("Location: login.php");
exit();
}
// Query to get all jobs based on employer id
$sql = "SELECT * FROM job_postings ORDER BY posted_date DESC";
$stmt = $conn->prepare($sql);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
while ($job = $result->fetch_assoc()) {
?>
<div class="lg:col-span-1">
<div class="card bg-base-100 shadow-xl">
<div class="card-body">
<!-- Job Overview -->
<h2 class="card-title text-xl mb-4"><?= htmlspecialchars($job['job_title']) ?></h2>
<div class="space-y-4">
<div class="flex items-center gap-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" viewBox="0 0 20 20"
fill="currentColor">
<path fill-rule="evenodd"
d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z"
clip-rule="evenodd" />
</svg>
<div>
<div class="text-sm opacity-70">Location</div>
<div class="font-medium"><?= htmlspecialchars($job['location']) ?></div>
</div>
</div>
<div class="flex items-center gap-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" viewBox="0 0 20 20"
fill="currentColor">
<path
d="M8.433 7.418c.155-.103.346-.196.567-.267v1.698a2.305 2.305 0 01-.567-.267C8.07 8.34 8 8.114 8 8c0-.114.07-.34.433-.582zM11 12.849v-1.698c.22.071.412.164.567.267.364.243.433.468.433.582 0 .114-.07.34-.433.582a2.305 2.305 0 01-.567.267z" />
<path fill-rule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a1 1 0 10-2 0v.092a4.535 4.535 0 00-1.676.662C6.602 6.234 6 7.009 6 8c0 .99.602 1.765 1.324 2.246.48.32 1.054.545 1.676.662v1.941c-.391-.127-.68-.317-.843-.504a1 1 0 10-1.51 1.31c.562.649 1.413 1.076 2.353 1.253V15a1 1 0 102 0v-.092a4.535 4.535 0 001.676-.662C13.398 13.766 14 12.991 14 12c0-.99-.602-1.765-1.324-2.246A4.535 4.535 0 0011 9.092V7.151c.391.127.68.317.843.504a1 1 0 101.511-1.31c-.563-.649-1.413-1.076-2.354-1.253V5z"
clip-rule="evenodd" />
</svg>
<div>
<div class="text-sm opacity-70">Salary</div>
<div class="font-medium"><?= htmlspecialchars($job['salary']) ?></div>
</div>
</div>
<div class="flex items-center gap-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" viewBox="0 0 20 20"
fill="currentColor">
<path fill-rule="evenodd"
d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"
clip-rule="evenodd" />
</svg>
<div>
<div class="text-sm opacity-70">Posted Date</div>
<div class="font-medium"><?= date('F j, Y', strtotime($job['posted_date'])) ?></div>
</div>
</div>
</div>
<div class="divider"></div>
<a href="job_details.php?id=<?= $job['job_id'] ?>" class="btn btn-primary btn-block">
View Details
</a>
</div>
</div>
</div>
<?php
}
} else {
echo "<p>No jobs available.</p>";
}
$conn->close();
?>
</div>
</main>
<?php include 'footer.php'; ?>
</body>
</html>

@ -0,0 +1,12 @@
<?php
$host ='localhost';
$user = 'root';
$password = '';
$db = 'Temphire';
$conn = new mysqli($host,$user,$password,$db);
if($conn -> connect_error)
{
echo "failed connection".$conn->connect_error;
}
?>

@ -0,0 +1,50 @@
.content {
padding: 40px 20px;
max-width: 800px;
margin: 0 auto;
}
.content h3 {
text-align: center;
}
.content form {
display: flex;
flex-direction: column;
gap: 15px;
}
.content form label {
font-weight: bold;
}
.content form input,
.content form textarea,
.content form button {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
}
.content form textarea {
resize: vertical;
height: 100px;
}
.content form button {
background-color: #00416A;
color: white;
border: none;
cursor: pointer;
}
.content form button:hover {
background-color: #62b9d1;
}

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us - Temphire</title>
<link rel="stylesheet" href="contactus.css">
</head>
<body>
<?php include 'navbar.php' ?>
<div class="content">
<h3><b>Please provide the feed back about your problem</h3>
<form>
<label for="name">Your Name:</label>
<input type="text" id="name" name="name" placeholder="Enter your name" required>
<label for="email">Your Email:</label>
<input type="email" id="email" name="email" placeholder="Enter your email" required>
<label for="message">Your Message:</label>
<textarea id="message" name="message" placeholder="Type your message here" required></textarea>
<button type="submit">Send Message</button>
</form>
</div>
<?php include 'footer.php' ?>
</body>
</html>

@ -0,0 +1,8 @@
form
{
display: flex;
justify-content: center;
align-items: center;
padding: 60px;
}

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- font-awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<!-- custom css -->
<link rel="stylesheet" href="createAccount.css">
</head>
<body>
<?php include 'navbar.php'; ?>
<form method="post" action="register.php">
<div class="forms-container">
<div class="row mb-4">
<div class="col">
<div class="form-outline">
<input type="text" id="fname" name="fname" class="form-control" required />
<label class="form-label" for="fname">First name</label>
</div>
</div>
<div class="col">
<div class="form-outline">
<input type="text" id="lname" name="lname" class="form-control" required />
<label class="form-label" for="lname">Last name</label>
</div>
</div>
</div>
<!-- Job type -->
<div class="form-outline mb-4">
<select name="user_type" id="user_type" class="form-control" required>
<option value="Job seeker" >Job seeker</option>
<option value="Employer" ">Employer</option>
</select>
<label class="form-label" for="user_type">User Type</label>
</div>
<!-- Contact input -->
<div class="form-outline mb-4">
<input type="number" name="contact" id="contact" class="form-control" />
<label class="form-label" for="contact">Contact</label>
</div>
<!-- Email input -->
<div class="form-outline mb-4">
<input type="email" id="email" name="email" class="form-control" required />
<label class="form-label" for="email">Email address</label>
</div>
<!-- Username input -->
<div class="form-outline mb-4">
<input type="text" name="username" id="username" class="form-control" />
<label class="form-label" for="username">Username</label>
</div>
<!-- Password input -->
<div class="form-outline mb-4">
<input type="password" name="password" id="password" class="form-control" required />
<label class="form-label" for="password">Password</label>
</div>
<!-- Submit button -->
<button type="submit" class="btn btn-primary btn-block mb-4" name="signup">Sign up</button>
</div>
</form>
<?php include 'footer.php'; ?>
</body>
</html>

@ -0,0 +1,65 @@
*
body {
margin: 0;
font-family: sans-serif;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.blue-box {
width: 100%;
height: 300px;
background-color: #8492e0;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
font-size: 2em;
}
.main-div {
width: 80%;
max-width: 800px;
margin-top: 50px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.button-div {
width: 30%;
height: 100px;
border: 1px solid #ddd;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
cursor: pointer;
}
.button-div:hover {
background-color: #f2f2f2;
}
.icon {
margin-right: 10px;
font-size: 2em;
}
.button-text {
font-size: 1.2em;
}
.button-div a{
text-decoration: none;
color: black;
}

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>Employee Dashboard</title>
<link rel="stylesheet" href="employe.css">
</head>
<body>
<?php include 'navbar.php'?>
<div class="container">
<div class="button-div">
<span class="icon">📄</span>
<span class="button-text">Manage Job Applications</span>
</div>
<div class="button-div">
<a href="managejob">
<span class="icon">💼</span>
<span class="button-text">post Jobs</span>
</div>
</a>
<div class="button-div">
<a href="viewjobs">
<span class="icon">💼</span>
<span class="button-text">View Jobs</span>
</div>
</a>
<div class="button-div">
<a href="employerprofile">
<span class="icon">👤</span>
<span class="button-text">My Profile</span>
</a>
</div>
<div class="button-div">
<a href="logout">
<span class="icon">🚪</span>
<span class="button-text">Logout</span>
</a>
</div>
</div>
</div>
<?php include 'footer.php'?>
</body>
</html>

@ -0,0 +1,84 @@
<?php
session_start(); // Start the session
// Include your database connection
include 'connect.php';
// Ensure the user is logged in
if (!isset($_SESSION['user_id'])) {
header("Location: login.php"); // Redirect to login if the user is not logged in
exit();
}
$user_id = $_SESSION['user_id']; // Get user ID from the session
// Fetch user data from the database
$query = "SELECT u.firstname, u.lastname, u.email, u.phone,
e.company_name, e.company_email, e.company_address,
e.industry
FROM users u
LEFT JOIN employers e ON u.user_id = e.user_id
WHERE u.user_id = ?";
$stmt = $conn->prepare($query);
if (!$stmt) {
die("Prepare failed: " . $conn->error);
}
$stmt->bind_param("i", $user_id);
if (!$stmt->execute()) {
die("Query execution failed: " . $stmt->error);
}
$result = $stmt->get_result();
// Check if the user data was found
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
} else {
$user = []; // Set $user to an empty array to avoid errors
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Update Profile</title>
<link rel="stylesheet" href="jobseekerprofile.css">
</head>
<body>
<?php include 'navbar.php' ?>
<div class="profile-container">
<h2>Employer Profile</h2>
<form class="profile-form" method="POST" action="updateemployeeprofile.php" enctype="multipart/form-data">
<div class="form-group">
<label>First Name</label>
<input type="text" name="first_name" value="<?php echo isset($user['firstname']) ? $user['firstname'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" name="last_name" value="<?php echo isset($user['lastname']) ? $user['lastname'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" name="email" value="<?php echo isset($user['email']) ? $user['email'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Phone Number</label>
<input type="tel" name="phone" value="<?php echo isset($user['phone']) ? $user['phone'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Company Address</label>
<input type="text" name="company_address" value="<?php echo isset($user['company_address']) ? $user['company_address'] : ''; ?>" required>
</div>
<button type="submit" class="submit-btn" name="update">Update</button>
</form>
</div>
<?php include 'footer.php'?>
</body>
</html>

@ -0,0 +1,32 @@
footer {
padding: 50px;
background-color: #28709c;
}
.quicklinks {
display: flex;
padding: 0 50px ;
justify-content: flex-start; /* Align the links to the start */
gap: 50px;
margin-bottom: 20px;
}
.quicklinks ul {
list-style: none;
padding: 0;
}
.quicklinks li {
margin: 5px 0;
}
.quicklinks a {
text-decoration: none;
color: black;
}
.copyright-section {
text-align: center;
font-size: 14px;
color: black;
}

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="footer.css">
</head>
<body>
<footer>
<div class="quicklinks ">
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Privacy Policy</a></li>
</ul>
<ul>
<li><a href="#">Jobs</a></li>
<li><a href="#">Companies</a></li>
<li><a href="#">Support</a></li>
</ul>
</div>
<div class="copyright-section">
<p>Content copyright &#169; 2024 Temphire</p>
</div>
</footer>
</body>
</html>

@ -1,3 +1,8 @@
<?php
session_start();
include ('connect.php');
?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -6,8 +11,6 @@
<title>Document</title> <title>Document</title>
</head> </head>
<body> <body>
<div class="container"> <p> logged in bruv</p>
</div>
</body> </body>
</html> </html>

@ -0,0 +1,144 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
.centered-image
{
display: flex;
justify-content: center;
}
.search-container {
max-width: 800px;
margin: 2rem auto;
padding: 0 1rem;
}
.search-bar {
width: 100%;
padding: 1rem;
border: 2px solid #ddd;
border-radius: 25px;
font-size: 1rem;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.section-title {
font-size: 1.5rem;
color: #00416A;
margin: 2rem 1rem;
text-align: center;
}
.section-title1 {
font-size: 1.5rem;
color: #00416A;
margin: 2rem 1rem;
text-align: center;
}
.ad-box {
text-align: center;
margin: 20px auto;
padding: 10px;
}
.centered-image img {
max-width: 25%;
height: auto;
}
.featured-jobs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
padding: 40px 20px;
margin: 0 auto;
max-width: 800px;
}
.job-card {
background-color: white;
border-radius: 8px;
padding: 40px 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.job-title {
font-size: 1.2rem;
color: #00416A;
margin-bottom: 0.5rem;
}
.job-card1 {
background-color: white;
border-radius: 8px;
padding: 40px 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.job-card2 {
background-color: white;
border-radius: 8px;
padding: 40px 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.job-card3 {
background-color: white;
border-radius: 8px;
padding: 40px 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.job-location {
color: #666;
margin-bottom: 1rem;
}
.job-description {
color: black;
font-size: 0.9rem;
line-height: 1.5;
}
.categories {
display: flex;
gap: 2rem;
padding: 2rem;
flex-wrap: wrap;
padding: 40px 20px;
margin: 0 auto;
max-width: 800px;
align-items: right;
justify-content: center;
}
.category {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
text-decoration: none;
color: #00416A;
transition: transform 0.2s;
}
.category:hover {
transform:translateY(-5px);
}
.category-icon {
width: 120px;
height: 80px;
border-radius: 8px;
overflow:hidden;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);;
}
.category-icon img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s;
}
.category-icon img:hover {
transform: scale(1.1);
}

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temphire</title>
<link rel="stylesheet" href="index.css">
</head>
<?php include 'navbar.php' ?>
<div class="centered-image">
<img src="pic/Job seek.jpg" alt="Image"/>
</div>
<div class="search-container">
<input type="text" class="search-bar" placeholder="Search for part-time jobs...">
</div>
<h2 class="section-title">Featured Jobs</h2>
<div class="featured-jobs">
<div class="job-card">
<h3 class="job-title">Care Taker</h3>
<div class="job-location">Location: Balaju, Kathmandu</div>
<p class="job-description">Take care of dogs for two days. Experience with pets required.</p>
</div>
<div class="job-card1">
<h3 class="job-title">Old Aged Helper</h3>
<div class="job-location">Location: Bouddha, Kathmandu</div>
<p class="job-description">Take care of elderly people for 3 days. Prior experience preferred.</p>
</div>
<div class="job-card2">
<h3 class="job-title">Cleaner</h3>
<div class="job-location">Location: Sundarijal, Kathmandu</div>
<p class="job-description">Cleaner for 1 week in an apartment.</p>
</div>
<div class="job-card3">
<h3 class="job-title">Factory Worker</h3>
<div class="job-location">Location: Biratnmagar, Kathmandu</div>
<p class="job-description">Factory worker for a month.</p>
</div>
</div>
<h2 class="section-title1">Job Categories</h2>
<div class="categories">
<a href="#" class="category">
<div class="category-icon">
<img src="pic/Pet Care Taker.jpg" alt="Dog Care Taker">
</div>
<span>Dog Care Taker</span>
</a>
<a href="#" class="category">
<div class="category-icon">
<img src="pic/Care Taker.jpeg" alt="Elderly Care">
</div>
<span>Old Aged Care Taker</span>
</a>
<a href="#" class="category">
<div class="category-icon">
<img src="pic/Cleaner.jpg" alt="Cleaner">
</div>
<span>Old Aged Care Taker</span>
</a>
<a href="#" class="category">
<div class="category-icon">
<img src="pic/Factoryworker.jpg" alt="Factory worker">
</div>
<span>Old Aged Care Taker</span>
</a>
</div>
<?php include 'footer.php'; ?>
</body>
</html>

@ -0,0 +1,138 @@
<?php
session_start();
// Check if the user is logged in
if (!isset($_SESSION['email'])) {
header("Location: login.php");
exit();
}
include 'connect.php';
// Check if the logged-in user is a job seeker
$is_job_seeker = ($_SESSION['user_type'] === 'Job seeker');
if (!$is_job_seeker) {
echo "Access denied. Only job seekers can view applications.";
exit();
}
// Get all applications for the current seeker
$seeker_id = $_SESSION['seeker_id'];
$sql = "SELECT a.*, j.job_title, j.location, j.salary, j.posted_date
FROM applications a
JOIN job_postings j ON a.job_id = j.job_id
WHERE a.seeker_id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $seeker_id);
$stmt->execute();
$result = $stmt->get_result();
?>
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Job Applications</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.2/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="min-h-screen flex flex-col bg-white">
<?php include 'navbar.php';?>
<main class="flex-grow container mx-auto px-4 py-8">
<!-- Breadcrumb -->
<div class="text-sm breadcrumbs mb-6">
<ul>
<li><a href="index.php">Home</a></li>
<li class="text-primary">My Applications</li>
</ul>
</div>
<div class="bg-white rounded-lg shadow-md p-6">
<h1 class="text-3xl font-bold mb-6 text-gray-800">My Job Applications</h1>
<?php if ($result->num_rows > 0): ?>
<div class="overflow-x-auto">
<table class="table w-full">
<thead>
<tr class="bg-gray-50">
<th class="text-left px-6 py-3 text-gray-600">Job Title</th>
<th class="text-left px-6 py-3 text-gray-600">Location</th>
<th class="text-left px-6 py-3 text-gray-600">Salary</th>
<th class="text-left px-6 py-3 text-gray-600">Application Date</th>
<th class="text-left px-6 py-3 text-gray-600">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<?php while ($application = $result->fetch_assoc()): ?>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-6 py-4">
<div class="text-sm font-medium text-gray-900">
<?= htmlspecialchars($application['job_title']) ?>
</div>
</td>
<td class="px-6 py-4 text-sm text-gray-600">
<?= htmlspecialchars($application['location']) ?>
</td>
<td class="px-6 py-4 text-sm text-gray-600">
<?= htmlspecialchars($application['salary']) ?>
</td>
<td class="px-6 py-4 text-sm text-gray-600">
<?= date('F j, Y', strtotime($application['application_date'])) ?>
</td>
<td class="px-6 py-4">
<?php
$statusClass = match($application['status']) {
'Pending' => 'bg-yellow-100 text-yellow-800',
'Accepted' => 'bg-green-100 text-green-800',
default => 'bg-red-100 text-red-800'
};
?>
<span class="px-3 py-1 inline-flex text-xs leading-5 font-semibold rounded-full <?= $statusClass ?>">
<?= htmlspecialchars($application['status']) ?>
</span>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="bg-blue-50 border-l-4 border-blue-400 p-4 mb-4">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
</svg>
</div>
<div class="ml-3">
<p class="text-sm text-blue-700">
You haven't applied to any jobs yet.
</p>
</div>
</div>
</div>
<?php endif; ?>
</div>
</main>
<?php include 'footer.php';?>
<style>
body {
min-height: 100vh;
display: flex;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
footer {
flex-shrink: 0;
}
</style>
</body>
</html>

@ -0,0 +1,121 @@
<?php
session_start();
// Check if the user is logged in
if (!isset($_SESSION['email'])) {
header("Location: login.php");
exit();
}
$seeker_id = $_SESSION['seeker_id'];
include 'connect.php';
// Get job ID from URL
$job_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($job_id > 0) {
// Query to get job details by job_id
$sql = "SELECT * FROM job_postings WHERE job_id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $job_id);
$stmt->execute();
$result = $stmt->get_result();
// Check if the job exists
if ($result->num_rows > 0) {
$job = $result->fetch_assoc();
} else {
echo "Job not found.";
exit();
}
} else {
echo "Invalid job ID.";
exit();
}
// Check if the logged-in user is a job seeker
$is_job_seeker = ($_SESSION['user_type'] === 'Job seeker');
// Handle job application
if (isset($_POST['apply']) && $is_job_seeker) {
// Get seeker_id from session
$seeker_id = $_SESSION['seeker_id'];
$application_date = date('Y-m-d H:i:s'); // Current date and time
$status = 'Pending'; // Default status
// Insert the application into the applications table
$sql_apply = "INSERT INTO applications (job_id, seeker_id, application_date, status) VALUES (?, ?, ?, ?)";
$stmt_apply = $conn->prepare($sql_apply);
$stmt_apply->bind_param("iiss", $job_id, $seeker_id, $application_date, $status);
if ($stmt_apply->execute()) {
$application_message = "You have successfully applied for this job!";
} else {
$application_message = "There was an error while applying. Please try again later.";
}
}
?>
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Job Details</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.2/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="min-h-screen bg-base-200">
<?php include 'navbar.php'; ?>
<main class="container mx-auto px-4 py-8">
<!-- Breadcrumb -->
<div class="text-sm breadcrumbs mb-6">
<ul>
<li><a href="index.php">Home</a></li>
<li class="text-primary">Job Details</li>
</ul>
</div>
<div class="max-w-4xl mx-auto bg-base-100 shadow-xl p-6">
<h2 class="text-3xl font-bold mb-4"><?= htmlspecialchars($job['job_title']) ?></h2>
<p class="text-lg font-medium mb-2"><strong>Location:</strong> <?= htmlspecialchars($job['location']) ?></p>
<p class="text-lg font-medium mb-2"><strong>Salary:</strong> <?= htmlspecialchars($job['salary']) ?></p>
<p class="text-lg font-medium mb-2"><strong>Posted Date:</strong> <?= date('F j, Y', strtotime($job['posted_date'])) ?></p>
<div class="mt-4">
<h3 class="text-2xl font-semibold mb-3">Job Description</h3>
<p><?= nl2br(htmlspecialchars($job['job_description'])) ?></p>
</div>
<!-- Display Application Message -->
<?php if (isset($application_message)): ?>
<div class="mt-4 text-center text-lg font-medium">
<?= htmlspecialchars($application_message) ?>
</div>
<?php endif; ?>
<!-- Apply Button for Job Seekers -->
<?php if ($is_job_seeker): ?>
<form method="POST">
<div class="mt-6">
<button type="submit" name="apply" class="btn btn-primary btn-block">Apply for Job</button>
</div>
</form>
<?php else: ?>
<div class="mt-6">
<button class="btn btn-disabled btn-block" disabled>You must be a job seeker to apply</button>
</div>
<?php endif; ?>
</div>
</main>
<?php include 'footer.php'; ?>
</body>
</html>
<?php
$conn->close();
?>

@ -0,0 +1,63 @@
body {
margin: 0;
font-family: sans-serif;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.blue-box {
width: 100%;
height: 300px;
background-color: #8492e0;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
font-size: 2em;
}
.main-div {
width: 80%;
max-width: 800px;
margin-top: 50px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.button-div {
width: 30%;
height: 100px;
border: 1px solid #ddd;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
cursor: pointer;
}
.button-div:hover {
background-color: #f2f2f2;
}
.icon {
margin-right: 10px;
font-size: 2em;
}
.button-text {
font-size: 1.2em;
}
.button-div a{
text-decoration: none;
color: black;
}

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>Job Seekers Dashboard</title>
<link rel="stylesheet" href="jobseekerdash.css">
</head>
<body>
<?php include 'navbar.php' ?>
<div class="container">
<div class="blue-box">
Dashboard
<p>HOME > DASHBOARD</p>
</div>
<div class="main-div">
<div class="button-div">
<a href="job_applications.php">
<span class="icon">📄</span>
<span class="button-text">My Job Applications</span>
</a>
</div>
<div class="button-div">
<a href="jobseekerprofile">
<span class="icon">👤</span>
<span class="button-text">My Profile</span>
</div>
</a>
<div class="button-div">
<a href="logout">
<span class="icon">🚪</span>
<span class="button-text">Logout</span>
</div>
</a>
</div>
</div>
<?php include 'footer.php' ?>
</body>
</html>

@ -0,0 +1,113 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.profile-container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.profile-container h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.profile-upload-section {
display: flex;
justify-content: center;
margin: 20px 0;
}
.profile-circle {
width: 120px;
height: 120px;
border-radius: 50%;
border: 2px solid #ccc;
position: relative;
overflow: hidden;
background: #f5f5f5;
}
.profile-circle img {
width: 100%;
height: 100%;
object-fit: cover;
}
.upload-label {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
color: white;
text-align: center;
padding: 8px 0;
cursor: pointer;
font-size: 12px;
}
.upload-label input[type="file"] {
display: none;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: 500;
color: #555;
}
.form-group input {
width: 100%;
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.form-group input:focus {
outline: none;
border-color: #007bff;
}
.file-input {
border: 1px solid #ddd;
padding: 6px;
border-radius: 4px;
background: #fff;
}
.submit-btn {
width: 100%;
padding: 10px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 10px;
}
.submit-btn:hover {
background: #0056b3;
}
input::placeholder {
color: #999;
}
/* Add required field indicator */
label:after {
content: '*';
color:red;
}

@ -0,0 +1,114 @@
<?php
session_start(); // Start the session
// Include your database connection
include 'connect.php';
// Ensure the user is logged in
if (!isset($_SESSION['user_id'])) {
header("Location: login.php"); // Redirect to login if the user is not logged in
exit();
}
$user_id = $_SESSION['user_id']; // Get user ID from the session
// Fetch user data from the database
$query = "SELECT u.firstname, u.lastname, u.email, u.phone,
j.skills, j.experience, j.education, j.location
FROM users u
LEFT JOIN job_seekers j ON u.user_id = j.user_id
WHERE u.user_id = ?";
$stmt = $conn->prepare($query);
if (!$stmt) {
die("Prepare failed: " . $conn->error);
}
$stmt->bind_param("i", $user_id);
if (!$stmt->execute()) {
die("Query execution failed: " . $stmt->error);
}
$result = $stmt->get_result();
// Check if the user data was found
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
} else {
$user = []; // Set $user to an empty array to avoid errors
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Update Profile</title>
<link rel="stylesheet" href="jobseekerprofile.css">
</head>
<body>
<?php include 'navbar.php' ?>
<div class="profile-container">
<h2>Jobseeker Profile</h2>
<div class="profile-upload-section">
<div class="profile-circle">
<img id="profile-preview" src="" alt="Profile Picture">
<label for="profile-upload" class="upload-label">
<span>Profile Picture</span>
<input type="file" id="profile-upload" accept="image/*">
</label>
</div>
</div>
<form class="profile-form" method="POST" action="updateprofile.php" enctype="multipart/form-data">
<div class="form-group">
<label>First Name</label>
<input type="text" name="first_name" value="<?php echo isset($user['firstname']) ? $user['firstname'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" name="last_name" value="<?php echo isset($user['lastname']) ? $user['lastname'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" name="email" value="<?php echo isset($user['email']) ? $user['email'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Phone Number</label>
<input type="tel" name="phone" value="<?php echo isset($user['phone']) ? $user['phone'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Location</label>
<input type="text" name="location" value="<?php echo isset($user['location']) ? $user['location'] : ''; ?>" required>
</div>
<div class="form-group">
<label>Skills</label>
<textarea name="skills" required><?php echo isset($user['skills']) ? $user['skills'] : ''; ?></textarea>
</div>
<div class="form-group">
<label>Experience</label>
<textarea name="experience" required><?php echo isset($user['experience']) ? $user['experience'] : ''; ?></textarea>
</div>
<div class="form-group">
<label>Education</label>
<textarea name="education" required><?php echo isset($user['education']) ? $user['education'] : ''; ?></textarea>
</div>
<button type="submit" class="submit-btn" name="update">Update</button>
</form>
</div>
<?php include 'footer.php'?>
</body>
</html>

@ -1,54 +1,12 @@
body {
margin: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #f0f0f0; /* Light background color */
}
.login-container {
background-color: rgb(126, 87, 174); /* Purple background */
width: 400px;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
text-align: center;
}
.login-container h1 { .h-custom {
color: #fff; height: calc(100% - 73px);
margin-bottom: 20px;
} }
@media (max-width: 450px) {
input { .h-custom {
margin: 10px 0; height: 100%;
padding: 10px;
border-radius: 5px;
border: none;
width: 80%;
} }
input[type="submit"] {
background-color: #4CAF50;
color: white;
cursor: pointer;
font-size: 16px;
}
input[type="submit"]:hover {
background-color: #45a049; /* Darker green on hover */
}
.text {
margin-top: 10px; /* Add space above the text */
}
.text a {
color: lightblue; /* Gold color for the link */
text-decoration: none; /* Remove underline */
}
.text a:hover {
text-decoration: underline; /* Underline on hover */
} }
.vh-80{
padding: 90px 0;
}

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="login.css">
</head>
<body>
<div class="login-container">
<h1>Login</h1>
<form action="post">
<div class="details-container">
<label for="email">Email:</label><br>
<input type="email" id="email" name="email" placeholder="example@gmail.com"><br>
<label for="password">Password:</label><br>
<input type="password" name="password" id="password"><br>
<input type="submit" name="login" id="login" value="Login"><br>
<p class="text">Don't Have an account? <a href="createAccount.html">Create an Account</a></p>
</div>
</form>
</div>
</body>
</html>

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="login.css">
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- font-awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<?php include 'navbar.php'; ?>
<section class="vh-80">
<div class="container-fluid h-custom">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-md-8 col-lg-6 col-xl-4 offset-xl-1">
<form method="post" action="register.php">
<!-- Email input -->
<div data-mdb-input-init class="form-outline mb-4">
<label class="form-label" for="email">Email address:</label>
<input type="email" id="email" name="email" class="form-control form-control-lg"
placeholder="Enter a valid email address" required />
</div>
<!-- Password input -->
<div data-mdb-input-init class="form-outline mb-3">
<label class="form-label" for="password">Password:</label>
<input type="password" id="password" name="password" class="form-control form-control-lg"
placeholder="Enter password" required />
</div>
<div class="d-flex justify-content-between align-items-center">
<!-- Checkbox -->
<div class="form-check mb-0">
<input class="form-check-input me-2" type="checkbox" value="" id="remember" />
<label class="form-check-label" for="remember">
Remember me
</label>
</div>
<a href="#!" class="text-body">Forgot password?</a>
</div>
<div class="text-center text-lg-start mt-4 pt-2">
<button type="submit" name="Login" class="btn btn-primary btn-lg"
style="padding-left: 2.5rem; padding-right: 2.5rem;">Login</button>
<p class="small fw-bold mt-2 pt-1 mb-0">Don't have an account? <a href="createAccount.php"
class="link-danger">Register</a></p>
</div>
</form>
</div>
</div>
</div>
</section>
<?php include 'footer.php'; ?>
</body>
</html>

@ -0,0 +1,7 @@
<?php
session_start();
session_unset(); // Remove all session variables
session_destroy(); // Destroy the session
header("Location: index"); // Redirect to home or login page
exit();
?>

@ -0,0 +1,187 @@
<?php
session_start();
// Check if the user is logged in
if (!isset($_SESSION['email'])) {
header("Location: login.php");
exit();
}
include 'connect.php';
// Check if the logged-in user is an employer
$is_employer = ($_SESSION['user_type'] === 'Employer');
if (!$is_employer) {
echo "Access denied. Only employers can view applications.";
exit();
}
// Get all applications for the employer's job postings
$employer_id = $_SESSION['employer_id'];
$sql = "SELECT
a.*,
j.job_title,
j.location,
j.salary,
u.firstname,
u.lastname,
u.email,
u.phone
FROM applications a
JOIN job_postings j ON a.job_id = j.job_id
JOIN job_seekers js ON a.seeker_id = js.seeker_id
JOIN users u ON js.user_id = u.user_id
WHERE j.employer_id = ?
ORDER BY a.application_date DESC";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $employer_id);
$stmt->execute();
$result = $stmt->get_result();
// Handle status updates if posted
if (isset($_POST['update_status']) && isset($_POST['application_id']) && isset($_POST['new_status'])) {
$application_id = intval($_POST['application_id']);
$new_status = $_POST['new_status'];
$allowed_statuses = ['Pending', 'Accepted', 'Rejected'];
if (in_array($new_status, $allowed_statuses)) {
$update_sql = "UPDATE applications SET status = ? WHERE application_id = ?";
$update_stmt = $conn->prepare($update_sql);
$update_stmt->bind_param("si", $new_status, $application_id);
$update_stmt->execute();
// Refresh the page to show updated status
header("Location: ".$_SERVER['PHP_SELF']);
exit();
}
}
?>
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Applications</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.2/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="min-h-screen flex flex-col bg-white">
<?php include 'navbar.php';?>
<main class="flex-grow container mx-auto px-4 py-8">
<div class="text-sm breadcrumbs mb-6">
<ul>
<li><a href="index.php">Home</a></li>
<li class="text-primary">Applications Received</li>
</ul>
</div>
<div class="bg-white rounded-lg shadow-md p-6">
<h1 class="text-3xl font-bold mb-6 text-gray-800">Applications Received</h1>
<?php if ($result->num_rows > 0): ?>
<div class="overflow-x-auto">
<table class="table w-full">
<thead>
<tr class="bg-gray-50">
<th class="text-left px-6 py-3 text-gray-600">Job Title</th>
<th class="text-left px-6 py-3 text-gray-600">Applicant Name</th>
<th class="text-left px-6 py-3 text-gray-600">Contact</th>
<th class="text-left px-6 py-3 text-gray-600">Application Date</th>
<th class="text-left px-6 py-3 text-gray-600">Status</th>
<th class="text-left px-6 py-3 text-gray-600">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<?php while ($application = $result->fetch_assoc()): ?>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-6 py-4">
<div class="text-sm font-medium text-gray-900">
<?= htmlspecialchars($application['job_title']) ?>
</div>
</td>
<td class="px-6 py-4">
<div class="text-sm text-gray-900">
<?= htmlspecialchars($application['firstname'] . ' ' . $application['lastname']) ?>
</div>
</td>
<td class="px-6 py-4">
<div class="text-sm text-gray-600">
<div>Email: <?= htmlspecialchars($application['email']) ?></div>
<div>Phone: <?= htmlspecialchars($application['phone']) ?></div>
</div>
</td>
<td class="px-6 py-4 text-sm text-gray-600">
<?= date('F j, Y', strtotime($application['application_date'])) ?>
</td>
<td class="px-6 py-4">
<?php
$statusClass = match($application['status']) {
'Pending' => 'bg-yellow-100 text-yellow-800',
'Accepted' => 'bg-green-100 text-green-800',
'Rejected' => 'bg-red-100 text-red-800',
default => 'bg-gray-100 text-gray-800'
};
?>
<span class="px-3 py-1 inline-flex text-xs leading-5 font-semibold rounded-full <?= $statusClass ?>">
<?= htmlspecialchars($application['status']) ?>
</span>
</td>
<td class="px-6 py-4">
<form method="POST" class="inline">
<input type="hidden" name="application_id" value="<?= $application['application_id'] ?>">
<select name="new_status" class="select select-bordered select-sm w-32 mr-2">
<option value="Pending" <?= $application['status'] === 'Pending' ? 'selected' : '' ?>>Pending</option>
<option value="Accepted" <?= $application['status'] === 'Accepted' ? 'selected' : '' ?>>Accept</option>
<option value="Rejected" <?= $application['status'] === 'Rejected' ? 'selected' : '' ?>>Reject</option>
</select>
<button type="submit" name="update_status" class="btn btn-sm btn-primary">
Update
</button>
</form>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="bg-blue-50 border-l-4 border-blue-400 p-4 mb-4">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
</svg>
</div>
<div class="ml-3">
<p class="text-sm text-blue-700">
No applications have been received yet for your job postings.
</p>
</div>
</div>
</div>
<?php endif; ?>
</div>
</main>
<footer class="mt-auto bg-white border-t">
<?php include 'footer.php';?>
</footer>
<style>
body {
min-height: 100vh;
display: flex;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
footer {
flex-shrink: 0;
}
</style>
</body>
</html>

@ -0,0 +1,144 @@
<?php
session_start();
include 'connect.php';
if (!isset($_SESSION['employer_id'])) {
echo "You must be logged in to post a job.";
exit(); // Stop further execution if not logged in
}
$employer_id = $_SESSION['employer_id']; // Get employer ID from session
// Handle job posting
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) {
try {
// Sanitize input data
$job_title = $_POST['job_title'];
$job_description = $_POST['job_description'];
$location = $_POST['location'];
$salary = $_POST['salary'];
$requirements = $_POST['requirements'];
// Prepare the SQL query to insert job data into job_postings table
$stmt = $conn->prepare(
"INSERT INTO job_postings (employer_id, job_title, job_description, location, salary, requirements)
VALUES (?, ?, ?, ?, ?, ?)"
);
$stmt->bind_param(
"isssss", // Define parameter types (string, string, string, string, string, string)
$employer_id,
$job_title,
$job_description,
$location,
$salary,
$requirements
);
$stmt->execute();
echo "<script>alert('Job posted successfully!'); window.location.href = 'employerdash';</script>";
exit;
} catch (Exception $e) {
// Return error response if an issue occurs
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
exit;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manage Jobs</title>
<link rel="stylesheet" href="ManageJob.css">
</head>
<body>
<?php include 'navbar.php'; ?>
<div class="container">
<div class="post-job">
<form method="Post" action="">
<input type="text" name="job_title" placeholder="Job Title" required>
<textarea name="job_description" placeholder="Job Description" required></textarea>
<input type="text" name="location" placeholder="Location" required>
<input type="text" name="salary" placeholder="Salary" required>
<textarea name="requirements" placeholder="Requirements" required></textarea>
<button type="submit">Post Job</button>
</form>
</div>
</div>
<?php include 'footer.php'; ?>
<script>
document.addEventListener('DOMContentLoaded', function () {
fetchJobs();
document.getElementById('postJobForm').addEventListener('submit', function (event) {
event.preventDefault();
postJob();
});
});
// Function to fetch jobs from the database
function fetchJobs() {
const xhr = new XMLHttpRequest();
xhr.open('GET', 'manage_jobs.php', true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
const data = JSON.parse(xhr.responseText);
const jobsList = document.getElementById('jobsList');
jobsList.innerHTML = '';
data.forEach(job => {
const jobDiv = document.createElement('div');
jobDiv.className = 'job';
jobDiv.innerHTML = `
<h3>${job.job_title}</h3>
<p><strong>Location:</strong> ${job.location}</p>
<p><strong>Salary:</strong> ${job.salary}</p>
<p><strong>Requirements:</strong> ${job.requirements}</p>
<p><strong>Posted Date:</strong> ${new Date(job.posted_date).toLocaleDateString()}</p>
<p>${job.job_description}</p>
<button onclick="applyJob(this)">Quick Apply</button>
`;
jobsList.appendChild(jobDiv);
});
}
};
xhr.send();
}
// Function to post a new job
function postJob() {
const xhr = new XMLHttpRequest();
const form = document.getElementById('postJobForm');
const formData = new FormData(form);
xhr.open('POST', 'manage_jobs.php', true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
const response = JSON.parse(xhr.responseText);
if (response.status === 'success') {
alert(response.message);
fetchJobs();
} else {
alert(response.message);
}
}
};
xhr.send(formData);
}
// Function for the "Quick Apply" button
function applyJob(button) {
const jobDiv = button.parentElement;
alert(`Applying for: ${jobDiv.querySelector('h3').textContent}`);
}
</script>
</body>
</html>

@ -0,0 +1,92 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 2px solid #eee;
background-color: white;
}
.logo {
display: flex;
align-items: center;
gap: 1rem;
font-size: 1.5rem;
font-weight: bolder;
color: #00416a;
}
.logo img {
height: 100px;
width: auto;
}
.nav-links {
display: flex;
gap: 2rem;
}
.nav-links a {
text-decoration: none;
color: #333;
font-size: 1rem;
padding: 0.5rem 1rem;
}
.nav-links a:hover {
color: #00416a;
}
/* Dropdown container */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown menu (hidden by default) */
.dropdown-menu {
display: none;
position: absolute;
top: 100%; /* Position below the dropdown */
left: 0;
background-color: #fff;
min-width: 100px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
z-index: 10;
padding: 0;
border-radius: 5px;
}
/* Menu items */
.dropdown-menu .dropdown-item {
padding: 10px 10px;
text-decoration: none;
color: #333;
display: block;
}
.dropdown-menu .dropdown-item:hover {
background-color: #f0f0f0;
color: #00416a;
}
/* Show the menu on hover */
.dropdown:hover .dropdown-menu {
display: block;
}
/* User icon and name */
.user-icon {
display: flex;
align-items: center;
cursor: pointer;
}
.user-icon i {
margin-right: 5px;
}

@ -0,0 +1,76 @@
<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="navbar.css">
<!-- font-awesome css -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link href="https://cdn.jsdelivr.net/npm/daisyui@latest/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<header class="header">
<div class="logo">
<img src="pic/TEMPHIRE_LOGO.png" alt="TEMPHIRE LOGO">
<span>Temphire</span>
</div>
<nav class="nav-links">
<a href="index">Home</a>
<a href="aboutus">About us</a>
<a href="contactus">Contact us</a>
<?php
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'];
$user_type = $_SESSION['user_type'];
if ($user_type === 'Employer') {
// Employer dropdown
echo '
<div class="dropdown">
<a href="#" class="user-icon">
<i class="fas fa-user"></i> ' . htmlspecialchars($username) . '
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="employerprofile">Profile</a>
<a class="dropdown-item" href="employerdash">Dashboard</a>
<a class="dropdown-item" href="logout">Logout</a>
</div>
</div>';
} else {
// Jobseeker dropdown
echo '
<div class="dropdown">
<a href="#" class="user-icon">
<i class="fas fa-user"></i> ' . htmlspecialchars($username) . '
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="jobseekerprofile">Profile</a>
<a class="dropdown-item" href="jobseekerdash">Dashboard</a>
<a class="dropdown-item" href="logout">Logout</a>
</div>
</div>';
}
} else {
// If not logged in, show login button
echo '<a href="login">Login</a>';
}
?>
</nav>
</header>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

@ -0,0 +1,122 @@
<?php
session_start();
include 'connect.php';
if (isset($_POST['signup'])) {
// Collecting form data
$firstName = trim($_POST['fname']);
$lastname = trim($_POST['lname']);
$email = trim($_POST['email']);
$user_type = trim($_POST['user_type']); // Make sure this matches the form field name
$username = trim($_POST['username']);
$contact = trim($_POST['contact']);
$password = trim($_POST['password']);
$password = md5($password); // Note: Consider using password_hash() instead of md5 for better security
// Check if email already exists
$checkEmail = "SELECT * FROM users WHERE email = ?";
$stmt = $conn->prepare($checkEmail);
$stmt->bind_param("s", $email);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
echo "<script>alert('Email address already exists.');</script>";
exit();
} else {
// Insert user into the database using prepared statement
$insertQuery = "INSERT INTO users (firstname, lastname, username, email, password, phone, user_type)
VALUES (?, ?, ?, ?, ?, ?, ?)";
$stmt = $conn->prepare($insertQuery);
$stmt->bind_param("sssssss", $firstName, $lastname, $username, $email, $password, $contact, $user_type);
if ($stmt->execute()) {
// Get the user_id of the newly inserted user
$user_id = $stmt->insert_id;
// Insert a new row into job_seekers table with the same user_id
if ($user_type === 'Job seeker') { // Only insert if the user is a jobseeker
$insertJobSeekerQuery = "INSERT INTO job_seekers (user_id) VALUES (?)";
$stmtJobSeeker = $conn->prepare($insertJobSeekerQuery);
$stmtJobSeeker->bind_param("i", $user_id);
if ($stmtJobSeeker->execute()) {
echo "<script>alert('Jobseeker profile created successfully!');</script>";
} else {
echo "Error inserting into job_seekers table: " . $stmtJobSeeker->error;
}
$stmtJobSeeker->close();
} elseif ($user_type === 'Employer') { // Only insert if the user is an Employer
$insertEmployerQuery = "INSERT INTO employers (user_id) VALUES (?)";
$stmtEmployer = $conn->prepare($insertEmployerQuery);
$stmtEmployer->bind_param("i", $user_id);
if ($stmtEmployer->execute()) {
echo "<script>alert('Employer profile created successfully!');</script>";
} else {
echo "Error inserting into employers table: " . $stmtEmployer->error;
}
$stmtEmployer->close();
}
$stmt->close();
header("Location: index.php");
exit();
} else {
echo "Error: " . $stmt->error;
}
$stmt->close();
}
}
// Login section
if (isset($_POST['Login'])) {
$email = trim($_POST['email']);
$password = trim($_POST['password']);
$password = md5($password);
// Use prepared statement for login
$sql = "SELECT * FROM users WHERE email = ? AND password = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ss", $email, $password);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$_SESSION['email'] = $row['email'];
$_SESSION['user_type'] = $row['user_type']; // Store user type in session
$_SESSION['user_id'] = $row['user_id']; // Store user ID in session
$_SESSION['username'] = $row['username']; // Store username in session
if (strtolower($row['user_type']) === 'employer') {
$employerQuery = "SELECT employer_id FROM employers WHERE user_id = ?";
$employerStmt = $conn->prepare($employerQuery);
$employerStmt->bind_param("i", $row['user_id']);
$employerStmt->execute();
$employerResult = $employerStmt->get_result();
if ($employerResult->num_rows > 0) {
$employerRow = $employerResult->fetch_assoc();
$_SESSION['employer_id'] = $employerRow['employer_id']; // Store employer_id in session
}
}
else if (strtolower($row['user_type']) === 'job seeker') {
$job_seekereQuery = "SELECT seeker_id FROM job_seekers WHERE user_id = ?";
$job_seekerStmt = $conn->prepare($job_seekereQuery);
$job_seekerStmt->bind_param("i", $row['user_id']);
$job_seekerStmt->execute();
$job_seekerResult = $job_seekerStmt->get_result();
if ($job_seekerResult->num_rows > 0) {
$job_seekerRow = $job_seekerResult->fetch_assoc();
$_SESSION['seeker_id'] = $job_seekerRow['seeker_id']; // Store seeker_id in session
}
}
header("Location: index");
exit();
} else {
echo "Incorrect email or password.";
}
}
?>

@ -0,0 +1,94 @@
<?php
session_start();
include 'connect.php';
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
$user_id = $_SESSION['user_id'];
if (isset($_POST['update'])) {
// Get form data
$first_name = trim($_POST['first_name']);
$last_name = trim($_POST['last_name']);
$email = trim($_POST['email']);
$phone = trim($_POST['phone']);
$company_address = trim($_POST['company_address']);
try {
$conn->begin_transaction();
// 1. First update the users table
$query_users = "UPDATE users
SET firstname = ?, lastname = ?, email = ?, phone = ?
WHERE user_id = ?";
$stmt_users = $conn->prepare($query_users);
if (!$stmt_users) {
throw new Exception("Prepare failed for users table: " . $conn->error);
}
$stmt_users->bind_param("ssssi", $first_name, $last_name, $email, $phone, $user_id);
if (!$stmt_users->execute()) {
throw new Exception("Error updating users table: " . $stmt_users->error);
}
// 2. Then handle the Employers table
// First check if a record exists
$check_query = "SELECT COUNT(*) as count FROM employers WHERE user_id = ?";
$check_stmt = $conn->prepare($check_query);
$check_stmt->bind_param("i", $user_id);
$check_stmt->execute();
$result = $check_stmt->get_result();
$row = $result->fetch_assoc();
if ($row['count'] > 0) {
// Update existing record
$employer_query = "UPDATE employers
SET
company_address = ?
WHERE user_id = ?";
} else {
// Insert new record
$employer_query = "INSERT INTO employers
( company_address, user_id)
VALUES (?, ?)";
}
$stmt_employers = $conn->prepare($employer_query);
if (!$stmt_employers) {
throw new Exception("Prepare failed for job_seekers table: " . $conn->error);
}
// Same binding for both UPDATE and INSERT
$stmt_employers->bind_param("si",
$company_address,
$user_id
);
if (!$stmt_employers->execute()) {
throw new Exception("Error with job_seekers table: " . $stmt_employers->error);
}
$conn->commit();
$_SESSION['success_message'] = "Profile updated successfully!";
header("Location: employerprofile");
exit();
} catch (Exception $e) {
$conn->rollback();
$_SESSION['error_message'] = "Error: " . $e->getMessage();
error_log("Profile update error: " . $e->getMessage());
header("Location: employerprofile");
exit();
} finally {
if (isset($stmt_users)) $stmt_users->close();
if (isset($stmt_employers)) $stmt_employers->close();
if (isset($check_stmt)) $check_stmt->close();
$conn->close();
}
}
?>

@ -0,0 +1,101 @@
<?php
session_start();
include 'connect.php';
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
$user_id = $_SESSION['user_id'];
if (isset($_POST['update'])) {
// Get form data
$first_name = trim($_POST['first_name']);
$last_name = trim($_POST['last_name']);
$email = trim($_POST['email']);
$phone = trim($_POST['phone']);
$skills = trim($_POST['skills']);
$experience = trim($_POST['experience']);
$education = trim($_POST['education']);
$location = trim($_POST['location']);
try {
$conn->begin_transaction();
// 1. First update the users table
$query_users = "UPDATE users
SET firstname = ?, lastname = ?, email = ?, phone = ?
WHERE user_id = ?";
$stmt_users = $conn->prepare($query_users);
if (!$stmt_users) {
throw new Exception("Prepare failed for users table: " . $conn->error);
}
$stmt_users->bind_param("ssssi", $first_name, $last_name, $email, $phone, $user_id);
if (!$stmt_users->execute()) {
throw new Exception("Error updating users table: " . $stmt_users->error);
}
// 2. Then handle the job_seekers table
// First check if a record exists
$check_query = "SELECT COUNT(*) as count FROM job_seekers WHERE user_id = ?";
$check_stmt = $conn->prepare($check_query);
$check_stmt->bind_param("i", $user_id);
$check_stmt->execute();
$result = $check_stmt->get_result();
$row = $result->fetch_assoc();
if ($row['count'] > 0) {
// Update existing record
$job_seeker_query = "UPDATE job_seekers
SET skills = ?,
experience = ?,
education = ?,
location = ?
WHERE user_id = ?";
} else {
// Insert new record
$job_seeker_query = "INSERT INTO job_seekers
(skills, experience, education, location, user_id)
VALUES (?, ?, ?, ?, ?, ?)";
}
$stmt_job_seekers = $conn->prepare($job_seeker_query);
if (!$stmt_job_seekers) {
throw new Exception("Prepare failed for job_seekers table: " . $conn->error);
}
// Same binding for both UPDATE and INSERT
$stmt_job_seekers->bind_param("sssssi",
$skills,
$experience,
$education,
$location,
$user_id
);
if (!$stmt_job_seekers->execute()) {
throw new Exception("Error with job_seekers table: " . $stmt_job_seekers->error);
}
$conn->commit();
$_SESSION['success_message'] = "Profile updated successfully!";
header("Location: jobseekerprofile.php");
exit();
} catch (Exception $e) {
$conn->rollback();
$_SESSION['error_message'] = "Error: " . $e->getMessage();
error_log("Profile update error: " . $e->getMessage());
header("Location: jobseekerprofile.php");
exit();
} finally {
if (isset($stmt_users)) $stmt_users->close();
if (isset($stmt_job_seekers)) $stmt_job_seekers->close();
if (isset($check_stmt)) $check_stmt->close();
$conn->close();
}
}
?>

@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>All Jobs</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.2/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="min-h-screen bg-base-200">
<?php include 'navbar.php'; ?>
<main class="container mx-auto px-4 py-8">
<!-- Breadcrumb -->
<div class="text-sm breadcrumbs mb-6">
<ul>
<li><a href="index.php">Home</a></li>
<li class="text-primary">All Jobs</li>
</ul>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<?php
include 'connect.php';
$employer_id = $_SESSION['employer_id'];
// Query to get all jobs based on employer id
$sql = "SELECT * FROM job_postings WHERE employer_id = ? ORDER BY posted_date DESC";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $employer_id); // Use 'i' for integer type parameter (employer_id)
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
while ($job = $result->fetch_assoc()) {
?>
<div class="lg:col-span-1">
<div class="card bg-base-100 shadow-xl">
<div class="card-body">
<!-- Job Overview -->
<h2 class="card-title text-xl mb-4"><?= htmlspecialchars($job['job_title']) ?></h2>
<div class="space-y-4">
<div class="flex items-center gap-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" viewBox="0 0 20 20"
fill="currentColor">
<path fill-rule="evenodd"
d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z"
clip-rule="evenodd" />
</svg>
<div>
<div class="text-sm opacity-70">Location</div>
<div class="font-medium"><?= htmlspecialchars($job['location']) ?></div>
</div>
</div>
<div class="flex items-center gap-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" viewBox="0 0 20 20"
fill="currentColor">
<path
d="M8.433 7.418c.155-.103.346-.196.567-.267v1.698a2.305 2.305 0 01-.567-.267C8.07 8.34 8 8.114 8 8c0-.114.07-.34.433-.582zM11 12.849v-1.698c.22.071.412.164.567.267.364.243.433.468.433.582 0 .114-.07.34-.433.582a2.305 2.305 0 01-.567.267z" />
<path fill-rule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a1 1 0 10-2 0v.092a4.535 4.535 0 00-1.676.662C6.602 6.234 6 7.009 6 8c0 .99.602 1.765 1.324 2.246.48.32 1.054.545 1.676.662v1.941c-.391-.127-.68-.317-.843-.504a1 1 0 10-1.51 1.31c.562.649 1.413 1.076 2.353 1.253V15a1 1 0 102 0v-.092a4.535 4.535 0 001.676-.662C13.398 13.766 14 12.991 14 12c0-.99-.602-1.765-1.324-2.246A4.535 4.535 0 0011 9.092V7.151c.391.127.68.317.843.504a1 1 0 101.511-1.31c-.563-.649-1.413-1.076-2.354-1.253V5z"
clip-rule="evenodd" />
</svg>
<div>
<div class="text-sm opacity-70">Salary</div>
<div class="font-medium"><?= htmlspecialchars($job['salary']) ?></div>
</div>
</div>
<div class="flex items-center gap-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" viewBox="0 0 20 20"
fill="currentColor">
<path fill-rule="evenodd"
d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"
clip-rule="evenodd" />
</svg>
<div>
<div class="text-sm opacity-70">Posted Date</div>
<div class="font-medium"><?= date('F j, Y', strtotime($job['posted_date'])) ?></div>
</div>
</div>
</div>
<div class="divider"></div>
<a href="job_details.php?id=<?= $job['job_id'] ?>" class="btn btn-primary btn-block">
View Details
</a>
</div>
</div>
</div>
<?php
}
} else {
echo "<p>No jobs available.</p>";
}
$conn->close();
?>
</div>
</main>
<?php include 'footer.php'; ?>
</body>
</html>
Loading…
Cancel
Save