-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcvEdit.php
More file actions
352 lines (320 loc) · 22.9 KB
/
Copy pathcvEdit.php
File metadata and controls
352 lines (320 loc) · 22.9 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<?php !defined("index") ? header("location: demo") : null ?>
<?php
if(@$_GET['content']){
$findCV = $data->prepare("SELECT * FROM users where submission_id=?");
$findCV->execute(array($_GET['content']));
$fetchCV = $findCV->fetch();
if($findCV->rowCount()){
if($fetchCV['username'] == $_SESSION['user']){
$findUser = $data->prepare("SELECT * FROM members where username=? limit 1");
$findUser->execute(array($fetchCV['username']));
$fetchUser = $findUser->fetch();
?>
<div class="container-lg">
<form class="cvCreateForm" action="" method="post" enctype="multipart/form-data">
<h1 class="form-title">Edit Your CV</h1>
<p class="form-exp">Edit and save the registered CV information as you wish!</p>
<div class="grid">
<div class="inputBox">
<div class="fileUplaodContainer" onclick="defaultBtnActive()">
<div class="fileUplaodWrapper">
<div class="fileImage">
<img src="<?= $siteUrl . $fetchCV['profile'] ?>" alt="">
</div>
<div class="fileUploadContent">
<div class="uploadIcon">
<i class="bi bi-cloud-upload"></i>
</div>
<div class="uploadText">
Choose your new profile from device
</div>
</div>
<div id="canselBtn">
<i class="bi bi-x"></i>
</div>
<div class="fileName">
</div>
</div>
<input id="default-btn" name="profile" type="file" accept="image/png, image/jpeg" hidden>
</div>
</div>
<div class="inputBox">
<div class="fileUplaodWrapper">
<div class="fileImage">
<img style="display: block" src="<?= $siteUrl . $fetchCV['profile'] ?>" alt="">
</div>
</div>
</div>
</div>
<div class="grid">
<div class="inputBox">
<label for="">Name and Surname <span title="required">*</span></label>
<input type="text" name="name" placeholder="Name and Surname" required maxlength="100" value="<?= $fetchCV['name']; ?>">
</div>
<div class="inputBox">
<label for="">Job Role <span title="required">*</span></label>
<input type="text" name="jobRole" placeholder="Job Role" required maxlength="100" value="<?= $fetchCV['jobRole']; ?>">
</div>
<div class="inputBox">
<label for="">Phone Number <span title="required">*</span></label>
<input type="phone" name="phoneNumber" placeholder="05396.." maxlength="11" required value="<?= $fetchCV['phoneNumber']; ?>">
</div>
<div class="inputBox">
<label for="">Address <span title="required">*</span></label>
<input type="text" name="address" placeholder="City/Town" required maxlength="100" value="<?= $fetchCV['address']; ?>">
</div>
<div class="inputBox">
<label for="">Email <span title="required">*</span></label>
<input type="email" name="email" placeholder="[email protected]" required maxlength="100" value="<?= $fetchCV['email']; ?>">
</div>
<div class="inputBox">
<label for="">Web Site </label>
<input type="text" name="webSite" placeholder="namesurname.com" maxlength="100" value="<?= $fetchCV['webSite']; ?>">
</div>
</div>
<div class="grid">
<?php
foreach ($socialMedia as $key => $value) {
?>
<div class="inputBox">
<label for=""><?= $value ?></label>
<input type="text" name="socialMedia[]" id="<?= $value ?>-input" placeholder="<?= $value ?> username" maxlength="50" value="<?= $fetchCV[$value]; ?>">
</div>
<?php
}
?>
</div>
<div class="inputBox">
<label for="">About <span title="required">*</span></label>
<textarea name="about" cols="30" rows="5" placeholder="About yourself.." required><?= $fetchCV['about']; ?></textarea>
</div>
<div class="inputBox" id="experiencesArea">
<label for="">Experiences <span title="required">*</span></label>
<?php
$allExperiences = $data->prepare("SELECT * FROM experiences where submission_id=?");
$allExperiences->execute(array($fetchCV['submission_id']));
$fetchAllExp = $allExperiences->fetchAll(PDO::FETCH_ASSOC);
if($allExperiences->rowCount()){
foreach($fetchAllExp as $key => $writeDatas){
$key != 0 ? $firstText = '<div class="deleteBoxIcon"><i class="bi bi-trash"></i></div>' : $firstText = "";
?>
<div class="expBox ">
<?= $firstText ?>
<div class="grid_four">
<div class="inputBox">
<span class="small-label">Job Role</span>
<input type="text" name="expJobRole[]" placeholder="Job Role" required value="<?= $writeDatas['expJobRole'] ?>">
</div>
<div class="inputBox">
<span class="small-label">Company Name</span>
<input type="text" name="expCompanyName[]" placeholder="Company Name" required value="<?= $writeDatas['expCompanyName'] ?>">
</div>
<div class="inputBox">
<span class="small-label">Start Year</span>
<input type="text" name="expStartingYear[]" maxlength="4" placeholder="2014" required value="<?= $writeDatas['expStartingYear'] ?>">
</div>
<div class="inputBox">
<span class="small-label">End Year</span>
<input type="text" name="expEndingYear[]" maxlength="10" placeholder="2018" required value="<?= $writeDatas['expEndingYear'] ?>">
</div>
</div>
<div class="inputBox">
<span class="small-label">Job Description</span>
<textarea name="expJobDescription[]" cols="30" rows="1" placeholder="Describe your job.." required><?= $writeDatas['expJobDescription'] ?></textarea>
</div>
</div>
<?php
}
}
?>
</div>
<div class="inputBox">
<div onclick="createNewExp()" class="CreateElemetBtn"><i class="bi bi-plus-circle"></i> Add New Experience</div>
</div>
<div class="inputBox" id="educationsArea">
<label for="">Educations <span title="required">*</span></label>
<?php
$allEducations = $data->prepare("SELECT * FROM educations where submission_id=?");
$allEducations->execute(array($fetchCV['submission_id']));
$fetchAllEdu = $allEducations->fetchAll(PDO::FETCH_ASSOC);
if($allEducations->rowCount()){
foreach($fetchAllEdu as $key => $writeDatas){
$key != 0 ? $firstText = '<div class="deleteBoxIcon"><i class="bi bi-trash"></i></div>' : $firstText = "";
?>
<div class="expBox ">
<?= $firstText ?>
<div class="grid_three">
<div class="inputBox">
<span class="small-label">School</span>
<input type="text" name="eduSchool[]" placeholder="School Name" required value="<?= $writeDatas['eduSchool'] ?>">
</div>
<div class="inputBox">
<span class="small-label">Start Year</span>
<input type="text" name="eduStartingYear[]" maxlength="4" placeholder="2014" required value="<?= $writeDatas['eduStartingYear'] ?>">
</div>
<div class="inputBox">
<span class="small-label">End Year</span>
<input type="text" name="eduEndingYear[]" maxlength="10" placeholder="2018" required value="<?= $writeDatas['eduEndingYear'] ?>">
</div>
</div>
</div>
<?php
}
}
?>
</div>
<div class="inputBox">
<div onclick="createNewEdu()" class="CreateElemetBtn"><i class="bi bi-plus-circle"></i> Add New Education</div>
</div>
<div class="grid">
<div>
<div class="inputBox" id="skillsArea">
<label for="">Skills <span title="required">*</span></label>
<?php
$allSkills = $data->prepare("SELECT * FROM skills where submission_id=?");
$allSkills->execute(array($fetchCV['submission_id']));
$fetchAllSkill = $allSkills->fetchAll(PDO::FETCH_ASSOC);
if($allSkills->rowCount()){
foreach($fetchAllSkill as $key => $writeDatas){
$key != 0 ? $firstText = '<div class="deleteBoxIcon"><i class="bi bi-trash"></i></div>' : $firstText = "";
?>
<div class="expBox ">
<?= $firstText ?>
<div class="gridBox">
<div class="inputBox">
<span class="small-label">Skill</span>
<input type="text" name="skillName[]" maxlength="75" placeholder="Your Skill" required value="<?= $writeDatas['skillName'] ?>">
</div>
<div class="inputBox">
<span class="small-label">Level</span>
<input type="number" name="skillLevel[]" min="0" max="100" placeholder="82" required value="<?= $writeDatas['skillLevel'] ?>">
</div>
</div>
</div>
<?php
}
}
?>
</div>
<div class="inputBox">
<div onclick="createNewLevelList('skillsArea','Skill','skill','Your Skill')" class="CreateElemetBtn"><i class="bi bi-plus-circle"></i> Add New Skill</div>
</div>
</div>
<div>
<div class="inputBox" id="languagesArea">
<label for="">Languages <span title="required">*</span></label>
<?php
$allLangs = $data->prepare("SELECT * FROM languages where submission_id=?");
$allLangs->execute(array($fetchCV['submission_id']));
$fetchAllLang = $allLangs->fetchAll(PDO::FETCH_ASSOC);
if($allLangs->rowCount()){
foreach($fetchAllLang as $key => $writeDatas){
$key != 0 ? $firstText = '<div class="deleteBoxIcon"><i class="bi bi-trash"></i></div>' : $firstText = "";
?>
<div class="expBox ">
<?= $firstText ?>
<div class="gridBox">
<div class="inputBox">
<span class="small-label">Language</span>
<input type="text" name="langName[]" placeholder="Language" required value="<?= $writeDatas['langName'] ?>">
</div>
<div class="inputBox">
<span class="small-label">Level</span>
<input type="number" name="langLevel[]" min="0" max="100" placeholder="82" required value="<?= $writeDatas['langLevel'] ?>">
</div>
</div>
</div>
<?php
}
}
?>
</div>
<div class="inputBox">
<div onclick="createNewLevelList('languagesArea','Language','lang','Language')" class="CreateElemetBtn"><i class="bi bi-plus-circle"></i> Add New Language</div>
</div>
</div>
</div>
<div class="grid">
<div>
<div class="inputBox" id="certificationsArea">
<label for="">Certificates (optional)</label>
<?php
$allCertificates = $data->prepare("SELECT * FROM certificates where submission_id=?");
$allCertificates->execute(array($fetchCV['submission_id']));
$fetchAllCertifica = $allCertificates->fetchAll(PDO::FETCH_ASSOC);
if($allCertificates->rowCount()){
foreach($fetchAllCertifica as $key => $writeDatas){
?>
<div class="expBox ">
<div class="deleteBoxIcon"><i class="bi bi-trash"></i></div>
<div class="grid_none">
<div class="inputBox">
<span class="small-label">Certifica</span>
<input type="text" name="certificaName[]" maxlength="100" placeholder="Certifica Title" value="<?= $writeDatas['certificaName'] ?>">
</div>
</div>
</div>
<?php
}
}
?>
</div>
<div class="inputBox">
<div onclick="createNewCertifica()" class="CreateElemetBtn"><i class="bi bi-plus-circle"></i> Add New Certifica</div>
</div>
</div>
<div>
<div class="inputBox" id="referencesArea">
<label for="">References (optional)</label>
<?php
$allRerefences = $data->prepare("SELECT * FROM reference where submission_id=?");
$allRerefences->execute(array($fetchCV['submission_id']));
$fetchAllReferences = $allRerefences->fetchAll(PDO::FETCH_ASSOC);
if($allRerefences->rowCount()){
foreach($fetchAllReferences as $key => $writeDatas){
?>
<div class="expBox ">
<div class="deleteBoxIcon"><i class="bi bi-trash"></i></div>
<div class="grid">
<div class="inputBox">
<span class="small-label">Name Surname</span>
<input type="text" name="refName[]" placeholder="Tonny Miller" maxlength="100" value="<?= $writeDatas['refName'] ?>">
</div>
<div class="inputBox">
<span class="small-label">Job Title</span>
<input type="text" name="refJobTitle[]" placeholder="FrontEnd Developer" maxlength="100" value="<?= $writeDatas['refJobTitle'] ?>">
</div>
</div>
</div>
<?php
}
}
?>
</div>
<div class="inputBox">
<div onclick="createNewReference()" class="CreateElemetBtn"><i class="bi bi-plus-circle"></i> Add New Reference</div>
</div>
</div>
</div>
<div class="inputBox">
<button class="submit-btn invalid-btn mt-3" type="submit">
<i class="bi bi-exclamation-circle"></i> Lütfen Tüm Alanları Doldurunuz!
</button>
<button class="submit-btn load-btn mt-3" onclick="this.classList.toggle('loading-button')" name="editCV" type="submit">
<span class="load_text"><i class="bi bi-plus-circle"></i> Düzenlemeyi Kaydet</span>
</button>
</div>
</form>
</div>
<?php
include "cvEditPost.php";
}else{
errorPage($siteUrl,"Kullanıcıya ait CV eşleşmiyor!","5503");
}
}else{
errorPage($siteUrl,"Kayıtlı CV bulunamadı!","5504");
}
}else{
errorPage($siteUrl,"Hatalı sayfa erişimi!","5505");
}
?>