최초등록

This commit is contained in:
sp1000je
2026-02-23 10:01:00 +09:00
commit 7bc9767bf4
3120 changed files with 198447 additions and 0 deletions
+211
View File
@@ -0,0 +1,211 @@
<%
' Page: FusionCharts.php
' Author: InfoSoft Global (P) Ltd.
' This page contains functions that can be used to render FusionCharts.
' encodeDataURL function encodes the dataURL before it's served to FusionCharts.
' If you've parameters in your dataURL, you necessarily need to encode it.
' Param: $strDataURL - dataURL to be fed to chart
' Param: $addNoCacheStr - Whether to add aditional string to URL to disable caching of data
function encodeDataURL( strDataURL, addNoCacheStr )
'Add the no-cache string if required
Dim h, m, s
If addNoCacheStr = "" Then addNoCacheStr = false
if addNoCacheStr = True then
' We add ?FCCurrTime=xxyyzz
' If the dataURL already contains a ?, we add &FCCurrTime=xxyyzz
' We replace : with _, as FusionCharts cannot handle : in URLs
h = Right( "0" & Hour(now), 2 )
m = Right( "0" & minute(now), 2 )
s = Right( "0" & second(now), 2 )
hms = h & "_" & m & "_" & s
if instr( strDataURL,"?") >0 then
strDataURL = strDataURL & "&FCCurrTime=" & hms
else
strDataURL = strDataURL & "?FCCurrTime=" & hms
End If
End if
' URL Encode it
encodeDataURL = strDataURL
End function
' datePart function converts MySQL database based on requested mask
' Param: $mask - what part of the date to return "m' for month,"d" for day, and "y" for year
' Param: $dateTimeStr - MySQL date/time format (yyyy-mm-dd HH:ii:ss)
function date_Part(mask, dateTimeStr)
Dim list_arr
Dim datePt, timePt, arDatePt, dataStr
Dim year_value, month_value, day_value
list_arr = Split( dateTimeStr, " " )
datePt = list_arr(0)
timePt = list_arr(1)
arDatePt = Split(datePt, "-")
dataStr = ""
' Ensure we have 3 parameters for the date
if UBound(arDatePt) = 2 then
year_value = arDatePt(0)
month_value = arDatePt(1)
day_value = arDatePt(2)
' determine the request
Select Case mask
Case "m" : date_Part = month_value
Case "d" : date_Part = day_value
Case "y" : date_Part = year_value
Case Else
date_Part = trim(month_value & "/"& day_value & "/" & year_value)
End select
' default to mm/dd/yyyy
End if
date_Part = dataStr
End function
' renderChart renders the JavaScript + HTML code required to embed a chart.
' This function assumes that you've already included the FusionCharts JavaScript class
' in your page.
' $chartSWF - SWF File Name (and Path) of the chart which you intend to plot
' $strURL - If you intend to use dataURL method for this chart, pass the URL as this parameter. Else, set it to "" (in case of dataXML method)
' $strXML - If you intend to use dataXML method for this chart, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method)
' $chartId - Id for the chart, using which it will be recognized in the HTML page. Each chart on the page needs to have a unique Id.
' $chartWidth - Intended width for the chart (in pixels)
' $chartHeight - Intended height for the chart (in pixels)
' $debugMode - Whether to start the chart in debug mode
' $registerWithJS - Whether to ask chart to register itself with JavaScript
function renderChart(chartSWF, strURL, strXML, chartId, chartWidth, chartHeight, debugMode, registerWithJS, setTransparent)
If debugMode = "" Then debugMode = False
If registerWithJS = "" Then registerWithJS = False
If setTransparent = "" Then setTransparent = ""
'First we create a new DIV for each chart. We specify the name of DIV as "chartId"Div.
'DIV names are case-sensitive.
' The Steps in the script block below are:
'
' 1)In the DIV the text "Chart" is shown to users before the chart has started loading
' (if there is a lag in relaying SWF from server). This text is also shown to users
' who do not have Flash Player installed. You can configure it as per your needs.
'
' 2) The chart is rendered using FusionCharts Class. Each chart's instance (JavaScript) Id
' is named as chart_"chartId".
'
' 3) Check whether we've to provide data using dataXML method or dataURL method
' save the data for usage below
If strXML = "" then
tempData = "//Set the dataURL of the chart" & vbcrlf & "tchart_" & chartId & ".setDataURL(""" & strURL & """)"
else
tempData = "//Provide entire XML data using dataXML method" & vbcrlf & "tchart_" & chartId & ".setDataXML(""" & strXML& """)"
End if
' Set up necessary variables for the RENDERCAHRT
chartIdDiv = chartId & "Div"
ndebugMode = boolToNum(debugMode)
nregisterWithJS = boolToNum(registerWithJS)
If setTransparent <> "" Then
If setTransparent = False then
nsetTransparent = "opaque"
Else
nsetTransparent = "transparent"
End if
Else
nsetTransparent = "window"
End if
' create a string for outputting by the caller
render_chart = "<!-- START Script Block for Chart "& chartId & " -->" & vbcrlf
render_chart = render_chart & "<div id=" & chartIdDiv & " align='center'>" & vbcrlf
render_chart = render_chart & " Chart." & vbcrlf
render_chart = render_chart & "</div>" & vbcrlf
render_chart = render_chart & "<script type='text/javascript'> " & vbcrlf
render_chart = render_chart & " //Instantiate the Chart " & vbcrlf
render_chart = render_chart & " var chart_" & chartId & " = new FusionCharts('" & chartSWF & "', '" & chartId & "', '" & chartWidth & "', '" & chartHeight & "', '" & ndebugMode & "', '" & nregisterWithJS & "');" & vbcrlf
render_chart = render_chart & " chart_" & chartId & ".setTransparent(" & nsetTransparent & ");" & vbcrlf
render_chart = render_chart & "" & vbcrlf
render_chart = render_chart & " " & tempData & vbcrlf
render_chart = render_chart & " //Finally, render the chart." & vbcrlf
render_chart = render_chart & " chart_" & chartId & ".render('" & chartIdDiv & "');" & vbcrlf
render_chart = render_chart & "</script> " & vbcrlf
render_chart = render_chart & "<!-- END Script Block for Chart "& chartId & " -->" & vbcrlf
renderChart = render_chart
End Function
'renderChartHTML function renders the HTML code for the JavaScript. This
'method does NOT embed the chart using JavaScript class. Instead, it uses
'direct HTML embedding. So, if you see the charts on IE 6 (or above), you'll
'see the "Click to activate..." message on the chart.
' $chartSWF - SWF File Name (and Path) of the chart which you intend to plot
' $strURL - If you intend to use dataURL method for this chart, pass the URL as this parameter. Else, set it to "" (in case of dataXML method)
' $strXML - If you intend to use dataXML method for this chart, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method)
' $chartId - Id for the chart, using which it will be recognized in the HTML page. Each chart on the page needs to have a unique Id.
' $chartWidth - Intended width for the chart (in pixels)
' $chartHeight - Intended height for the chart (in pixels)
' $debugMode - Whether to start the chart in debug mode
function renderChartHTML( chartSWF, strURL, strXML, chartId, chartWidth, chartHeight, debugMode, registerWithJS, setTransparent )
If debugMode = "" Then debugMode = False
If registerWithJS = "" Then registerWithJS = False
If setTransparent = "" Then setTransparent = false
' Generate the FlashVars string based on whether dataURL has been provided
' or dataXML.
strFlashVars = "chartWidth=" & chartWidth & "&amp;chartHeight=" & chartHeight & "&amp;debugMode=" & boolToNum( debugMode )
if strXML ="" then
' DataURL Mode
strFlashVars = strFlashVars & "&amp;dataURL=" & strURL
else
'DataXML Mode
strFlashVars = strFlashVars & "&amp;dataXML=" & strXML
End if
nregisterWithJS = boolToNum( registerWithJS )
If setTransparent <> "" Then
If setTransparent = False Then
nsetTransparent = "opaque"
Else
nsetTransparent = "transparent"
End if
else
nsetTransparent = "window"
End If
HTML_chart = "<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"" width=""" & chartWidth & """ height=""" & chartHeight & """>" & vbcrlf
HTML_chart = HTML_chart & " <param name=""movie"" value=""" & chartSWF & """ />" & vbcrlf
HTML_chart = HTML_chart & " <param name=""wmode"" value=""" & nsetTransparent & """ />" & vbcrlf
HTML_chart = HTML_chart & " <param name=""allowScriptAccess"" value=""always"" />" & vbcrlf
HTML_chart = HTML_chart & " <param name=""quality"" value=""high"" />" & vbcrlf
HTML_chart = HTML_chart & " <param name=""FlashVars"" value=""" & strFlashVars & "&amp;registerWithJS=" & nregisterWithJS & """ />" & vbcrlf
HTML_chart = HTML_chart & " </object>" & vbcrlf
HTML_chart = HTML_chart & " <!--[if !IE]> <-->" & vbcrlf
HTML_chart = HTML_chart & " <object type=""application/x-shockwave-flash"" data=""" & chartSWF & " width=""" & chartWidth & """ height=""" & chartHeight & """ name=""" & chartId & """>" & vbcrlf
HTML_chart = HTML_chart & " <param name=""FlashVars"" value=""" & strFlashVars & "&amp;registerWithJS=" & nregisterWithJS & """ />" & vbcrlf
HTML_chart = HTML_chart & " <param name=""wmode"" value=""" & nsetTransparent & """ />" & vbcrlf
HTML_chart = HTML_chart & " 이 콘텐츠는 Flash로 제작되었습니다.<br />이 콘텐츠를 보려면 <a href=""http://www.adobe.com/kr/products/flashplayer/"">Flash Player</a>(무료)가 필요합니다." & vbcrlf
HTML_chart = HTML_chart & " </object>" & vbcrlf
HTML_chart = HTML_chart & " <!--> <![endif]-->" & vbcrlf
'response.write "a"
'response.end
renderChartHTML = HTML_chart
End function
' boolToNum function converts boolean values to numeric (1/0)
function boolToNum(bVal)
If bVal = True Then
boolToNum = 1
Else
boolToNum = 0
End if
End function
%>
+219
View File
@@ -0,0 +1,219 @@
<%
'
' VBS JSON 2.0.3
' Copyright (c) 2009 Tu?ul Topuz
' Under the MIT (MIT-LICENSE.txt) license.
'
Const JSON_OBJECT = 0
Const JSON_ARRAY = 1
Class jsCore
Public Collection
Public Count
Public QuotedVars
Public Kind ' 0 = object, 1 = array
Private Sub Class_Initialize
Set Collection = CreateObject("Scripting.Dictionary")
QuotedVars = True
Count = 0
End Sub
Private Sub Class_Terminate
Set Collection = Nothing
End Sub
' counter
Private Property Get Counter
Counter = Count
Count = Count + 1
End Property
' - data maluplation
' -- pair
Public Property Let Pair(p, v)
If IsNull(p) Then p = Counter
Collection(p) = v
End Property
Public Property Set Pair(p, v)
If IsNull(p) Then p = Counter
If TypeName(v) <> "jsCore" Then
Err.Raise &hD, "class: class", "Incompatible types: '" & TypeName(v) & "'"
End If
Set Collection(p) = v
End Property
Public Default Property Get Pair(p)
If IsNull(p) Then p = Count - 1
If IsObject(Collection(p)) Then
Set Pair = Collection(p)
Else
Pair = Collection(p)
End If
End Property
' -- pair
Public Sub Clean
Collection.RemoveAll
End Sub
Public Sub Remove(vProp)
Collection.Remove vProp
End Sub
' data maluplation
' encoding
Function jsEncode(str)
Dim charmap(127), haystack()
charmap(8) = "\b"
charmap(9) = "\t"
charmap(10) = "\n"
charmap(12) = "\f"
charmap(13) = "\r"
charmap(34) = "\"""
charmap(47) = "\/"
charmap(92) = "\\"
Dim strlen : strlen = Len(str) - 1
ReDim haystack(strlen)
Dim i, charcode
For i = 0 To strlen
haystack(i) = Mid(str, i + 1, 1)
charcode = AscW(haystack(i)) And 65535
If charcode < 127 Then
If Not IsEmpty(charmap(charcode)) Then
haystack(i) = charmap(charcode)
ElseIf charcode < 32 Then
haystack(i) = "\u" & Right("000" & Hex(charcode), 4)
End If
Else
haystack(i) = "\u" & Right("000" & Hex(charcode), 4)
End If
Next
jsEncode = Join(haystack, "")
End Function
' converting
Public Function toJSON(vPair)
Select Case VarType(vPair)
Case 0 ' Empty
toJSON = "null"
Case 1 ' Null
toJSON = "null"
Case 7 ' Date
' toJSON = "new Date(" & (vPair - CDate(25569)) * 86400000 & ")" ' let in only utc time
toJSON = """" & CStr(vPair) & """"
Case 8 ' String
toJSON = """" & jsEncode(vPair) & """"
Case 9 ' Object
Dim bFI,i
bFI = True
If vPair.Kind Then toJSON = toJSON & "[" Else toJSON = toJSON & "{"
For Each i In vPair.Collection
If bFI Then bFI = False Else toJSON = toJSON & ","
If vPair.Kind Then
toJSON = toJSON & toJSON(vPair(i))
Else
If QuotedVars Then
toJSON = toJSON & """" & i & """:" & toJSON(vPair(i))
Else
toJSON = toJSON & i & ":" & toJSON(vPair(i))
End If
End If
Next
If vPair.Kind Then toJSON = toJSON & "]" Else toJSON = toJSON & "}"
Case 11
If vPair Then toJSON = "true" Else toJSON = "false"
Case 12, 8192, 8204
toJSON = RenderArray(vPair, 1, "")
Case Else
toJSON = Replace(vPair, ",", ".")
End select
End Function
Function RenderArray(arr, depth, parent)
Dim first : first = LBound(arr, depth)
Dim last : last = UBound(arr, depth)
Dim index, rendered
Dim limiter : limiter = ","
RenderArray = "["
For index = first To last
If index = last Then
limiter = ""
End If
On Error Resume Next
rendered = RenderArray(arr, depth + 1, parent & index & "," )
If Err = 9 Then
On Error GoTo 0
RenderArray = RenderArray & toJSON(Eval("arr(" & parent & index & ")")) & limiter
Else
RenderArray = RenderArray & rendered & "" & limiter
End If
Next
RenderArray = RenderArray & "]"
End Function
Public Property Get jsString
jsString = toJSON(Me)
End Property
Sub Flush
If TypeName(Response) <> "Empty" Then
Response.Write(jsString)
ElseIf WScript <> Empty Then
WScript.Echo(jsString)
End If
End Sub
function Flush2
If TypeName(Response) <> "Empty" Then
' Response.Write(jsString)
Flush2 = jsString
ElseIf WScript <> Empty Then
WScript.Echo(jsString)
End If
End function
Public Function Clone
Set Clone = ColClone(Me)
End Function
Private Function ColClone(core)
Dim jsc, i
Set jsc = new jsCore
jsc.Kind = core.Kind
For Each i In core.Collection
If IsObject(core(i)) Then
Set jsc(i) = ColClone(core(i))
Else
jsc(i) = core(i)
End If
Next
Set ColClone = jsc
End Function
End Class
Function jsObject
Set jsObject = new jsCore
jsObject.Kind = JSON_OBJECT
End Function
Function jsArray
Set jsArray = new jsCore
jsArray.Kind = JSON_ARRAY
End Function
Function toJSON(val)
toJSON = (new jsCore).toJSON(val)
End Function
%>
+460
View File
@@ -0,0 +1,460 @@
<!--METADATA TYPE= "typelib" NAME= "ADODB Type Library" FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->
<%
Function getConnectString()
Dim strConnect
strConnect = "Provider=SQLOLEDB.1;Data Source="&Application("url")&";Initial catalog="&Application("DB")&";user ID="&Application("DB_id")&";Password="&Application("DB_pwd")
'strConnect = "Provider=OraOLEDB.Oracle;Data Source="&Application("url")&";User Id="&Application("DB_id")&";Password="&Application("DB_pwd")
getConnectString = strConnect
End function
'select
class SelectTable
public connectString
Private dbcon
Private rs
'클래스 초기화
Private Sub Class_Initialize
connectString = getConnectString()
Set dbcon = Server.CreateObject("ADODB.Connection")
End Sub
'select 쿼리(단일필드)
Public function selectQueryColumn( sql )
Dim ret_value : ret_value = null
selectQuery( sql )
If Not( rs.bof Or rs.eof ) Then
ret_value = rs(0)
If isnull(ret_value) Then ret_value = ""
ret_value = CStr( ret_value )
End if
dbClose()
selectQueryColumn = ret_value
End function
'select 쿼리(단일행,배열)
Public function selectQueryRecord( sql )
Dim ret_value : Set ret_value = Server.CreateObject("Scripting.Dictionary")
selectQuery( sql )
If Not( rs.bof Or rs.eof ) Then
For each k in rs.Fields
value = k.value
If isnull(value) Then value = ""
value = CStr( value )
ret_value(LCase(k.name)) = value
Next
End If
dbClose()
Set selectQueryRecord = ret_value
Set ret_value = nothing
End Function
'select 쿼리(2차원배열)
Public function selectQueryTable( sql )
Dim ret_value(), ret_null, i
selectQuery( sql )
If rs.bof Or rs.eof Then
selectQueryTable = null
else
redim ret_value(rs.recordcount-1)
i = 0
Do until rs.eof
Set ret_value(i) = Server.CreateObject("Scripting.Dictionary")
For each k in rs.Fields
value = k.value
If isnull(value) Then value = ""
value = CStr( value )
ret_value(i)( LCase(k.name) ) = value
Next
rs.movenext
i = i + 1
Loop
selectQueryTable = ret_value
End If
dbClose()
End function
Public sub arr2Value( rs )
For each item in rs
execute(item & " = rs(""" & item & """)")
next
End sub
Private sub selectQuery( sql )
dbcon.Open connectString
Set Rs = Server.CreateObject("ADODB.RecordSet")
rs.open sql, dbcon, 3
End sub
Private sub dbClose()
rs.close()
Set rs = Nothing
dbcon.close
End sub
' 클래스 종료
Private Sub Class_Terminate
Set dbcon = Nothing
End Sub
end Class
'insert
class InsertTable
public connectString
public tableName
Private dbcon
'db에 저장할 데이타 저장 리스트
private insertValues
private addValues
'클래스 초기화
Private Sub Class_Initialize
tableName = ""
Set insertValues = Server.CreateObject("Scripting.Dictionary")
Set addValues = Server.CreateObject("Scripting.Dictionary")
connectString = getConnectString()
Set dbcon = Server.CreateObject("ADODB.Connection")
End Sub
'세팅된 insertValues로 insert 쿼리 생성 실행
Public function execute()
Dim sql, i_fields, i_values, i
If tableName = "" then
respons.wirte "tableName is none."
Response.end
End if
sql = "insert into " & tableName & "("
i_fields = ""
If addValues.count > 0 Then
i = 0
For each k in addValues
If i > 0 Then i_fields = i_fields & ","
i_fields = i_fields & k
i = i + 1
next
End If
For each k in insertValues
If i_fields <> "" Then i_fields = i_fields & ","
i_fields = i_fields & k
next
sql = sql & i_fields & ") values("
i_values = ""
If addValues.count > 0 Then
i = 0
For each v in addValues
If i > 0 Then i_values = i_values & ","
i_values = i_values & addValues(v)
i = i + 1
next
End If
For each v in insertValues
If i_values <> "" Then i_values = i_values & ","
i_values = i_values & "'" & insertValues(v) & "'"
next
sql = sql & i_values & ")"
insertQuery(sql)
'연관배열 초기화
insertValues.removeall
addValues.removeall
execute = sql
End function
'insert 쿼리 직접받아서 실행
private sub insertQuery(sql)
dbcon.Open connectString
dbcon.execute sql
dbcon.close()
End sub
'연관배열 추가
sub setValues(keyname, value)
insertValues( keyname ) = value
End sub
'연관배열 추가
sub setAddValues(keyname, value)
addValues(keyname) = value
End sub
'필드명으로 연관배열 추가
sub setFieldsValues( str_fileds )
Dim str_fileds_arr, z
str_fileds = replace(str_fileds, " ", "")
str_fileds_arr = split(str_fileds, ",")
For z=0 To ubound( str_fileds_arr )
Call setValues(str_fileds_arr(z), eval(str_fileds_arr(z)))
next
End sub
' 클래스 종료
Private Sub Class_Terminate
Set dbcon = nothing
Set insertValues = Nothing
Set addValues = nothing
End Sub
end Class
'update
class UpdateTable
public connectString
public tableName
public whereQuery
Private dbcon
'db에 저장할 데이타 저장 리스트
private updateValues
private addValues
'클래스 초기화
Private Sub Class_Initialize
tableName = ""
whereQuery = ""
Set updateValues = Server.CreateObject("Scripting.Dictionary")
Set addValues = Server.CreateObject("Scripting.Dictionary")
connectString = getConnectString()
Set dbcon = Server.CreateObject("ADODB.Connection")
End Sub
'세팅된 updateValues로 insert 쿼리 생성 실행
Public function execute()
Dim sql, u_values, i
If tableName = "" then
respons.wirte "tableName is none."
Response.end
End if
sql = "update " & tableName & " set "
u_values = ""
If addValues.count > 0 Then
i = 0
For each k in addValues
If i > 0 Then u_values = u_values & ","
u_values = u_values & k & "=" & addValues(k)
i = i + 1
next
End If
If updateValues.count > 0 Then
i = 0
For each k in updateValues
If u_values <> "" Then u_values = u_values & ","
u_values = u_values & k & "= '" & updateValues(k) & "'"
i = i + 1
next
End If
sql = sql & u_values & " " & whereQuery
updateQuery( sql )
'연관배열 초기화
updateValues.removeall
addValues.removeall
execute = sql
End function
'update 쿼리 직접받아서 실행
private sub updateQuery(sql)
dbcon.Open connectString
dbcon.execute sql
dbcon.close()
End sub
'연관배열 추가
sub setValues(keyname, value)
updateValues( keyname ) = value
End sub
'연관배열 추가
sub setAddValues(keyname, value)
addValues(keyname) = value
End sub
'필드명으로 연관배열 추가
sub setFieldsValues( str_fileds )
Dim str_fileds_arr, z
str_fileds = replace(str_fileds, " ", "")
str_fileds_arr = split(str_fileds, ",")
For z=0 To ubound( str_fileds_arr )
Call setValues(str_fileds_arr(z), eval(str_fileds_arr(z)))
next
End sub
' 클래스 종료
Private Sub Class_Terminate
Set dbcon = nothing
Set updateValues = Nothing
Set addValues = nothing
End Sub
end Class
class UpdateClob
public connectString
public tableName
public whereQuery
public field
public value
Private dbcon
'db에 저장할 데이타 저장 리스트
private updateValues
'클래스 초기화
Private Sub Class_Initialize
tableName = ""
whereQuery = ""
Set updateValues = Server.CreateObject("Scripting.Dictionary")
connectString = getConnectString()
Set dbcon = Server.CreateObject("ADODB.Connection")
End Sub
'세팅된 updateValues로 insert 쿼리 생성 실행
Public function execute()
Dim sql, u_values, i, ocmd
If tableName = "" then
respons.wirte "tableName is none."
Response.end
End if
sql = "update " & tableName & " set "
u_values = ""
If updateValues.count > 0 Then
i = 0
For each k in updateValues
If u_values <> "" Then u_values = u_values & ","
u_values = u_values & k & "= empty_clob()"
i = i + 1
next
End If
If field <> "" And value <> "" Then
If u_values <> "" Then u_values = u_values & ","
u_values = u_values & field & " = empty_clob() "
End if
sql = sql & u_values & " " & whereQuery
updateQuery( sql )
sql = "UPDATE " & tableName & " SET "
u_values = ""
If updateValues.count > 0 Then
i = 0
For each k in updateValues
If u_values <> "" Then u_values = u_values & ","
u_values = u_values & k & "= ?"
i = i + 1
next
End If
If field <> "" And value <> "" Then
If u_values <> "" Then u_values = u_values & ","
u_values = u_values & field & " = ?"
End if
sql = sql & u_values & " " & whereQuery
set ocmd = Server.CreateObject("ADODB.Command")
With ocmd
.ActiveConnection = connectString
.CommandType = adCmdText
.CommandText = sql
For each k in updateValues
.Parameters.Append .CreateParameter("@"&field, adLongVarWChar, adParamInput, 40000, updateValues(k))
Next
If field <> "" And value <> "" Then
.Parameters.Append .CreateParameter("@"&field, adLongVarWChar, adParamInput, 40000, value)
End if
.Execute
End With
Set ocmd = nothing
'연관배열 초기화
updateValues.removeall
execute = sql
End function
'update 쿼리 직접받아서 실행
private sub updateQuery(sql)
dbcon.Open connectString
dbcon.execute sql
dbcon.close()
End sub
'연관배열 추가
sub setValues(keyname, value)
updateValues( keyname ) = value
End sub
'필드명으로 연관배열 추가
sub setFieldsValues( str_fileds )
Dim str_fileds_arr, z
str_fileds = replace(str_fileds, " ", "")
str_fileds_arr = split(str_fileds, ",")
For z=0 To ubound( str_fileds_arr )
Call setValues(str_fileds_arr(z), eval(str_fileds_arr(z)))
next
End sub
' 클래스 종료
Private Sub Class_Terminate
Set dbcon = nothing
Set updateValues = Nothing
End Sub
end Class
Sub executeQuery( sql )
Dim dbcon
Set dbcon = Server.CreateObject("ADODB.Connection")
dbcon.Open getConnectString()
dbcon.execute sql
dbcon.close
Set dbcon = nothing
End sub
%>
+47
View File
@@ -0,0 +1,47 @@
<%@ codepage = 65001%>
<% session.codepage = 65001 %>
<%Response.CharSet = "UTF-8"%>
<%
Response.Expires = -1
Response.Expiresabsolute = Now() - 1
Response.AddHeader "Pragma", "no_cache"
Response.AddHeader "cache-control", "no-cache"
Response.CacheControl = "no-cache"
'Application("DB") = "sms_nninc_201303"
Dim sql_pattern, item, array_counter, item_position1, item_position2
Dim strConnect
Dim Dbcon
'sql_pattern=Array("/*","*/","char","nchar","varchar","nvarchar","alter","begin","cast","create","cursor","declare","dorp","end","exec","execute","fetch","insert","kill","open","select","sys","sys**s","syscolumns","table","update")
'
''GET 방식 체크
'For each item in Request.QueryString
' For array_counter=lbound(sql_pattern) to ubound(sql_pattern)
' item_position1=InStr(lcase(Request(item)), sql_pattern(array_counter))
' item_position2=InStr(lcase(Request.QueryString), sql_pattern(array_counter))
'
' IF (item_position1 > 0) OR (item_position2 > 0) THEN
' Response.End()
' END IF
' NEXT
'NEXT
'
''POST 방식 체크
'For each item in Request.Form
' For array_counter=lbound(sql_pattern) to ubound(sql_pattern)
' item_position1=InStr(lcase(Request(item)), sql_pattern(array_counter))
' item_position2=InStr(lcase(Request.QueryString), sql_pattern(array_counter))
'
' IF (item_position1 > 0) OR (item_position2 > 0) THEN
' Response.End()
' END IF
' NEXT
'NEXT
strConnect="Provider=SQLOLEDB.1;Data Source="&Application("url")&";Initial catalog="&Application("DB")&";user ID="&Application("DB_id")&";Password="&Application("DB_pwd")
Set DbCon=Server.CreateObject("ADODB.Connection")
DbCon.Open strConnect
%><!--#include virtual="/common/lib/dbclass.asp"-->
+85
View File
@@ -0,0 +1,85 @@
<!-- #include virtual= "/common/lib/func_db.asp" -->
<!-- #include virtual= "/common/lib/func_member.asp" -->
<!-- #include virtual= "/common/lib/func_total.asp" -->
<!-- #include virtual= "/common/lib/func_design.asp" -->
<!-- #include virtual= "/common/lib/func_count.asp" -->
<!-- #include virtual= "/common/lib/func_message.asp" -->
<%
tabindex = 5000
NOWPAGE = Request.ServerVariables("path_info")
If Request.ServerVariables("query_string") <> "" Then
NOWPAGE = NOWPAGE & "?" & Request.ServerVariables("query_string")
End if
' 현재 페이지 경로 확인
Dim currentPath, currentHost, slashCount, i
currentPath = Request.ServerVariables("SCRIPT_NAME")
currentHost = LCase(Request.ServerVariables("HTTP_HOST"))
' 경로의 슬래시(/) 개수 세기
slashCount = 0
For i = 1 To Len(currentPath)
If Mid(currentPath, i, 1) = "/" Then
slashCount = slashCount + 1
End If
Next
' 슬래시가 1개면 최상위 폴더 (예: /page.asp, /default.asp)
' 슬래시가 2개 이상이면 하위 폴더 (예: /folder/page.asp)
If slashCount > 1 Or currentPath = "/" Or currentPath = "/default.asp" Or currentPath = "/index.asp" Then
' 하위 폴더에서만 리다이렉션
' sms.nninc.co.kr로 접속한 경우
If InStr(currentHost, "sms.nninc.co.kr") > 0 Then
Response.Redirect "https://lms.nninc.co.kr"
Response.End
End If
' lms.nninc.co.kr로 접속한 경우 (포트 7444가 아닌 경우)
'If InStr(currentHost, "lms.nninc.co.kr") > 0 And InStr(currentHost, ":443") = 0 Then
' Response.Redirect "https://lms.nninc.co.kr"
' Response.End
'End If
'Call ForceHTTPS()
End If
' HTTPS 체크 및 리디렉션
Function ForceHTTPS()
Dim isHTTPS, serverPort, redirectURL
' HTTPS 프로토콜 체크
isHTTPS = (Request.ServerVariables("HTTPS") = "on")
' 서버 포트 체크
serverPort = Request.ServerVariables("SERVER_PORT")
' HTTPS가 아니거나 443 포트가 아닌 경우
If Not isHTTPS Or serverPort <> "443" Then
' 리디렉션 URL 구성
redirectURL = "https://" & Request.ServerVariables("SERVER_NAME")
' 기본 HTTPS 포트(443)가 아닌 경우 포트 번호 포함
' 만약 443 포트로만 리디렉션하려면 이 부분 제거
' If serverPort <> "443" And serverPort <> "80" Then
' redirectURL = redirectURL & ":443"
' End If
' 요청 경로 및 쿼리스트링 추가
redirectURL = redirectURL & Request.ServerVariables("URL")
If Request.ServerVariables("QUERY_STRING") <> "" Then
redirectURL = redirectURL & "?" & Request.ServerVariables("QUERY_STRING")
End If
' 301 영구 리디렉션
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", redirectURL
Response.End
End If
End Function
%>
+182
View File
@@ -0,0 +1,182 @@
<%
' //******************* Information ***********************
' // Program Title : 접속통계 config
' // File Name : config.asp
' // :
' //*********************************************************
'
' //******************* Information ***********************
' // 함수설명 : 이전,다음) 년,월,일 변경
' //*********************************************************
sub ChangeDate( prevTextYY, nextTextYY, prevTextMM, nextTextMM, prevTextDD, nextTextDD)
if YY <> "" Then theCase = "YY"
if YY <> "" and MM <> "" Then theCase = "MM"
if YY <> "" and MM <> "" and DD <> "" Then theCase = "DD"
'//echo $theCase;
Select Case theCase
Case "YY"
tempPrev = YY - 1
tempNext = YY + 1
if tempPrev < 1 Then tempPrev = 1
if tempNext > 2100 Then tempNext = 2100
strValue = "&nbsp;<a href='" & Request.ServerVariables("path_info") & "?YY=" & tempPrev & "'>" & prevTextYY & "</a>&nbsp;|&nbsp;"
strValue = strValue & "<a href='" & Request.ServerVariables("path_info") & "?YY=" & tempNext & "'>" & nextTextYY & "</a>"
Case "MM"
tempPrev = DateSerial(YY, MM-1, 1)
tempNext = DateSerial(YY, MM+1, 1)
strValue = "&nbsp;<a href='" & Request.ServerVariables("path_info") & "?YY=" & year(tempPrev) & "&MM=" & Right( "0" & Month(tempPrev), 2 ) & "'>" & prevTextMM & "</a>&nbsp;|&nbsp;"
strValue = strValue & "<a href='" & Request.ServerVariables("path_info") & "?YY=" & Year( tempNext ) & "&MM=" & Right( "0" & Month( tempNext ), 2 ) & "'>" & nextTextMM & "</a>"
Case "DD"
tempPrev = DateSerial(YY, MM, DD-1)
tempNext = DateSerial(YY, MM, DD+1)
strValue = "&nbsp;<a href='" & Request.ServerVariables("path_info") & "?YY=" & Year(tempPrev) & "&MM=" & Right( "0" & Month(tempPrev), 2 ) & "&DD=" & Right( "0" & Day(tempPrev), 2 ) & "'>" & prevTextDD & "</a>&nbsp;|&nbsp;"
strValue = strValue & "<a href='" & Request.ServerVariables("path_info") & "?YY=" & Year(tempNext) & "&MM=" & Right( "0" & Month(tempNext), 2) & "&DD=" & Right( "0" & Day(tempNext), 2 ) & "'>" & nextTextDD & "</a>"
End select
response.write strValue
End sub
' //******************* Information ***********************
' // 함수설명 : 최대값 bold 적용
' //*********************************************************
sub SetDetail(theNum)
if arrData(theNum,0) = maxCount and maxCount <> 0 then
arrData(theNum,0) = "<strong>" & arrData(theNum,0) & "</strong>"
End if
response.write arrData(theNum,0)
End sub
' //******************* Information ***********************
' // 함수설명 : 주일
' //*********************************************************
sub SetWeek(theNum)
Dim week
Select Case theNum
Case 0 : week = "日"
Case 1 : week = "月"
Case 2 : week = "火"
Case 3 : week = "水"
Case 4 : week = "木"
Case 5 : week = "金"
Case 6 : week = "土"
End select
response.write week
End sub
' //******************* Information ***********************
' // 함수설명 : os명
' //*********************************************************
function SetOS(strvalue)
Dim vOS
Select Case strvalue
case "" : vOS = "unKnown"
case "Windows NT 5.0": vOS = "Windows 2000"
case "Windows NT 5.1": vOS = "Windows XP"
Case Else
vOS = strvalue
End select
SetOS = vOS
End function
' //******************* Information ***********************
' // 함수설명 : 브라우저명
' //*********************************************************
function SetBrowser(strvalue)
if trim(strvalue) = "" then
vBrowser = "unKnown"
else
vBrowser = strvalue
End if
SetBrowser = vBrowser
End function
' //******************* Information ***********************
' // 함수설명 : 검색 조건
' //*********************************************************
sub SetWhere()
qryValue = ""
if YY <> "" then
qryValue = " where vYY = '"& YY & "'"
End if
if MM <> "" then
if qryValue <> "" then qryValue = qryValue & " and "
qryValue = qryValue & " vMM = '" & MM & "'"
End if
if DD <> "" then
if qryValue <> "" then qryValue = qryValue & " and "
qryValue = qryValue & " vDD = '"& DD & "'"
End if
If YY = "" and ( MM <> "" or DD <> "" ) Then qryValue = " where " & qryValue
End sub
' //******************* Information ***********************
' // 함수설명 : 년 select box
' //*********************************************************
sub SelectYear()
%>
<select name="YY" onchange="document.Form1.submit();">
<option value="">전체</option>
<% for y = Year(now)-5 to Year(now) + 5 %>
<option value="<%=y%>"><%=y%>년</option>
<%next%>
</select>
<%
End sub
' //******************* Information ***********************
' // 함수설명 : 월 select box
' //*********************************************************
sub SelectMonth()
%>
<select name="MM" onchange="document.Form1.submit();">
<option value="">전체</option>
<% For m = 1 To 12
m = Right( "0" & m, 2 )
%>
<option value="<%=m%>"><%=m%>월</option>
<% next%>
</select>
<%
End sub
' //******************* Information ***********************
' // 함수설명 : 일 select box
' //*********************************************************
sub SelectDay()
%>
<select name="DD" onchange="document.Form1.submit();">
<option value="">전체</option>
<% For d = 1 To 31
d = Right( "0" & d, 2 )
%>
<option value="<%=d%>"><%=d%>일</option>
<% Next %>
</select>
<%
end sub
%>
+168
View File
@@ -0,0 +1,168 @@
<%
' ************************
' 2.DB관련
' ************************
'
'function RequestAll(R_Fields, RequestObj) '변수한번에 요청하기
'Function InsertQuery(R_Fields, table) 'insert 쿼리문 생성기
'Function UpdateQuery(R_Fields, table, where) 'update 쿼리문 생성기
'Function SelectQuery(R_Fields, table, where) 'select 쿼리문 생성기
'Function arr2Value(R_Fields, arrObj, recordcount) '레코드셋에 필드명대로 변수만들기
'************** Information ****************************************
' Program Title : 변수한번에 요청하기
' Company :
' Creator : 최 경 수 2007-03-08
'*********************************************************************
'
'변수가 많지 않을때는 가급적 사용 자제
'ex) RequestAll("filed1, filed2", "Request.Form")
function RequestAll(R_Fields, RequestObj)
Dim R_Fields_arr
Dim sql, rs, i
R_Fields = Replace(R_Fields, " ", "")
R_Fields_arr = Split(R_Fields, ",")
If RequestObj="" Then RequestObj = "request"
For i=0 To UBound(R_Fields_arr)
execute(" "& R_Fields_arr(i) &" = InputValue("&RequestObj&"("""&R_Fields_arr(i)&""")) ")
next
End function
'필드가 많지 않을때는 가급적 사용 자제
'ex) InsertQuery "filed1, filed2", "table"
Function InsertQuery(R_Fields, table)
Dim i, R_Fields_arr
R_Fields = Replace(R_Fields, " ", "")
R_Fields_arr = Split(R_Fields, ",")
execute("sql = ""insert into "&table&"("&R_Fields&") values(""")
For i = 0 To UBound(R_Fields_arr)
execute("sql = sql & ""'""&"&R_Fields_arr(i)&"&""'""")
If i < UBound(R_Fields_arr) Then sql = sql & ","
next
execute("sql = sql & "")""")
'response.write sql
'Response.end
Dbcon.Execute sql
End Function
'************** Information ****************************************
' Program Title : update 쿼리문 생성기
' Company :
' Creator : 2008-05-31
'*********************************************************************
'
'필드가 많지 않을때는 가급적 사용 자제
'ex) UpdateQuery "filed1, filed2", "table", "where idx = 1"
Function UpdateQuery(R_Fields, table, where)
Dim i, R_Fields_arr
R_Fields = Replace(R_Fields, " ", "")
R_Fields_arr = Split(R_Fields, ",")
execute("sql = ""update "&table&" set """)
For i = 0 To UBound(R_Fields_arr)
execute("sql = sql & """&R_Fields_arr(i)&" = '""&"&R_Fields_arr(i)&"&""'""")
If i < UBound(R_Fields_arr) Then sql = sql & ","
next
execute("sql = sql & "" "" & where")
'response.write sql
'response.end
Dbcon.Execute sql
End Function
'************** Information ****************************************
' Program Title : select 쿼리문 생성기
' Company :
' Creator : 2008-05-31
'*********************************************************************
'필드가 많지 않을때는 가급적 사용 자제
'ex) SelectQuery "filed1, filed2", "table", "where idx = 1"
Function SelectQuery(R_Fields, table, where)
Dim i, R_Fields_arr, rs
R_Fields = Replace(R_Fields, " ", "")
R_Fields_arr = Split(R_Fields, ",")
execute("sql = ""select "&R_Fields&" from "" & table & "" "" & where")
' response.write sql
' response.End
Set rs = Dbcon.Execute( sql )
If rs.bof Or rs.eof Then
SelectQuery = false
Else
SelectQuery = true
For i = 0 To UBound(R_Fields_arr) '전역변수에 담기
execute( R_Fields_arr(i) & "= rs("""&R_Fields_arr(i)&""")")
'execute("response.write """&R_Fields_arr(i)&"=""&"&R_Fields_arr(i)&"&""<br>""")
Next
End if
Set rs = nothing
End Function
'************** Information ****************************************
' Program Title : 레코드셋에 필드명대로 변수만들기
' Company : 나눔아이앤씨
' Creator : 최 경 수 2010-02-26
'*********************************************************************
'ex) arr2Value Rs
Function arr2Value(R_Fields, arrObj, recordcount)
Dim i, R_Fields_arr
R_Fields = Replace(R_Fields, " ", "")
R_Fields_arr = Split(R_Fields, ",")
For i = 0 To UBound(R_Fields_arr)
execute(R_Fields_arr(i)&" = "&arrObj&"("&i&","&recordcount&")")
'response.write R_Fields_arr(i)&" = "&eval(arrObj&"("&i&","&recordcount&")")&"<br>"
next
End Function
Function arr2Search(arrObj, idx, fieldCount) '2차원 배열 idx값으로 원하는 값 검색
Dim i
arr2Search = ""
If Not( IsNull( arrObj ) ) Then
For i =0 To UBound(arrObj, 2)
If Cstr( arrObj(0,i) ) = CStr(idx) Then
arr2Search = arrObj(fieldCount,i)
Exit for
End if
Next
End if
End function
%>
+128
View File
@@ -0,0 +1,128 @@
<%
'response.write "test"
site_name = "문자전송 시스템"
site_root_dir_path = Server.MapPath("\") '프로그램 시작디렉토리 절대경로
include_dir_path = site_root_dir_path&"\include" 'Include디렉토리 절대경로
site_root_dir_url = "" '프로그램 시작디렉토리 url
include_dir_url = site_root_dir_url&"/include" 'Include디렉토리 url
common_image_url = site_root_dir_url&"/imgs" '공통 이미지디렉토리 url
main_url = site_root_dir_url&"/"
'//---------스킨--------------------
skin = Request.Cookies("skin_ck")
If skin <> "blue" And skin<>"orange" And skin<>"sky" And skin<>"green" And skin<>"gray" then
skin = "blue"
End if
'//파일명앞자리2개가져와서 서브메뉴 체크온표시
menu_chk_tmp = Split( Request.ServerVariables("path_info"), "/" )
menu_chk = Left(menu_chk_tmp(UBound(menu_chk_tmp)),2) ' 페이지 명의 앞 2글자 ( 01_02.asp 에서 "01" )
menu_chk2 = Left(menu_chk_tmp(UBound(menu_chk_tmp)),5) ' 페이지 명의 앞 5글자 ( 01_02.asp 에서 "01_02" )
menu_chk3 = Left(menu_chk_tmp(UBound(menu_chk_tmp)),7) ' 페이지 명의 앞 5글자 ( 01_02.asp 에서 "01_0200" )
menu_dir = menu_chk_tmp(UBound(menu_chk_tmp)-1) ' 폴더명 ( "01intro" )
menu_chk_on = menu_chk
If Left(menu_chk_on,1)="0" Then menu_chk_on = Mid(menu_chk_on,2)
If menu_dir = "01message" Then
menu_loc = "1"
if menu_chk2 = "01_01" Then
tit_name = "단문전송 | "
elseif menu_chk2 = "02_01" Then tit_name = "예약문자확인 | "
elseif menu_chk2 = "03_01" Then tit_name = "보낸문자함 | "
End if
ElseIf menu_dir = "02address" Then
menu_loc = "2"
if menu_chk2 = "01_01" Then
tit_name = "주소록 | "
elseif menu_chk2 = "02_01" Then tit_name = "그룹관리 | "
End if
ElseIf menu_dir = "03schedule" Then
menu_loc = "3"
if menu_chk2 = "01_01" Then
tit_name = "일정관리 | "
elseif menu_chk2 = "02_01" Then tit_name = "일정쓰기 | "
End if
ElseIf menu_dir = "04advice" Then
menu_loc = "4"
if menu_chk2 = "01_01" Then
tit_name = "도움말 | "
End if
ElseIf menu_dir = "05mypage" Then
menu_loc = "5"
if menu_chk2 = "01_01" Then
tit_name = "개인정보수정 | "
elseif menu_chk2 = "02_01" Then tit_name = "발송현황 | "
End if
response.write tit_name_yes
End if
'/* 게시판 */
a_num = Request.QueryString("a_num")
If a_num = "71074505" Then
menu_loc = "1" : menu_chk_on = "2" : tit_name = "공지사항"
ElseIf a_num = "7569561" Then
menu_loc = "1" : menu_chk_on = "2" : tit_name = "행사앨범"
End If
If a_num <>"" Then
If menu_chk2 = "write" Then
board_name = " (글쓰기) | "
elseIf menu_chk2 = "list." Then
board_name = " (목록) | "
elseIf menu_chk2 = "view." Then
board_name = " (글내용) | "
Else
board_name = " | "
End If
tit_name = tit_name & board_name
End if
'문자메시지
menu01_0101 = "href=""/content/01message/01_01.asp"" " '//단문전송
menu01_0201 = "href=""/content/01message/02_01.asp"" " '//예약문자확인
menu01_0301 = "href=""/content/01message/03_01.asp"" " '//보낸문자함
menu01_0401 = "href=""/content/01message/04_01.asp"" " '//보낸문자함(장문)
'주소록
menu02_0101 = "href=""/content/02address/01_01.asp"" " '//주소록
menu02_0201 = "href=""/content/02address/02_01.asp"" " '//그룹관리
'일정관리
menu03_0101 = "href=""/content/03schedule/01_01.asp"" " '//일정관리
menu03_0201 = "href=""/content/03schedule/02_01.asp"" " '//일정쓰기
'도움말
menu04_0101 = "href=""/content/04advice/01_01.asp"" " '//도움말
'마이페이지
menu05_0101 = "href=""/content/05mypage/01_01.asp"" " '//개인정보수정
menu05_0201 = "href=""/content/05mypage/02_01.asp"" " '//발송현황
' 회원관련 페이지 선언
Const LOGIN_URL = "/content/member/login.php"
Const MODIFY_URL = "/content/memeber/modify.php"
%>
+226
View File
@@ -0,0 +1,226 @@
<%
Dim sBASE_64_CHARACTERS, sBASE_64_CHARACTERSansi
sBASE_64_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
sBASE_64_CHARACTERSansi = strUnicode2Ansi(sBASE_64_CHARACTERS)
Function strUnicodeLen(asContents)
Dim asContents1 : asContents1 ="a" & asContents
Dim Len1 : Len1=Len(asContents1)
Dim K : K=0
Dim I, Asc1
For I=1 To Len1
Asc1 = asc(mid(asContents1,I,1))
IF Asc1 < 0 Then Asc1 = 65536 + Asc1
IF Asc1 > 255 Then
K = K + 2
ELSE
K = K + 1
End IF
Next
strUnicodeLen = K - 1
End Function
Function strUnicode2Ansi(asContents)
Dim Len1 : Len1 = Len(asContents)
Dim I, VarCHAR, VarASC, VarHEX, VarLOW, VarHIGH
strUnicode2Ansi = ""
For I = 1 to Len1
VarCHAR = Mid(asContents,I,1)
VarASC = Asc(VarCHAR)
IF VarASC < 0 Then VarASC = VarASC + 65536
IF VarASC > 255 Then
VarHEX = Hex(VarASC)
VarLOW = Left(VarHEX,2)
VarHIGH = Right(VarHEX,2)
strUnicode2Ansi = strUnicode2Ansi & ChrB("&H" & VarLOW ) & ChrB("&H" & VarHIGH )
Else
strUnicode2Ansi = strUnicode2Ansi & ChrB(VarASC)
End IF
Next
End Function
Function strAnsi2Unicode(asContents)
Dim Len1 : Len1 = LenB(asContents)
Dim VarCHAR, VarASC, I
strAnsi2Unicode = ""
IF Len1=0 Then Exit Function
For I=1 To Len1
VarCHAR = MidB(asContents,I,1)
VarASC = AscB(VarCHAR)
IF VarASC > 127 Then
strAnsi2Unicode = strAnsi2Unicode & Chr(AscW(MidB(asContents, I+1,1) & VarCHAR))
I = I + 1
Else
strAnsi2Unicode = strAnsi2Unicode & Chr(VarASC)
End IF
Next
End function
Function Base64encode(asContents)
Dim lnPosition
Dim lsResult
Dim Char1
Dim Char2
Dim Char3
Dim Char4
Dim Byte1
Dim Byte2
Dim Byte3
Dim SaveBits1
Dim SaveBits2
Dim lsGroupBinary
Dim lsGroup64
Dim M3, M4, Len1, Len2
Len1 =LenB(asContents)
IF Len1 < 1 Then
Base64encode = ""
Exit Function
End IF
M3=Len1 Mod 3
IF M3 > 0 Then asContents = asContents & String(3 - M3, ChrB(0))
IF m3 > 0 Then
Len1 = Len1 + (3 - M3)
Len2 = Len1 - 3
Else
Len2 = Len1
End IF
lsResult = ""
For lnPosition = 1 To Len2 Step 3
lsGroup64 = ""
lsGroupBinary = MidB(asContents, lnPosition, 3)
Byte1 = AscB(MidB(lsGroupBinary, 1, 1)) : SaveBits1 = Byte1 And 3
Byte2 = AscB(MidB(lsGroupBinary, 2, 1)) : SaveBits2 = Byte2 And 15
Byte3 = AscB(MidB(lsGroupBinary, 3, 1))
Char1 = MidB(sBASE_64_CHARACTERSansi, ((Byte1 And 252) \ 4) + 1, 1)
Char2 = MidB(sBASE_64_CHARACTERSansi, (((Byte2 And 240) \ 16) Or (SaveBits1 * 16) And &HFF) + 1, 1)
Char3 = MidB(sBASE_64_CHARACTERSansi, (((Byte3 And 192) \ 64) Or (SaveBits2 * 4) And &HFF) + 1, 1)
Char4 = MidB(sBASE_64_CHARACTERSansi, (Byte3 And 63) + 1, 1)
lsGroup64 = Char1 & Char2 & Char3 & Char4
lsResult = lsResult & lsGroup64
Next
IF M3 > 0 Then
lsGroup64 = ""
lsGroupBinary = MidB(asContents, Len2 + 1, 3)
Byte1 = AscB(MidB(lsGroupBinary, 1, 1)) : SaveBits1 = Byte1 And 3
Byte2 = AscB(MidB(lsGroupBinary, 2, 1)) : SaveBits2 = Byte2 And 15
Byte3 = AscB(MidB(lsGroupBinary, 3, 1))
Char1 = MidB(sBASE_64_CHARACTERSansi, ((Byte1 And 252) \ 4) + 1, 1)
Char2 = MidB(sBASE_64_CHARACTERSansi, (((Byte2 And 240) \ 16) Or (SaveBits1 * 16) And &HFF) + 1, 1)
Char3 = MidB(sBASE_64_CHARACTERSansi, (((Byte3 And 192) \ 64) Or (SaveBits2 * 4) And &HFF) + 1, 1)
IF M3=1 Then
lsGroup64 = Char1 & Char2 & ChrB(61) & ChrB(61)
Else
lsGroup64 = Char1 & Char2 & Char3 & ChrB(61)
End IF
lsResult = lsResult & lsGroup64
End IF
Base64encode = lsResult
End Function
Function Base64decode(asContents)
Dim lsResult
Dim lnPosition
Dim lsGroup64, lsGroupBinary
Dim Char1, Char2, Char3, Char4
Dim Byte1, Byte2, Byte3
Dim M4, Len1, Len2
Len1 = LenB(asContents)
M4 = Len1 Mod 4
IF Len1 < 1 Or M4 > 0 Then
Base64decode = ""
Exit Function
End IF
IF MidB(asContents, Len1, 1) = ChrB(61) Then M4 = 3
IF MidB(asContents, Len1-1, 1) = ChrB(61) Then M4 = 2
IF M4 = 0 Then
Len2 = Len1
Else
Len2 = Len1 - 4
End IF
For lnPosition = 1 To Len2 Step 4
lsGroupBinary = ""
lsGroup64 = MidB(asContents, lnPosition, 4)
Char1 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 1, 1)) - 1
Char2 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 2, 1)) - 1
Char3 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 3, 1)) - 1
Char4 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 4, 1)) - 1
Byte1 = ChrB(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & ChrB(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = ChrB((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
lsGroupBinary = Byte1 & Byte2 & Byte3
lsResult = lsResult & lsGroupBinary
Next
IF M4 > 0 Then
lsGroupBinary = ""
lsGroup64 = MidB(asContents, Len2 + 1, M4) & ChrB(65)
IF M4=2 Then
lsGroup64 = lsGroup64 & chrB(65)
End IF
Char1 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 1, 1)) - 1
Char2 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 2, 1)) - 1
Char3 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 3, 1)) - 1
Char4 = InStrB(sBASE_64_CHARACTERSansi, MidB(lsGroup64, 4, 1)) - 1
Byte1 = ChrB(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & ChrB(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = ChrB((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
IF M4=2 Then
lsGroupBinary = Byte1
elseIF M4=3 Then
lsGroupBinary = Byte1 & Byte2
end IF
lsResult = lsResult & lsGroupBinary
End IF
Base64decode = lsResult
End Function
'################################## 紫遂 児巴 ##################################
'Dim ORIGNvalue : ORIGNvalue = "馬刃嬢発神虞っ壱っ錠けぉ22けけ@@しけぉ;いしaabcsdfaeerdfadf"
'Dim EncodeA : EncodeA = strAnsi2Unicode(Base64encode(strUnicode2Ansi(ORIGNvalue)))
'Dim DecodeA : DecodeA = strAnsi2Unicode(Base64decode(strUnicode2Ansi(EncodeA)))
'response.write "------------------------------------------------------------------------<BR>"
'response.write "lsResult : " & ORIGNvalue & "<BR>"
'response.write "lsResult : " & EncodeA & "<BR>"
'response.write "lsResult : " & DecodeA & "<BR>"
'response.write "------------------------------------------------------------------------<BR>"
%>
+234
View File
@@ -0,0 +1,234 @@
<%
' ************************
' 1.회원관련
' ************************
'function memgr_idpwdchk(m_id,m_pwd) '아이디패스워드검사
'function memgr_logincookie(m_id, m_pwd) '로긴시 쿠키생성
'function memgr_logout() '로그아웃
'function memgr_ad_cmscookie() '관리자페이지 쿠키생성
'function security_ad_cms() '관리자페이지 체크
'function member_login_chk(url) '회원로그인 체크
'get_level(g_num) '등급이름찾기
'************** Information ****************************************
' Program Title : security_ad_cms
' Company :
' Creator :
'*********************************************************************/
sub security_ad_cms()
If session("ss_security_ad_cms") <> "ok" then
%>
<script type='text/javascript'>
//alert('잘못된 접속입니다.');
//history.back();
top.location.href='/manager/login.asp';
</script>
<%
response.end
End If
End sub
'************** Information ****************************************
' Program Title : '등급이름찾기
' Company :
' reator : 윤 종 우 2007-02-07
'*********************************************************************
function get_level(g_num)
Dim rs, g_menuname
If g_num <> "" Then
sql = "select g_num, g_menuname from member_group where g_num = " & g_num
Set rs = dbcon.execute( sql )
If rs.bof Or rs.eof Then
If g_num = "-1" Then
If session("sp_g_num") = "-2" Then
get_level = "슈퍼관리자"
Else
get_level = "총관리자"
End if
Else
get_level = ""
End if
Else
g_menuname = rs(1)
get_level = g_menuname
End If
Set rs = Nothing
End If
End Function
'************** Information ****************************************
' Program Title : 아이디패스워드검사
' Company :
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function memgr_idpwdchk(m_id, m_pwd)
Dim sql, rs
' sql = " select m_num from member_view where m_id = '" & m_id & "' and m_pwd = '" & m_pwd & "' and g_manager = 'Y'"
sql = " select m_num from member_view where m_id = '" & m_id & "' and m_pwd = '" & m_pwd & "' "
Set rs = dbcon.execute( sql )
If rs.bof Or rs.eof Then
memgr_idpwdchk = false
Else
memgr_idpwdchk = true
End if
Set rs = nothing
End function
'************** Information ****************************************
' Program Title : 아이디패스워드검사
' Company :
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function memgr_idpwdchk3(m_id, m_pwd)
Dim sql, rs
sql = " select m_num from member_view where m_id = '" & m_id & "' and m_pwd = '" & m_pwd & "' and m_level <> '2'"
'Response.write sql
'Response.end
Set rs = dbcon.execute( sql )
If rs.bof Or rs.eof Then
memgr_idpwdchk3 = false
Else
memgr_idpwdchk3 = true
End if
Set rs = nothing
End function
'************** Information ****************************************
' Program Title : '로긴시 쿠키생성
' Company :
' Creator : 윤 종 우 2004. 05
'*********************************************************************
function memgr_logincookie(m_id, m_pwd)
Dim sql, Rs_m, lastdate
'sql = " select m_num, m_id, m_name, m_level, m_pwd, m_jumin, (m_mobile1+'-'+m_mobile2+'-'+m_mobile3)as m_mobile, bdm_idx from member where m_id = '" & m_id & "' and m_pwd = '" & m_pwd & "'"
sql = " select m_num, m_id, m_name, m_level, m_pwd, m_jumin, m_mobile1, m_mobile2, m_mobile3, bdm_idx from member where m_id = '" & m_id & "' and m_pwd = '" & m_pwd & "'"
Set Rs_m = dbcon.execute( sql )
'1544-9642 처럼 m_mobile3 없는 발신번호때문에 다시 조합.. (은영20240112)
m_mobile = Rs_m("m_mobile1") & "-" & Rs_m("m_mobile2")
If Rs_m("m_mobile3") <> "" Then
m_mobile = m_mobile & "-" & Rs_m("m_mobile3")
End If
SESSION("ss_m_num") = Rs_m("m_num")
SESSION("ss_m_id") = Rs_m("m_id")
SESSION("ss_m_name") = Rs_m("m_name")
SESSION("ss_g_num") = Rs_m("m_level")
SESSION("ss_m_pwd") = Rs_m("m_pwd")
SESSION("ss_m_jumin") = Rs_m("m_jumin")
SESSION("ss_m_mobile") = m_mobile
SESSION("ss_bdm_idx") = Rs_m("bdm_idx")
'최근접속일 등록
lastdate = date()
sql = "update member set m_lastdate='" & lastdate & "' where m_id = '" & Trim( Rs_m("m_id") ) & "'"
dbcon.execute sql
'접속로그 남기기
' sql = "insert into login_log (log_id,log_name,log_ip,log_wdate) values('" & trim( Rs_m("m_id") ) & "' ,'" & trim( Rs_m("m_name") ) & "', '" & request.ServerVariables("REMOTE_ADDR") & "' ,'" & date() & "')"
' dbcon.execute sql
Set Rs_m = nothing
End Function
'************** Information ****************************************
' Program Title : 아이디패스워드검사
' Company :
' Creator : 윤 종 우 2004. 05
'*********************************************************************
'function memgr_idpwdchk2(m_id,m_pwd) {
'
' $DbCon2 = mysql_connect("localhost","root","tkdlxm##");
' mysql_select_db("super_user",$DbCon2);
'
' $sql = " select m_num from super_member where m_id = '".$m_id."' and m_pwd = '".$m_pwd."'";
' $query = mysql_query($sql,$DbCon2);
'
' if (mysql_num_rows($query) > 0) {
' return true;
' }else{
' return false;
' }
' exit;
'
'}
'//************** Information ****************************************
'// Program Title : '로긴시 쿠키생성
'// Company :
'// Creator : 윤 종 우 2004. 05
'//*********************************************************************
'function memgr_logincookie2($m_id, $m_pwd) {
'
' global $Application_domain;
'
' $DbCon2 = mysql_connect("localhost","root","tkdlxm##");
' mysql_select_db("super_user",$DbCon2);
'
' $sql = " select m_num, m_id, m_name,m_level from super_member where m_id = '".$m_id."' and m_pwd = '".$m_pwd."'";
' $query = mysql_query($sql,$DbCon2);
'
' $col = mysql_fetch_array($query);
'
' setcookie("ck_m_num", $col[m_num], 0, "/", $Application_domain); //--회원pk
' setcookie("ck_m_id", $col[m_id], 0, "/", $Application_domain); //--회원id
' setcookie("ck_m_name", $col[m_name], 0, "/", $Application_domain); //--회원이름
' setcookie("ck_g_num", $col[m_level], 0, "/", $Application_domain); //--등급pk -1
'
' setcookie("sp_g_num", "-2", 0, "/", $Application_domain); //--관리자페이지 권한부여
'
' mysql_close($DbCon2);
'}
'//************** Information ****************************************
'// Program Title : 관리자페이지 쿠키생성
'// Company :
'// Creator : 윤 종 우 2004. 05
'//*********************************************************************
sub memgr_ad_cmscookie()
SESSION("ss_security_ad_cms") = "ok"
End sub
'//************** Information ****************************************
'// Program Title : 로그아웃
'// Company :
'// Creator : 윤 종 우 2004. 05
'//*********************************************************************
sub memgr_logout()
session.abandon
End Sub
sub member_login_chk(url)
If session("ss_m_id") = "" Then
'goUrl(url)
Call Back_back2("세션이 만료되어 로그아웃됩니다.", url)
End if
End sub
%>
+624
View File
@@ -0,0 +1,624 @@
<%
'************** Information ****************************************
' Program Title : SMS 전송
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006-03-17
'*********************************************************************
Function SmsSend(tran_phone, tran_callback, Msg, RDate, s_num)
'tran_phone = b_phone1&"-"&b_phone2&"-"&b_phone3 '받는사람
'tran_phone = a_smssend_addr '받는사람
'tran_callback = "053-955-9055" '보내는 사람
'a_num = 고유번호
tran_phone = Replace(tran_phone, "-" , "")
tran_phone = Replace(tran_phone, " " , "")
message_temp = StringToHTML2(Msg, 80, true)
messageArr = Split(message_temp, "<BR>")
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
If UBound(messageArr) > 0 Then
For ii = 0 To UBound(messageArr)
response.write ii&"=ii<BR>"
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) values ("
SQL = SQL & "'"&session("ss_m_id")&"','"&tran_phone&"', '"&tran_callback&"', '1', '"&Rdate&"', '"&ii+1&")"&messageArr(ii)&"','', '"&s_num&"','"&session("ss_bdm_idx")&"', '"&get_bdm_idx2(session("ss_bdm_idx"))&"')"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
sql = "update member set M_g_sms = M_g_sms - 1 where M_id = '" & session("ss_m_id") & "'"
dbcon.execute sql
next
else
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) values ("
SQL = SQL & "'"&session("ss_m_id")&"','"&tran_phone&"', '"&tran_callback&"', '1', '"&Rdate&"', '"&Msg&"','', '"&s_num&"', '"&session("ss_bdm_idx")&"','"&get_bdm_idx2(session("ss_bdm_idx"))&"')"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
sql = "update member set M_g_sms = M_g_sms - 1 where M_id = '" & session("ss_m_id") & "'"
dbcon.execute sql
End if
End Function
'************** Information ****************************************
' Program Title : SMS 전송
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006-03-17
'*********************************************************************
Function SmsSend_s(tran_phone, tran_callback, Msg, RDate, s_num)
'tran_phone = b_phone1&"-"&b_phone2&"-"&b_phone3 '받는사람
'tran_phone = a_smssend_addr '받는사람
'tran_callback = "053-955-9055" '보내는 사람
'a_num = 고유번호
tran_phone = Replace(tran_phone, "-" , "")
tran_phone = Replace(tran_phone, " " , "")
message_temp = StringToHTML2(Msg, 80, true)
messageArr = Split(message_temp, "<BR>")
If UBound(messageArr) > 0 Then
For ii = 0 To UBound(messageArr)
'response.write ii&"=ii<BR>"
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) values ("
SQL = SQL & "'"&session("ss_m_id")&"','"&tran_phone&"', '"&tran_callback&"', '1', '"&Rdate&"', '"&ii+1&")"&messageArr(ii)&"','', '"&s_num&"','"&session("ss_bdm_idx")&"', '"&get_bdm_idx2(session("ss_bdm_idx"))&"')"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
next
else
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) values ("
SQL = SQL & "'"&session("ss_m_id")&"','"&tran_phone&"', '"&tran_callback&"', '1', '"&Rdate&"', '"&Msg&"','', '"&s_num&"', '"&session("ss_bdm_idx")&"','"&get_bdm_idx2(session("ss_bdm_idx"))&"')"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
End if
End Function
'************** Information ****************************************
' Program Title : SMS 전송
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006-03-17
'*********************************************************************
Function SmsSend_2(tran_phone, tran_callback, Msg, RDate, a_num, qry, rowcnt)
'tran_phone = b_phone1&"-"&b_phone2&"-"&b_phone3 '받는사람
'tran_phone = a_smssend_addr '받는사람
'tran_callback = "053-955-9055" '보내는 사람
'a_num = 고유번호
tran_phone = Replace(tran_phone, "-" , "")
tran_phone = Replace(tran_phone, " " , "")
message_temp = StringToHTML2(Msg, 80, true)
messageArr = Split(message_temp, "<BR>")
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
If UBound(messageArr) > 0 Then
For ii = 0 To UBound(messageArr)
'response.write ii&"=ii<BR>"
qry_value = Replace(qry, Msg, ii+1&")"&messageArr(ii) )
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
sql = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) " & qry_value
'select '"&session("ss_m_id")&"', m_mobile, '"&callback&"', '1', getdate(), '"&message&"', '', '', '"&session("ss_bdm_idx")&"','"&get_bdm_idx(session("ss_bdm_idx"))&"' from member"
'SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) " &qry
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
sql = "update member set M_g_sms = M_g_sms - "&rowcnt&" where M_id = '" & session("ss_m_id") & "'"
dbcon.execute sql
next
else
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) " &qry
'"select '"&session("ss_m_id")&"', m_mobile, '"&callback&"', '1', getdate(), '"&message&"', '', '', '"&session("ss_bdm_idx")&"','"&get_bdm_idx(session("ss_bdm_idx"))&"' from member"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
sql = "update member set M_g_sms = M_g_sms - "&rowcnt&" where M_id = '" & session("ss_m_id") & "'"
'response.write sql
dbcon.execute sql
End if
End Function
'************** Information ****************************************
' Program Title : SMS 전송
' Company : (주)나우아이텍 (053)955-9055
' Creator : 최 경 수 2006-03-17
'*********************************************************************
Function SmsSend_s_2(tran_phone, tran_callback, Msg, RDate, a_num, qry, rowcnt)
'tran_phone = b_phone1&"-"&b_phone2&"-"&b_phone3 '받는사람
'tran_phone = a_smssend_addr '받는사람
'tran_callback = "053-955-9055" '보내는 사람
'a_num = 고유번호
tran_phone = Replace(tran_phone, "-" , "")
tran_phone = Replace(tran_phone, " " , "")
message_temp = StringToHTML2(Msg, 80, true)
messageArr = Split(message_temp, "<BR>")
If UBound(messageArr) > 0 Then
For ii = 0 To UBound(messageArr)
'response.write ii&"=ii<BR>"
qry_value = Replace(qry, Msg, ii+1&")"&messageArr(ii) )
sql = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) " & qry_value
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
next
else
SQL = "Insert into em_tran(tran_id, tran_phone, tran_callback, tran_status, tran_date, tran_msg, tran_etc1, tran_etc2, tran_etc3, tran_etc4) " &qry
'"select '"&session("ss_m_id")&"', m_mobile, '"&callback&"', '1', getdate(), '"&message&"', '', '', '"&session("ss_bdm_idx")&"','"&get_bdm_idx(session("ss_bdm_idx"))&"' from member"
'response.write sql & "<br>"
'response.write "<br>sql="&sql
'response.end
dbcon.execute sql
End if
End Function
'************** Information ****************************************
' Program Title : MMS 전송
'*********************************************************************
sub mmsSend(tran_phone, tran_callback, Msg, RDate, s_num)
'tran_phone = b_phone1&"-"&b_phone2&"-"&b_phone3 '받는사람
'tran_phone = a_smssend_addr '받는사람
'tran_callback = "053-955-9055" '보내는 사람
'a_num = 고유번호
Dim subject, now_date, sql
tran_phone = Replace(tran_phone, "-" , "")
tran_phone = Replace(tran_phone, " " , "")
now_date = Replace( Date(), "-", "" ) & Right("0"&hour(now), 2) & Right("0"&minute(now), 2) & Right("0"&second(now), 2)
SCHEDULE_TYPE = 0
If now_date < rdate Then
SCHEDULE_TYPE = 1
End if
subject = StringToHTML( Msg, 30, false )
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
sql = "insert into SDK_MMS_SEND( user_id, subject, now_date, send_date, dest_count, dest_info, msg_type, mms_msg, content_count, content_data, callback, RESERVED1, RESERVED2, RESERVED3, RESERVED4, SCHEDULE_TYPE) values('"
sql = sql & session("ss_m_id") & "','"
sql = sql & subject & "', '"
sql = sql & now_date & "','"
sql = sql & RDate & "', '"
sql = sql & "1', '"
sql = sql & "noname^" & tran_phone & "', '"
sql = sql & "0', '"
sql = sql & Msg & "', '"
sql = sql & "1', '"
sql = sql & "', '"
sql = sql & tran_callback & "', '"
sql = sql & "', '"
sql = sql & s_num & "', '"
sql = sql & session("ss_bdm_idx") & "', '"
sql = sql & get_bdm_idx2(session("ss_bdm_idx")) & "', '"
sql = sql & SCHEDULE_TYPE & "'"
sql = sql & ")"
'Response.write "<br />" & sql
executeQuery( sql )
sql = "update member set M_g_sms = M_g_sms - 3 where M_id = '" & session("ss_m_id") & "'"
executeQuery( sql )
End sub
'************** Information ****************************************
' Program Title : MMS 전송 (쿼리로 대량발송)
'*********************************************************************
sub mmsSend2(tran_callback, Msg, RDate, s_num, qry)
Dim subject, now_date, rs, i, dest_info, rowcnt, sql
Set ST = New SelectTable
rs = ST.selectQueryTable( qry )
dest_info = ""
rowcnt = 0
If Not( isnull( rs ) ) Then
rowcnt = ubound( rs ) + 1
dest_info = rs(0)("dest_info")
For i = 1 To ubound( rs )
dest_info = dest_info & "|" & rs(i)("dest_info")
Next
End if
now_date = Replace( Date(), "-", "" ) & Right("0"&hour(now), 2) & Right("0"&minute(now), 2) & Right("0"&second(now), 2)
SCHEDULE_TYPE = 0
If now_date < rdate Then
SCHEDULE_TYPE = 1
End if
subject = StringToHTML( Msg, 30, false )
if clng(smsSelect()) <= 0 then Back_back2 "당월 남은 건수가 부족합니다.", request.servervariables("http_referer")
sql = "insert into SDK_MMS_SEND( user_id, subject, now_date, send_date, dest_count, dest_info, msg_type, mms_msg, content_count, content_data, callback, RESERVED1, RESERVED2, RESERVED3, RESERVED4, SCHEDULE_TYPE) values('"
sql = sql & session("ss_m_id") & "','"
sql = sql & subject & "', '"
sql = sql & now_date & "','"
sql = sql & RDate & "', '"
sql = sql & "1', '"
sql = sql & dest_info & "', '"
sql = sql & "0', '"
sql = sql & Msg & "', '"
sql = sql & "1', '"
sql = sql & "', '"
sql = sql & tran_callback & "', '"
sql = sql & "', '"
sql = sql & s_num & "', '"
sql = sql & session("ss_bdm_idx") & "', '"
sql = sql & get_bdm_idx2(session("ss_bdm_idx")) & "', '"
sql = sql & SCHEDULE_TYPE & "'"
sql = sql & ")"
'Response.write sql
'Response.end
executeQuery( sql )
rowcnt = rowcnt * 3
sql = "update member set M_g_sms = M_g_sms - "& rowcnt &" where M_id = '" & session("ss_m_id") & "'"
executeQuery( sql )
End sub
Function SMSdateChk(dateval, hourval, minval)
If CDate(dateval) > Date() Then '날짜가 오늘날짜보다 크면
SMSdateChk = True
ElseIf CDate(dateval) = Date() Then '날짜가 같다면
If CInt(hourval) > CInt(hour(now)) Then '같은날짜 시간이 크다면
SMSdateChk = True
ElseIf Not(CInt(hourval) < CInt(hour(now))) And CInt(minval) > Minute(now) Then'시간이 작지않고 분이 크다면
SMSdateChk = True
Else
SMSdateChk = false
End If
Else
SMSdateChk = False
End if
End function
'************** Information ****************************************
' Program Title : sms건수 조회
' Company :
'*********************************************************************
function smsSelect()
Dim rs, sql
If session("ss_m_id") <> "" Then
sql = "select m_g_sms from member where m_id = '" & session("ss_m_id") & "'"
'Response.write sql
Set rs = dbcon.execute( sql )
If rs.bof Or rs.eof Then
smsSelect = 0
Else
smsSelect = rs(0)
End If
Set rs = Nothing
End If
End Function
function smsSelect2(m_id)
Dim rs, sql
If m_id <> "" Then
sql = "select m_g_sms from member where m_id = '" & m_id & "'"
Set rs = dbcon.execute( sql )
If rs.bof Or rs.eof Then
smsSelect2 = 0
Else
smsSelect2 = rs(0)
End If
Set rs = Nothing
End If
End Function
'=======================회원별 남은 통수 보기=========================================================
Function smsMail()
Dim strConnect, Db, sql, rs_mail
strConnect="Provider=SQLOLEDB.1;Data Source=(local);Initial catalog="&Application("DB")&";user ID="&Application("DB_id")&";Password="&Application("DB_pwd")
Set Db=Server.CreateObject("ADODB.Connection")
Db.Open strConnect
sql = "select M_g_mail from member where M_id = '" & session("ss_m_id") & "'"
Set rs_mail = Db.Execute(sql)
If rs_mail.bof Or rs_mail.eof Then
smsMail = 0
Else
smsMail = rs_mail(0)
End If
Set rs_mail = Nothing
Db.close
Set Db = nothing
End Function
'===================내 소속 실국 번호 알아내기==========================
Function mysilguk()
sql = "select b.bdm_ref from member as a inner join bd_menu_page b on a.bdm_idx = b.bdm_idx where a.M_id = '" & session("ss_m_id") & "'"
Set rs = Dbcon.Execute(sql)
If rs.bof Or rs.eof Then
mysilguk = null
Else
mysilguk = cint(rs(0))
End If
Set rs = nothing
End function
'=======================================================================
'---------------------sms 용 수정 최경수---------------
function StringToHTML2( str, max, br )
Dim i, length, buf, tmp, count, count2, ch, first
first = false
if ( isnull(str) ) then
StringToHTML = "ㅋㅋㅋ"
Exit Function
end if
if max>0 then
buf = Trim( str )
'buf = Replace( buf, CHR(9), " " )
'buf = Replace( buf, CHR(13), "" )
length = len( buf )
count = 1
count2 = 0
tmp = ""
for i=1 to length
if count>max then
if br=false then
tmp = tmp & "..."
exit for
end if
if i<length-1 then tmp = tmp & "<BR>"
count = 1
first = true
end if
ch = mid( buf, i, 1 )
'if ch=CHR(10) then
'if br=false then
' exit for
'end if
'tmp = tmp & "<BR>"
'count = 1
'first = true
'Else
if count>1 AND ch=CHR(32) then
if not first then
tmp = tmp & " "
end if
elseif count = 1 and ch = CHR(32) then
tmp = tmp
else
tmp = tmp & ch
first = false
end if
if asc(ch)<0 then '한글이면
count = count+2
else '영문이면
count = count+1
end if
next
else
tmp = str
tmp = Trim( tmp )
tmp = Replace( tmp, "&", "&amp;" )
tmp = Replace( tmp, "<", "&lt;" )
tmp = Replace( tmp, ">", "&gt;" )
'tmp = Replace( tmp, CHR(10), "<BR>" )
'tmp = Replace( tmp, CHR(32), " " )
end if
StringToHTML2 = tmp
end function
'************** Information ****************************************
' Program Title : '회원 최상위부서
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-24
'*********************************************************************
function get_bdm_idx2(bdm_idx)
if bdm_idx <> 0 then
SQL = "Select bdm_ref from bd_menu_page where bdm_idx = "&bdm_idx
'response.write sql
set rs_buseo = DbCon.Execute(sql)
if rs_buseo.eof then
get_bdm_idx2 = 0
else
get_bdm_idx2 = rs_buseo(0)
end if
Set rs_buseo = nothing
else
get_bdm_idx2 = 0
end if
end Function
'************** Information ****************************************
' Program Title : '회원부서
' Company : (주)나우아이텍 (053)955-9055
' Creator : 윤 종 우 2005-07-24
'*********************************************************************
function get_buseo(bdm_idx)
If IsNull(bdm_idx) Or Trim(bdm_idx) = "" Then bdm_idx = 0
if CLng(bdm_idx) > 0 then
SQL = "Select bdm_menuname from bd_menu_page where bdm_idx = "&bdm_idx
'response.write sql
set rs_buseo = DbCon.Execute(sql)
if rs_buseo.eof then
get_buseo = "부서없음"
else
get_buseo = rs_buseo(0)
end if
Set rs_buseo = nothing
else
get_buseo = "부서없음"
end if
end Function
'휴대폰번호 정규화
Function phoneValue(value)
Dim phone_arr_temp, phone_arr_temp_len, i
If IsNull( value ) Then value = ""
phone_arr_temp = Trim(value)
'---------------불필요한 문자열 제거------------------
phone_arr_temp = Replace(phone_arr_temp,")","")
phone_arr_temp = Replace(phone_arr_temp,"(","")
phone_arr_temp = Replace(phone_arr_temp,"-","")
phone_arr_temp = Replace(phone_arr_temp," ","")
phone_arr_temp = Replace(phone_arr_temp,"ㅡ","")
phone_arr_temp = Replace(phone_arr_temp,"*","")
'---------------불필요한 문자열 제거------------------
phone_arr_temp_len = Len(phone_arr_temp)
'phone_arr_temp = Split(mem_list(4, i), "-")
If Left(phone_arr_temp, 2) = "00" Then '지역번호에 0이 2개 들어갔을 경우
phone_arr_temp = Mid(phone_arr_temp, 2)
End if
'response.write "["& mem_list(4, i) &"], "
'---------------전화번호를 정규화------------------
Select Case phone_arr_temp_len
Case 7
phone_arr = Array("053",Left(phone_arr_temp,3),right(phone_arr_temp,4))
Case 8
phone_arr = Array("053",Left(phone_arr_temp,4),right(phone_arr_temp,4))
Case 10
phone_arr = Array(Left(phone_arr_temp,3),mid(phone_arr_temp,4,3),right(phone_arr_temp,4))
Case 11
phone_arr = Array(Left(phone_arr_temp,3),mid(phone_arr_temp,4,4),right(phone_arr_temp,4))
Case 12
phone_arr = Array(Left(phone_arr_temp,4),mid(phone_arr_temp,5,4),right(phone_arr_temp,4))
Case Else
phone_arr = Array("","","")
End select
'---------------전화번호를 정규화끝------------------
'---------------마지막필터 숫자냐---------------
If IsNumeric(phone_arr(0)) And IsNumeric(phone_arr(1)) And IsNumeric(phone_arr(2)) Then
M_phone = phone_arr(0) & "-" & phone_arr(1) & "-" & phone_arr(2)
Else
M_phone = "--"
End If
'---------------마지막필터 숫자냐---------------
phoneValue = M_phone
End Function
Function setDate(value)
value = Replace(value, "Y", year(now))
value = Replace(value, "m", Right("0" & month(now), 2))
value = Replace(value, "d", Right("0" & day(now), 2))
value = Replace(value, "H", Right("0" & hour(now), 2))
value = Replace(value, "i", Right("0" & minute(now), 2))
value = Replace(value, "s", Right("0" & second(now), 2))
setDate = value
End function
Function createDate( value )
Dim y, m, d, h, i, s, ret_value
y = mid(value,1,4)
m = mid(value,5,2)
d = mid(value,7,2)
h = "00"
i = "00"
s = "00"
If Len(value) >= 10 Then h = mid(value,9,2)
If Len(value) >= 12 Then i = mid(value,11,2)
If Len(value) >= 14 Then s = mid(value,13,2)
'ret_value = y & "-" & m & "-" & d & " " & h & ":" & i & ":" & s
ret_value = y & "-" & m & "-" & d & " " & h & ":" & i
createDate = ret_value
End function
%>
File diff suppressed because one or more lines are too long