Compare commits

...

3 Commits

  1. 4
      contactus.php
  2. 6
      footer.php
  3. 2
      job_details.php
  4. 18
      jobseekerprofile.php
  5. 3
      register.php
  6. 7
      updateemployeeprofile.php
  7. 8
      updateprofile.php
  8. 34
      uploadfeedback.php

@ -16,7 +16,7 @@
<div class="card-body">
<h3 class="text-2xl font-bold text-center mb-4">Please provide the feedback about your problem</h3>
<form class="space-y-4">
<form class="space-y-4" method="POST" action="uploadfeedback.php" >
<div class="form-control">
<label class="label">
<span class="label-text">Your Name</span>
@ -39,7 +39,7 @@
</div>
<div class="form-control mt-6">
<button class="btn btn-primary">Send Message</button>
<button class="btn btn-primary" name="submit" >Send Message</button>
</div>
</form>
</div>

@ -10,12 +10,12 @@
<footer>
<div class="quicklinks ">
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact</a></li>
<li><a href="aboutus">About Us</a></li>
<li><a href="contactus">Contact</a></li>
<li><a href="#">Privacy Policy</a></li>
</ul>
<ul>
<li><a href="#">Jobs</a></li>
<li><a href="">Jobs</a></li>
<li><a href="#">Companies</a></li>
<li><a href="#">Support</a></li>
</ul>

@ -3,7 +3,7 @@ session_start();
// Check if the user is logged in
if (!isset($_SESSION['email'])) {
header("Location: login.php");
header("Location: login");
exit();
}
// Check if seeker_id exists in the session

@ -15,7 +15,7 @@ $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,
$query = "SELECT u.firstname, u.lastname, u.email, u.phone,u.username,
j.skills, j.experience, j.education, j.location
FROM users u
LEFT JOIN job_seekers j ON u.user_id = j.user_id
@ -101,13 +101,27 @@ if ($result->num_rows > 0) {
>
</div>
<!-- username -->
<div class="form-control">
<label class="label">
<span class="label-text">username</span>
</label>
<input
type="text"
name="username"
value="<?php echo isset($user['username']) ? htmlspecialchars($user['username']) : ''; ?>"
class="input input-bordered w-full"
required
>
</div>
<!-- Phone -->
<div class="form-control">
<label class="label">
<span class="label-text">Phone Number</span>
</label>
<input
type="tel"
type="number"
name="phone"
value="<?php echo isset($user['phone']) ? htmlspecialchars($user['phone']) : ''; ?>"
class="input input-bordered w-full"

@ -116,7 +116,8 @@ if (isset($_POST['Login'])) {
header("Location: index");
exit();
} else {
echo "Incorrect email or password.";
echo "<script>alert('Incorrect email or password.'); window.location.href = 'login';</script>";
exit();
}
}
?>

@ -18,7 +18,7 @@ if (isset($_POST['update'])) {
$username = trim($_POST['username']);
$address = trim($_POST['address']);
try {
$conn->begin_transaction();
@ -32,6 +32,7 @@ if (isset($_POST['update'])) {
}
$stmt_users->bind_param("sssssi", $first_name, $last_name, $email, $phone, $username,$user_id);
if (!$stmt_users->execute()) {
throw new Exception("Error updating users table: " . $stmt_users->error);
}
@ -75,8 +76,8 @@ if (isset($_POST['update'])) {
}
$conn->commit();
$_SESSION['success_message'] = "Profile updated successfully!";
header("Location: employerprofile");
echo "<script>alert('Profile updated successfully! Relogin to see the changes'); window.location.href = 'login';</script>";
exit();
} catch (Exception $e) {

@ -14,6 +14,7 @@ if (isset($_POST['update'])) {
$first_name = trim($_POST['first_name']);
$last_name = trim($_POST['last_name']);
$email = trim($_POST['email']);
$username = trim($_POST['username']);
$phone = trim($_POST['phone']);
$skills = trim($_POST['skills']);
$experience = trim($_POST['experience']);
@ -25,13 +26,13 @@ if (isset($_POST['update'])) {
// 1. First update the users table
$query_users = "UPDATE users
SET firstname = ?, lastname = ?, email = ?, phone = ?
SET firstname = ?, lastname = ?, email = ?, phone = ? ,username =?
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);
$stmt_users->bind_param("sssssi", $first_name, $last_name, $email, $phone,$username, $user_id);
if (!$stmt_users->execute()) {
throw new Exception("Error updating users table: " . $stmt_users->error);
@ -81,8 +82,7 @@ if (isset($_POST['update'])) {
}
$conn->commit();
$_SESSION['success_message'] = "Profile updated successfully!";
header("Location: jobseekerprofile.php");
echo "<script>alert('Profile updated successfully! relogin to see the changes'); window.location.href = 'login';</script>";
exit();
} catch (Exception $e) {

@ -0,0 +1,34 @@
<?php
session_start();
include 'connect.php';
if(!isset($_SESSION['email'])){
header("Location: login");
exit();
}
$user_id = $_SESSION['user_id'];
if(isset($_POST['submit'])){
$username = trim($_POST['name']);
$email = trim($_POST['email']);
$feedback = trim($_POST['message']);
$stmt = $conn->prepare(
"INSERT INTO feedback (user_id,name,email,feedback)
VALUES (?, ?, ?, ?)"
);
$stmt->bind_param(
"isss",
$user_id,
$username,
$email,
$feedback
);
$stmt -> execute();
echo "<script>alert('feedback posted successfully!'); window.location.href = 'index';</script>";
exit;
}
?>
Loading…
Cancel
Save