<%
const MAX_DATE = "4000-1-1"
const MIN_DATE = "1900-1-1"
Dim conn
Dim rs
Dim sql
'DB Connection
Sub DBConnection()
Dim connStr
Set conn = Server.CreateObject("ADODB.Connection")
'connStr = "driver={Microsoft Access Driver (*.mdb)};DBQ=C:\unics.mdb"
connStr = "driver={Sql Server};server=UNICS-SV1;uid=unics;pwd=unics.cn.com;database=UNICS"
conn.Open connStr
End Sub
'单选按钮的选择设置
Function setChecked(str1, str2)
if str1 = str2 then
setChecked = " checked"
else
setChecked = ""
End if
End Function
' LIST 文本的选择设置
Function setSelected(str1, str2)
if str1 = str2 then
setSelected = " selected"
else
setSelected = ""
End if
End Function
'取得用户IP地址
Function getUserIP()
getUserIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If getUserIP = "" Then getUserIP = Request.ServerVariables("REMOTE_ADDR")
End Function
Function getFeedBackType(intId)
select case intId
case 0
getFeedBackType = "其他"
case 1
getFeedBackType = "投诉或建议"
case 2
getFeedBackType = "联系我们"
end select
End Function
'ERROR MESSAGE 的输出
Sub MessageBox(strMsg)
Response.write ""
End Sub
'INFO MESSAGE 的输出
Sub MessageInfo(strMsg,turnUrl,tar)
response.redirect "/admin/common/complete.asp?msg="&Server.URLEncode(strMsg)&"&url="&Server.URLEncode(turnUrl)&"&tar="&Server.URLEncode(tar)
End Sub
'找不到该页!
Sub showNoPage()
if rs.eof then
rs.close
set rs = nothing
conn.close
set conn = nothing
response.redirect "nopage"
end if
End Sub
'格式化日期
Function getDatecn()
Dim nowDate
nowDate = now()
getDatecn=datepart("yyyy",nowDate)&"年"&datepart("m",nowDate)&"月"&datepart("d",nowDate)&"日 "&formatdatetime(nowDate,vbshorttime)
End Function
'取得年月日
Function getYMDDate(datetime)
if datetime = Empty Then Exit Function
if len(datetime) < 18 then
getYMDDate = left(datetime, 9)
else
getYMDDate = left(datetime, 10)
end if
getYMDDate = Trim(getYMDDate)
End Function
Function getTextMining(sHtml)
getTextMining = left(sHtml,100)
End Function
'检查网站管理者是否登录
Sub AdminCheck()
if (session("snAdminId")="" or session("snAdminPwd")="" ) then
response.redirect "/admin/login/"
end if
End Sub
%>