Skip to content

Commit

Permalink
Add filters for the job and change home.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hvudeshi committed Nov 3, 2021
1 parent 3807253 commit 45a6aaf
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 36 deletions.
32 changes: 2 additions & 30 deletions Code/Database/schema/srijas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ INSERT INTO `job_master` (`job_id`, `job_title`, `is_active`, `created_by`, `cre

-- --------------------------------------------------------

--
-- Table structure for table `login_master`
--

CREATE TABLE `login_master` (
`login_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

--
-- Table structure for table `resume_master`
--
Expand Down Expand Up @@ -199,6 +188,8 @@ CREATE TABLE `user_master` (
`user_lname` varchar(50) DEFAULT NULL,
`user_email` varchar(50) NOT NULL,
`user_password` varchar(20) NOT NULL,
`user_location` varchar(20) DEFAULT NULL,
`user_threshold` int(11) DEFAULT 100,
`user_preferred_job_id` int(11) NOT NULL,
`is_active` bit(1) NOT NULL,
`created_by` int(11) NOT NULL,
Expand Down Expand Up @@ -238,13 +229,6 @@ CREATE TABLE `user_resume` (
ALTER TABLE `job_master`
ADD PRIMARY KEY (`job_id`);

--
-- Indexes for table `login_master`
--
ALTER TABLE `login_master`
ADD PRIMARY KEY (`login_id`),
ADD KEY `login_master_user_fk` (`user_id`);

--
-- Indexes for table `resume_master`
--
Expand Down Expand Up @@ -291,12 +275,6 @@ ALTER TABLE `user_resume`
ALTER TABLE `job_master`
MODIFY `job_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `login_master`
--
ALTER TABLE `login_master`
MODIFY `login_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `resume_master`
--
Expand Down Expand Up @@ -331,12 +309,6 @@ ALTER TABLE `user_resume`
-- Constraints for dumped tables
--

--
-- Constraints for table `login_master`
--
ALTER TABLE `login_master`
ADD CONSTRAINT `login_master_user_fk` FOREIGN KEY (`user_id`) REFERENCES `user_master` (`user_id`);

--
-- Constraints for table `resume_skills`
--
Expand Down
24 changes: 23 additions & 1 deletion Code/Web_app/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,31 @@
<html>
<head></head>
<body>
<h1>Homepage</h1>
<h1> Skills matched with the Job Description </h1>
<?php
$sql_query = "select DISTINCT skill_master.skill_title FROM skill_master INNER JOIN resume_skills on skill_master.skill_id = resume_skills.skill_id INNER JOIN resume_master on resume_master.resume_id = resume_skills.resume_id INNER JOIN user_resume on user_resume.resume_id = resume_master.resume_id INNER JOIN user_master on user_master.user_id = user_resume.user_id;";
$result = $conn->query($sql_query);

// var_dump($result)
$len = $result->num_rows;
if ($len > 0) {
while($row = $result->fetch_assoc()) {
echo $row["skill_title"];
echo "<br>";
}
echo "<br>";
}

echo "<br>";


?>
<form method='post' action="">
<input type="submit" value="Logout" name="but_logout">
</form>

<form method='post' action="">
<input type="submit" value="Upload New Resume" name="new">
</form>
</body>
</html>
9 changes: 9 additions & 0 deletions Code/Web_app/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
<input type="password" name="inputPassword" class="form-control" id="inputPassword" placeholder="Enter Password" required>
</div>

<div class="form-group col-4">
<label for="inputLocation">Location</label>
<input type="text" name="inputLocation" class="form-control" id="inputLocation" placeholder="Enter Location">
</div>

<div class="form-group col-4">
<label for="inputThreshold">Threshold for Skill Matching</label>
<input type="text" name="inputThreshold" class="form-control" id="inputThreshold" placeholder="Enter Threshold in percentage">
</div>

<div class="col-auto my-1 col-4">
<label for="inputJobTypeId">Type Of Job You Are Looking For: </label>
Expand Down
12 changes: 7 additions & 5 deletions Code/Web_app/sendData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* that indicate respectively whether the resume table code test cases
* and the user table code test cases have passed. 1-> pass, 0-> fail
*/
function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $target_file){
function executer($inputName, $inputEmail, $inputPassword, $inputLocation, $inputThreshold, $inputJobTypeId, $target_file){
/**
* Include the autoload.php file from the PdfParser application for
* reading the text from the pdf.
Expand Down Expand Up @@ -132,10 +132,10 @@ function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $tar
* This segment of the code uses a prepared statement to insert the form data
* into the user_master table
*/
$stmt = $conn->prepare("INSERT INTO user_master (user_fname, user_lname, user_email, user_password, user_preferred_job_id, is_active, created_by)
VALUES (?, ?, ?, ?, ?, ?, ?)");
$stmt = $conn->prepare("INSERT INTO user_master (user_fname, user_lname, user_email, user_password, user_location, user_threshold, user_preferred_job_id, is_active, created_by)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");

$stmt->bind_param("ssssiii", $firstName, $lastName, $inputEmail, $inputPassword, $inputJobTypeId, $active, $created_by);
$stmt->bind_param("sssssiiii", $firstName, $lastName, $inputEmail, $inputPassword, $inputJobTypeId, $active, $created_by);
$stmt->execute();
$stmt->close();

Expand Down Expand Up @@ -335,6 +335,8 @@ function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $tar
$inputEmail = $_POST["inputEmail"];
$inputJobTypeId = $_POST["inputJobTypeId"];
$inputPassword = $_POST["inputPassword"];
$inputLocation = $_POST["inputLocation"];
$inputThreshold = $_POST["inputThreshold"];


$target_dir = "uploads/";
Expand Down Expand Up @@ -362,7 +364,7 @@ function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $tar
}

try{
executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $target_file);
executer($inputName, $inputEmail, $inputPassword, $inputLocation, $inputThreshold, $inputJobTypeId, $target_file);
}catch(Exception $e){
echo "Code did not execute - caught exception in function call->function executer: ".$e->getMessage()."<br>";
}
Expand Down

0 comments on commit 45a6aaf

Please sign in to comment.