-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathresume.review.php
79 lines (69 loc) · 2.18 KB
/
resume.review.php
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
ob_start();
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/search.view.css" type="text/css" />
</head>
<?php
$conn = mysql_connect('localhost', 'root', '');
$db = mysql_select_db('jobsportal', $conn);
if($conn == false){ echo mysql_errno($conn).":".mysql_error($conn)."\n"; }
if($db == false){ echo mysql_errno($conn).":".mysql_error($conn)."\n"; }
?>
<body>
<div style="margin-left:45%">
<b><font color="#FFFFFF">Upload New Resume</font></b>
</div>
<div id="body_struct" style="margin-top: 1.5%">
<?php
$id = $_SESSION['SEEK_ID'];
$query = "SELECT resume FROM seeker_details WHERE id='$id'";
$query_run = mysql_query($query);
$file = mysql_result($query_run, 0, 'resume');
$handle = fopen($file, 'r');
$read = file($file);
foreach($read as $fname)
{
echo $fname.'<br />';
}
fclose($handle);
?>
</div id="body_struct">
<div style="margin-left: 9.7%">
<form action="resume.review.php" method="post" enctype="multipart/form-data">
<input type="file" name="new_resume" value="file" />
<input type="submit" name="upload_new_resume" value="Save" / style="margin-left: 65%; -webkit-border-radius: 8px; font-size: 15px;">
</form>
</div>
</body>
<?php
if(isset($_POST['upload_new_resume']))
{
if(isset($_FILES['new_resume']))
{
if(!empty($_FILES['new_resume']))
{
$filename = $_FILES['new_resume']['name'];
$new_filename = $db_id.'_'.$filename;
$folder = 'upload/seeker_resume/';
$format = substr($filename, strpos($filename, '.') + 1);
$upload_cv = $folder.$db_id.'_'.$filename;
if($format == doc || $format == docx)
{
move_uploaded_file($_FILES['new_resume']['tmp_name'], $folder.$new_filename);
$query = "UPDATE seeker_details SET resume='$upload_cv' WHERE id='$id'";
$query_run = mysql_query($query);
}
else
{
echo '<script> alert("File not supported. Select only document file ie .doc or .docx"); </script>';
}
}
}
}
?>
</html>