added siswa delete and struktur organisasi api
@ -103,21 +103,40 @@ class Api extends RestController
|
||||
$this->response(['message' => 'ini untuk siswa get', 'status' => true, 'data' => $data[0]], 200);
|
||||
}
|
||||
|
||||
// siswa delete
|
||||
public function siswa_delete_post()
|
||||
{
|
||||
$id = $this->post('id');
|
||||
$cek_data = $this->model->tampil_data_where('tb_siswa', ['id_siswa' => $id])->result();
|
||||
if (count($cek_data) == 0) return $this->response(['message' => 'data tidak ditemukan', 'status' => false], 400);
|
||||
// delete the folder
|
||||
$upload_dir = 'assets/siswa/' . $id . '/';
|
||||
if (is_dir($upload_dir)) {
|
||||
array_map('unlink', glob("$upload_dir/*.*"));
|
||||
rmdir($upload_dir);
|
||||
}
|
||||
$this->model->delete('tb_siswa', ['id_siswa' => $id]);
|
||||
|
||||
$this->response(['message' => 'ini untuk siswa delete', 'status' => true], 200);
|
||||
}
|
||||
|
||||
|
||||
public function dana_sosial_post()
|
||||
{
|
||||
$nama = $this->post('nama');
|
||||
$nama = $this->post('nama') == '' ? null : $this->post('nama');
|
||||
$jumlah = $this->post('jumlah') == '' ? null : $this->post('jumlah');
|
||||
$tanggal = $this->post('tanggal');
|
||||
$ket = $this->post('ket') == '' ? null : $this->post('ket');
|
||||
$jenis = $this->post('jenis');
|
||||
$bentuk = $this->post('bentuk');
|
||||
|
||||
$array = [
|
||||
'nama' => $nama,
|
||||
'jumlah' => $jumlah,
|
||||
'tanggal' => $tanggal,
|
||||
'ket' => $ket,
|
||||
'jenis' => $jenis
|
||||
'jenis' => $jenis,
|
||||
'bentuk' => $bentuk
|
||||
];
|
||||
|
||||
$this->model->insert('tb_dana_sosial', $array);
|
||||
@ -210,4 +229,10 @@ class Api extends RestController
|
||||
|
||||
$this->response(['message' => $cek_data, 'status' => true], 200);
|
||||
}
|
||||
|
||||
public function jabatan_get(){
|
||||
$jabatan = $this->get('jabatan');
|
||||
$data = $this->model->tampil_data_where('tb_jabatan', ['jabatan' => $jabatan])->result();
|
||||
$this->response(['message' => 'ini untuk jabatan get', 'status' => true, 'data' => $data], 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
BIN
assets/jabatan/58/Image_created_with_a_mobile_phone.png
Normal file
|
After Width: | Height: | Size: 11 MiB |
BIN
assets/jabatan/59/Image_created_with_a_mobile_phone.png
Normal file
|
After Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 198 KiB |
BIN
assets/siswa/4/premium_photo-1680553492268-516537c44d91.jpg
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
assets/siswa/6/Image_created_with_a_mobile_phone.png
Normal file
|
After Width: | Height: | Size: 11 MiB |