diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..7d154db --- /dev/null +++ b/.htaccess @@ -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] diff --git a/ManageJob.css b/ManageJob.css new file mode 100644 index 0000000..0cc08b1 --- /dev/null +++ b/ManageJob.css @@ -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; +} \ No newline at end of file diff --git a/Untitled-1.html b/Untitled-1.html deleted file mode 100644 index 4b91411..0000000 --- a/Untitled-1.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - PartTime Profession - Lets find your next part-time profession - - - -
- - -
- -
- -
- -

Featured Jobs

- - -

Job Categories

-
- -
- Dog Care -
- Dog Care Taker -
- -
- Elderly Care -
- Old Aged Care Taker -
-
- - - - diff --git a/YOLO b/YOLO deleted file mode 160000 index 4bdb85b..0000000 --- a/YOLO +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4bdb85bff7567151b15e51566ccf08447e97cd68 diff --git a/aboutus.css b/aboutus.css new file mode 100644 index 0000000..c35b88a --- /dev/null +++ b/aboutus.css @@ -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; +} diff --git a/aboutus.php b/aboutus.php new file mode 100644 index 0000000..0e424a1 --- /dev/null +++ b/aboutus.php @@ -0,0 +1,35 @@ + + + + + + About Us - Part-Time Job + + + + + +
+

Welcome to Temphire

+

+ 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. +

+

+ 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. +

+

Our Mission

+

+ 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. +

+

Why Choose Us?

+

+ - A wide variety of part-time job listings across multiple sectors.
+ - User-friendly platform for easy navigation and application.
+ - Tools to filter and customize your job search to find the perfect fit.
+ - Dedicated support to assist you every step of the way. +

+
+ + + + diff --git a/alljobs.php b/alljobs.php new file mode 100644 index 0000000..749b30f --- /dev/null +++ b/alljobs.php @@ -0,0 +1,115 @@ + + + + + + + All Jobs + + + + + + + +
+ + + +
+ prepare($sql); + $stmt->execute(); + $result = $stmt->get_result(); + + if ($result->num_rows > 0) { + while ($job = $result->fetch_assoc()) { + ?> +
+
+
+ +

+ +
+
+ + + +
+
Location
+
+
+
+ +
+ + + + +
+
Salary
+
+
+
+ +
+ + + +
+
Posted Date
+
+
+
+
+ +
+ + + View Details + +
+
+
+ No jobs available.

"; + } + $conn->close(); + ?> +
+
+ + + + + \ No newline at end of file diff --git a/connect.php b/connect.php new file mode 100644 index 0000000..d93e182 --- /dev/null +++ b/connect.php @@ -0,0 +1,12 @@ + connect_error) +{ + echo "failed connection".$conn->connect_error; +} + +?> \ No newline at end of file diff --git a/contactus.css b/contactus.css new file mode 100644 index 0000000..5f502d8 --- /dev/null +++ b/contactus.css @@ -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; + } + + \ No newline at end of file diff --git a/contactus.php b/contactus.php new file mode 100644 index 0000000..f4aae36 --- /dev/null +++ b/contactus.php @@ -0,0 +1,31 @@ + + + + + + Contact Us - Temphire + + + + + + +
+

Please provide the feed back about your problem

+
+ + + + + + + + + + +
+
+ + + + diff --git a/createAccount.css b/createAccount.css new file mode 100644 index 0000000..1939182 --- /dev/null +++ b/createAccount.css @@ -0,0 +1,8 @@ +form +{ + display: flex; + justify-content: center; + align-items: center; + padding: 60px; + +} \ No newline at end of file diff --git a/createAccount.php b/createAccount.php new file mode 100644 index 0000000..93f08c4 --- /dev/null +++ b/createAccount.php @@ -0,0 +1,77 @@ + + + + + + + Document + + + + + + + + + + +
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+ + +
+ + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + + +
+
+ + + + + \ No newline at end of file diff --git a/employe.css b/employe.css new file mode 100644 index 0000000..bd08c94 --- /dev/null +++ b/employe.css @@ -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; +} diff --git a/employerdash.php b/employerdash.php new file mode 100644 index 0000000..0864269 --- /dev/null +++ b/employerdash.php @@ -0,0 +1,47 @@ + + + + Employee Dashboard + + + + + + +
+
+ 📄 + Manage Job Applications +
+ + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/employerprofile.php b/employerprofile.php new file mode 100644 index 0000000..ac8cee4 --- /dev/null +++ b/employerprofile.php @@ -0,0 +1,84 @@ +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 +} +?> + + + + + + Update Profile + + + + +
+

