Perubahan barcode dan inventory

This commit is contained in:
Wian Drs
2026-07-12 22:10:02 +07:00
parent 3ac6316da4
commit 3113d77242
21 changed files with 2989 additions and 1138 deletions
+26
View File
@@ -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'