Update: 2026-06-26 20:52:17

This commit is contained in:
Hamza-Ayed
2026-06-26 20:52:18 +03:00
parent 1ff132cd07
commit b4f063aaac
7 changed files with 152 additions and 91 deletions

View File

@@ -1,45 +1,82 @@
<?php <?php
require_once __DIR__ . '/../../connect.php'; require_once __DIR__ . '/../../connect.php';
$kazan = filterRequest("kazan"); $kazanPercent = filterRequest("kazanPercent") ?: filterRequest("kazan");
$adminId = filterRequest("adminId"); $adminId = filterRequest("adminId");
$latePrice = filterRequest("latePrice"); $fuelPrice = filterRequest("fuelPrice");
$heavyPrice = filterRequest("heavyPrice"); $currency = filterRequest("currency") ?: 'SYP';
$naturePrice = filterRequest("naturePrice");
$comfortPrice = filterRequest("comfortPrice");
$speedPrice = filterRequest("speedPrice"); $speedPrice = filterRequest("speedPrice");
$comfortPrice = filterRequest("comfortPrice");
$ladyPrice = filterRequest("ladyPrice");
$electricPrice = filterRequest("electricPrice");
$vanPrice = filterRequest("vanPrice");
$deliveryPrice = filterRequest("deliveryPrice"); $deliveryPrice = filterRequest("deliveryPrice");
$mishwarVipPrice = filterRequest("mishwarVipPrice");
$fixedPrice = filterRequest("fixedPrice");
$awfarPrice = filterRequest("awfarPrice");
$normalMinPrice = filterRequest("normalMinPrice");
$peakMinPrice = filterRequest("peakMinPrice");
$lateMinPrice = filterRequest("lateMinPrice") ?: filterRequest("latePrice");
$naturePrice = filterRequest("naturePrice");
$heavyPrice = filterRequest("heavyPrice");
$freePrice = filterRequest("freePrice"); $freePrice = filterRequest("freePrice");
$country = filterRequest("country"); $country = filterRequest("country");
$fuelPrice = filterRequest("fuelPrice");
// Prepare an SQL statement with placeholders for the values $sql = "INSERT INTO `kazan`
$sql = "INSERT INTO `kazan`( `country`,`kazan`, `comfortPrice`, `speedPrice`, `deliveryPrice`, `freePrice`, `latePrice`, `heavyPrice`, `adminId`, `naturePrice`, `fuelPrice`) VALUES (:country,:kazan, :comfortPrice, :speedPrice, :deliveryPrice, :freePrice, :latePrice, :heavyPrice, :adminId, :naturePrice,:fuelPrice)"; (`country`, `kazanPercent`, `fuelPrice`, `currency`,
`speedPrice`, `comfortPrice`, `ladyPrice`, `electricPrice`, `vanPrice`,
`deliveryPrice`, `mishwarVipPrice`, `fixedPrice`, `awfarPrice`,
`normalMinPrice`, `peakMinPrice`, `lateMinPrice`,
`adminId`)
VALUES
(:country, :kazanPercent, :fuelPrice, :currency,
:speedPrice, :comfortPrice, :ladyPrice, :electricPrice, :vanPrice,
:deliveryPrice, :mishwarVipPrice, :fixedPrice, :awfarPrice,
:normalMinPrice, :peakMinPrice, :lateMinPrice,
:adminId)
ON DUPLICATE KEY UPDATE
`kazanPercent` = VALUES(`kazanPercent`),
`fuelPrice` = VALUES(`fuelPrice`),
`currency` = VALUES(`currency`),
`speedPrice` = VALUES(`speedPrice`),
`comfortPrice` = VALUES(`comfortPrice`),
`ladyPrice` = VALUES(`ladyPrice`),
`electricPrice` = VALUES(`electricPrice`),
`vanPrice` = VALUES(`vanPrice`),
`deliveryPrice` = VALUES(`deliveryPrice`),
`mishwarVipPrice` = VALUES(`mishwarVipPrice`),
`fixedPrice` = VALUES(`fixedPrice`),
`awfarPrice` = VALUES(`awfarPrice`),
`normalMinPrice` = VALUES(`normalMinPrice`),
`peakMinPrice` = VALUES(`peakMinPrice`),
`lateMinPrice` = VALUES(`lateMinPrice`),
`adminId` = VALUES(`adminId`)";
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
// Bind the parameters to the SQL query $stmt->bindParam(':kazanPercent', $kazanPercent);
$stmt->bindParam(':kazan', $kazan);
$stmt->bindParam(':comfortPrice', $comfortPrice);
$stmt->bindParam(':speedPrice', $speedPrice);
$stmt->bindParam(':deliveryPrice', $deliveryPrice);
$stmt->bindParam(':freePrice', $freePrice);
$stmt->bindParam(':latePrice', $latePrice);
$stmt->bindParam(':heavyPrice', $heavyPrice);
$stmt->bindParam(':adminId', $adminId); $stmt->bindParam(':adminId', $adminId);
$stmt->bindParam(':naturePrice', $naturePrice);
$stmt->bindParam(':country', $country);
$stmt->bindParam(':fuelPrice', $fuelPrice); $stmt->bindParam(':fuelPrice', $fuelPrice);
$stmt->bindParam(':currency', $currency);
$stmt->bindParam(':speedPrice', $speedPrice);
$stmt->bindParam(':comfortPrice', $comfortPrice);
$stmt->bindParam(':ladyPrice', $ladyPrice);
$stmt->bindParam(':electricPrice', $electricPrice);
$stmt->bindParam(':vanPrice', $vanPrice);
$stmt->bindParam(':deliveryPrice', $deliveryPrice);
$stmt->bindParam(':mishwarVipPrice', $mishwarVipPrice);
$stmt->bindParam(':fixedPrice', $fixedPrice);
$stmt->bindParam(':awfarPrice', $awfarPrice);
$stmt->bindParam(':normalMinPrice', $normalMinPrice);
$stmt->bindParam(':peakMinPrice', $peakMinPrice);
$stmt->bindParam(':lateMinPrice', $lateMinPrice);
$stmt->bindParam(':country', $country);
// Execute the statement
if ($stmt->execute()) { if ($stmt->execute()) {
// Print a success message
jsonSuccess(null, "Kazan saved successfully"); jsonSuccess(null, "Kazan saved successfully");
} else { } else {
// Print a failure message
jsonError("Failed to save Kazan"); jsonError("Failed to save Kazan");
} }
// Close the statement
$stmt->close(); $stmt->close();
?> ?>

