문자 메일 발송 메뉴 청소년 요청서류 알림 메뉴 교육결과관리 메뉴 저작권체험교실 - 저작권 체험교실 > 운영신청 관리 > 상세(운영신청단계인거) 수정요청 버튼 클릭하고 기본멘트로 확인 버튼 눌렀을때 문자발송
101 lines
2.3 KiB
JavaScript
101 lines
2.3 KiB
JavaScript
//문자발송
|
|
function sendSms(
|
|
p_receiver, // 수신자
|
|
p_cn, //내용
|
|
p_logSeq, //로그에 남길 pk
|
|
p_trgtId, //받는사용자pk
|
|
p_alertYn // 발송 후 alert 여부
|
|
){
|
|
|
|
if (p_cn==""){
|
|
alert("SMS 발송 내용은 필수값입니다.");
|
|
return false;
|
|
}
|
|
sendContent(
|
|
p_receiver,
|
|
p_cn,
|
|
"",
|
|
"10", //코드 10:sms 20:mail
|
|
p_logSeq,
|
|
p_trgtId,
|
|
p_alertYn
|
|
);
|
|
}
|
|
|
|
//이메일 발송
|
|
function sendEmail(
|
|
p_receiver, // 수신자
|
|
p_cn, //내용
|
|
p_logSeq, //로그에 남길 pk
|
|
p_trgtId, //받는사용자pk
|
|
p_flag, // p_flag -> 'C' 청소년 , 'S' 성인
|
|
p_alertYn // 발송 후 alert 여부
|
|
){
|
|
|
|
if (p_cn==""){
|
|
alert("이메일 발송 내용은 필수값입니다.");
|
|
return false;
|
|
}
|
|
|
|
sendContent(
|
|
p_receiver,
|
|
p_cn,
|
|
p_flag,
|
|
"20", //코드 10:sms 20:mail
|
|
p_logSeq,
|
|
p_trgtId,
|
|
p_alertYn
|
|
);
|
|
}
|
|
|
|
//발송
|
|
function sendContent(p_receiver, p_cn, p_flag, p_cd, p_logSeq, p_trgtId, p_alertYn){
|
|
|
|
var url = "";
|
|
if(p_cd == '10') url = getContextPath()+"/kccadr/oprtn/pblc/offeduSMSSndAjax.do";
|
|
else if(p_cd == '20') url = getContextPath()+"/kccadr/oprtn/pblc/emailSndAjax.do";
|
|
|
|
if(url ==""){
|
|
if(p_alertYn != 'N'){
|
|
alert("발송이 실패했습니다.");
|
|
}
|
|
return false;
|
|
}
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url:url,
|
|
data:{
|
|
"clphone": p_receiver,
|
|
"email": p_receiver,
|
|
"sndCn": p_cn,
|
|
"sndFlag": p_flag,
|
|
"sndCd": p_cd,
|
|
"eduAplctOrd": p_logSeq,
|
|
"trgtId" : p_trgtId
|
|
},
|
|
dataType:'json',
|
|
success:function(returnData){
|
|
if(returnData.result == "success"){
|
|
if(p_alertYn != 'N'){
|
|
alert(returnData.message);
|
|
}
|
|
}else{
|
|
if(p_alertYn != 'N'){
|
|
alert(returnData.message);
|
|
}
|
|
}
|
|
},
|
|
error:function(request , status, error){
|
|
if(p_alertYn != 'N'){
|
|
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function getContextPath(){
|
|
var hostIndex = location.href.indexOf( location.host ) + location.host.length;
|
|
var contextPath = location.href.substring( hostIndex, location.href.indexOf('/', hostIndex + 1) );
|
|
return contextPath;
|
|
} |