color coding changes on the monthly leave calendar and prod e-learning URL added.

Courses-CR#-7150
Sultan khan 24 hours ago
parent d5c3ce4c62
commit 8ea831c2c4

@ -435,7 +435,7 @@ class DashboardApiClient {
//Fetch All Courses Status //Fetch All Courses Status
Future<CoursesResponseModel?> fetchAllCoursesStatus() async { Future<CoursesResponseModel?> fetchAllCoursesStatus() async {
String url = "https://elearning.hmg.com/moodle_dev/api/Fetch_All_Courses_Status.php"; String url = ApiConsts.eLearningBaseUrl +"Fetch_All_Courses_Status.php";
Map<String, String> headers = { Map<String, String> headers = {
'x-api-key': 'bLi@mbXJeXTHd/)h&LFh%25+%25(Nbnaq6hBg%7d%5dyQbthY%7bv6ew6-5UT\$NASwucn%7d,_PSJpuwNCCen2%7djj%7b00HR2T-%5b,k7W%7d-0yepK?%258', 'x-api-key': 'bLi@mbXJeXTHd/)h&LFh%25+%25(Nbnaq6hBg%7d%5dyQbthY%7bv6ew6-5UT\$NASwucn%7d,_PSJpuwNCCen2%7djj%7b00HR2T-%5b,k7W%7d-0yepK?%258',

@ -4,13 +4,13 @@ class ApiConsts {
// static String baseUrl = "http://10.200.204.11"; // Local server // static String baseUrl = "http://10.200.204.11"; // Local server
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024"; // static String baseUrl = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server static String baseUrl = "https://mohemm.hmg.com"; // New Live server
// //static String eLearningBaseUrl = "https://elearning.hmg.com/moodle_dev/api/"; // Elearning server UAT
static String eLearningBaseUrl = "https://elearning.hmg.com/moodle/api/"; // Elearning server live
// static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "http://10.20.200.111:1010/";

@ -22,6 +22,8 @@ class GetDayHoursTypeDetailsList {
dynamic? fROMROWNUM; dynamic? fROMROWNUM;
String? lATEINFLAG; String? lATEINFLAG;
String? lATEINHRS; String? lATEINHRS;
String? lEAVEDESCRIPTION;
String? lEAVETYPECODE;
String? mISSINGSWIPEFLAG; String? mISSINGSWIPEFLAG;
String? nONSCHEDULEDFLAG; String? nONSCHEDULEDFLAG;
dynamic? nOOFROWS; dynamic? nOOFROWS;
@ -66,6 +68,8 @@ class GetDayHoursTypeDetailsList {
this.fROMROWNUM, this.fROMROWNUM,
this.lATEINFLAG, this.lATEINFLAG,
this.lATEINHRS, this.lATEINHRS,
this.lEAVEDESCRIPTION,
this.lEAVETYPECODE,
this.mISSINGSWIPEFLAG, this.mISSINGSWIPEFLAG,
this.nONSCHEDULEDFLAG, this.nONSCHEDULEDFLAG,
this.nOOFROWS, this.nOOFROWS,
@ -110,6 +114,8 @@ class GetDayHoursTypeDetailsList {
fROMROWNUM = json['FROM_ROW_NUM']; fROMROWNUM = json['FROM_ROW_NUM'];
lATEINFLAG = json['LATE_IN_FLAG']; lATEINFLAG = json['LATE_IN_FLAG'];
lATEINHRS = json['LATE_IN_HRS']; lATEINHRS = json['LATE_IN_HRS'];
lEAVEDESCRIPTION = json['LEAVE_DESCRIPTION'];
lEAVETYPECODE = json['LEAVE_TYPE_CODE'];
mISSINGSWIPEFLAG = json['MISSING_SWIPE_FLAG']; mISSINGSWIPEFLAG = json['MISSING_SWIPE_FLAG'];
nONSCHEDULEDFLAG = json['NON_SCHEDULED_FLAG']; nONSCHEDULEDFLAG = json['NON_SCHEDULED_FLAG'];
nOOFROWS = json['NO_OF_ROWS']; nOOFROWS = json['NO_OF_ROWS'];
@ -156,6 +162,8 @@ class GetDayHoursTypeDetailsList {
data['FROM_ROW_NUM'] = this.fROMROWNUM; data['FROM_ROW_NUM'] = this.fROMROWNUM;
data['LATE_IN_FLAG'] = this.lATEINFLAG; data['LATE_IN_FLAG'] = this.lATEINFLAG;
data['LATE_IN_HRS'] = this.lATEINHRS; data['LATE_IN_HRS'] = this.lATEINHRS;
data['LEAVE_DESCRIPTION'] = this.lEAVEDESCRIPTION;
data['LEAVE_TYPE_CODE'] = this.lEAVETYPECODE;
data['MISSING_SWIPE_FLAG'] = this.mISSINGSWIPEFLAG; data['MISSING_SWIPE_FLAG'] = this.mISSINGSWIPEFLAG;
data['NON_SCHEDULED_FLAG'] = this.nONSCHEDULEDFLAG; data['NON_SCHEDULED_FLAG'] = this.nONSCHEDULEDFLAG;
data['NO_OF_ROWS'] = this.nOOFROWS; data['NO_OF_ROWS'] = this.nOOFROWS;

@ -315,6 +315,26 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y'; bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y'; bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y';
// Get leave type code and corresponding color
String? leaveTypeCode = getDayHoursTypeDetailsList[index].lEAVETYPECODE;
Color? leaveTypeColor;
bool useGradient = false;
// Determine color based on leave type code
if (leaveTypeCode != null && leaveTypeCode.isNotEmpty) {
leaveTypeColor = leaveTypeColors[leaveTypeCode];
}
// If no leave type color found, use default colors based on attendance status
if (leaveTypeColor == null) {
if (isDayIsPresent) {
leaveTypeColor = leaveTypeColors['Present'];
useGradient = true; // Use gradient for present days without leave type
} else if (isDayIsAbsent) {
leaveTypeColor = leaveTypeColors['Absent'];
}
}
if (isDayIsOff) { if (isDayIsOff) {
return Container( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
@ -331,12 +351,13 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
return Container( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: const LinearGradient( gradient: useGradient && leaveTypeColor != null ? LinearGradient(
transform: GradientRotation(.46), transform: GradientRotation(.46),
begin: Alignment.topRight, begin: Alignment.topRight,
end: Alignment.bottomLeft, end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
), ) : null,
color: !useGradient && leaveTypeColor != null ? leaveTypeColor : null,
shape: BoxShape.circle, shape: BoxShape.circle,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -358,7 +379,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
return Container( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: MyColors.backgroundBlackColor, color: leaveTypeColor ?? MyColors.backgroundBlackColor,
shape: BoxShape.circle, shape: BoxShape.circle,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -751,3 +772,24 @@ class Meeting {
Color background; Color background;
bool isAllDay; bool isAllDay;
} }
const Map<String, Color> leaveTypeColors = {
'Present': Color(0xFF00ad62),
'Absent': Color(0xFFcb3232),
'HOLIDAY': Color(0xFFF26B0F),
'BUS_TRIP': Color(0xFF001A6E),
'WFH': Color(0xFF5DB996),
'ANNUAL': Color(0xFFf39c12),
'EMERGENCY': Color(0xFFFF2929),
'EXAM': Color(0xFFCB6040),
'HAJJ': Color(0xFF798645),
'HALF': Color(0xFFE8B86D),
'LWOP': Color(0xFFCD5C08),
'LWOP_MATUNPAID': Color(0xFFE73879),
'LWOP_UNAUUNPAID': Color(0xFFA02334),
'MATPAID': Color(0xFFE73879),
'MRGE': Color(0xFF0D7C66),
'PAT': Color(0xFFC96868),
'PROF': Color(0xFF6256CA),
'SICK': Color(0xFFA5B68D),
};

Loading…
Cancel
Save