-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_cv_data.php
55 lines (49 loc) · 1.48 KB
/
view_cv_data.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
<?php
//handle CORS policy error
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type");
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
exit();
}
include 'connection.php';
$request = $_GET['user_id'];
$query5 = "SELECT * FROM resume_user
WHERE resume_user.uid = '$request'";
$user_data = array();
$result = mysqli_query($conn, $query5);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$user_data[] = $row;
}
}
$query6 = "SELECT * FROM education
WHERE education.uid = $request";
$edu_data = array();
$result = mysqli_query($conn, $query6);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$edu_data[] = $row;
}
}
$query7 = "SELECT * FROM experience
WHERE experience.uid = $request";
$exp_data = array();
$result = mysqli_query($conn, $query7);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$exp_data[] = $row;
}
}
$query8 = "SELECT * FROM skills
WHERE skills.uid = $request";
$skill_data = array();
$result = mysqli_query($conn, $query8);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$skill_data[] = $row;
}
}
echo json_encode(array($user_data, $edu_data, $exp_data, $skill_data));
mysqli_close($conn);
?>