Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Validasi Berkas
- public function validasiberkas_post()
- {
- $username = trim($this->post('username'));
- $level = trim($this->post('level'));
- $file_id = trim($this->post('file_id'));
- $lstValid = trim($this->post('lstValid')); // Valid/Tidak Valid
- if ($username == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Username tidak ditemukan.',
- ];
- } elseif ($level == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Level tidak ditemukan.',
- ];
- } elseif ($level == 'Member') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Level Member tidak diperkenankan.',
- ];
- } elseif ($file_id == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'ID Berkas tidak ditemukan.',
- ];
- } elseif ($lstValid == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Status Validasi harus dipilih.',
- ];
- } else {
- // Validasi Berkas (Valid / Tidak Valid)
- $data = array(
- 'upload_status' => $lstValid,
- 'upload_date_valid' => date('Y-m-d'),
- 'upload_time_valid' => date('Y-m-d H:i:s'),
- );
- $this->db->where('file_id', $file_id);
- $this->db->where('user_username', $username);
- $this->db->update('bpmppt_upload', $data);
- $response = [
- 'resp_error' => false,
- 'resp_msg' => 'Validasi Sukses.',
- ];
- }
- $this->response($response, 200);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement