added new columns in the job_postings database

implmented those records on our pages
main
Grim0o5 6 months ago
parent ab6eb51002
commit e6bc17cdc3
  1. 14
      job_applications.php
  2. 94
      job_details.php
  3. 13
      manage_applications.php
  4. 67
      managejob.php
  5. 17
      viewjobs.php

@ -19,7 +19,7 @@ if (!$is_job_seeker) {
// 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
$sql = "SELECT a.*, j.job_title, j.location, j.salary, j.posted_date,j.job_type,j.skills_level,j.salary_type
FROM applications a
JOIN job_postings j ON a.job_id = j.job_id
WHERE a.seeker_id = ?";
@ -62,6 +62,9 @@ $result = $stmt->get_result();
<th class="bg-base-200">Job Title</th>
<th class="bg-base-200">Location</th>
<th class="bg-base-200">Salary</th>
<th class="bg-base-200">Salary Type</th>
<th class="bg-base-200">Job type</th>
<th class="bg-base-200">Skill Level</th>
<th class="bg-base-200">Application Date</th>
<th class="bg-base-200">Status</th>
</tr>
@ -80,6 +83,15 @@ $result = $stmt->get_result();
<td>
<?= htmlspecialchars($application['salary']) ?>
</td>
<td>
<?= htmlspecialchars($application['salary_type']) ?>
</td>
<td>
<?= htmlspecialchars($application['job_type']) ?>
</td>
<td>
<?= htmlspecialchars($application['skills_level']) ?>
</td>
<td>
<?= date('F j, Y', strtotime($application['application_date'])) ?>
</td>

@ -7,7 +7,7 @@ if (!isset($_SESSION['email'])) {
exit();
}
// Check if seeker_id exists in the session
$seeker_id = isset($_SESSION['seeker_id']) ;
$seeker_id = isset($_SESSION['seeker_id']);
include 'connect.php';
@ -90,6 +90,7 @@ if (isset($_POST['remove']) && $is_employer) {
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -97,8 +98,9 @@ if (isset($_POST['remove']) && $is_employer) {
<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-base-200">
<?php include 'navbar.php';?>
<?php include 'navbar.php'; ?>
<main class="flex-grow container mx-auto px-4 py-8">
<!-- Breadcrumb -->
@ -116,8 +118,10 @@ if (isset($_POST['remove']) && $is_employer) {
<!-- Display Application Message -->
<?php if (isset($application_message)): ?>
<div class="alert alert-success mb-4">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-current shrink-0 w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
class="stroke-current shrink-0 w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span><?= htmlspecialchars($application_message) ?></span>
</div>
@ -125,18 +129,59 @@ if (isset($_POST['remove']) && $is_employer) {
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div class="flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
</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-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span class="font-medium"><?= htmlspecialchars($job['location']) ?></span>
<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-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span class="font-medium"><?= htmlspecialchars($job['salary']) ?></span>
<div>
<div class="text-sm opacity-70">Salary Type</div>
<div class="font-medium"><?= htmlspecialchars($job['salary_type']) ?></div>
</div>
</div>
<div class="flex items-center gap-2">
<i class="fas fa-briefcase text-primary mr-3"></i>
<div>
<div class="text-sm opacity-70">job Type</div>
<div class="font-medium"><?= htmlspecialchars($job['job_type']) ?></div>
</div>
</div>
<div class="flex items-center gap-2">
<i class="fa-solid fa-graduation-cap text-primary mr-3"></i>
<div>
<div class="text-sm opacity-70">Skill Level</div>
<div class="font-medium"><?= htmlspecialchars($job['skills_level']) ?></div>
</div>
</div>
</div>
@ -158,16 +203,20 @@ if (isset($_POST['remove']) && $is_employer) {
<?php if ($is_job_seeker): ?>
<form method="POST">
<button type="submit" name="apply" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Apply for Job
</button>
</form>
<?php else: ?>
<button class="btn btn-disabled" disabled>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
You must be a job seeker to apply
</button>
@ -176,16 +225,20 @@ if (isset($_POST['remove']) && $is_employer) {
<?php if ($is_employer): ?>
<form method="POST">
<button type="submit" name="remove" class="btn btn-error">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Remove Job Posting
</button>
</form>
<?php else: ?>
<button class="btn btn-disabled" disabled>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
You must be a Employer to remove
</button>
@ -197,8 +250,9 @@ if (isset($_POST['remove']) && $is_employer) {
</div>
</main>
<?php include 'footer.php';?>
<?php include 'footer.php'; ?>
</body>
</html>
<?php

@ -26,6 +26,7 @@ $sql = "SELECT
u.firstname,
u.lastname,
u.email,
js.skills,
u.phone
FROM applications a
JOIN job_postings j ON a.job_id = j.job_id
@ -105,6 +106,9 @@ if (isset($_POST['update_status']) && isset($_POST['application_id']) && isset($
<th class="text-base-content font-bold">
<i class="fas fa-address-card mr-2"></i>Contact
</th>
<th class="text-base-content font-bold">
<i class="fas fa-graduation-cap mr-2"></i>Skills
</th>
<th class="text-base-content font-bold">
<i class="fas fa-calendar mr-2"></i>Date
</th>
@ -141,6 +145,15 @@ if (isset($_POST['update_status']) && isset($_POST['application_id']) && isset($
<i class="fas fa-phone mr-2 text-gray-400"></i>
<?= htmlspecialchars($application['phone']) ?>
</div>
<div class="flex items-center text-sm">
<i class="fas fa-location-dot mr-2 text-gray-400"></i>
<?= htmlspecialchars($application['location']) ?>
</div>
</div>
</td>
<td>
<div class="font-medium">
<?= htmlspecialchars($application['skills']) ?>
</div>
</td>
<td>

@ -19,20 +19,26 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) {
$location = $_POST['location'];
$salary = $_POST['salary'];
$requirements = $_POST['requirements'];
$salary_type = $_POST['salary_type'];
$job_type = $_POST['job_type'];
$skills_level = $_POST['skills_level'];
// 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 (?, ?, ?, ?, ?, ?)"
"INSERT INTO job_postings (employer_id, job_title, job_description, location, salary, requirements,salary_type,job_type,skills_level )
VALUES (?, ?, ?, ?, ?, ?,?,?,?)"
);
$stmt->bind_param(
"isssss", // Define parameter types (string, string, string, string, string, string)
"issssssss", // Define parameter types (string, string, string, string, string, string)
$employer_id,
$job_title,
$job_description,
$location,
$salary,
$requirements
$requirements,
$salary_type,
$job_type,
$skills_level
);
$stmt->execute();
@ -49,6 +55,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) {
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -131,6 +138,52 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) {
class="input input-bordered w-full focus:input-primary" required />
</div>
<!-- salary type -->
<div class="form-control">
<label class="label">
<span class="label-text font-medium flex items-center">
<i class="fas fa-dollar-sign text-gray-400 mr-2"></i>
Salary type
</span>
</label>
<select class="select select-bordered w-full max-w-xs" name="salary_type" >
<option disabled selected >Select Range</option>
<option>Daily</option>
<option>Hourly</option>
</select>
</div>
<!-- job type -->
<div class="form-control">
<label class="label">
<span class="label-text font-medium flex items-center">
<i class="fa-solid fa-briefcase text-gray-400 mr-2"></i>
Job type
</span>
</label>
<select class="select select-bordered w-full max-w-xs" name="job_type" >
<option disabled selected>Select Type</option>
<option>childcare and petcare</option>
<option>cleaning and maintainence</option>
<option>delivery and logistics</option>
<option>Seasonal</option>
</select>
</div>
<!-- Skills level -->
<div class="form-control">
<label class="label">
<span class="label-text font-medium flex items-center">
<i class="fa-solid fa-graduation-cap text-gray-400 mr-2"></i>
skills level
</span>
</label>
<select class="select select-bordered w-full max-w-xs"name="skills_level">
<option disabled selected>Select Level</option>
<option>Entry Level</option>
<option>Intermediate</option>
<option>Experienced</option>
</select>
</div>
<!-- Requirements -->
<div class="form-control">
<label class="label">
@ -143,6 +196,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) {
class="textarea textarea-bordered h-32 focus:textarea-primary" required></textarea>
</div>
<!-- Submit Button -->
<div class="form-control mt-8">
<button type="submit" class="btn btn-primary">
@ -184,6 +240,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) {
<h3>${job.job_title}</h3>
<p><strong>Location:</strong> ${job.location}</p>
<p><strong>Salary:</strong> ${job.salary}</p>
<p><strong>Requirements:</strong> ${job.salary_type}</p>
<p><strong>Requirements:</strong> ${job.job_type}</p>
<p><strong>Requirements:</strong> ${job.skills_level}</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>

@ -71,6 +71,23 @@
</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 Type</div>
<div class="font-medium"><?= htmlspecialchars($job['salary_type']) ?></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">

Loading…
Cancel
Save