add new featurs like realtime 2026-5-10-10

This commit is contained in:
Hamza-Ayed
2026-05-10 01:07:26 +03:00
parent 13b8b4cc7f
commit 8d37725ffb
2 changed files with 7 additions and 3 deletions

View File

@@ -462,6 +462,9 @@ function sendFCM_Internal(
function logAudit($con, $adminId, $action, $tableName = null, $recordId = null, $details = null) {
try {
if (empty($adminId)) {
$adminId = 'unknown_admin';
}
$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)

View File

@@ -30,12 +30,13 @@ $params[":id"] = $id;
$stmt = $con->prepare($sql);
$stmt->execute($params);
// تسجيل العملية في السجل دائماً (حتى لو لم تتغير القيمة) لضمان الشفافية
logAudit($con, $user_id, "تحديث عمولة/أسعار النظام (Kazan)", "kazan", $id, $params);
if ($stmt->rowCount() > 0) {
// تسجيل العملية في السجل
logAudit($con, $user_id, "تحديث عمولة/أسعار النظام (Kazan)", "kazan", $id, $params);
jsonSuccess(null, "Kazan data updated successfully");
} else {
// تسجيل محاولة التحديث حتى لو لم تتغير القيم (اختياري)
// If no rows were changed but execute was successful, it might be because the data is the same
jsonSuccess(null, "Kazan data remains unchanged or updated");
}
?>