Employer Profile

+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + +
+
+ + + \ No newline at end of file diff --git a/footer.css b/footer.css new file mode 100644 index 0000000..a36ec69 --- /dev/null +++ b/footer.css @@ -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; +} diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..cd8a1c0 --- /dev/null +++ b/footer.php @@ -0,0 +1,28 @@ + + + + + + Document + + + + + + \ No newline at end of file diff --git a/createAccount.html b/home.php similarity index 71% rename from createAccount.html rename to home.php index 0e37619..8404df9 100644 --- a/createAccount.html +++ b/home.php @@ -1,3 +1,8 @@ + + @@ -6,8 +11,6 @@ Document -
- -
+

logged in bruv

\ No newline at end of file diff --git a/index.css b/index.css new file mode 100644 index 0000000..8401fb2 --- /dev/null +++ b/index.css @@ -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); +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..2945642 --- /dev/null +++ b/index.php @@ -0,0 +1,77 @@ + + + + + + Temphire + + + + + +
+ Image +
+ +
+ +
+ +

Featured Jobs

+ + +

Job Categories

+
+ +
+ Dog Care Taker +
+ Dog Care Taker +
+ +
+ Elderly Care +
+ Old Aged Care Taker +
+ +
+ Cleaner +
+ Old Aged Care Taker +
+ +
+ Factory worker +
+ Old Aged Care Taker +
+
+ + + + + + + \ No newline at end of file diff --git a/job_applications.php b/job_applications.php new file mode 100644 index 0000000..2106c14 --- /dev/null +++ b/job_applications.php @@ -0,0 +1,138 @@ +prepare($sql); +$stmt->bind_param("i", $seeker_id); +$stmt->execute(); +$result = $stmt->get_result(); +?> + + + + + + + My Job Applications + + + + + + +
+ + + +
+

My Job Applications

+ + num_rows > 0): ?> +
+ + + + + + + + + + + + fetch_assoc()): ?> + + + + + + + + + +
Job TitleLocationSalaryApplication DateStatus
+
+ +
+
+ + + + + + + 'bg-yellow-100 text-yellow-800', + 'Accepted' => 'bg-green-100 text-green-800', + default => 'bg-red-100 text-red-800' + }; + ?> + + + +
+
+ +
+
+
+ + + +
+
+

+ You haven't applied to any jobs yet. +

+
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/job_details.php b/job_details.php new file mode 100644 index 0000000..ecfecb5 --- /dev/null +++ b/job_details.php @@ -0,0 +1,121 @@ + 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."; + } +} +?> + + + + + + + + Job Details + + + + + + + +
+ + + +
+

+

Location:

+

Salary:

+

Posted Date:

+
+

Job Description

+

+
+ + + +
+ +
+ + + + +
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + +close(); +?> diff --git a/jobseekerdash.css b/jobseekerdash.css new file mode 100644 index 0000000..47b655e --- /dev/null +++ b/jobseekerdash.css @@ -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; +} \ No newline at end of file diff --git a/jobseekerdash.php b/jobseekerdash.php new file mode 100644 index 0000000..ed3bf08 --- /dev/null +++ b/jobseekerdash.php @@ -0,0 +1,39 @@ + + + + Job Seekers Dashboard + + + + +
+
+ Dashboard +

HOME > DASHBOARD

+
+ +
+ + + + + \ No newline at end of file diff --git a/jobseekerprofile.css b/jobseekerprofile.css new file mode 100644 index 0000000..2e7c994 --- /dev/null +++ b/jobseekerprofile.css @@ -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; + } \ No newline at end of file diff --git a/jobseekerprofile.php b/jobseekerprofile.php new file mode 100644 index 0000000..a0988ac --- /dev/null +++ b/jobseekerprofile.php @@ -0,0 +1,114 @@ +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 +} +?> + + + + + + Update Profile + + + + +
+

Jobseeker Profile

