Perubahan barcode dan inventory
This commit is contained in:
@@ -10,6 +10,10 @@ class Employees extends CI_Controller {
|
||||
$this->load->database();
|
||||
$this->load->helper(['url', 'file']);
|
||||
|
||||
if (!$this->session->userdata('logged_in')) {
|
||||
redirect('auth');
|
||||
}
|
||||
|
||||
date_default_timezone_set('Asia/Jakarta');
|
||||
}
|
||||
|
||||
@@ -192,6 +196,14 @@ class Employees extends CI_Controller {
|
||||
$data['photo'] = $photo;
|
||||
|
||||
$this->db->insert('k_employees',$data);
|
||||
$employee_id = $this->db->insert_id();
|
||||
|
||||
log_activity(
|
||||
'employees',
|
||||
'create',
|
||||
'Menambah karyawan: '.$data['full_name'].' (ID: '.$employee_id.')',
|
||||
'success'
|
||||
);
|
||||
|
||||
return $this->json([
|
||||
'status' => true,
|
||||
@@ -247,6 +259,13 @@ class Employees extends CI_Controller {
|
||||
->where('id',$id)
|
||||
->update('k_employees',$data);
|
||||
|
||||
log_activity(
|
||||
'employees',
|
||||
'update',
|
||||
'Update karyawan ID: '.$id.' Nama: '.($data['full_name'] ?? '-'),
|
||||
'success'
|
||||
);
|
||||
|
||||
return $this->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil update data'
|
||||
@@ -292,6 +311,13 @@ class Employees extends CI_Controller {
|
||||
'id'=>$id
|
||||
]);
|
||||
|
||||
log_activity(
|
||||
'employees',
|
||||
'delete',
|
||||
'Hapus karyawan ID: '.$id.' Nama: '.($employee->full_name ?? '-'),
|
||||
'success'
|
||||
);
|
||||
|
||||
return $this->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil hapus data'
|
||||
|
||||
Reference in New Issue
Block a user