Update besar apk finance
This commit is contained in:
@@ -8,19 +8,17 @@ function log_activity($module, $action, $desc, $status = 'success')
|
||||
|
||||
$ip = $CI->input->ip_address();
|
||||
|
||||
if (!$ip || $ip == '0.0.0.0') {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'] ??
|
||||
$_SERVER['REMOTE_ADDR'] ??
|
||||
'UNKNOWN';
|
||||
}
|
||||
if (!$ip || $ip == '0.0.0.0') {
|
||||
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'UNKNOWN';
|
||||
}
|
||||
|
||||
$CI->db->insert('activity_logs', [
|
||||
'user_id' => $CI->session->userdata('user_id') ?? 0,
|
||||
'module' => strtolower($module),
|
||||
'action' => strtolower($action),
|
||||
'description' => $desc,
|
||||
'description' => substr(strip_tags((string) $desc), 0, 1000),
|
||||
'status' => strtolower($status),
|
||||
'ip_address' => $ip,
|
||||
'created_at' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user