add new featurs like realtime 2026-5-10-9
This commit is contained in:
@@ -460,4 +460,22 @@ function sendFCM_Internal(
|
||||
|
||||
|
||||
|
||||
|
||||
function logAudit($con, $adminId, $action, $tableName = null, $recordId = null, $details = null) {
|
||||
try {
|
||||
$stmt = $con->prepare("
|
||||
INSERT INTO `admin_audit_log` (`admin_id`, `action`, `table_name`, `record_id`, `details`)
|
||||
VALUES (:admin_id, :action, :table_name, :record_id, :details)
|
||||
");
|
||||
$stmt->execute([
|
||||
':admin_id' => $adminId,
|
||||
':action' => $action,
|
||||
':table_name' => $tableName,
|
||||
':record_id' => $recordId,
|
||||
':details' => is_array($details) ? json_encode($details, JSON_UNESCAPED_UNICODE) : $details
|
||||
]);
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
error_log("Audit Log Error: " . $e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user