<% Dim idx, userId, userName, userTel, userDate, userTime, contents, writeDate, anser, memo, katalkId Dim userTel1, userTel2, userTel3, kind, device, writePage Dim UploadForm, SQL, RS, tableName, listFile Dim mode, msg Dim smsVariant, smsMsg, smsFrom Dim time1, time2, time3, tran_date Dim branchCode, branchName, branchMobile, branchEmail tableName = "TB_TEL_COUNSEL" '### DB Å×À̺í¸í listFile = "/" '### ¸®½ºÆ® ÆÄÀϸí '³Ñ¾î¿Â °ª º¯¼ö¿¡ ¹Þ±â mode = Trim(Request("mode")) idx = Trim(Request("idx")) branchCode = Trim(Request("branchCode")) userId = Trim(Request("userId")) userName = Trim(Request("userName")) : userName = InjectionDefender(userName) userTel1 = Trim(Request("userTel1")) userTel2 = Trim(Request("userTel2")) userTel3 = Trim(Request("userTel3")) katalkId = Trim(Request("katalkId")) If katalkId = "" Then userTel = userTel1 & "-" & userTel2 & "-" & userTel3 Else userTel = katalkId End If userDate = Trim(Request("inDate")) userTime = Trim(Request("userTime")) contents = Request("contents") : contents = InjectionDefender(contents) anser = Trim(Request("anser")) memo = Request("memo") : memo = InjectionDefender(memo) kind = Trim(Request("kind")) device = Trim(Request("device")) writePage = Trim(Request("writePage")) Select Case mode Case "edit" '¼öÁ¤ ########################################################## Call CheckAuth("sojujan", mode) '### Á¢±Ù ±ÇÇÑ Ã¼Å© msg = "¼öÁ¤" 'DB ¼öÁ¤ SQL = "UPDATE " & tableName SQL = SQL & " SET branchCode = '" & branchCode & "'" SQL = SQL & ", userName = '" & userName & "'" SQL = SQL & ", userTel = '" & userTel & "'" SQL = SQL & ", userDate = '" & userDate & "'" SQL = SQL & ", userTime = '" & userTime & "'" SQL = SQL & ", contents = '" & contents & "'" SQL = SQL & ", anser = '" & anser & "'" SQL = SQL & ", memo = '" & memo & "'" SQL = SQL & " WHERE idx = " & idx Dbcon.Execute(SQL) Case "del" '»èÁ¦ ########################################################## Call CheckAuth("sojujan", mode) '### Á¢±Ù ±ÇÇÑ Ã¼Å© msg = "»èÁ¦" 'DB »èÁ¦ SQL = "DELETE " & tableName & " WHERE idx=" & idx Dbcon.Execute(SQL) Case "insert" 'Ãß°¡ ########################################################## msg = "µî·Ï" '### 1. DB ÀúÀå SQL = "INSERT INTO " & tableName & " (branchCode, userId, userName, userTel, userDate, userTime, contents, writeDate, kind, device, writePage) " SQL = SQL & " VALUES ('" & branchCode & "', '" & userId & "', '" & userName & "', '" & userTel & "', '" & userDate & "', '" & userTime & "', '" & contents & "', GETDATE(), '" & kind & "', '" & device & "', '" & writePage & "')" %> <% Dbcon.Execute(SQL) '############## SMS ¹ß¼Û ½ÃÀÛ ############################ 'Dim smsVariant, smsMsg, smsFrom 'Dim time1, time2, time3, tran_date 'Dim branchCode, branchName, branchMobile, branchEmail '¾ß°£ ½Ã°£´ë´Â ¿¹¾à¹ß¼Û, ³ª¸ÓÁö´Â Áï½Ã ¹ß¼Û time1 = "20:59" 'À̽𣠺¸´Ù Å©¸é ³»ÀÏ ¾ÆÄ§ time3¿¡ ¹ß¼Û time1 = CDate(time1) time2 = "08:59" 'À̽𣠺¸´Ù ÀÛÀ¸¸é ¿À´Ã ¾ÆÄ§ time3¿¡ ¹ß¼Û time2 = CDate(time2) time3 = "09:00" '¹ß¼ÛºÒ°¡ ½Ã°£Àº À̽ð£À¸·Î ¿¹¾à¹ß¼Û If Time() > time1 Then tran_date = Date() + 1 & " " & time3 & ":00" ElseIf Time() < time2 Then tran_date = Date() & " " & time3 & ":00" Else tran_date = "0" 'Áï½Ã ¹ß¼Û End If 'ÁöÁ¡ °ü¸®ÀÚ Á¤º¸ °¡Á®¿À±â 'SQL = "SELECT branchName, branchMobile, branchEmail FROM GW_BRANCH WHERE branchCode = '" & branchCode & "'" SQL = "SELECT branchName, branchMobile, branchEmail FROM GW_BRANCH WHERE branchCode = 'M001'" 'Äݼ¾ÅÍ ´ã´çÀÚ Set RS = Dbcon.Execute(SQL) If RS.eof = false Then branchName = RS("branchName") 'ÁöÁ¡¸í branchMobile = RS("branchMobile") 'ÁöÁ¡ °ü¸®ÀÚ ÈÞ´ëÆù branchEmail = RS("branchEmail") 'ÁöÁ¡ °ü¸®ÀÚ À̸ÞÀÏ End If RS.Close Set RS = Nothing '### ¼³Á¤1. ¹ß½Å¹øÈ£ smsFrom = userTel '### ¼³Á¤2. ¹®ÀÚ ³»¿ë smsMsg = "[ " & kind & "¿äû ] " & userName & " (" & userDate & " " & userTime & ") " & branchName & Left(contents, 0) Response.Write "" 'Àü¼Û°á°ú ¾Èº¸ÀÌ°Ô Ã³¸®.. branchMobile = Split(branchMobile, "|") '°ü¸®ÀÚ ÈÞ´ëÆù °¹¼ö¸¸Å­ ¹Ýº¹ ¹ß¼Û(ÃÖ´ë 3°Ç) For cnt=0 To Ubound(branchMobile) If Len(branchMobile(cnt)) > 9 Then Set smsVariant = New MVariant ' Ŭ·¡½º ¼ÂÆÃ smsVariant.smsServer = "sms.gabia.com" ' ¼­¹ö ÁÖ¼Ò ¶Ç´Â IP smsVariant.smsPort = "5000" ' ¿¬°á Æ÷Æ® smsVariant.smsTimeout = 10 ' ¿¬°á TimeOut ¼³Á¤ smsVariant.smsStatus = "1" ' Àü¼Û»óż³Á¤ smsVariant.sms_key = "GS" ' SMS ۰ª¼³Á¤ smsVariant.cTranid = "uni114" ' SMS »ç¿ëÀÚ ID smsVariant.cTranpasswd = "uni1141003" ' SMS »ç¿ëÀÚ ¾ÏÈ£ smsVariant.cTranphone = branchMobile(cnt) ' ## ¹Þ´Â»ç¶÷ ÇÚµåÆù ¹øÈ£ smsVariant.cTrancallback = smsFrom ' ## º¸³»´Â »ç¶÷ ÇÚµåÆù ¹øÈ£(°í°´ ¹øÈ£) smsVariant.cTrandate = tran_date ' ## º¸³¾ ³¯Â¥ (°ªÀÌ '0' Àϰæ¿ì Áö±Ý´çÀ庸³»´Â°Í, ±× ¿Ü¿¡ ¿¹¾à ¹ß¼ÛÀÏ °æ¿ì ³¯Â¥ ÆÐÅÏÀº YYYY-MM-DD HH:MM:SS ÀÌ´Ù) smsVariant.cTranmsg = smsMsg ' ## º¸³¾ ¸Þ¼¼Áö smsVariant.smsEndOfCommand = chr(10) ' Á¾·á¹®ÀÚ Set sms = Server.CreateObject("Intrafoundation.TCPClient") sms.Clear() sms.Open smsVariant.smsServer, smsVariant.smsPort ' ¼­¹ö¿¡ ¿¬°á - ¼ÒÄÏÀ» ÀÌ¿ëÇÏ¿© À̺¥Æ®¸¦ ¹ß»ý ½ÃÄ×À»°æ¿ì ÇØ´ç À̺¥Æ®¿¡ ´ëÇÑ ¸Þ¼¼Áö´Â .LastError ¸Þ¼Òµå·Î È®ÀÎ ÇÒ ¼ö ÀÖ´Ù. sms.Timeout = smsVariant.smsTimeout If sms.Connected = 1 Then ' ¿¬°áÀÌ ¼º°ø ÇßÀ» °æ¿ì Call Submit ' ¼­¹ö¿¡ Àü¼ÛÇÏ´Â ÇÔ¼ö È£Ãâ smsVariant.ReturnMSG = sms.Recv ' ¸®ÅÏ ¸Þ¼¼Áö ÀúÀå response.write smsVariant.ReturnMSG & "
" Err_Message = CommError(smsVariant.ReturnMSG) ' ¸®ÅÏ ¸Þ¼¼Áö·Î ¿¡·¯ ¸Þ¼¼Áö¸¦ ÃßÃâ sms.Close ' ¼ÒÄÏ ¿¬°á ÇØÁ¦ set sms = nothing ' SMS ¼ÒÄÏ °³Ã¼ ÃʱâÈ­ set smsVariant = nothing ' Ŭ·¡½º ÃʱâÈ­ response.write Err_Message & "
" end If End If Next Response.Write "
" '############## SMS ¹ß¼Û Á¾·á ############################ '### 3. À̸ÞÀÏ ¹ß¼Û ######################### ' ######## ¸ÞÀÏ º¸³»±â ¼³Á¤ set objMessage = createobject("cdo.message") set objConfig = createobject("cdo.configuration") Schemas = "Http://Schemas.Microsoft.Com/Cdo/Configuration" Set Flds = objConfig.Fields With Flds Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 '1 (·ÎÄà SMTP) / 2 (¿ÜºÎ SMTP) Flds.item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'SMTP Port Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 'È£½ºÆ® ¼³Á¤ Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup" 'Pickup µð·ºÅ丮 ¼³Á¤ Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30 '¿¬°á ½Ã°£ Flds.update End With Set objMessage.Configuration = objConfig '########## ¸ÞÀÏ ¼³Á¤ ³¡ to_email = branchEmail 'ÁöÁ¡ °ü¸®ÀÚ from_email = admin_email subject = "[UNI " & kind & "¿äû] " & userName & " (" & userDate & " " & userTime & ") " 'Á¦¸ñ contents = Replace(contents, chr(13) & chr(10), "
") 'ÀÛ¼º±Û ÁÙ¹Ù²Þ '¸ÞÀÏ º»¹® content = "" content = content & "" content = content & "" content = content & "" content = content & "" content = content & "" content = content & "
" content = content & "" content = content & "" content = content & "" content = content & "" content = content & "" content = content & "" content = content & "
ÁöÁ¡" & branchName & "
¼º¸í" & userName & "
¿¬¶ôó" & userTel & "
°¡´É½Ã°£" & userDate & " (" & userTime & ")
³»¿ë" & contents & "
" content = content & "
" objMessage.To = to_email ' ¹Þ´Â»ç¶÷ objMessage.From = from_email ' º¸³»´Â»ç¶÷ objMessage.bcc = "" 'ÂüÁ¶ ¸ÞÀÏ objMessage.Subject = subject ' Á¦¸ñ objMessage.HTMLBody = content ' ³»¿ë objMessage.BodyPart.Charset="ks_c_5601-1987" ' ³»¿ë ÇÑ±Û objMessage.HTMLBodyPart.Charset="ks_c_5601-1987" objMessage.fields.update if to_email <> "" then objMessage.Send ' ½ÇÁ¦·Î º¸³½´Â ¸Þ¼Òµå end if set objMessage = nothing set objConfig = nothing set Flds = Nothing '==================================== Case Else msg = "½ÇÆÐ" End Select 'ó¸® ¿Ï·á(°ø¿ë) ########################################################## 'If Session("admin_div") < 1 Then listFile = "/" : '°ü¸®ÀÚ°¡ ¾Æ´Ï¸é ¸ÞÀÎÀ¸·Î À̵¿ Response.Write "" Response.End %>