Update: 2026-08-01 05:29:35
This commit is contained in:
@@ -26,7 +26,7 @@ class AppLink {
|
|||||||
static String get locationServer => locationServerSide;
|
static String get locationServer => locationServerSide;
|
||||||
|
|
||||||
static String get locationServerSide {
|
static String get locationServerSide {
|
||||||
return 'https://api.intaleqapp.com/loction_server/intaleq/ride/location';
|
return 'https://api.intaleqapp.com/loction_server/siro/ride/location';
|
||||||
}
|
}
|
||||||
|
|
||||||
static String get locationSocketUrl {
|
static String get locationSocketUrl {
|
||||||
@@ -251,8 +251,10 @@ class AppLink {
|
|||||||
static String get paymobPayoutDriverWallet =>
|
static String get paymobPayoutDriverWallet =>
|
||||||
"$paymentServer/ride/payMob/paymob_driver/paymob_payout.php";
|
"$paymentServer/ride/payMob/paymob_driver/paymob_payout.php";
|
||||||
|
|
||||||
static String get addSeferWallet => "$paymentServer/ride/intaleqWallet/add.php";
|
static String get addSeferWallet =>
|
||||||
static String get getSeferWallet => "$paymentServer/ride/intaleqWallet/get.php";
|
"$paymentServer/ride/intaleqWallet/add.php";
|
||||||
|
static String get getSeferWallet =>
|
||||||
|
"$paymentServer/ride/intaleqWallet/get.php";
|
||||||
static String get addDriverPaymentPoints =>
|
static String get addDriverPaymentPoints =>
|
||||||
"$paymentServer/ride/driverPayment/add.php";
|
"$paymentServer/ride/driverPayment/add.php";
|
||||||
static String get addPaymentTokenDriver =>
|
static String get addPaymentTokenDriver =>
|
||||||
|
|||||||
@@ -449,13 +449,8 @@ class LoginDriverController extends GetxController {
|
|||||||
box.write(BoxName.carTypeOfDriver, 'Awfar Car');
|
box.write(BoxName.carTypeOfDriver, 'Awfar Car');
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ الحصول على توكن access بدل registration قبل أي طلبات بعد تسجيل الدخول
|
// (لا داعي لتوليد توكن جديد هنا، فعملية OTP قد زودتنا بتوكن Access صحيح وتم حفظه في الذاكرة)
|
||||||
Log.print('🔑 Getting access token after login...');
|
Log.print('✅ Access token is already saved from the login process.');
|
||||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
|
||||||
// await storage.write(
|
|
||||||
// key: BoxName.fingerPrint, value: fingerPrint.toString());
|
|
||||||
// await getJWT();
|
|
||||||
// Log.print('🔑 Access token obtained.');
|
|
||||||
|
|
||||||
// add invitations
|
// add invitations
|
||||||
if (box.read(BoxName.isInstall) == null ||
|
if (box.read(BoxName.isInstall) == null ||
|
||||||
@@ -483,6 +478,8 @@ class LoginDriverController extends GetxController {
|
|||||||
final serverFp = serverData['data'][0]['fingerPrint'].toString();
|
final serverFp = serverData['data'][0]['fingerPrint'].toString();
|
||||||
final tokenMismatch =
|
final tokenMismatch =
|
||||||
storedToken.isNotEmpty && serverToken != storedToken;
|
storedToken.isNotEmpty && serverToken != storedToken;
|
||||||
|
|
||||||
|
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||||
Log.print(
|
Log.print(
|
||||||
'🔍 [FP_COMPARE] serverFp: $serverFp | localFp: ${fingerPrint.toString()} | tokenMismatch: $tokenMismatch | serverToken: $serverToken | storedToken: $storedToken');
|
'🔍 [FP_COMPARE] serverFp: $serverFp | localFp: ${fingerPrint.toString()} | tokenMismatch: $tokenMismatch | serverToken: $serverToken | storedToken: $storedToken');
|
||||||
if (tokenMismatch) {
|
if (tokenMismatch) {
|
||||||
|
|||||||
@@ -88,6 +88,12 @@ class PhoneAuthHelper {
|
|||||||
if (isRegistered) {
|
if (isRegistered) {
|
||||||
// ✅ السائق مسجل مسبقًا - سجل دخوله واذهب إلى الصفحة الرئيسية
|
// ✅ السائق مسجل مسبقًا - سجل دخوله واذهب إلى الصفحة الرئيسية
|
||||||
final driver = data['message']['driver'];
|
final driver = data['message']['driver'];
|
||||||
|
final jwt = data['message']['jwt'];
|
||||||
|
|
||||||
|
if (jwt != null) {
|
||||||
|
await storage.write(key: BoxName.jwt, value: jwt.toString());
|
||||||
|
}
|
||||||
|
|
||||||
// mySnackbarSuccess('Welcome back, ${driver['first_name']}!');
|
// mySnackbarSuccess('Welcome back, ${driver['first_name']}!');
|
||||||
|
|
||||||
// حفظ بيانات السائق إذا أردت:
|
// حفظ بيانات السائق إذا أردت:
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class DestinationController extends GetxController {
|
|||||||
|
|
||||||
if (response != null && response is Map && response['status'] == 'success') {
|
if (response != null && response is Map && response['status'] == 'success') {
|
||||||
final data = response['message'];
|
final data = response['message'];
|
||||||
if (data != null) {
|
if (data != null && data is Map) {
|
||||||
final lat = double.tryParse(data['target_latitude']?.toString() ?? '0') ?? 0.0;
|
final lat = double.tryParse(data['target_latitude']?.toString() ?? '0') ?? 0.0;
|
||||||
final lng = double.tryParse(data['target_longitude']?.toString() ?? '0') ?? 0.0;
|
final lng = double.tryParse(data['target_longitude']?.toString() ?? '0') ?? 0.0;
|
||||||
activeLatLng = LatLng(lat, lng);
|
activeLatLng = LatLng(lat, lng);
|
||||||
|
|||||||
@@ -939,7 +939,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
bool isZeroCommissionActive = false;
|
bool isZeroCommissionActive = false;
|
||||||
|
|
||||||
getCountRideToday() async {
|
getCountRideToday() async {
|
||||||
var res = await CRUD().get(
|
var res = await CRUD().getWallet(
|
||||||
link: AppLink.getCountRide,
|
link: AppLink.getCountRide,
|
||||||
payload: {'driver_id': box.read(BoxName.driverID).toString()});
|
payload: {'driver_id': box.read(BoxName.driverID).toString()});
|
||||||
data = jsonDecode(res);
|
data = jsonDecode(res);
|
||||||
|
|||||||
@@ -320,11 +320,13 @@ class UserHeader extends StatelessWidget {
|
|||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
shadows: [Shadow(blurRadius: 2, color: Colors.black26)]),
|
shadows: [Shadow(blurRadius: 2, color: Colors.black26)]),
|
||||||
),
|
),
|
||||||
accountEmail:
|
accountEmail: (box
|
||||||
(box.read(BoxName.emailDriver).toString().contains('siroapp') ||
|
.read(BoxName.emailDriver)
|
||||||
box.read(BoxName.emailDriver).toString().contains('intaleqapp'))
|
.toString()
|
||||||
? Text('Your email not updated yet'.tr)
|
.contains('siroapp') ||
|
||||||
: Text(box.read(BoxName.emailDriver)),
|
box.read(BoxName.emailDriver).toString().contains('intaleqapp'))
|
||||||
|
? Text('Your email not updated yet'.tr)
|
||||||
|
: Text(box.read(BoxName.emailDriver)),
|
||||||
currentAccountPicture: GetBuilder<ImageController>(
|
currentAccountPicture: GetBuilder<ImageController>(
|
||||||
builder: (controller) => Stack(
|
builder: (controller) => Stack(
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
@@ -334,7 +336,8 @@ class UserHeader extends StatelessWidget {
|
|||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(color: Colors.white, width: 2),
|
border: Border.all(color: Colors.white, width: 2),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(color: Colors.black.withValues(alpha: 0.3), blurRadius: 5)
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(alpha: 0.3), blurRadius: 5)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: controller.isloading
|
child: controller.isloading
|
||||||
@@ -349,13 +352,17 @@ class UserHeader extends StatelessWidget {
|
|||||||
: null,
|
: null,
|
||||||
|
|
||||||
// [تعديل هام]: في حال فشل تحميل الصورة (غير موجودة)
|
// [تعديل هام]: في حال فشل تحميل الصورة (غير موجودة)
|
||||||
onBackgroundImageError: (exception, stackTrace) {
|
onBackgroundImageError: (box
|
||||||
// طباعة الخطأ في الكونسول للتوضيح
|
.read(BoxName.driverPhotoUrl)
|
||||||
debugPrint(
|
?.toString()
|
||||||
"Profile image not found or error loading: $exception");
|
.isNotEmpty ==
|
||||||
// استدعاء نافذة التنبيه
|
true)
|
||||||
_showUploadPhotoDialog(context, controller);
|
? (exception, stackTrace) {
|
||||||
},
|
debugPrint(
|
||||||
|
"Profile image not found or error loading: $exception");
|
||||||
|
_showUploadPhotoDialog(context, controller);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
|
||||||
// أيقونة بديلة تظهر في الخلفية إذا لم تكن الصورة موجودة
|
// أيقونة بديلة تظهر في الخلفية إذا لم تكن الصورة موجودة
|
||||||
backgroundColor: Colors.grey.shade300,
|
backgroundColor: Colors.grey.shade300,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ try {
|
|||||||
//$con->exec("SET time_zone = '+03:00'");
|
//$con->exec("SET time_zone = '+03:00'");
|
||||||
// --- JWT Authentication ---
|
// --- JWT Authentication ---
|
||||||
// include "encrypt_decrypt.php";
|
// include "encrypt_decrypt.php";
|
||||||
include "functions.php"; // Include the functions file
|
include __DIR__ . "/functions.php"; // Include the functions file
|
||||||
|
|
||||||
|
|
||||||
$decodedToken = authenticateJWT(); // Call the authentication function
|
$decodedToken = authenticateJWT(); // Call the authentication function
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ try {
|
|||||||
} else {
|
} else {
|
||||||
// إنشاء فاتورة جديدة برقم عشوائي
|
// إنشاء فاتورة جديدة برقم عشوائي
|
||||||
$invoice_number = random_int(100000, 999999);
|
$invoice_number = random_int(100000, 999999);
|
||||||
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash (invoice_number, driverID, phone, amount, status, created_at) VALUES (?, ?, ?, ?, 'pending', NOW())");
|
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash (invoice_number, driverID, amount, status, created_at) VALUES (?, ?, ?, 'pending', NOW())");
|
||||||
$stmtIns->execute([$invoice_number, $driverID, $phone ?: null, $amount]);
|
$stmtIns->execute([$invoice_number, $driverID, $amount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
|
|||||||
Reference in New Issue
Block a user