Initial commit

This commit is contained in:
root
2026-05-26 08:07:45 +00:00
commit a234e55e64
4263 changed files with 855927 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
function log_activity($module, $action, $desc, $status = 'success')
{
$CI =& get_instance();
$ip = $CI->input->ip_address();
if (!$ip || $ip == '0.0.0.0') {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'] ??
$_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,
'status' => strtolower($status),
'ip_address' => $ip,
'created_at' => date('Y-m-d H:i:s')
]);
}