+ +
+
+ Profile Picture + +
+
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+ + + \ No newline at end of file diff --git a/login.css b/login.css index b534d29..53bea4a 100644 --- a/login.css +++ b/login.css @@ -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 { - color: #fff; - margin-bottom: 20px; +.h-custom { +height: calc(100% - 73px); } - -input { - margin: 10px 0; - padding: 10px; - border-radius: 5px; - border: none; - width: 80%; +@media (max-width: 450px) { +.h-custom { +height: 100%; } - -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; +} \ No newline at end of file diff --git a/login.html b/login.html deleted file mode 100644 index f73cfb9..0000000 --- a/login.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Document - - - -
-

Login

-
-
-
-
-
-
-
-

Don't Have an account? Create an Account

-
-
-
- - diff --git a/login.php b/login.php new file mode 100644 index 0000000..8af6e61 --- /dev/null +++ b/login.php @@ -0,0 +1,62 @@ + + + + + + + Document + + + + + + + + + +
+
+
+
+
+ +
+ + +
+ + +
+ + +
+ +
+ +
+ + +
+ Forgot password? +
+ +
+ +

Don't have an account? Register

+
+
+
+
+
+ +
+ + + + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..168e11c --- /dev/null +++ b/logout.php @@ -0,0 +1,7 @@ + diff --git a/manage_applications.php b/manage_applications.php new file mode 100644 index 0000000..b5c697b --- /dev/null +++ b/manage_applications.php @@ -0,0 +1,187 @@ +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(); + } +} +?> + + + + + + + View Applications + + + + + + +
+ + +
+

Applications Received

+ + num_rows > 0): ?> +
+ + + + + + + + + + + + + fetch_assoc()): ?> + + + + + + + + + + +
Job TitleApplicant NameContactApplication DateStatusActions
+
+ +
+
+
+ +
+
+
+
Email:
+
Phone:
+
+
+ + + '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' + }; + ?> + + + + +
+ + + +
+
+
+ +
+
+
+ + + +
+
+

+ No applications have been received yet for your job postings. +

+
+
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/managejob.php b/managejob.php new file mode 100644 index 0000000..dbb45ba --- /dev/null +++ b/managejob.php @@ -0,0 +1,144 @@ +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 ""; + exit; + + } catch (Exception $e) { + // Return error response if an issue occurs + echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); + exit; + } +} +?> + + + + + + + + Manage Jobs + + + + + +
+
+
+ + + + + + +
+
+ +
+ + + + + + diff --git a/navbar.css b/navbar.css new file mode 100644 index 0000000..7f58121 --- /dev/null +++ b/navbar.css @@ -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; +} diff --git a/navbar.php b/navbar.php new file mode 100644 index 0000000..8d60d83 --- /dev/null +++ b/navbar.php @@ -0,0 +1,76 @@ + + + + + + + + + Document + + + + + + + + +
+ + +
+ + + diff --git a/pic/Cleaner.jpg b/pic/Cleaner.jpg new file mode 100644 index 0000000..dc6a840 Binary files /dev/null and b/pic/Cleaner.jpg differ diff --git a/pic/Factoryworker.jpg b/pic/Factoryworker.jpg new file mode 100644 index 0000000..8811226 Binary files /dev/null and b/pic/Factoryworker.jpg differ diff --git a/pic/Job seek.jpg b/pic/Job seek.jpg new file mode 100644 index 0000000..82a95e1 Binary files /dev/null and b/pic/Job seek.jpg differ diff --git a/pic/login.png b/pic/login.png new file mode 100644 index 0000000..8b1bf2d Binary files /dev/null and b/pic/login.png differ diff --git a/register.php b/register.php new file mode 100644 index 0000000..efef9a5 --- /dev/null +++ b/register.php @@ -0,0 +1,122 @@ +prepare($checkEmail); + $stmt->bind_param("s", $email); + $stmt->execute(); + $result = $stmt->get_result(); + + if ($result->num_rows > 0) { + echo ""; + 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 ""; + } 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 ""; + } 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."; + } +} +?> \ No newline at end of file diff --git a/updateemployeeprofile.php b/updateemployeeprofile.php new file mode 100644 index 0000000..5c0052d --- /dev/null +++ b/updateemployeeprofile.php @@ -0,0 +1,94 @@ +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(); + } +} +?> \ No newline at end of file diff --git a/updateprofile.php b/updateprofile.php new file mode 100644 index 0000000..f9e6cdb --- /dev/null +++ b/updateprofile.php @@ -0,0 +1,101 @@ +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(); + } +} +?> \ No newline at end of file diff --git a/viewjobs.php b/viewjobs.php new file mode 100644 index 0000000..85e64d9 --- /dev/null +++ b/viewjobs.php @@ -0,0 +1,109 @@ + + + + + + + All Jobs + + + + + + + +
+ + + +
+ 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()) { + ?> +
+
+
+ +

+ +
+
+ + + +
+
Location
+
+
+
+ +
+ + + + +
+
Salary
+
+
+
+ +
+ + + +
+
Posted Date
+
+
+
+
+ +
+ + + View Details + +
+
+
+ No jobs available.

"; + } + $conn->close(); + ?> +
+
+ + + + + \ No newline at end of file