Update: 2026-06-26 20:52:17
This commit is contained in:
@@ -1,45 +1,82 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$kazan = filterRequest("kazan");
|
||||
$kazanPercent = filterRequest("kazanPercent") ?: filterRequest("kazan");
|
||||
$adminId = filterRequest("adminId");
|
||||
$latePrice = filterRequest("latePrice");
|
||||
$heavyPrice = filterRequest("heavyPrice");
|
||||
$naturePrice = filterRequest("naturePrice");
|
||||
$comfortPrice = filterRequest("comfortPrice");
|
||||
$fuelPrice = filterRequest("fuelPrice");
|
||||
$currency = filterRequest("currency") ?: 'SYP';
|
||||
$speedPrice = filterRequest("speedPrice");
|
||||
$comfortPrice = filterRequest("comfortPrice");
|
||||
$ladyPrice = filterRequest("ladyPrice");
|
||||
$electricPrice = filterRequest("electricPrice");
|
||||
$vanPrice = filterRequest("vanPrice");
|
||||
$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");
|
||||
$country = filterRequest("country");
|
||||
$fuelPrice = filterRequest("fuelPrice");
|
||||
|
||||
// Prepare an SQL statement with placeholders for the values
|
||||
$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)";
|
||||
$sql = "INSERT INTO `kazan`
|
||||
(`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);
|
||||
|
||||
// Bind the parameters to the SQL query
|
||||
$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(':kazanPercent', $kazanPercent);
|
||||
$stmt->bindParam(':adminId', $adminId);
|
||||
$stmt->bindParam(':naturePrice', $naturePrice);
|
||||
$stmt->bindParam(':country', $country);
|
||||
$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()) {
|
||||
// Print a success message
|
||||
jsonSuccess(null, "Kazan saved successfully");
|
||||
} else {
|
||||
// Print a failure message
|
||||
jsonError("Failed to save Kazan");
|
||||
}
|
||||
|
||||
// Close the statement
|
||||
$stmt->close();
|
||||
?>
|
||||
|
||||
@@ -4,8 +4,12 @@ require_once __DIR__ . '/../../connect.php';
|
||||
$id = filterRequest("id");
|
||||
|
||||
$allowedFields = [
|
||||
"kazan", "comfortPrice", "speedPrice", "deliveryPrice",
|
||||
"freePrice", "latePrice", "heavyPrice", "adminId", "naturePrice", "fuelPrice", "familyPrice"
|
||||
"kazanPercent", "fuelPrice", "currency",
|
||||
"speedPrice", "comfortPrice", "ladyPrice",
|
||||
"electricPrice", "vanPrice", "deliveryPrice",
|
||||
"mishwarVipPrice", "fixedPrice", "awfarPrice",
|
||||
"normalMinPrice", "peakMinPrice", "lateMinPrice",
|
||||
"adminId"
|
||||
];
|
||||
|
||||
$setParts = [];
|
||||
@@ -32,7 +36,6 @@ $stmt->execute($params);
|
||||
|
||||
$userIdToLog = $user_id ?? 'unknown_admin';
|
||||
|
||||
// تسجيل العملية في السجل دائماً
|
||||
$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";
|
||||
|
||||
@@ -20,7 +20,5 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>13.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -2,12 +2,15 @@ import Flutter
|
||||
import UIKit
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
|
||||
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>نحتاج إلى الوصول إلى الشبكة المحلية لاكتشاف الأجهزة القريبة.</string>
|
||||
|
||||
<key>NSBonjourServices</key>
|
||||
<array>
|
||||
<string>_http._tcp</string>
|
||||
<string>_https._tcp</string>
|
||||
</array>
|
||||
<dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
@@ -31,7 +25,37 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<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>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
@@ -49,9 +73,5 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true />
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true />
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -11,9 +11,9 @@ class KazanController extends GetxController {
|
||||
final CRUD _crud = CRUD();
|
||||
|
||||
final List<Map<String, String>> countries = [
|
||||
{'code': 'syria', 'name': 'سوريا', 'flag': '🇸🇾'},
|
||||
{'code': 'jordan', 'name': 'الأردن', 'flag': '🇯🇴'},
|
||||
{'code': 'egypt', 'name': 'مصر', 'flag': '🇪🇬'},
|
||||
{'code': 'Syria', 'name': 'سوريا', 'flag': '🇸🇾'},
|
||||
{'code': 'Jordan', 'name': 'الأردن', 'flag': '🇯🇴'},
|
||||
{'code': 'Egypt', 'name': 'مصر', 'flag': '🇪🇬'},
|
||||
];
|
||||
|
||||
String get selectedCountryCode =>
|
||||
@@ -60,7 +60,7 @@ class KazanController extends GetxController {
|
||||
Future<bool> updateKazan(Map<String, dynamic> data) async {
|
||||
isLoading.value = true;
|
||||
try {
|
||||
data['country'] = selectedCountry.value;
|
||||
data['country'] = selectedCountryCode;
|
||||
final String link = data.containsKey('id') ? AppLink.updateKazanPercent : AppLink.addKazanPercent;
|
||||
|
||||
Map<String, String> payload = {};
|
||||
|
||||
@@ -416,7 +416,7 @@ class KazanEditorPage extends StatelessWidget {
|
||||
if (!data.containsKey('country') ||
|
||||
data['country'] == null ||
|
||||
data['country'].toString().isEmpty) {
|
||||
data['country'] = controller.selectedCountry.value;
|
||||
data['country'] = controller.selectedCountryCode;
|
||||
}
|
||||
|
||||
bool success = await controller.updateKazan(data);
|
||||
|
||||
Reference in New Issue
Block a user