-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.php
129 lines (108 loc) · 3.83 KB
/
create.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
include 'inc/package.php';
include 'inc/classes/concept.php';
define('PAGE_TITLE', 'Create');
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$additionalCSS = ['create'];
// $additionalJS = ['create.js'];
// General Data
$personalData = array(
['Persoonlijke informatie', false],
'firstName' => ['Voornaam', 'text', true],
'lastName' => ['Achternaam', 'text', true],
'completeName' => ['Naam, volledig', 'text', true],
'maritalStatus' => ['Burgerlijke staat', 'select', true, ['Ongehuwd', 'Gehuwd']],
'gender' => ['Geslacht', 'select', true, ['Man', 'Vrouw']],
'address_street' => ['Straat, huisnummer', 'text', false],
'address_zip' => ['Postcode, stad', 'text', false],
'telphone_land' => ['Vaste telefoon', 'text', false],
'telphone_mob' => ['Mobiel', 'text', false],
'dob' => ['Geboortedatum', 'text', true],
'cityob' => ['Geboorteplaats', 'text', true],
'email' => ['Email', 'text', true]
);
$educationData = array(
['Opleidingen', true],
'education_school' => ['School', 'text', false],
'education_education' => ['Opleiding', 'text', false],
'education_from' => ['Van', 'text', false],
'education_to' => ['Tot', 'text', false]
);
$workExperienceData = array(
['Werkervaring', true],
'work_company' => ['Bedrijf', 'text', false],
'work_function' => ['Functie', 'text', false],
'work_tasks' => ['Taken', 'textarea', false],
'work_from' => ['Van', 'text', false],
'work_to' => ['Tot', 'text', false]
);
$linguarData = array(
['Taalkennis', true],
'language' => ['Taal', 'text', false],
'languageSkill' => ['Behendigheid', 'range', false]
);
$computerData = array(
['Programmas', true],
'program' => ['Programma', 'text', false],
'programSkill' => ['Behendigheid', 'range', false]
);
$drivingData = array(
['Rijbewijs', true],
'license' => ['Rijbewijs', 'select', false,['A', 'A1', 'A2', 'AM', 'B', 'BE', 'C', 'CE', 'C1', 'C1E', 'D', 'DE', 'D1', 'D1E', 'T']]
);
// Sector specific
$sectorProgramming = array(
['Programmeertalen', true],
'programmingLanguage' => ['Programmeertaal', 'text', false],
'programmingSkill' => ['Behendigheid', 'range', false]
);
$sectorProjects = array(
['Projecten', true],
'project' => ['Projectnaam', 'text', false],
'description' => ['Omschrijving', 'textarea', false],
'link' => ['Link', 'text', false]
);
//Default form elements
$form = [$personalData, $educationData, $workExperienceData, $linguarData, $computerData, $drivingData];
if(isset($_POST['startform-sector'])) {
switch ($_POST['startform-sector']) {
case '9':
array_push($form, $sectorProgramming, $sectorProjects);
break;
default:
# code...
break;
}
$formSet = true;
}
//Handling the form on index.php
//Save CV input
if(isset($_POST['saveCV'])) {
if(isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] == true) {
if(isset($_SESSION['username']) && isset($_SESSION['id'])){
$concept = new Concept(true, $_POST, $_SESSION['username'], $_SESSION['id']);
header('Location: /profile.php');
}
} else {
echo "You're nog logged in";
}
}
$view = 'views/create.php';
include $template;
if (isset($_POST['submitCV'])) {
if (isset($_POST['startform-firstname'])) {
echo "<script>$('#firstName').val('".$_POST['startform-firstname']."')</script>";
}
if (isset($_POST['startform-lastname'])) {
echo "<script>$('#lastName').val('".$_POST['startform-lastname']."')</script>";
}
if (isset($_POST['startform-dob'])) {
echo "<script>$('#dob').val('".$_POST['startform-dob']."')</script>";
}
if (isset($_POST['startform-email'])) {
echo "<script>$('#email').val('".$_POST['startform-email']."')</script>";
}
}
?>