|
|
@ -19,24 +19,30 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
$location = $_POST['location']; |
|
|
|
$location = $_POST['location']; |
|
|
|
$salary = $_POST['salary']; |
|
|
|
$salary = $_POST['salary']; |
|
|
|
$requirements = $_POST['requirements']; |
|
|
|
$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 |
|
|
|
// Prepare the SQL query to insert job data into job_postings table |
|
|
|
$stmt = $conn->prepare( |
|
|
|
$stmt = $conn->prepare( |
|
|
|
"INSERT INTO job_postings (employer_id, job_title, job_description, location, salary, requirements) |
|
|
|
"INSERT INTO job_postings (employer_id, job_title, job_description, location, salary, requirements,salary_type,job_type,skills_level ) |
|
|
|
VALUES (?, ?, ?, ?, ?, ?)" |
|
|
|
VALUES (?, ?, ?, ?, ?, ?,?,?,?)" |
|
|
|
); |
|
|
|
); |
|
|
|
$stmt->bind_param( |
|
|
|
$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, |
|
|
|
$employer_id, |
|
|
|
$job_title, |
|
|
|
$job_title, |
|
|
|
$job_description, |
|
|
|
$job_description, |
|
|
|
$location, |
|
|
|
$location, |
|
|
|
$salary, |
|
|
|
$salary, |
|
|
|
$requirements |
|
|
|
$requirements, |
|
|
|
|
|
|
|
$salary_type, |
|
|
|
|
|
|
|
$job_type, |
|
|
|
|
|
|
|
$skills_level |
|
|
|
); |
|
|
|
); |
|
|
|
$stmt->execute(); |
|
|
|
$stmt->execute(); |
|
|
|
|
|
|
|
|
|
|
|
echo "<script>alert('Job posted successfully!'); window.location.href = 'employerdash';</script>"; |
|
|
|
echo "<script>alert('Job posted successfully!'); window.location.href = 'employerdash';</script>"; |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception $e) { |
|
|
|
} catch (Exception $e) { |
|
|
@ -49,6 +55,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html> |
|
|
|
<!DOCTYPE html> |
|
|
|
<html lang="en" data-theme="light"> |
|
|
|
<html lang="en" data-theme="light"> |
|
|
|
|
|
|
|
|
|
|
|
<head> |
|
|
|
<head> |
|
|
|
<meta charset="UTF-8"> |
|
|
|
<meta charset="UTF-8"> |
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
@ -66,8 +73,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
<div class="text-sm breadcrumbs mb-6"> |
|
|
|
<div class="text-sm breadcrumbs mb-6"> |
|
|
|
<ul class="flex items-center space-x-2"> |
|
|
|
<ul class="flex items-center space-x-2"> |
|
|
|
<li><a href="index.php" class="flex items-center text-gray-600 hover:text-primary"> |
|
|
|
<li><a href="index.php" class="flex items-center text-gray-600 hover:text-primary"> |
|
|
|
<i class="fas fa-home mr-2"></i> Home |
|
|
|
<i class="fas fa-home mr-2"></i> Home |
|
|
|
</a></li> |
|
|
|
</a></li> |
|
|
|
<li class="flex items-center text-primary"> |
|
|
|
<li class="flex items-center text-primary"> |
|
|
|
<i class="fas fa-plus-circle mr-2"></i> Post a New Job |
|
|
|
<i class="fas fa-plus-circle mr-2"></i> Post a New Job |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -91,8 +98,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
Job Title |
|
|
|
Job Title |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<input type="text" name="job_title" placeholder="Enter job title" |
|
|
|
<input type="text" name="job_title" placeholder="Enter job title" |
|
|
|
class="input input-bordered w-full focus:input-primary" required /> |
|
|
|
class="input input-bordered w-full focus:input-primary" required /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Job Description --> |
|
|
|
<!-- Job Description --> |
|
|
@ -103,8 +110,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
Job Description |
|
|
|
Job Description |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<textarea name="job_description" placeholder="Enter detailed job description" |
|
|
|
<textarea name="job_description" placeholder="Enter detailed job description" |
|
|
|
class="textarea textarea-bordered h-32 focus:textarea-primary" required></textarea> |
|
|
|
class="textarea textarea-bordered h-32 focus:textarea-primary" required></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Location --> |
|
|
|
<!-- Location --> |
|
|
@ -115,8 +122,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
Location |
|
|
|
Location |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<input type="text" name="location" placeholder="Enter job location" |
|
|
|
<input type="text" name="location" placeholder="Enter job location" |
|
|
|
class="input input-bordered w-full focus:input-primary" required /> |
|
|
|
class="input input-bordered w-full focus:input-primary" required /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Salary --> |
|
|
|
<!-- Salary --> |
|
|
@ -127,8 +134,54 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
Salary |
|
|
|
Salary |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<input type="text" name="salary" placeholder="Enter salary range or fixed amount" |
|
|
|
<input type="text" name="salary" placeholder="Enter salary range or fixed amount" |
|
|
|
class="input input-bordered w-full focus:input-primary" required /> |
|
|
|
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> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Requirements --> |
|
|
|
<!-- Requirements --> |
|
|
@ -139,10 +192,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
Requirements |
|
|
|
Requirements |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<textarea name="requirements" placeholder="Enter job requirements" |
|
|
|
<textarea name="requirements" placeholder="Enter job requirements" |
|
|
|
class="textarea textarea-bordered h-32 focus:textarea-primary" required></textarea> |
|
|
|
class="textarea textarea-bordered h-32 focus:textarea-primary" required></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Submit Button --> |
|
|
|
<!-- Submit Button --> |
|
|
|
<div class="form-control mt-8"> |
|
|
|
<div class="form-control mt-8"> |
|
|
|
<button type="submit" class="btn btn-primary"> |
|
|
|
<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> |
|
|
|
<h3>${job.job_title}</h3> |
|
|
|
<p><strong>Location:</strong> ${job.location}</p> |
|
|
|
<p><strong>Location:</strong> ${job.location}</p> |
|
|
|
<p><strong>Salary:</strong> ${job.salary}</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>Requirements:</strong> ${job.requirements}</p> |
|
|
|
<p><strong>Posted Date:</strong> ${new Date(job.posted_date).toLocaleDateString()}</p> |
|
|
|
<p><strong>Posted Date:</strong> ${new Date(job.posted_date).toLocaleDateString()}</p> |
|
|
|
<p>${job.job_description}</p> |
|
|
|
<p>${job.job_description}</p> |
|
|
@ -225,4 +284,4 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['job_title'])) { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</body> |
|
|
|
|
|
|
|
|
|
|
|
</html> |
|
|
|
</html> |