01.
function
(isConfirm)
02.
{
03.
if
(isConfirm)
04.
{
05.
$.post(service,data,
function
(datar){
06.
try
07.
{
08.
var
dataj = $.parseJSON(datar);
09.
if
(dataj.status==
'ok'
){
10.
swal(
"Save! Project "
,
"Your save data completed."
,
"success"
);
11.
12.
$(
"#refreshProject"
).click(
function
() {
13.
$(
"#projectBidCmb"
).load(
'crm/app/bd/cbd/adHeader.php'
);
14.
});
15.
$(
"#exampleModal2"
).toggle(); ---> หน้าที่ต้องการให้ค้างอยู่
16.
17.
18.
19.
if
(opt ==
"inst"
){
20.
clearDialog();
21.
}
22.
23.
}
else
if
(dataj.status==
'no'
){
24.
swal(
"Error!"
, dataj.bc,
"warning"
);
25.
setTimeout(
function
() {
26.
location.reload();
27.
}, 2000);
28.
}
29.
}
30.
catch(err)
31.
{
32.
swal(
"Data input error."
, datar,
"error"
);
33.
setTimeout(
function
() {
34.
location.reload();
35.
}, 2000);
36.
}
37.
});
38.
}
else
{
39.
swal(
"Cancled"
,
"Your Cancled data complete :)"
,
"error"
);
40.
setTimeout(
function
() {
41.
location.reload();
42.
}, 2000);
43.
}
44.
};