-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathsearch.quick.fetch.php
More file actions
65 lines (58 loc) · 2.06 KB
/
search.quick.fetch.php
File metadata and controls
65 lines (58 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
//Including database connection files to the page.
require 'db.connect.php';
//Checking whether value of textbox does exist or not.
if(isset($_POST['quick_key']) && isset($_POST['quick_location']))
{
//Initializing variables with the user inputs.
$key = $_POST['quick_key'];
$location = $_POST['quick_location'];
//Checking whether value is empty or not in given textbox or not.
if(!empty($key) && !empty($location))
{
//Query which is going to execute to for database manipulation.
$query = "SELECT * FROM job_details WHERE location= '$location' OR key_skill LIKE '%$key%'";
$query_quick = mysql_query($query);
echo ' <table border="1">
<tr>
<td><center><b>Name</center></b></td>
<td><center><b>Profile</b></center></td>
<td><center><b>Key Skill</b></center></td>
<td><center><b>Location</b></center></td>
<td><center><b>CTC</b></center></td>
<td><center><b>More</b></center></td>
</tr>
</table>';
$query_rows_num = mysql_num_rows($query_quick);
if($query_rows_num > 0)
{
while($query_quick_result = mysql_fetch_array($query_quick))
{
echo ' <table border="1">
<tr>
<td><center>'.$query_quick_result['name'].'</center></td>
<td><center>'.$query_quick_result['profile'].'</center></td>
<td><center>'.$query_quick_result['key_skill'].'</center></td>
<td><center>'.$query_quick_result['location'].'</center></td>
<td><center>'.$query_quick_result['ctc'].'</center></td>
<td><center>';
echo '<a href="search.jobs.view.php" onClick="MyWindow=window.open('."'search.jobs.view.php?id="
.$query_quick_result['id']."', '_window');".'return false;">
Click for Details
</a>
</center></td>
</tr>';
echo' </table>';
}
}
else
{
echo '<script> alert("No result Found. Search with different keywords"); </script>';
}
}
else if(empty($key) || empty($location))
{
header('Location: index.php');
}
}
?>