View File

@@ -4,8 +4,12 @@ require_once __DIR__ . '/../../connect.php';
$id = filterRequest("id"); $id = filterRequest("id");
$allowedFields = [ $allowedFields = [
"kazan", "comfortPrice", "speedPrice", "deliveryPrice", "kazanPercent", "fuelPrice", "currency",
"freePrice", "latePrice", "heavyPrice", "adminId", "naturePrice", "fuelPrice", "familyPrice" "speedPrice", "comfortPrice", "ladyPrice",
"electricPrice", "vanPrice", "deliveryPrice",
"mishwarVipPrice", "fixedPrice", "awfarPrice",
"normalMinPrice", "peakMinPrice", "lateMinPrice",
"adminId"
]; ];
$setParts = []; $setParts = [];
@@ -32,7 +36,6 @@ $stmt->execute($params);
$userIdToLog = $user_id ?? 'unknown_admin'; $userIdToLog = $user_id ?? 'unknown_admin';
// تسجيل العملية في السجل دائماً
$auditResult = logAudit($con, $userIdToLog, "تحديث عمولة/أسعار النظام (Kazan)", "kazan", $id, $params); $auditResult = logAudit($con, $userIdToLog, "تحديث عمولة/أسعار النظام (Kazan)", "kazan", $id, $params);
$debugLog = "[" . date('Y-m-d H:i:s') . "] Kazan Update Triggered. User: $userIdToLog. Audit Result: " . ($auditResult === true ? 'SUCCESS' : $auditResult) . "\n"; $debugLog = "[" . date('Y-m-d H:i:s') . "] Kazan Update Triggered. User: $userIdToLog. Audit Result: " . ($auditResult === true ? 'SUCCESS' : $auditResult) . "\n";

View File

@@ -20,7 +20,5 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key>
<string>13.0</string>
</dict> </dict>
</plist> </plist>

View File

@@ -2,12 +2,15 @@ import Flutter
import UIKit import UIKit
@main @main
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
override func application( override func application(
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
}
} }

View File

@@ -1,15 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSLocalNetworkUsageDescription</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<string>نحتاج إلى الوصول إلى الشبكة المحلية لاكتشاف الأجهزة القريبة.</string> <true/>
<key>NSBonjourServices</key>
<array>
<string>_http._tcp</string>
<string>_https._tcp</string>
</array>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
@@ -31,7 +25,37 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true /> <true/>
<key>NSBonjourServices</key>
<array>
<string>_http._tcp</string>
<string>_https._tcp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>نحتاج إلى الوصول إلى الشبكة المحلية لاكتشاف الأجهزة القريبة.</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneConfigurationName</key>
<string>flutter</string>
<key>UISceneDelegateClassName</key>
<string>FlutterSceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
@@ -49,9 +73,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key> </dict>
<true />
<key>UIApplicationSupportsIndirectInputEvents</key>
<true />
</dict>
</plist> </plist>

View File

@@ -11,9 +11,9 @@ class KazanController extends GetxController {
final CRUD _crud = CRUD(); final CRUD _crud = CRUD();
final List<Map<String, String>> countries = [ final List<Map<String, String>> countries = [
{'code': 'syria', 'name': 'سوريا', 'flag': '🇸🇾'}, {'code': 'Syria', 'name': 'سوريا', 'flag': '🇸🇾'},
{'code': 'jordan', 'name': 'الأردن', 'flag': '🇯🇴'}, {'code': 'Jordan', 'name': 'الأردن', 'flag': '🇯🇴'},
{'code': 'egypt', 'name': 'مصر', 'flag': '🇪🇬'}, {'code': 'Egypt', 'name': 'مصر', 'flag': '🇪🇬'},
]; ];
String get selectedCountryCode => String get selectedCountryCode =>
@@ -60,7 +60,7 @@ class KazanController extends GetxController {
Future<bool> updateKazan(Map<String, dynamic> data) async { Future<bool> updateKazan(Map<String, dynamic> data) async {
isLoading.value = true; isLoading.value = true;
try { try {
data['country'] = selectedCountry.value; data['country'] = selectedCountryCode;
final String link = data.containsKey('id') ? AppLink.updateKazanPercent : AppLink.addKazanPercent; final String link = data.containsKey('id') ? AppLink.updateKazanPercent : AppLink.addKazanPercent;
Map<String, String> payload = {}; Map<String, String> payload = {};

View File

@@ -416,7 +416,7 @@ class KazanEditorPage extends StatelessWidget {
if (!data.containsKey('country') || if (!data.containsKey('country') ||
data['country'] == null || data['country'] == null ||
data['country'].toString().isEmpty) { data['country'].toString().isEmpty) {
data['country'] = controller.selectedCountry.value; data['country'] = controller.selectedCountryCode;
} }
bool success = await controller.updateKazan(data); bool success = await controller.updateKazan(data);