Project

General

Profile

Bug #2939 » hrPAUpload-fnUploadData-20240808.js

Tri Rizqiaty, 08/08/2024 03:10 PM

 
1
var _num = (fldFile.getValue().length) - 4;
2
var _num1 = (fldFile.getValue().length) - 5;
3
//alert(_num1);
4
//alert(Ext.util.Format.substr(fldFile.getValue(), _num1, 5));
5
var mdtype = fldMDType.getValue();
6
if (Ext.util.Format.substr(fldFile.getValue(), _num, 4) == ".xls" ||
7
    Ext.util.Format.substr(fldFile.getValue(), _num1, 5) == ".xlsx") {
8
    if (mdtype == "empmd0019") {
9
        if (pnlParam.getForm().isValid()) {
10
            pnlParam.getForm().submit({
11
                url: "/HR_Core_Att/UploadMDDataAtt",
12
                waitMsg: "Uploading data...",
13
                method: "POST",
14
                success: function (pnlParam, o) {
15
                    dataResult.loadData(o.result.logs);
16

    
17
                    Ext.Msg.show({
18
                        title: 'Result',
19
                        msg: 'Process OK',
20
                        buttons: Ext.Msg.OK,
21
                        icon: Ext.Msg.INFO
22
                    });
23
                },
24
                failure: function (pnlParam, o) {
25
                    Ext.Msg.show({
26
                        title: 'Result',
27
                        msg: o.result.error,
28
                        buttons: Ext.Msg.OK,
29
                        icon: Ext.Msg.ERROR
30
                    });
31
                }
32
            })
33
        }
34
    } else {
35
        if (pnlParam.getForm().isValid()) {
36
            pnlParam.getForm().submit({
37
                url: "/HR_Core/UploadMDData",
38
                waitMsg: "Uploading data...",
39
                method: "POST",
40
                success: function (pnlParam, o) {
41
                    dataResult.loadData(o.result.logs);
42

    
43
                    Ext.Msg.show({
44
                        title: 'Result',
45
                        msg: 'Process OK',
46
                        buttons: Ext.Msg.OK,
47
                        icon: Ext.Msg.INFO
48
                    });
49
                },
50
                failure: function (pnlParam, o) {
51
                    Ext.Msg.show({
52
                        title: 'Result',
53
                        msg: o.result.error,
54
                        buttons: Ext.Msg.OK,
55
                        icon: Ext.Msg.ERROR
56
                    });
57
                }
58
            })
59
        }
60
    }
61
}
(7-7/7)