Skip to content

Commit 45a6aaf

Browse files
committed
Add filters for the job and change home.php
1 parent 3807253 commit 45a6aaf

File tree

4 files changed

+41
-36
lines changed

4 files changed

+41
-36
lines changed

Code/Database/schema/srijas.sql

+2-30
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,6 @@ INSERT INTO `job_master` (`job_id`, `job_title`, `is_active`, `created_by`, `cre
6565

6666
-- --------------------------------------------------------
6767

68-
--
69-
-- Table structure for table `login_master`
70-
--
71-
72-
CREATE TABLE `login_master` (
73-
`login_id` int(11) NOT NULL,
74-
`user_id` int(11) NOT NULL
75-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
76-
77-
-- --------------------------------------------------------
78-
7968
--
8069
-- Table structure for table `resume_master`
8170
--
@@ -199,6 +188,8 @@ CREATE TABLE `user_master` (
199188
`user_lname` varchar(50) DEFAULT NULL,
200189
`user_email` varchar(50) NOT NULL,
201190
`user_password` varchar(20) NOT NULL,
191+
`user_location` varchar(20) DEFAULT NULL,
192+
`user_threshold` int(11) DEFAULT 100,
202193
`user_preferred_job_id` int(11) NOT NULL,
203194
`is_active` bit(1) NOT NULL,
204195
`created_by` int(11) NOT NULL,
@@ -238,13 +229,6 @@ CREATE TABLE `user_resume` (
238229
ALTER TABLE `job_master`
239230
ADD PRIMARY KEY (`job_id`);
240231

241-
--
242-
-- Indexes for table `login_master`
243-
--
244-
ALTER TABLE `login_master`
245-
ADD PRIMARY KEY (`login_id`),
246-
ADD KEY `login_master_user_fk` (`user_id`);
247-
248232
--
249233
-- Indexes for table `resume_master`
250234
--
@@ -291,12 +275,6 @@ ALTER TABLE `user_resume`
291275
ALTER TABLE `job_master`
292276
MODIFY `job_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
293277

294-
--
295-
-- AUTO_INCREMENT for table `login_master`
296-
--
297-
ALTER TABLE `login_master`
298-
MODIFY `login_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
299-
300278
--
301279
-- AUTO_INCREMENT for table `resume_master`
302280
--
@@ -331,12 +309,6 @@ ALTER TABLE `user_resume`
331309
-- Constraints for dumped tables
332310
--
333311

334-
--
335-
-- Constraints for table `login_master`
336-
--
337-
ALTER TABLE `login_master`
338-
ADD CONSTRAINT `login_master_user_fk` FOREIGN KEY (`user_id`) REFERENCES `user_master` (`user_id`);
339-
340312
--
341313
-- Constraints for table `resume_skills`
342314
--

Code/Web_app/home.php

+23-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,31 @@
1616
<html>
1717
<head></head>
1818
<body>
19-
<h1>Homepage</h1>
19+
<h1> Skills matched with the Job Description </h1>
20+
<?php
21+
$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;";
22+
$result = $conn->query($sql_query);
23+
24+
// var_dump($result)
25+
$len = $result->num_rows;
26+
if ($len > 0) {
27+
while($row = $result->fetch_assoc()) {
28+
echo $row["skill_title"];
29+
echo "<br>";
30+
}
31+
echo "<br>";
32+
}
33+
34+
echo "<br>";
35+
36+
37+
?>
2038
<form method='post' action="">
2139
<input type="submit" value="Logout" name="but_logout">
2240
</form>
41+
42+
<form method='post' action="">
43+
<input type="submit" value="Upload New Resume" name="new">
44+
</form>
2345
</body>
2446
</html>

Code/Web_app/index.php

+9
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@
8282
<input type="password" name="inputPassword" class="form-control" id="inputPassword" placeholder="Enter Password" required>
8383
</div>
8484

85+
<div class="form-group col-4">
86+
<label for="inputLocation">Location</label>
87+
<input type="text" name="inputLocation" class="form-control" id="inputLocation" placeholder="Enter Location">
88+
</div>
89+
90+
<div class="form-group col-4">
91+
<label for="inputThreshold">Threshold for Skill Matching</label>
92+
<input type="text" name="inputThreshold" class="form-control" id="inputThreshold" placeholder="Enter Threshold in percentage">
93+
</div>
8594

8695
<div class="col-auto my-1 col-4">
8796
<label for="inputJobTypeId">Type Of Job You Are Looking For: </label>

Code/Web_app/sendData.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* that indicate respectively whether the resume table code test cases
1414
* and the user table code test cases have passed. 1-> pass, 0-> fail
1515
*/
16-
function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $target_file){
16+
function executer($inputName, $inputEmail, $inputPassword, $inputLocation, $inputThreshold, $inputJobTypeId, $target_file){
1717
/**
1818
* Include the autoload.php file from the PdfParser application for
1919
* reading the text from the pdf.
@@ -132,10 +132,10 @@ function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $tar
132132
* This segment of the code uses a prepared statement to insert the form data
133133
* into the user_master table
134134
*/
135-
$stmt = $conn->prepare("INSERT INTO user_master (user_fname, user_lname, user_email, user_password, user_preferred_job_id, is_active, created_by)
136-
VALUES (?, ?, ?, ?, ?, ?, ?)");
135+
$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)
136+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
137137

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

@@ -335,6 +335,8 @@ function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $tar
335335
$inputEmail = $_POST["inputEmail"];
336336
$inputJobTypeId = $_POST["inputJobTypeId"];
337337
$inputPassword = $_POST["inputPassword"];
338+
$inputLocation = $_POST["inputLocation"];
339+
$inputThreshold = $_POST["inputThreshold"];
338340

339341

340342
$target_dir = "uploads/";
@@ -362,7 +364,7 @@ function executer($inputName, $inputEmail, $inputPassword, $inputJobTypeId, $tar
362364
}
363365

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

0 commit comments

Comments
 (0)