📄 sub.asp
字号:
' UserName会员帐号
' UserType会员类型(1个人、2企业、3培训、4院校)
' sValue消费项目
' nValue扣除的点数
' 0前台操作 1后台操作
Function PayLog(UserName,UserType,sValue,nValue,DoType)
Dim rsl,sqll,trueIP,DoWhere
trueIP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If trueIP="" Then trueIP=Request.ServerVariables("REMOTE_ADDR")
Select Case DoType
Case 0:DoWhere="前台"
Case 1:DoWhere="后台"
End Select
Set rsl=Server.CreateObject("ADODB.RecordSet")
sqll="Select * From JOB_consume"
rsl.Open sqll,Conn,1,3
rsl.AddNew
rsl("consume_content")=sValue
rsl("consume_num")=nValue
rsl("consume_date")=Now()
rsl("consume_ip")=trueIP
rsl("consume_member")=UserName
rsl("consume_userclass")=UserType
rsl("consume_type")=DoWhere
rsl.Update
rsl.Close
Set rsl=Nothing
End Function
'函数名称:PayItem
'函数功能:会员消费项目
'传递参数:PayItemID,GetDataType
' PayItemID=消费项目ID
' GetDataType=消费项目返回值(rPoint返回扣除的点数,rDate返回消费项目天数)
Function PayItem(PayItemID,ShowItemValue)
If IsNull(PayItemID) Or IsNumeric(PayItemID)=False Then Exit Function
Dim rsl,sqll
Set rsl=Server.CreateObject("ADODB.RecordSet")
sqll="Select * From job_prices Where id="&PayItemID
rsl.Open sqll,Conn,1,1
If Not(rsl.Eof) Then
If ShowItemValue=0 Then
PayItem=rsl("price_value")
Else
PayItem=rsl("price_useday")
End If
End If
rsl.Close
Set rsl=Nothing
End Function
Function UserTypePoint(UserType,GetType)
If IsNull(UserType) Or UserType="" Then Exit Function
Dim rsl,sqll
Set rsl=Server.CreateObject("ADODB.RecordSet")
sqll="Select * From JOB_C_cmembertype Where user_type='"&UserType&"'"
rsl.Open sqll,Conn,1,1
If Not(rsl.Eof) Then
Select Case GetType
Case "升级"
UserTypePoint=rsl("money")
Case "加天"
UserTypePoint=rsl("days")
End Select
End If
rsl.Close
Set rsl=Nothing
End Function
Function SetItem(nValue)
Select Case nValue
Case 2
If Pay_ItemPoint(session("user_name"),2,PayItem(2,0))=True Then
sql="update JOB_C_company set company_logocommand=1,company_logostartdate=date(),company_logoenddate="&DateValue(Date()+PayItem(2,1))&" where company_cmember='"&session("user_name")&"'"
conn.execute(sql)
Call PayLog(session("user_name"),2,"企业Logo推荐",PayItem(2,0),0)
End If
Case 3
If Pay_ItemPoint(session("user_name"),2,PayItem(3,0))=True Then
sql="update JOB_C_company set company_command=1,company_commandstartdate=date(),company_commandenddate="&DateValue(Date()+PayItem(3,1))&" where company_cmember='"&session("user_name")&"'"
conn.execute(sql)
Call PayLog(session("user_name"),2,"名企推荐",PayItem(3,0),0)
End If
End Select
End Function
Function Pay_ItemPoint(UserName,UserType,nValue)
If IsNull(UserName) Or UserName="" Or IsNumeric(nValue)=False Then
Exit Function
Else
Dim rsp,sqlp,HavePoint
Select Case UserType
Case 1:sqlp="Select * From JOB_P_pmember Where pmember_login='"&UserName&"'":PointName="pmember_consumenums"
Case 2:sqlp="Select * From JOB_C_cmember Where cmember_login='"&UserName&"'":PointName="cmember_consumenums"
Case 3:sqlp="Select * From JOB_T_tmember Where tmember_login='"&UserName&"'":PointName="tmember_consumenums"
Case 4:sqlp="Select * From JOB_S_smember Where smember_login='"&UserName&"'":PointName="smember_consumenums"
End Select
Set rsp=Server.CreateObject("ADODB.RecordSet")
rsp.Open sqlp,Conn,1,3
If Not(rsp.Eof) Then
If IsNumeric(rsp(""&PointName&""))=False Then
HavePoint=0
Else
HavePoint=rsp(""&PointName&"")
End If
HavePoint=CLng(HavePoint)
nValue=CLng(nValue)
If HavePoint<nValue Then
Pay_ItemPoint=False
Else
HavePoint=HavePoint-nValue
rsp(""&PointName&"")=HavePoint
rsp.Update
Pay_ItemPoint=True
End If
End If
rsp.Close
Set rsp=Nothing
End If
End Function
Function CheckPoint(UserName,UserType,nValue)
If IsNull(UserName) Or UserName="" Or IsNumeric(nValue)=False Then
Exit Function
Else
Dim rsp,sqlp,HavePoint
Select Case UserType
Case 1:sqlp="Select * From JOB_P_pmember Where pmember_login='"&UserName&"'":PointName="pmember_consumenums"
Case 2:sqlp="Select * From JOB_C_cmember Where cmember_login='"&UserName&"'":PointName="cmember_consumenums"
Case 3:sqlp="Select * From JOB_T_tmember Where tmember_login='"&UserName&"'":PointName="tmember_consumenums"
Case 4:sqlp="Select * From JOB_S_smember Where smember_login='"&UserName&"'":PointName="smember_consumenums"
End Select
Set rsp=Server.CreateObject("ADODB.RecordSet")
rsp.Open sqlp,Conn,1,1
If Not(rsp.Eof) Then
If IsNumeric(rsp(""&PointName&""))=False Then
HavePoint=0
Else
HavePoint=rsp(""&PointName&"")
End If
HavePoint=CLng(HavePoint)
nValue=CLng(nValue)
If HavePoint<nValue Then
CheckPoint=False
Else
CheckPoint=True
End If
End If
rsp.Close
Set rsp=Nothing
End If
End Function
Function JoinChar(strUrl)
if strUrl="" then
JoinChar=""
exit function
end if
if InStr(strUrl,"?")<len(strUrl) then
if InStr(strUrl,"?")>1 then
if InStr(strUrl,"&")<len(strUrl) then
JoinChar=strUrl & "&"
else
JoinChar=strUrl
end if
else
JoinChar=strUrl & "?"
end if
else
JoinChar=strUrl
end if
End Function
Function showpage(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit)
dim n, i,strTemp,strUrl
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
strTemp= "<table align=""center""><tr><td>"& vbCrLf
strTemp=strTemp & "共 <font color=""#0000FF""><b>" & totalnumber & "</b></font> " & strUnit & " "
strUrl=JoinChar(sfilename)
if Page<2 then
strTemp=strTemp & "首页 上一页 "
else
strTemp=strTemp & "<a href=""" & strUrl & "page=1"">首页</a> "
strTemp=strTemp & "<a href=""" & strUrl & "page=" & (Page-1) & """>上一页</a> "
end if
if n-Page<1 then
strTemp=strTemp & "下一页 尾页"
else
strTemp=strTemp & "<a href=""" & strUrl & "page=" & (Page+1) & """>下一页</a> "
strTemp=strTemp & "<a href=""" & strUrl & "page=" & n & """>尾页</a>"
end if
strTemp=strTemp & " 页次:<strong><font color=""#FF0000"">" & Page & "</font>/" & n & "</strong>页 "
strTemp=strTemp & " <b>" & maxperpage & "</b>" & strUnit & "/页"& vbCrLf
if ShowAllPages=True then
strTemp=strTemp & " 转到:<select name=""page"" size=""1"" onchange=""javascript:window.location='" & strUrl & "page=" & "'+this.options[this.selectedIndex].value;"">"& vbCrLf
for i = 1 to n
strTemp=strTemp & "<option value=""" & i & """"
if cint(Page)=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">第" & i & "页</option>"
next
strTemp=strTemp & "</select>"& vbCrLf
end if
strTemp=strTemp & "</td></tr></table>"& vbCrLf
response.write strTemp
End Function
Function ReCount(CTable,cField,CUser,UserID)
Dim rsc,sqlc
Set rsc=Server.CreateObject("ADODB.RecordSet")
sqlc="Select Count("&cField&") From "&CTable&" Where "&CUser&"='"&UserID&"'"
rsc.Open sqlc,Conn,1,1
If Not(rsc.Eof) Then
ReCount=rsc(0)
End If
rsc.Close
Set rsc=Nothing
End Function
Function CheckInfo(CheckItem)
Select Case CheckItem
Case 1
a=OutInfo("JOB_C_cmembertype","type_id","hirenums",session("user_type"))
b=ReCount("JOB_C_hire","hire_id","hire_cmember",""&session("user_name")&"")
Case 2
a=OutInfo("JOB_C_cmembertype","type_id","rehirenums",session("user_type"))
b=ReCount("JOB_C_myreceive","myreceive_id","myreceive_cmember",""&session("user_name")&"")
Case 3
a=OutInfo("JOB_C_cmembertype","type_id","meetnums",session("user_type"))
b=ReCount("JOB_C_interview","cominterview_id","cominterview_cmember",""&session("user_name")&"")
Case 4
a=OutInfo("JOB_C_cmembertype","type_id","expertnums",session("user_type"))
b=ReCount("JOB_C_myexpert","myexpert_id","myexpert_cmember",""&session("user_name")&"")
Case 5
a=OutInfo("JOB_C_cmembertype","type_id","recyclenums",session("user_type"))
b=ReCount("JOB_C_recycle","comrecycle_id","comrecycle_cmember",""&session("user_name")&"")
End Select
If CLng(a)>Clng(b) Then
CheckInfo=True
Else
CheckInfo=False
End If
End Function
Function alert(msg,url)
If IsNumeric(url)=False Then
Response.Write("<script>alert("""&msg&""");window.location='"&url&"';</script>")
Else
Response.Write("<script>alert("""&msg&""");history.go(-"&url&");</script>")
End If
Response.End()
End Function
Function CheckTitle(msg,num)
if msg="" then
exit function
end if
if not isNumeric(num) then
num=20
end if
msg=split(cstr(msg),"^")
if ubound(msg)>=1 then
if ubound(msg)=1 then
tempstr=left(msg(1),cint(num))
elseif ubound(msg)=2 then
tempstr=msg(1)&left(msg(2),cint(num))
end if
if Chkrequest(msg(0)) then
select case trim(cint(msg(0)))
case "1"
CheckTitle="<font color=#000000>"&tempstr&"</font>"
case "2"
CheckTitle="<font color=#FFFFFF>"&tempstr&"</font>"
case "3"
CheckTitle="<font color=#008000>"&tempstr&"</font>"
case "4"
CheckTitle="<font color=#800000>"&tempstr&"</font>"
case "5"
CheckTitle="<font color=#808000>"&tempstr&"</font>"
case "6"
CheckTitle="<font color=#000080>"&tempstr&"</font>"
case "7"
CheckTitle="<font color=#800080>"&tempstr&"</font>"
case "8"
CheckTitle="<font color=#808080>"&tempstr&"</font>"
case "9"
CheckTitle="<font color=#FFFF00>"&tempstr&"</font>"
case "10"
CheckTitle="<font color=#00FF00>"&tempstr&"</font>"
case "11"
CheckTitle="<font color=#00FFFF>"&tempstr&"</font>"
case "12"
CheckTitle="<font color=#FF00FF>"&tempstr&"</font>"
case "13"
CheckTitle="<font color=#FF0000>"&tempstr&"</font>"
case "14"
CheckTitle="<font color=#0000FF>"&tempstr&"</font>"
case "15"
CheckTitle="<font color=#008080>"&tempstr&"</font>"
case else
CheckTitle=tempstr
end select
else
CheckTitle=msg(0)&tempstr
end if
else
CheckTitle=left(msg(0),num)
end if
End Function
Function CheckTitle2(msg,num)
if msg="" then
exit function
end if
if not isNumeric(num) then
num=20
end if
msg=split(msg,"^")
if ubound(msg)=0 then
CheckTitle2=left(msg(0),num)
else
CheckTitle2=left(msg(1),num)
end if
End Function
Sub Title(color)
color=cint(color)
response.Write "<select name=TitleFontColor id=TitleFontColor>"
response.Write "<option value=''>颜色</option>"
response.Write "<option value=''>默认</option>"
response.Write "<option value='1' style='background-color:#000000'"
if color=1 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='2' style='background-color:#FFFFFF'"
if color=2 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='3' style='background-color:#008000'"
if color=3 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='4' style='background-color:#800000'"
if color=4 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='5' style='background-color:#808000'"
if color=5 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='6' style='background-color:#000080'"
if color=6 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='7' style='background-color:#800080'"
if color=7 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='8' style='background-color:#808080'"
if color=8 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='9' style='background-color:#FFFF00'"
if color=9 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='10' style='background-color:#00FF00'"
if color=10 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='11' style='background-color:#00FFFF'"
if color=11 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='12' style='background-color:#FF00FF'"
if color=12 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='13' style='background-color:#FF0000'"
if color=13 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='14' style='background-color:#0000FF'"
if color=14 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "<option value='15' style='background-color:#008080'"
if color=15 then
response.Write " selected >"
end if
response.Write "</option>"
response.Write "</select>"
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -