Initial commit for intaleq_admin
This commit is contained in:
37
lib/controller/drivers/driver_not_active_controller.dart
Normal file
37
lib/controller/drivers/driver_not_active_controller.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/links.dart';
|
||||
import '../functions/crud.dart';
|
||||
|
||||
class DriverController extends GetxController {
|
||||
List drivers = [];
|
||||
Map driverDetails = {};
|
||||
|
||||
// جلب السائقين pending
|
||||
getDriversPending() async {
|
||||
var res = await CRUD().post(
|
||||
link: AppLink.getDriversPending, // رابط drivers_pending_list.php
|
||||
payload: {},
|
||||
);
|
||||
if (res != 'failure') {
|
||||
drivers = (res)['message'];
|
||||
update(['drivers']); // تحديث الـ UI
|
||||
} else {
|
||||
Get.snackbar('Error', 'Failed to load drivers');
|
||||
}
|
||||
}
|
||||
|
||||
// جلب تفاصيل سائق واحد
|
||||
getDriverDetails(String driverId) async {
|
||||
var res = await CRUD().post(
|
||||
link: AppLink.getDriverDetails, // رابط driver_details.php
|
||||
payload: {"id": driverId},
|
||||
);
|
||||
if (res != 'failure') {
|
||||
driverDetails = (res)['message'];
|
||||
update(['driverDetails']); // تحديث صفحة التفاصيل
|
||||
} else {
|
||||
Get.snackbar('Error', 'Failed to load driver details');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user