-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.js
84 lines (78 loc) · 2.63 KB
/
module.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
M.block_sms = {};
M.block_sms.init = function (Y, param3) {
// Variables.
var showuser = Y.one("#btnajax");
var sms_send = Y.one('#smssend');
var action = Y.one('#id_rid');
var action1 = Y.one('#id_mid');
var action2 = Y.one('#id_cid');
var userlist = Y.one("#table-change");
var img = Y.one('#load');
var msg_body = Y.one('#id_sms_body');
var m_id = action1.get('value');
Y.io('load_message.php?m_id=' + m_id, {
on: {
start: function (id, args) {
msg_body.hide();
img.show();
},
complete: function (id, e) {
var json = e.responseText;
img.hide();
msg_body.show();
msg_body.set('value', json);
}
}
});
// Image default setting.
img.hide();
sms_send.hide();
// Event occurs after click on show user button.
showuser.on('click', function () {
var content = Y.one('#id_sms_body');
var c_id = action2.get('value');
var r_id = action.get('value');
var msg = content.get('value');
Y.io('user_list.php?msg=' + msg + '&c_id=' + c_id + '&r_id=' + r_id, {
on: {
start: function (id, args) {
userlist.set('innerHTML', '<img src="Loading.gif" id="load-users" style="margin-left:6cm;" />');
},
complete: function (id, e) {
var json = e.responseText;
console.log(json);
userlist.set('innerHTML', json);
sms_send.show();
$('.display').DataTable({ paging:false });
}
}
});
});
// End show user event.
// If viewpage is 2 means send sms page.
if (param3 == '2') {
action.on('change', function () {
var b = this.get('text');
});
// Select Message Template.
action1.on('change', function () {
var content = Y.one('#id_sms_body');
var m_id = action1.get('value');
Y.io('load_message.php?m_id=' + m_id, {
on: {
start: function (id, args) {
content.hide();
img.show();
},
complete: function (id, e) {
var json = e.responseText;
console.log(json);
img.hide();
content.show();
content.set('value', json);
}
}
});
});
}
};