dienianindya 1 gadu atpakaļ
vecāks
revīzija
2a95351f6a

+ 7
- 0
android/app/src/main/AndroidManifest.xml Parādīt failu

@@ -2,6 +2,12 @@
2 2
     xmlns:tools="http://schemas.android.com/tools"
3 3
     package="com.example.hris_selfservice_mobile">
4 4
 
5
+
6
+    <uses-permission android:name="android.permission.INTERNET" />
7
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
8
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
9
+    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
10
+
5 11
     <application
6 12
         android:icon="@mipmap/ic_launcher"
7 13
         android:label="Employee Self Service"
@@ -11,6 +17,7 @@
11 17
         <meta-data android:name="com.google.android.geo.API_KEY"
12 18
             android:value="YOUR-KEY-HERE"/>
13 19
 
20
+
14 21
         <activity
15 22
             android:name=".MainActivity"
16 23
             android:screenOrientation="portrait"

Binārs
firebase-tools-instant-win.exe Parādīt failu


+ 1
- 0
ios/Runner/Info.plist Parādīt failu

@@ -55,5 +55,6 @@
55 55
 	<string>Need to upload image</string>
56 56
 	<key>NSLocationWhenInUseUsageDescription</key>
57 57
 	<key>NSLocationAlwaysUsageDescription</key>
58
+	<true/>
58 59
 </dict>
59 60
 </plist>

+ 4
- 0
lib/Screens/Home/home_screen.dart Parādīt failu

@@ -166,6 +166,10 @@ class _HomeView extends State<HomeView> {
166 166
           email = object['result']['email'].toString();
167 167
           address = object['result']['address'].toString();
168 168
           position = object['result']['position'].toString();
169
+
170
+          var prefs = await SharedPreferences.getInstance();
171
+          await prefs.setString('position', position);
172
+
169 173
         }
