Files
sms_host20170829/hostsms_utf8_etc.asp
T
2026-02-23 10:01:00 +09:00

104 lines
3.1 KiB
Plaintext

<!--#include virtual = "/common/lib/dbcon.asp" -->
<!--#include virtual = "/common/lib/func.asp" -->
<%
'────────────────────────────────────────────────────
' 나눔 PHP 모듈에서 사용중 175.126.77.226 / 112.216.151.211
' 의성교육지원청 사용중
'────────────────────────────────────────────────────
'm_id : 회원ID
'msg : 메세지
'tran_callback : 회신번호
'tran_phone : 수신번호 ex) 0111231234,0171231234
'rtn_url : 리턴URL ex) http://nninc.co.kr
m_id = inputValue( Request("sms_m_id") )
msg = inputValue( Request("sms_msg") )
tran_callback = inputValue( Request("sms_tran_callback") )
tran_phone = inputValue( Request("sms_tran_phone") )
rtn_url = inputValue( Request("sms_rtn_url"))
etc2 = inputValue( Request("etc2"))
second2 = inputValue( Request("second2"))
'Response.write "a=" & m_id
'Response.end
'msg = Replace(msg, "&amp;","&")
If Instr(msg, "[국민건강검진]통지서") <> 0 Then Response.end
If Instr(msg, ".host") <> 0 Then Response.end
If Instr(msg, ".wiki") <> 0 Then Response.end
If tran_callback = "" Then tran_callback = tran_callback1&tran_callback2&tran_callback3
If rtn_url = "" Then rtn_url = Request.ServerVariables("HTTP_REFERER")
Rdate = Date()& " " & Hour(now)&":"& Minute(now)&":"& Second(now)
'날짜더하기(5초씩 더해서 순차적으로 발송되게)
If second2 <> "0" And second2 <> "" Then
Rdate = DateAdd("s",second2, Rdate)
End If
'날짜형식변경
Rdate = get_DateTimeFormat(Rdate, "yyyy-mm-dd h:n:s")
tran_callback = Replace(tran_callback, "-", "")
If smsSelect2(m_id) > 0 Then
tran_phone_arr = Split(tran_phone,",")
z = 0
For i = 0 To UBound( tran_phone_arr )
If Trim(tran_phone_arr(i)) <> "" then
tran_phone = Replace(tran_phone_arr(i), "-", "")
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc2) values ("
SQL = SQL & "'"&m_id&"','"&tran_phone&"', '"&tran_callback&"', '1', '"&Rdate&"', '"&Msg&"','"&etc2&"')"
Dbcon.Execute sql
z = z + 1
End if
Next
sql = "update member set M_g_sms = M_g_sms - "&z&" where M_id = '"&m_id&"'"
'response.write z
Dbcon.Execute sql
End if
Dbcon.close
Set Dbcon = Nothing
If rtn_url <> "" then
response.redirect rtn_url
End If
'날짜변환함수
Function get_DateTimeFormat(obj_date, dateFormat)
Dim reValue
if false = IsDate(obj_date) then
obj_date = now
end if
if dateFormat = "" then
dateFormat = "yyyy-mm-dd-h:n:s"
end if
reValue = Replace(dateFormat, "yyyy", Year(obj_date))
reValue = Replace(reValue, "mm", right("0" & Month(obj_date) , 2))
reValue = Replace(reValue, "dd", right("0" & Day(obj_date) , 2))
reValue = Replace(reValue, "h", right("0" & Hour(obj_date) , 2))
reValue = Replace(reValue, "n", right("0" & Minute(obj_date) , 2))
reValue = Replace(reValue, "s", right("0" & Second(obj_date) , 2))
get_DateTimeFormat = reValue
End Function
%>