-
Notifications
You must be signed in to change notification settings - Fork 0
/
addlowongan.php
64 lines (52 loc) · 2.4 KB
/
addlowongan.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
require 'connectpostgre.php';
require_once 'config.php';
$job_id=$_POST['jobid'];
$position=$_POST['jobposition'];
$salarymin=$_POST['salarymin'];
$salarymax=$_POST['salarymax'];
$pekerjaan=$_POST['pekerjaan'];
$kriteria=$_POST['kriteria'];
$jobstatus=$_POST['jobstatus'];
$pendidikan=$_POST['pendidikan'];
$pengalamankerja=$_POST['pengalamankerja'];
$kriteriaumum=$_POST['kriteriaumum'];
$deskripsi=$_POST['deskripsi'];
$jobdes=$_POST['jobdes'];
$jobcriteriaen=$_POST['jobcriteriaen'];
$educationen=$_POST['educationen'];
$ceklowongan=$pdo->query("select * from lowongan_kerja");
$ceklowongan->execute();
$data=$ceklowongan->fetchAll();
foreach($data as $value){
if($job_id==$value['job_id']){
$status=1;
echo'
<script>
alert("lowongan kerja sudah pernah ditambahkah")
window.location.href="formlowongan.php"
</script>';
}
else{
$status++;
}
}
if($status>1){
$sql='INSERT INTO lowongan_kerja(job_id,job_name,salary_min,salary_max,job_desc,job_criteria,job_status,education,year_experience,kriteria_umum,deskripsi_umum,jobdescen,jobcriteriaen,educationen) values (:job_id,:position,:salarymin,:salarymax,:pekerjaan,:kriteria,:jobstatus,:pendidikan,:pengalamankerja,:kriteriaumum,:deskripsi,:jobdes,:jobcriteriaen,:educationen)';
$stmt=$pdo->prepare($sql);
$stmt->execute([':job_id'=>$job_id,':position'=>$position,':salarymin'=>$salarymin,':salarymax'=>$salarymax,':pekerjaan'=>$pekerjaan,':kriteria'=>$kriteria,':jobstatus'=>$jobstatus,':pendidikan'=>$pendidikan,':pengalamankerja'=>$pengalamankerja,':kriteriaumum'=>$kriteriaumum,':deskripsi'=>$deskripsi,':jobdes'=>$jobdes,':jobcriteriaen'=>$jobcriteriaen,':educationen'=>$educationen]);
if($stmt){
echo'
<script>
alert("Berhasil menambahkan lowongan")
window.location.href="careeradmin.php"
</script>';
} else{
echo '
<script>
alert("Gagal menambahkan Lowongan");
window.location.href="formlowongan.php";
</script> ';
}
}
?>