-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplied_jobs_controller.php
More file actions
61 lines (60 loc) · 1.48 KB
/
applied_jobs_controller.php
File metadata and controls
61 lines (60 loc) · 1.48 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
<?php
session_start();
require_once("includes/db_connect.php");
if (isset($_GET['action'])&& $_GET['action']!='') {
$action=$_GET['action'];
} else {
'';
}
switch ($action) {
case"add":
add_job();
break;
case"edit":
edit_data();
break;
case"delete":
delete_data();
break;
}
function add_job()
{
global $connection;
if(isset($_SESSION['seeker_id']))
{
$jid=$_GET['jid'];
$sid=$_GET['sid'];
$sql="SELECT file FROM resume WHERE s_id='$sid'";
$res=mysqli_query($connection,$sql);
$row=mysqli_num_rows($res);
{
if(!$row>0)
{
$_SESSION['errormsg']="First u Provide Resume Details";
header("Location:index.php");
}
}
$sql="SELECT * FROM applied_jobs WHERE job_id='$jid'AND s_id='$sid'";
$res=mysqli_query($connection,$sql);
$row=mysqli_num_rows($res);
if($row>0)
{
$_SESSION['errormsg']="Alraedy Applied for This Job";
header("Location:index.php");
}
else{
$sql="INSERT INTO `applied_jobs`(`job_id`, `s_id`) VALUES('$jid','$sid')";
$res=mysqli_query($connection,$sql);
if($res)
{
$_SESSION['successmsg']="Successfully Applied";
header("Location:index.php");
}
}
}
else
{
$_SESSION['errormsg']="First Login Please?";
header("Location:seeker_login.php");
}
}