170 174
       } else {
171 175
         Fluttertoast.showToast(

+ 1
- 1
lib/Screens/Menu/About/about_screen.dart Parādīt failu

@@ -21,7 +21,7 @@ class _AboutScreenState extends State<AboutScreen> {
21 21
                 children: [
22 22
                   WavyHeader(),
23 23
                   Container(
24
-                      margin: EdgeInsets.only(top: 90),
24
+                      margin: EdgeInsets.only(top: MediaQuery.of(context).size.height/6 - 20),
25 25
                       padding: EdgeInsets.fromLTRB(20, 5, 25, 5),
26 26
                       child: Row(
27 27
                         mainAxisAlignment: MainAxisAlignment.end,

+ 11
- 6
lib/Screens/Menu/Absensi/absensi_screen.dart Parādīt failu

@@ -3,8 +3,7 @@ import 'package:flutter_map/plugin_api.dart';
3 3
 import 'package:geolocator/geolocator.dart';
4 4
 import 'package:hris_selfservice_mobile/Screens/Menu/Absensi/absensi_history_screen.dart';
5 5
 //import 'package:latlong/latlong.dart' as latlong;
6
-import 'package:latlong2/latlong.dart';
7
-
6
+import 'package:latlong2/latlong.dart' as latlong;
8 7
 
9 8
 class AbsensiScreen extends StatefulWidget {
10 9
   const AbsensiScreen({Key? key}) : super(key: key);
@@ -16,7 +15,7 @@ class AbsensiScreen extends StatefulWidget {
16 15
 class _AbsensiScreenState extends State<AbsensiScreen> {
17 16
   double long = 49.5;
18 17
   double lat = -0.09;
19
-  //latlong.LatLng point = latlong.LatLng(-6.186729296979901, 106.93023205185953);
18
+  latlong.LatLng point = latlong.LatLng(-6.186729296979901, 106.93023205185953);
20 19
   var location = [];
21 20
 
22 21
   @override
@@ -32,16 +31,22 @@ class _AbsensiScreenState extends State<AbsensiScreen> {
32 31
               height: size.height * 0.5,
33 32
               child: FlutterMap(
34 33
                 options: MapOptions(
34
+                  onTap: (p, point) async{
35 35
 
36
+                  },
37
+                  center: point
36 38
                 ),
37 39
                 children: [
38 40
                   TileLayer(
39 41
                     minZoom: 1,
40
-                    maxZoom: 18,
42
+                    maxZoom: 14,
41 43
                     backgroundColor: Colors.black54,
42 44
                     urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
43
-                    subdomains: ['a', 'b', 'c'],
44
-                  )
45
+                     subdomains: ['a', 'b', 'c'],
46
+                  ),
47
+                 /* MarkerLayer(
48
+                    markers: [point]
49
+                  )*/
45 50
                 ],
46 51
               )
47 52
             ),

+ 1
- 1
lib/Screens/Menu/AjukanCuti/ajukancuti_screen.dart Parādīt failu

@@ -134,7 +134,7 @@ class _AjukanCutiScreenState extends State<AjukanCutiScreen> {
134 134
             children: [
135 135
               WavyHeader(),
136 136
               Container(
137
-                  margin: EdgeInsets.only(top: 90),
137
+                  margin: EdgeInsets.only(top: MediaQuery.of(context).size.height/6 - 20),
138 138
                   padding: EdgeInsets.fromLTRB(20, 5, 25, 5),
139 139
                   child: Row(
140 140
                     mainAxisAlignment: MainAxisAlignment.end,

+ 2
- 3
lib/Screens/Menu/AjukanCuti/history_cuti.dart Parādīt failu

@@ -167,8 +167,7 @@ class _HistoryCutiState extends State<HistoryCuti> {
167 167
                   children: [
168 168
                     WavyHeader(),
169 169
                     Container(
170
-                        margin: EdgeInsets.only(
171
-                            top: (size.height / 6) - 20),
170
+                        margin: EdgeInsets.only(top: (size.height / 6) - 20),
172 171
                         padding: EdgeInsets.fromLTRB(0, 5, 25, 5),
173 172
                         child: Row(
174 173
                           mainAxisAlignment: MainAxisAlignment.end,
@@ -230,7 +229,7 @@ class _HistoryCutiState extends State<HistoryCuti> {
230 229
                                     flex: 2,
231 230
                                     child: Padding(
232 231
                                       padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
233
-                                      child: Text(status_List[i], style: GoogleFonts.lilitaOne(color: statusColor[i], fontSize: 17),
232
+                                      child: Text(status_List[i], textAlign: TextAlign.center, style: GoogleFonts.lilitaOne(color: statusColor[i], fontSize: 17),
234 233
                                       ),
235 234
                                     )
236 235
                                 ),

+ 1
- 1
lib/Screens/Menu/Reimburse/RequestHttp/historyReimburse_post.dart Parādīt failu

@@ -20,7 +20,7 @@ class HistoryReimburse_Post {
20 20
     var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
21 21
       "data": [
22 22
         {
23
-          "session": "2113213123211321123112123123"
23
+          "session": session
24 24
         }
25 25
       ]
26 26
     }), headers: {

+ 2
- 2
lib/Screens/Menu/Reimburse/history_reimburse.dart Parādīt failu

@@ -79,6 +79,7 @@ class _HistoryReimburse extends State<HistoryReimburse> {
79 79
           alertDialogFailedRetrievedData(context);
80 80
         } else {
81 81
           List <dynamic> historyReimburse = object['result'];
82
+          loading.hide();
82 83
           setState(() {
83 84
             for (int i = 0; i < historyReimburse.length; i++){
84 85
               String date = historyReimburse[i]['date'].toString();
@@ -125,7 +126,6 @@ class _HistoryReimburse extends State<HistoryReimburse> {
125 126
 
126 127
             HistoryLength = historyReimburse.length;
127 128
           });
128
-          loading.hide();
129 129
         }
130 130
       } else {
131 131
         Fluttertoast.showToast(
@@ -216,7 +216,7 @@ class _HistoryReimburse extends State<HistoryReimburse> {
216 216
                                     flex: 2,
217 217
                                     child: Padding(
218 218
                                       padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
219
-                                      child: Text(status_List[i], style: GoogleFonts.lilitaOne(color: statusColor[i], fontSize: 17),
219
+                                      child: Text(status_List[i], textAlign: TextAlign.center, style: GoogleFonts.lilitaOne(color: statusColor[i], fontSize: 17),
220 220
                                       ),
221 221
                                     )
222 222
                                 ),

+ 13
- 16
lib/Screens/Menu/Reimburse/reimburse_screen.dart Parādīt failu

@@ -80,7 +80,7 @@ class _ReimburseScreen extends State<ReimburseScreen> {
80 80
       if (object.containsKey("result").toString() == "true"){
81 81
         String result = object['result'].toString();
82 82
         logDev.log(result, name: "Jenis Cuti Result");
83
-        if (result.contains("status")) {
83
+        if (result.contains("failed")) {
84 84
           loading.hide();
85 85
           setState(() {
86 86
             alertDialogFailedRetrievedData(context);
@@ -102,14 +102,8 @@ class _ReimburseScreen extends State<ReimburseScreen> {
102 102
         }
103 103
       } else {
104 104
         setState((){
105
+          loading.hide();
105 106
           alertDialogFailedResponse(context);
106
-          Fluttertoast.showToast(
107
-              msg: "Server Response Error",
108
-              toastLength: Toast.LENGTH_SHORT,
109
-              gravity: ToastGravity.CENTER,
110
-              timeInSecForIosWeb: 1,
111
-              textColor: Colors.white,
112
-              fontSize: 16.0);
113 107
         });
114 108
         loading.hide();
115 109
       }
@@ -127,7 +121,7 @@ class _ReimburseScreen extends State<ReimburseScreen> {
127 121
                 children: [
128 122
                   WavyHeader(),
129 123
                   Container(
130
-                      margin: EdgeInsets.only(top: 90),
124
+                      margin: EdgeInsets.only(top: MediaQuery.of(context).size.height/6 - 20),
131 125
                       padding: EdgeInsets.fromLTRB(20, 5, 25, 5),
132 126
                       child: Row(
133 127
                         mainAxisAlignment: MainAxisAlignment.end,
@@ -202,6 +196,13 @@ class _ReimburseScreen extends State<ReimburseScreen> {
202 196
                                     borderRadius: BorderRadius.circular(10)),
203 197
                                 child: Column(
204 198
                                   children: [
199
+                                    Container(
200
+                                      margin: EdgeInsets.only(
201
+                                          left: 10, right: 10, top: 15, bottom: 10),
202
+                                      child: Text('Reimburse Submission', style:
203
+                                      GoogleFonts.josefinSans(fontSize: 18, fontWeight: FontWeight.bold, decoration: TextDecoration.underline,
204
+                                          decorationStyle: TextDecorationStyle.dashed),),
205
+                                    ),
205 206
                                     Container(
206 207
                                       margin: EdgeInsets.only(
207 208
                                           left: 10, right: 10, top: 10, bottom: 10),
@@ -653,8 +654,6 @@ class _ReimburseScreen extends State<ReimburseScreen> {
653 654
                                                   messageTextStyle: TextStyle(
654 655
                                                       color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
655 656
 
656
-                                              //loading.show();
657
-
658 657
                                               if (!validateFormReimburse(context)){
659 658
                                                 return;
660 659
                                               } else if (validateFormReimburse(context)){
@@ -692,6 +691,9 @@ class _ReimburseScreen extends State<ReimburseScreen> {
692 691
                                                       );
693 692
                                                     } else {
694 693
                                                       loading.hide();
694
+                                                      formattedDateFrom = "";
695
+                                                      visibleDateFrom = false;
696
+                                                      visibleDateFrom = false;
695 697
                                                       deskripsiTeksController.clear();
696 698
                                                       Widget okButton = TextButton(
697 699
                                                         child: Text("OK"),
@@ -718,12 +720,7 @@ class _ReimburseScreen extends State<ReimburseScreen> {
718 720
                                                           return alert;
719 721
                                                         },
720 722
                                                       );
721
-                                                      deskripsiTeksController.clear();
722
-                                                      formattedDateFrom = "";
723
-                                                      visibleDateFrom = false;
724
-                                                      visibleDateFrom = false;
725 723
                                                     }
726
-
727 724
                                                   } else {
728 725
                                                     loading.hide();
729 726
                                                     alertDialogFailedResponse(context);

+ 36
- 0
lib/Screens/Menu/SlipGaji/RequestHttp/detailSlipGaji_post.dart Parādīt failu

@@ -0,0 +1,36 @@
1
+import 'dart:convert';
2
+import 'dart:core';
3
+import 'package:http/http.dart' as http;
4
+import 'package:hris_selfservice_mobile/constants.dart';
5
+import 'dart:developer' as developer;
6
+
7
+import 'package:shared_preferences/shared_preferences.dart';
8
+
9
+class DetailSlipGaji_Post {
10
+  late String batch_id;
11
+  late String session;
12
+
13
+  DetailSlipGaji_Post({required this.session});
14
+
15
+  static Future<String> connectToAPI(String batch_id) async {
16
+    String URL = baseURL + "/api/v1/detail_slip_gaji";
17
+
18
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
19
+    final session = prefs.getString('session');
20
+
21
+    var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
22
+      "data": [
23
+        {
24
+          "batch_id" : batch_id,
25
+          "session": session
26
+        }
27
+      ]
28
+    }), headers: {
29
+      "Content-Type": "application/json",
30
+      "Api-key": apiKey
31
+    });
32
+
33
+    developer.log(sendData.body, name: "Get History Reimburse Result");
34
+    return sendData.body;
35
+  }
36
+}

+ 36
- 0
lib/Screens/Menu/SlipGaji/RequestHttp/downloadSlipGaji_post.dart Parādīt failu

@@ -0,0 +1,36 @@
1
+import 'dart:convert';
2
+import 'dart:core';
3
+import 'package:http/http.dart' as http;
4
+import 'package:hris_selfservice_mobile/constants.dart';
5
+import 'dart:developer' as developer;
6
+
7
+import 'package:shared_preferences/shared_preferences.dart';
8
+
9
+class DownloadSlipGaji_Post {
10
+  late String batch_id;
11
+  late String session;
12
+
13
+  DownloadSlipGaji_Post({required this.session});
14
+
15
+  static Future<String> connectToAPI(String batch_id) async {
16
+    String URL = baseURL + "/api/v1/download_slip";
17
+
18
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
19
+    final session = prefs.getString('session');
20
+
21
+    var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
22
+      "data": [
23
+        {
24
+          "batch_id" : batch_id,
25
+          "session" : session
26
+        }
27
+      ]
28
+    }), headers: {
29
+      "Content-Type": "application/json",
30
+      "Api-key": apiKey
31
+    });
32
+
33
+    developer.log(sendData.body, name: "Download Slip Gaji Result");
34
+    return sendData.body;
35
+  }
36
+}

+ 34
- 0
lib/Screens/Menu/SlipGaji/RequestHttp/historySlipGaji_post.dart Parādīt failu

@@ -0,0 +1,34 @@
1
+import 'dart:convert';
2
+import 'dart:core';
3
+import 'package:http/http.dart' as http;
4
+import 'package:hris_selfservice_mobile/constants.dart';
5
+import 'dart:developer' as developer;
6
+
7
+import 'package:shared_preferences/shared_preferences.dart';
8
+
9
+class HistorySlipGaji_Post {
10
+  late String session;
11
+
12
+  HistorySlipGaji_Post({required this.session});
13
+
14
+  static Future<String> connectToAPI() async {
15
+    String URL = baseURL + "/api/v1/history_slip_gaji";
16
+
17
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
18
+    final session = prefs.getString('session');
19
+
20
+    var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
21
+      "data": [
22
+        {
23
+          "session": session
24
+        }
25
+      ]
26
+    }), headers: {
27
+      "Content-Type": "application/json",
28
+      "Api-key": apiKey
29
+    });
30
+
31
+    developer.log(sendData.body, name: "History Slip Gaji Result");
32
+    return sendData.body;
33
+  }
34
+}

+ 297
- 11
lib/Screens/Menu/SlipGaji/slipgaji_screen.dart Parādīt failu

@@ -1,7 +1,18 @@
1
+import 'dart:convert';
2
+
1 3
 import 'package:flutter/cupertino.dart';
4
+import 'package:flutter/gestures.dart';
2 5
 import 'package:flutter/material.dart';
6
+import 'package:fluttertoast/fluttertoast.dart';
3 7
 import 'package:google_fonts/google_fonts.dart';
8
+import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/detailSlipGaji_post.dart';
9
+import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/historySlipGaji_post.dart';
4 10
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/background.dart';
11
+import 'package:intl/date_symbol_data_local.dart';
12
+import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
13
+import 'dart:developer' as logDev;
14
+
15
+import 'package:shared_preferences/shared_preferences.dart';
5 16
 
6 17
 class SlipGajiScreen extends StatefulWidget {
7 18
   const SlipGajiScreen({Key? key}) : super(key: key);
@@ -11,9 +22,212 @@ class SlipGajiScreen extends StatefulWidget {
11 22
 }
12 23
 
13 24
 class _SlipGajiScreenState extends State<SlipGajiScreen> {
25
+  late List <String> dateTo_List;
26
+  late List <String> batchID_List;
27
+
28
+  //Detail Slip Gaji
29
+  late List <String> period_List;
30
+  late List <String> namaPegawai_List;
31
+  late List <String> status_List;
32
+  late List <String> structure_List;
33
+  late String position;
34
+
35
+  //Komponen Gaji
36
+  late List <String> name_List;
37
+  late List <String> category_List;
38
+  late List <String> total_List;
39
+
40
+  late int HistoryLength;
41
+  late int DetailLength;
42
+
14 43
   var selectedDate;
15 44
   bool visible = false;
16 45
 
46
+  @override
47
+  void initState() {
48
+    super.initState();
49
+    dateTo_List = [""];
50
+    batchID_List = [""];
51
+
52
+    name_List = [""];
53
+    category_List = [""];
54
+    total_List = [""];
55
+
56
+    WidgetsBinding.instance.addPostFrameCallback((_) {
57
+      ProgressDialog loading = ProgressDialog(context);
58
+      loading = ProgressDialog(context,
59
+          type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
60
+      loading.style(
61
+          message: 'Please Wait .....',
62
+          borderRadius: 3,
63
+          backgroundColor: Colors.white,
64
+          progressWidget: CircularProgressIndicator(),
65
+          elevation: 10.0,
66
+          padding: EdgeInsets.all(10),
67
+          insetAnimCurve: Curves.easeInOut,
68
+          progress: 0.0,
69
+          maxProgress: 100.0,
70
+          progressTextStyle: TextStyle(
71
+              color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
72
+          messageTextStyle: TextStyle(
73
+              color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
74
+      loading.show();
75
+      getHistoryData();
76
+      loading.hide();
77
+    });
78
+  }
79
+
80
+  getHistoryData() async {
81
+    HistorySlipGaji_Post.connectToAPI().then((valueResult) async {
82
+      Map<String, dynamic> object = json.decode(valueResult);
83
+      if (object.containsKey("result").toString() == "true"){
84
+        String result = object['result'].toString();
85
+        if (result.contains("failed")) {
86
+          //loading.hide();
87
+          setState(() {
88
+            alertDialogFailedRetrievedData(context);
89
+          });
90
+        } else {
91
+          List <dynamic> historySlipGaji = object['result'];
92
+          setState(() {
93
+            for (int i = 0; i < historySlipGaji.length; i++){
94
+              String dateTo = historySlipGaji[i]['date_to'].toString();
95
+              String bulan = dateTo.substring(5,7);
96
+              String tahun = dateTo.substring(0,4);
97
+              String batchID = historySlipGaji[i][''].toString();
98
+
99
+              String bulanStr = "";
100
+              if (bulan == "01"){
101
+                bulanStr = "January";
102
+              } else if (bulan == "02"){
103
+                bulanStr = "February";
104
+              } else if (bulan == "03"){
105
+                bulanStr = "March";
106
+              } else if (bulan == "04"){
107
+                bulanStr = "April";
108
+              } else if (bulan == "05"){
109
+                bulanStr = "May";
110
+              } else if (bulan == "06"){
111
+                bulanStr = "June";
112
+              } else if (bulan == "07"){
113
+                bulanStr = "July";
114
+              } else if (bulan == "08"){
115
+                bulanStr = "August";
116
+              } else if (bulan == "09"){
117
+                bulanStr = "September";
118
+              } else if (bulan == "10"){
119
+                bulanStr = "October";
120
+              } else if (bulan == "11"){
121
+                bulanStr = "November";
122
+              } else if (bulan == "12"){
123
+                bulanStr = "December";
124
+              }
125
+
126
+              String bulanTahun = bulanStr + " " + tahun;
127
+              dateTo_List.add(bulanTahun);
128
+              batchID_List.add(batchID);
129
+            }
130
+            dateTo_List.removeAt(0);
131
+            batchID_List.removeAt(0);
132
+            logDev.log(dateTo_List.toString(), name: "LIST DATE");
133
+            HistoryLength = historySlipGaji.length;
134
+
135
+          });
136
+          //loading.hide();
137
+        }
138
+      } else {
139
+        setState((){
140
+          alertDialogFailedResponse(context);
141
+          Fluttertoast.showToast(
142
+              msg: "Server Response Error",
143
+              toastLength: Toast.LENGTH_SHORT,
144
+              gravity: ToastGravity.CENTER,
145
+              timeInSecForIosWeb: 1,
146
+              textColor: Colors.white,
147
+              fontSize: 16.0);
148
+        });
149
+        //loading.hide();
150
+      }
151
+    });
152
+
153
+  }
154
+
155
+  getDetailData () async {
156
+    ProgressDialog loading = ProgressDialog(context);
157
+    loading = ProgressDialog(context,
158
+        type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
159
+    loading.style(
160
+        message: 'Please Wait .....',
161
+        borderRadius: 3,
162
+        backgroundColor: Colors.white,
163
+        progressWidget: CircularProgressIndicator(),
164
+        elevation: 10.0,
165
+        padding: EdgeInsets.all(10),
166
+        insetAnimCurve: Curves.easeInOut,
167
+        progress: 0.0,
168
+        maxProgress: 100.0,
169
+        progressTextStyle: TextStyle(
170
+            color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
171
+        messageTextStyle: TextStyle(
172
+            color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
173
+    loading.show();
174
+
175
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
176
+    for (int i = 0; i < HistoryLength; i++){
177
+      DetailSlipGaji_Post.connectToAPI(batchID_List[i]).then((valueResult) async {
178
+        Map<String, dynamic> object = json.decode(valueResult);
179
+        if (object.containsKey("result").toString() == "true"){
180
+          String result = object['result'].toString();
181
+          if (result.contains("failed")) {
182
+            loading.hide();
183
+            setState(() {
184
+              alertDialogFailedRetrievedData(context);
185
+            });
186
+          } else {
187
+            List <dynamic> detailSlipGaji = object['result'];
188
+            setState(() {
189
+              position = prefs.getString('position')!;
190
+              for (int k = 0; k < detailSlipGaji.length; k++){
191
+                String tanggalAwal = detailSlipGaji[k]['date_from'].toString();
192
+                String tanggalAkhir = detailSlipGaji[k]['date_to'].toString();
193
+                String namaPegawai = detailSlipGaji[k]['employee'].toString();
194
+                String status = detailSlipGaji[i]['status'].toString();
195
+                String structure = detailSlipGaji[i]['structure'].toString();
196
+                List <dynamic> component = object['result']['component'];
197
+                for (int j = 0; j < component.length; j++){
198
+                  String name = component[j]['name'].toString();
199
+                  String category = component[j]['category'].toString();
200
+                  String total = component[j]['total'].toString();
201
+
202
+                  name_List.add(name);
203
+                  category_List.add(category);
204
+                  total_List.add(total);
205
+                }
206
+
207
+                period_List.add(tanggalAwal + " - " + tanggalAkhir);
208
+                namaPegawai_List.add(namaPegawai);
209
+                status_List.add(status);
210
+              }
211
+            });
212
+            loading.hide();
213
+          }
214
+        } else {
215
+          setState((){
216
+            alertDialogFailedResponse(context);
217
+            Fluttertoast.showToast(
218
+                msg: "Server Response Error",
219
+                toastLength: Toast.LENGTH_SHORT,
220
+                gravity: ToastGravity.CENTER,
221
+                timeInSecForIosWeb: 1,
222
+                textColor: Colors.white,
223
+                fontSize: 16.0);
224
+          });
225
+          loading.hide();
226
+        }
227
+      });
228
+    }
229
+  }
230
+
17 231
   @override
18 232
   Widget build(BuildContext context) {
19 233
     return Scaffold(
@@ -24,7 +238,7 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
24 238
             children: [
25 239
               WavyHeader(),
26 240
               Container(
27
-                margin: EdgeInsets.only(top: 90),
241
+                margin: EdgeInsets.only(top: MediaQuery.of(context).size.height/6 - 20),
28 242
                 padding: EdgeInsets.fromLTRB(20, 5, 25, 5),
29 243
                 child: Row(
30 244
                   mainAxisAlignment: MainAxisAlignment.end,
@@ -88,7 +302,7 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
88 302
                                       }
89 303
                                     });
90 304
                                   },
91
-                                  items: dateList
305
+                                  items: dateTo_List
92 306
                                       .map(
93 307
                                         (e) => DropdownMenuItem(
94 308
                                             value: e,
@@ -103,7 +317,8 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
103 317
                     Visibility(
104 318
                       visible: visible,
105 319
                       child: Text(
106
-                        'Salary Slip ' + selectedDate.toString(),
320
+                        'Salary Slip ' + selectedDate.toString() + "\nPT. Global Service Indonesia",
321
+                        textAlign: TextAlign.center,
107 322
                         style: GoogleFonts.viga(
108 323
                           fontSize: 15,
109 324
                           fontWeight: FontWeight.bold,
@@ -119,7 +334,9 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
119 334
                             child: Container(
120 335
                                 decoration: BoxDecoration(
121 336
                                     color: Color(0XFFFFFEFC),
122
-                                    borderRadius: BorderRadius.circular(10))),
337
+                                    borderRadius: BorderRadius.circular(10)
338
+                                )
339
+                            ),
123 340
                           ),
124 341
                         )),
125 342
                     Visibility(
@@ -144,14 +361,83 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
144 361
   }
145 362
 }
146 363
 
147
-List<String> dateList = [
148
-  "September 2022",
149
-  "Oktober 2022",
150
-  "November 2022",
151
-  "Desember 2022"
152
-];
153
-
154 364
 const List<Color> Gradients1 = [
155 365
   Color(0xFF0EDED2),
156 366
   Color(0xFF03A0FE),
157 367
 ];
368
+
369
+alertDialogFailedRetrievedData(BuildContext context){
370
+  Widget okButton = TextButton(
371
+    child: Text("Refresh"),
372
+    onPressed: () {
373
+      Navigator.of(context, rootNavigator: true).pop();
374
+      Navigator.pushReplacement(context, MaterialPageRoute(
375
+          builder: (context) => SlipGajiScreen()));
376
+    },
377
+  );
378
+
379
+  Widget noButton = TextButton(
380
+    child: Text("Back"),
381
+    onPressed: () {
382
+      Navigator.of(context, rootNavigator: true).pop();
383
+      Navigator.pop(context);
384
+
385
+    },
386
+  );
387
+
388
+  // set up the AlertDialog
389
+  AlertDialog alert = AlertDialog(
390
+    title: Text("Employee Self Service"),
391
+    content: Text("Failed to Retrieve Data"),
392
+    actions: [
393
+      noButton,
394
+      okButton,
395
+    ],
396
+  );
397
+
398
+  // show the dialog
399
+  showDialog(
400
+    context: context,
401
+    builder: (BuildContext context) {
402
+      return alert;
403
+    },
404
+  );
405
+}
406
+
407
+alertDialogFailedResponse(BuildContext context){
408
+  Widget okButton = TextButton(
409
+    child: Text("Refresh"),
410
+    onPressed: () {
411
+      Navigator.of(context, rootNavigator: true).pop();
412
+      Navigator.pushReplacement(context, MaterialPageRoute(
413
+          builder: (context) => SlipGajiScreen()));
414
+    },
415
+  );
416
+
417
+  Widget noButton = TextButton(
418
+    child: Text("Back"),
419
+    onPressed: () {
420
+      Navigator.of(context, rootNavigator: true).pop();
421
+      Navigator.pop(context);
422
+
423
+    },
424
+  );
425
+
426
+  // set up the AlertDialog
427
+  AlertDialog alert = AlertDialog(
428
+    title: Text("Employee Self Service"),
429
+    content: Text("Server Response Error"),
430
+    actions: [
431
+      noButton,
432
+      okButton,
433
+    ],
434
+  );
435
+
436
+  // show the dialog
437
+  showDialog(
438
+    context: context,
439
+    builder: (BuildContext context) {
440
+      return alert;
441
+    },
442
+  );
443
+}

+ 36
- 0
lib/Screens/Menu/SuratTugas/RequestHttp/detailST_post.dart Parādīt failu

@@ -0,0 +1,36 @@
1
+import 'dart:convert';
2
+import 'dart:core';
3
+import 'package:http/http.dart' as http;
4
+import 'package:hris_selfservice_mobile/constants.dart';
5
+import 'dart:developer' as developer;
6
+
7
+import 'package:shared_preferences/shared_preferences.dart';
8
+
9
+class DetailST_Post {
10
+  late String id;
11
+  late String session;
12
+
13
+  DetailST_Post({required this.session});
14
+
15
+  static Future<String> connectToAPI(String id) async {
16
+    String URL = baseURL + "/api/v1/detail_st";
17
+
18
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
19
+    final session = prefs.getString('session');
20
+
21
+    var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
22
+      "data": [
23
+        {
24
+          "id" : id,
25
+          "session": session
26
+        }
27
+      ]
28
+    }), headers: {
29
+      "Content-Type": "application/json",
30
+      "Api-key": apiKey
31
+    });
32
+
33
+    developer.log(sendData.body, name: "Detail ST Result");
34
+    return sendData.body;
35
+  }
36
+}

+ 34
- 0
lib/Screens/Menu/SuratTugas/RequestHttp/historyST_post.dart Parādīt failu

@@ -0,0 +1,34 @@
1
+import 'dart:convert';
2
+import 'dart:core';
3
+import 'package:http/http.dart' as http;
4
+import 'package:hris_selfservice_mobile/constants.dart';
5
+import 'dart:developer' as developer;
6
+
7
+import 'package:shared_preferences/shared_preferences.dart';
8
+
9
+class HistoryST_Post {
10
+  late String session;
11
+
12
+  HistoryST_Post({required this.session});
13
+
14
+  static Future<String> connectToAPI() async {
15
+    String URL = baseURL + "/api/v1/history_st";
16
+
17
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
18
+    final session = prefs.getString('session');
19
+
20
+    var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
21
+      "data": [
22
+        {
23
+          "session": session
24
+        }
25
+      ]
26
+    }), headers: {
27
+      "Content-Type": "application/json",
28
+      "Api-key": apiKey
29
+    });
30
+
31
+    developer.log(sendData.body, name: "Get History Reimburse Result");
32
+    return sendData.body;
33
+  }
34
+}

+ 62
- 0
lib/Screens/Menu/SuratTugas/RequestHttp/pengajuanST_post.dart Parādīt failu

@@ -0,0 +1,62 @@
1
+import 'dart:convert';
2
+import 'dart:core';
3
+import 'package:http/http.dart' as http;
4
+import 'package:hris_selfservice_mobile/constants.dart';
5
+import 'dart:developer' as developer;
6
+
7
+import 'package:shared_preferences/shared_preferences.dart';
8
+
9
+class PengajuanST_Post {
10
+  late String session;
11
+  late String tanggal_st;
12
+  late String uang_muka;
13
+  late String keperluan;
14
+  late String tanggal_berangkat;
15
+  late String tanggal_kembali;
16
+  late String tujuan;
17
+  late String ticket_type;
18
+  late String ticket_from;
19
+  late String ticket_to;
20
+  late String date;
21
+  late String harga;
22
+
23
+  PengajuanST_Post({required this.session});
24
+
25
+  static Future<String> connectToAPI(String tanggal_st, String uang_muka, String keperluan,
26
+      String tanggal_berangkat, String tanggal_kembali, String tujuan, String ticket_type,
27
+      String ticket_from, String ticket_to, String date, String harga) async {
28
+    String URL = baseURL + "/api/v1/pengajuan_st";
29
+
30
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
31
+    final session = prefs.getString('session');
32
+
33
+    var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
34
+      "data": [
35
+        {
36
+          "tanggal_st" : tanggal_st,
37
+          "uang_muka" : uang_muka,
38
+          "keperluan" : keperluan,
39
+          "tanggal_berangkat" : tanggal_berangkat,
40
+          "tanggal_kembali" : tanggal_kembali,
41
+          "tujuan" : tujuan,
42
+          "tiketnya" : [
43
+            {
44
+              "ticket_type" : ticket_type,
45
+              "ticket_from" : ticket_from,
46
+              "ticket_to" : ticket_to,
47
+              "date" : date,
48
+              "harga" : harga
49
+            }
50
+          ],
51
+          "session" : "fsfssdfsdfsdf"
52
+        }
53
+      ]
54
+    }), headers: {
55
+      "Content-Type": "application/json",
56
+      "Api-key": apiKey
57
+    });
58
+
59
+    //developer.log(sendData.body, name: "Get Jenis Cuti Result");
60
+    return sendData.body;
61
+  }
62
+}

+ 400
- 0
lib/Screens/Menu/SuratTugas/history_st.dart Parādīt failu

@@ -0,0 +1,400 @@
1
+import 'dart:convert';
2
+import 'dart:ui';
3
+
4
+import 'package:flutter/material.dart';
5
+import 'package:fluttertoast/fluttertoast.dart';
6
+import 'package:google_fonts/google_fonts.dart';
7
+import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/RequestHttp/detailST_post.dart';
8
+import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/RequestHttp/historyST_post.dart';
9
+import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
10
+import 'dart:developer' as logDev;
11
+
12
+import '../AjukanCuti/backgroundHistory.dart';
13
+
14
+class HistoryST extends StatefulWidget {
15
+  const HistoryST({Key? key}) : super(key: key);
16
+
17
+  @override
18
+  State<HistoryST> createState() => _HistoryST();
19
+}
20
+
21
+class _HistoryST extends State<HistoryST> {
22
+  late List <String> id_List;
23
+  late List <String> number_List;
24
+  late List <String> keperluan_List;
25
+  late List <String> tglDibuat_List;
26
+  late List <String> status_List;
27
+
28
+  late List <String> tglST_List;
29
+  late List <String> uMuka_List;
30
+  late List <String> tglBerangkat_List;
31
+  late List <String> tglKembali_List;
32
+  late List <String> tujuan_List;
33
+
34
+  late List <String> ticketType_List;
35
+  late List <String> ticketFrom_List;
36
+  late List <String> ticketTo_List;
37
+  late List <String> ticketDate_List;
38
+  late List <String> ticketPrice_List;
39
+
40
+  late List <Color> statusColor;
41
+  late List <bool> visible;
42
+
43
+  int HistoryLength = 0;
44
+
45
+  @override
46
+  initState() {
47
+    id_List = [""];
48
+    number_List = [""];
49
+    keperluan_List = [""];
50
+    tglDibuat_List = [""];
51
+    status_List = [""];
52
+
53
+    tglST_List = [""];
54
+    uMuka_List = [""];
55
+    tglBerangkat_List = [""];
56
+    tglKembali_List = [""];
57
+    tujuan_List = [""];
58
+
59
+    ticketType_List = [""];
60
+    ticketFrom_List = [""];
61
+    ticketTo_List = [""];
62
+    ticketDate_List = [""];
63
+    ticketPrice_List = [""];
64
+
65
+    statusColor = [Colors.black54];
66
+    visible = [false];
67
+
68
+    WidgetsBinding.instance.addPostFrameCallback((_) async {
69
+      getHistoryData();
70
+      getDetailData();
71
+    });
72
+    logDev.log(HistoryLength.toString(), name: "Banyak History");
73
+  }
74
+
75
+  getHistoryData() async {
76
+    ProgressDialog loading = ProgressDialog(context);
77
+    loading = ProgressDialog(context,
78
+        type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
79
+    loading.style(
80
+        message: 'Please Wait .....',
81
+        borderRadius: 3,
82
+        backgroundColor: Colors.white,
83
+        progressWidget: CircularProgressIndicator(),
84
+        elevation: 10.0,
85
+        padding: EdgeInsets.all(10),
86
+        insetAnimCurve: Curves.easeInOut,
87
+        progress: 0.0,
88
+        maxProgress: 100.0,
89
+        progressTextStyle: TextStyle(
90
+            color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
91
+        messageTextStyle: TextStyle(
92
+            color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
93
+
94
+    loading.show();
95
+    HistoryST_Post.connectToAPI().then((valueResult) async {
96
+      Map<String, dynamic> object = jsonDecode(valueResult);
97
+      if (object.containsKey("result").toString() == "true") {
98
+        String result = object['result'].toString();
99
+        if (result.contains("failed")) {
100
+          loading.hide();
101
+          alertDialogFailedRetrievedData(context);
102
+        } else {
103
+          List <dynamic> historyST = object['result'];
104
+          setState(() {
105
+            for (int i = 0; i < historyST.length; i++){
106
+              String id = historyST[i]['id'].toString();
107
+              String number = historyST[i]['number'].toString();
108
+              String keperluan = historyST[i]['keperluan'].toString();
109
+              String tglDibuat = historyST[i]['tgl_dibuat'].toString();
110
+              String status = historyST[i]['status'].toString();
111
+
112
+              id_List.add(id);
113
+              number_List.add(number);
114
+              keperluan_List.add(keperluan);
115
+              tglDibuat_List.add(tglDibuat);
116
+              status_List.add(status);
117
+              visible.add(false);
118
+
119
+              var statColor;
120
+              if (status == "draft"){
121
+                statColor = Colors.red;
122
+              } else if (status == "approved"){
123
+                statColor = Colors.green;
124
+              } else if (status == "advacanced"){
125
+                statColor = Colors.orangeAccent;
126
+              } else if (status == "done"){
127
+                statColor = Colors.blueAccent;
128
+              } else if (status == "close"){
129
+                statColor = Colors.deepPurple;
130
+              }
131
+              statusColor.add(statColor);
132
+            }
133
+
134
+            id_List.removeAt(0);
135
+            number_List.removeAt(0);
136
+            keperluan_List.removeAt(0);
137
+            tglDibuat_List.removeAt(0);
138
+            status_List.removeAt(0);
139
+
140
+            statusColor.removeAt(0);
141
+            visible.removeAt(0);
142
+
143
+            HistoryLength = historyST.length;
144
+          });
145
+        }
146
+      } else {
147
+        Fluttertoast.showToast(
148
+            msg: "Server Response Error",
149
+            toastLength: Toast.LENGTH_SHORT,
150
+            gravity: ToastGravity.CENTER,
151
+            timeInSecForIosWeb: 1,
152
+            textColor: Colors.white,
153
+            fontSize: 16.0);
154
+      }
155
+    });
156
+  }
157
+  getDetailData() async {
158
+    ProgressDialog loading = ProgressDialog(context);
159
+    loading = ProgressDialog(context,
160
+        type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
161
+    loading.style(
162
+        message: 'Please Wait .....',
163
+        borderRadius: 3,
164
+        backgroundColor: Colors.white,
165
+        progressWidget: CircularProgressIndicator(),
166
+        elevation: 10.0,
167
+        padding: EdgeInsets.all(10),
168
+        insetAnimCurve: Curves.easeInOut,
169
+        progress: 0.0,
170
+        maxProgress: 100.0,
171
+        progressTextStyle: TextStyle(
172
+            color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
173
+        messageTextStyle: TextStyle(
174
+            color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
175
+
176
+    for (int i = 0; i < HistoryLength;i++){
177
+      DetailST_Post.connectToAPI(id_List[i]).then((valueResult) async {
178
+        Map<String, dynamic> object = jsonDecode(valueResult);
179
+        if (object.containsKey("result").toString() == "true") {
180
+          String result = object['result'].toString();
181
+          if (result.contains("failed")) {
182
+            loading.hide();
183
+            alertDialogFailedRetrievedData(context);
184
+          } else {
185
+            List <dynamic> detailST = object['result'];
186
+            loading.hide();
187
+            setState(() {
188
+              for (int j = 0; j < HistoryLength; j++){
189
+                String tglST = detailST[j]['tgl_st'].toString();
190
+                String uMuka = detailST[j]['umuka'].toString();
191
+                String tglBerangkat = detailST[j]['tgl_berangkat'].toString();
192
+                String tglKembali = detailST[j]['tgl_kembali'].toString();
193
+                String tujuan = detailST[j]['tujuan'].toString();
194
+
195
+                List<dynamic> ticketID = object['result']['ticket_ids'];
196
+                String ticketType = ticketID[j]['type'].toString();
197
+                String ticketFrom = ticketID[j]['from'].toString();
198
+                String ticketTo = ticketID[j]['to'].toString();
199
+                String ticketDate = ticketID[j]['tgl'].toString();
200
+                String ticketPrice = ticketID[j]['harga'].toString();
201
+
202
+                tglST_List.add(tglST);
203
+                uMuka_List.add(uMuka);
204
+                tglBerangkat_List.add(tglBerangkat);
205
+                tglKembali_List.add(tglKembali);
206
+                tujuan_List.add(tujuan);
207
+
208
+                ticketType_List.add(ticketType);
209
+                ticketFrom_List.add(ticketFrom);
210
+                ticketTo_List.add(ticketTo);
211
+                ticketDate_List.add(ticketDate);
212
+                ticketPrice_List.add(ticketPrice);
213
+              }
214
+
215
+              tglST_List.removeAt(0);
216
+              uMuka_List.removeAt(0);
217
+              tglBerangkat_List.removeAt(0);
218
+              tglKembali_List.removeAt(0);
219
+              tujuan_List.removeAt(0);
220
+
221
+              ticketType_List.removeAt(0);
222
+              ticketFrom_List.removeAt(0);
223
+              ticketTo_List.removeAt(0);
224
+              ticketDate_List.removeAt(0);
225
+              ticketPrice_List.removeAt(0);
226
+            });
227
+          }
228
+        } else {
229
+          Fluttertoast.showToast(
230
+              msg: "Server Response Error",
231
+              toastLength: Toast.LENGTH_SHORT,
232
+              gravity: ToastGravity.CENTER,
233
+              timeInSecForIosWeb: 1,
234
+              textColor: Colors.white,
235
+              fontSize: 16.0);
236
+        }
237
+      });
238
+    }
239
+    loading.hide();
240
+  }
241
+
242
+  @override
243
+  Widget build(BuildContext context) {
244
+    var size = MediaQuery.of(context).size;
245
+    return Scaffold(
246
+      body: Stack(
247
+          children: [
248
+            Column(
249
+              children: <Widget>[
250
+                Stack(
251
+                  children: [
252
+                    WavyHeader(),
253
+                    Container(
254
+                        margin: EdgeInsets.only(
255
+                            top: (size.height / 6) - 20),
256
+                        padding: EdgeInsets.fromLTRB(0, 5, 25, 5),
257
+                        child: Row(
258
+                          mainAxisAlignment: MainAxisAlignment.end,
259
+                          crossAxisAlignment: CrossAxisAlignment.end,
260
+                          children: [
261
+                            Text(
262
+                              'Assignment Letter\nHistory\t\t',
263
+                              maxLines: 1,
264
+                              style: GoogleFonts.luckiestGuy(
265
+                                fontSize: 28,
266
+                                color: Colors.red,
267
+                                fontStyle: FontStyle.italic,
268
+                              ),
269
+                            ),
270
+                            Image.asset(
271
+                              'assets/images/ic_history.png',
272
+                              width: 40,
273
+                              height: 40,
274
+                            ),
275
+                          ],
276
+                        )
277
+                    ),
278
+                  ],
279
+                ),
280
+              ],
281
+            ),
282
+            Container(
283
+              margin: EdgeInsets.only(top: (MediaQuery.of(context).size.height / 6) + 40, left: 5, right: 5, bottom: 10),
284
+              child: ListView.builder(
285
+                scrollDirection: Axis.vertical,
286
+                shrinkWrap: true,
287
+                itemCount: HistoryLength,
288
+                itemBuilder: (context, int i) {
289
+                  return Container(
290
+                    child: InkWell(
291
+                      child: Card(
292
+                        elevation: 10,
293
+                        child: Column(
294
+                          children: [
295
+                            Row(
296
+                              children: [
297
+                                Expanded(
298
+                                    flex: 8,
299
+                                    child: Padding(
300
+                                      padding: EdgeInsets.fromLTRB(10, 5, 5, 5),
301
+                                      child: Column(
302
+                                        mainAxisAlignment: MainAxisAlignment.center,
303
+                                        crossAxisAlignment: CrossAxisAlignment.start,
304
+                                        children: [
305
+                                          Text(number_List[i], style: GoogleFonts.rubikBubbles(fontSize: 16)),
306
+                                          Text(keperluan_List[i], style: GoogleFonts.nunito(fontSize: 15)),
307
+                                          Text("\nCreated : " + tglDibuat_List[i], style: GoogleFonts.nunito(fontSize: 15)),
308
+                                        ],
309
+                                      ),
310
+                                    )
311
+                                ),
312
+                                Expanded(
313
+                                    flex: 2,
314
+                                    child: Padding(
315
+                                      padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
316
+                                      child: Text(status_List[i], textAlign: TextAlign.center, style: GoogleFonts.lilitaOne(color: statusColor[i], fontSize: 17),
317
+                                      ),
318
+                                    )
319
+                                ),
320
+                              ],
321
+                            ),
322
+                            Align(
323
+                              alignment: Alignment.centerLeft,
324
+                              child: Visibility(
325
+                                  visible: visible[i],
326
+                                  child: Padding(
327
+                                    padding: EdgeInsets.fromLTRB(10, 5, 5, 5),
328
+                                    child: Column(
329
+                                      mainAxisAlignment: MainAxisAlignment.start,
330
+                                      crossAxisAlignment: CrossAxisAlignment.start,
331
+                                      children: [
332
+                                        Text("\nAssignment Letter Date\t : " + tglST_List[i], style: GoogleFonts.josefinSans(fontSize: 15, fontWeight: FontWeight.bold)),
333
+                                        Text("Down Payment\t\t : " + uMuka_List[i], style: GoogleFonts.nunito(fontSize: 15)),
334
+                                        Text("Departure Date\t\t : " + tglBerangkat_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
335
+                                        Text("Return Date\t\t : " + tglKembali_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
336
+                                        Text("Destination\t\t : " + tujuan_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
337
+                                        Text("Ticket Type\t\t : " + ticketType_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
338
+                                        Text("From\t\t\t : " + ticketFrom_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
339
+                                        Text("To\t\t : " + ticketTo_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
340
+                                        Text("Ticket Date\t\t : " + ticketDate_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
341
+                                        Text("Ticket Price\t\t\t : " + ticketPrice_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
342
+                                      ],
343
+                                    ),
344
+                                  )
345
+                              ),
346
+                            )
347
+                          ],
348
+                        ),
349
+                      ),
350
+                      onTap: (){
351
+                        setState(() {
352
+                          visible[i] = !visible[i];
353
+                        });
354
+                      },
355
+                    ),
356
+                  );
357
+                },
358
+              ),
359
+            )
360
+          ]),
361
+    );
362
+  }
363
+}
364
+
365
+alertDialogFailedRetrievedData(BuildContext context) {
366
+  Widget okButton = TextButton(
367
+    child: Text("Refresh"),
368
+    onPressed: () {
369
+      Navigator.of(context, rootNavigator: true).pop();
370
+      Navigator.pushReplacement(
371
+          context, MaterialPageRoute(builder: (context) => HistoryST()));
372
+    },
373
+  );
374
+
375
+  Widget noButton = TextButton(
376
+    child: Text("Back"),
377
+    onPressed: () {
378
+      Navigator.of(context, rootNavigator: true).pop();
379
+      Navigator.pop(context);
380
+    },
381
+  );
382
+
383
+  // set up the AlertDialog
384
+  AlertDialog alert = AlertDialog(
385
+    title: Text("Employee Self Service"),
386
+    content: Text("Failed to Retrieve Data"),
387
+    actions: [
388
+      noButton,
389
+      okButton,
390
+    ],
391
+  );
392
+
393
+  // show the dialog
394
+  showDialog(
395
+    context: context,
396
+    builder: (BuildContext context) {
397
+      return alert;
398
+    },
399
+  );
400
+}

+ 708
- 358
lib/Screens/Menu/SuratTugas/pengajuan_st.dart
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 14
- 3
lib/Screens/Menu/SuratTugas/surattugas_screen.dart Parādīt failu

@@ -1,6 +1,7 @@
1 1
 import 'package:flutter/cupertino.dart';
2 2
 import 'package:flutter/material.dart';
3 3
 import 'package:google_fonts/google_fonts.dart';
4
+import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/history_st.dart';
4 5
 import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/pengajuan_st.dart';
5 6
 
6 7
 import '../SlipGaji/background.dart';
@@ -28,7 +29,7 @@ class _SuratTugas_ScreenState extends State<SuratTugas_Screen> {
28 29
             children: [
29 30
               WavyHeader(),
30 31
               Container(
31
-                  margin: EdgeInsets.only(top: 90),
32
+                  margin: EdgeInsets.only(top: MediaQuery.of(context).size.height/6 - 20),
32 33
                   padding: EdgeInsets.fromLTRB(20, 5, 25, 5),
33 34
                   child: Row(
34 35
                     mainAxisAlignment: MainAxisAlignment.end,
@@ -124,7 +125,12 @@ class _SuratTugas_ScreenState extends State<SuratTugas_Screen> {
124 125
                                 )
125 126
                               ],
126 127
                             )),
127
-                        onTap: () {},
128
+                        onTap: () {
129
+                          Navigator.push(
130
+                              context,
131
+                              MaterialPageRoute(
132
+                                  builder: (context) => PengajuanST_Screen()));
133
+                        },
128 134
                       ),
129 135
                       InkWell(
130 136
                         child: Container(
@@ -155,7 +161,12 @@ class _SuratTugas_ScreenState extends State<SuratTugas_Screen> {
155 161
                                 )
156 162
                               ],
157 163
                             )),
158
-                        onTap: () {},
164
+                        onTap: () {
165
+                          Navigator.push(
166
+                              context,
167
+                              MaterialPageRoute(
168
+                                  builder: (context) => HistoryST()));
169
+                        },
159 170
                       ),
160 171
                       InkWell(
161 172
                         child: Container(

+ 2
- 0
lib/Screens/Splash/loginstatus_post.dart Parādīt failu

@@ -35,6 +35,8 @@ class LoginStatus_Post {
35 35
         }),
36 36
         headers: {"Content-Type": "application/json", "Api-key": apiKey});
37 37
 
38
+
39
+    logDev.log(sendData.body, name: "Login Status");
38 40
     return sendData.body;
39 41
 
40 42
 

+ 10
- 3
pubspec.lock Parādīt failu

@@ -196,7 +196,7 @@ packages:
196 196
       name: file_picker
197 197
       url: "https://pub.dartlang.org"
198 198
     source: hosted
199
-    version: "5.2.4"
199
+    version: "5.2.5"
200 200
   firebase_core:
201 201
     dependency: "direct main"
202 202
     description:
@@ -568,7 +568,7 @@ packages:
568 568
       name: lottie
569 569
       url: "https://pub.dartlang.org"
570 570
     source: hosted
571
-    version: "2.1.0"
571
+    version: "2.2.0"
572 572
   matcher:
573 573
     dependency: transitive
574 574
     description:
@@ -695,6 +695,13 @@ packages:
695 695
       url: "https://pub.dartlang.org"
696 696
     source: hosted
697 697
     version: "5.1.0"
698
+  plain_notification_token:
699
+    dependency: "direct main"
700
+    description:
701
+      name: plain_notification_token
702
+      url: "https://pub.dartlang.org"
703
+    source: hosted
704
+    version: "0.0.4"
698 705
   platform:
699 706
     dependency: transitive
700 707
     description:
@@ -986,7 +993,7 @@ packages:
986 993
       name: xdg_directories
987 994
       url: "https://pub.dartlang.org"
988 995
     source: hosted
989
-    version: "0.2.0+2"
996
+    version: "0.2.0+3"
990 997
   xml:
991 998
     dependency: transitive
992 999
     description:

+ 1
- 0
pubspec.yaml Parādīt failu

@@ -83,6 +83,7 @@ dependencies:
83 83
   provider: ^6.0.5
84 84
   connectivity_plus: ^3.0.2
85 85
   internet_connection_checker: ^1.0.0+1
86
+  plain_notification_token: ^0.0.4
86 87
 
87 88
 dev_dependencies:
88 89
   flutter_test:

Notiek ielāde…
Atcelt
Saglabāt