first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
$key=$_POST['key'];
|
||||
if ($key=='approve') {
|
||||
$riwayat_kegiatan_id=$_POST['riwayat_kegiatan_id'];
|
||||
$satuan_kerja_id=$_POST['satuan_kerja_id'];
|
||||
$a=$_POST['riwayat_peserta_id'];
|
||||
$pecah=explode(',',$a);
|
||||
foreach($pecah as $selected) {
|
||||
$cek_peserta2=pg_query("SELECT riwayat_peserta_id FROM riwayat_evaluasi WHERE riwayat_peserta_id='$selected' AND riwayat_kegiatan_id='$riwayat_kegiatan_id'");
|
||||
$row_peserta2 = pg_fetch_row($cek_peserta2);
|
||||
if ($row_peserta2[0] > 0) {} else {
|
||||
$ins_peserta = pg_query("INSERT into riwayat_evaluasi (
|
||||
riwayat_kegiatan_id,
|
||||
riwayat_peserta_id,
|
||||
satuan_kerja_id
|
||||
) values(
|
||||
'$riwayat_kegiatan_id',
|
||||
'$selected',
|
||||
'$satuan_kerja_id'
|
||||
)
|
||||
");
|
||||
}
|
||||
}
|
||||
} else
|
||||
if ($key=='delete_peserta') {
|
||||
$id=$_POST['id'];
|
||||
$del=pg_query("DELETE FROM riwayat_evaluasi WHERE id='$id'");
|
||||
} else
|
||||
if ($key=='status_form') {
|
||||
$riwayat_kegiatan_id=$_POST['riwayat_kegiatan_id'];
|
||||
$satuan_kerja_id=$_POST['satuan_kerja_id'];
|
||||
$upd=pg_query("UPDATE riwayat_evaluasi SET status='Kirim' WHERE riwayat_kegiatan_id='$riwayat_kegiatan_id' AND satuan_kerja_id='$satuan_kerja_id'");
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user