📄 dbokxp.asp
字号:
<% @language=VBScript %>
<%
option explicit
dim cnn,strcnn
set cnn=server.createobject("ADODB.Connection")
strcnn="Provider = Microsoft.Jet.OLEDB.4.0; Data Source = "&Server.Mappath("xjdb.mdb")
cnn.open strcnn
dim hxrcount,hxr,fhxrcount,fhxr
dim Filehxrps,Filefhxrps,hxrpscount,fhxrpscount
set hxrcount = cnn.execute("select count(*) from hxr")
set hxr = cnn.execute("select * from hxr")
set fhxrcount = cnn.execute("select count(*) from fhxr")
set fhxr = cnn.execute("select * from fhxr")
dim hxrnum,fhxrnum
dim hxrname,hxrps,fhxrname,fhxrps
dim revxzs
revxzs=request.querystring("xzs")
cnn.execute "update xqs set xqrs='"&revxzs&"' where id='xqkey'"
hxrnum=hxrcount(0)
fhxrnum=fhxrcount(0)
dim xhi,xhj
dim totalxzs
totalxzs=0
dim strfield,strvalue
dim Fnum
dim tmpid,tmpname
set Fnum=cnn.execute("select serial from serialnumber where idkey='numkey'")
strfield="序号,类型"
strvalue=""
for xhi=1 to hxrnum
tmpid=request.querystring("hxr"+cstr(xhi)+"id")
tmpname=request.querystring("hxr"+cstr(xhi)+"name")
if Cint(tmpid)=1 then
totalxzs=totalxzs+1
end if
strfield=strfield+","+tmpname
strvalue=strvalue+","+"'"+tmpid+"'"
next
for xhj=1 to fhxrnum
tmpid=request.querystring("fhxr"+cstr(xhj)+"id")
tmpname=request.querystring("fhxr"+cstr(xhj)+"name")
if Cint(tmpid)=1 then
totalxzs=totalxzs+1
end if
strfield=strfield+","+tmpname
strvalue=strvalue+","+"'"+tmpid+"'"
next
if (totalxzs>0)and(totalxzs<=Cint(revxzs)) then
for xhi=1 to hxrnum
hxrname=trim(request.querystring("hxr"+cstr(xhi)+"name"))
hxrps =trim(request.querystring("hxr"+cstr(xhi)+"id"))
set hxrpscount=cnn.execute("select count(*) from hxrps where hxr_name='"&trim(hxrname)&"'")
if hxrpscount(0)>0 then
set Filehxrps=cnn.execute("select hxr_ps from hxrps where hxr_name='"&trim(hxrname)&"'")
dim revsumps
revsumps=Cstr(Cint(Filehxrps(0))+hxrps)
cnn.execute "update hxrps set hxr_ps='"&revsumps&"'"&" where hxr_name='"&trim(hxrname)&"'"
response.write "<script language='javascript'>"
response.write vbLf
response.write "window.opener.document.formhk.ps"&xhi&".value=""个人["&revsumps&"]票"";"
response.write vbLf
response.write vbLf
response.write "</script>"
response.write vbLf
set Filehxrps=nothing
else
cnn.execute "insert into hxrps (hxr_name,hxr_ps) values('"&trim(hxrname)&"','"&hxrps&"')"
end if
set hxrpscount=nothing
next
for xhj=1 to fhxrnum
fhxrname=trim(request.querystring("fhxr"+cstr(xhj)+"name"))
fhxrps =trim(request.querystring("fhxr"+cstr(xhj)+"id"))
set fhxrpscount=cnn.execute("select count(*) from fhxrps where fhxr_name='"&trim(fhxrname)&"'")
if fhxrpscount(0)>0 then
dim revfsumps
set Filefhxrps=cnn.execute("select fhxr_ps from fhxrps where fhxr_name='"&trim(fhxrname)&"'")
revfsumps=Cstr(Cint(Filefhxrps(0))+fhxrps)
cnn.execute "update fhxrps set fhxr_ps='"&revfsumps&"'"&" where fhxr_name='"&trim(fhxrname)&"'"
response.write "<script language='javascript'>"
response.write vbLf
response.write "window.opener.document.formhk.fps"&xhj&".value=""个人["&revfsumps&"]票"";"
response.write vbLf
response.write vbLf
response.write "</script>"
response.write vbLf
set Filefhxrps=nothing
else
cnn.execute "insert into fhxrps (fhxr_name,fhxr_ps) values('"&trim(fhxrname)&"','"&fhxrps&"')"
end if
set fhxrpscount=nothing
next
dim Filetj
set Filetj=cnn.execute("select totalnum,usenum from tongji")
dim revtotalnum,revuse
revtotalnum=Filetj(0)+1
revuse=Filetj(1)+1
cnn.execute "update tongji set totalnum='"&revtotalnum&"' where id='tongji'"
cnn.execute "update tongji set usenum='"&revuse&"' where id='tongji'"
response.write "<script language='javascript'>"
response.write vbLf
response.write "window.opener.document.formhk.totalnum.value="""&revtotalnum&""";"
response.write vbLf
response.write "window.opener.document.formhk.use.value="""&revuse&""";"
response.write vbLf
response.write "</script>"
response.write vbLf
set Filetj=nothing
strvalue="'"&Fnum(0)&"','有效'" +strvalue
cnn.execute "insert into changpiao ("&strfield&") values("&strvalue&")"
cnn.execute "update serialnumber set serial="&(Cint(Fnum(0))+1)&" where idkey='numkey'"
set Fnum=nothing
else
if totalxzs>Cint(revxzs) then
dim Filetj1
set Filetj1=cnn.execute("select totalnum,nousenum from tongji")
dim revtotalone,revnouse
revtotalone=Filetj1(0)+1
revnouse=Filetj1(1)+1
cnn.execute "update tongji set totalnum='"&revtotalone&"' where id='tongji'"
cnn.execute "update tongji set nousenum='"&revnouse&"' where id='tongji'"
response.write "<script language='javascript'>"
response.write vbLf
response.write "window.opener.document.formhk.totalnum.value="""&revtotalone&""""
response.write vbLf
response.write "window.opener.document.formhk.nouse.value="""&revnouse&""""
response.write vbLf
response.write "</script>"
response.write vbLf
set Filetj1=nothing
response.write "<html><head><title></title><body>"
response.write vbLf
response.write "<script language="""&"VBScript"&""""&">"
response.write vbLf
response.write "alert("""&"所选人数超过限选人数,已经增加一张无效票"&""")"
response.write vbLf
response.write "</script></body></html>"
strvalue="'"&Fnum(0)&"','无效'" +strvalue
cnn.execute "insert into changpiao ("&strfield&") values("&strvalue&")"
cnn.execute "update serialnumber set serial="&(Cint(Fnum(0))+1)&" where idkey='numkey'"
set Fnum=nothing
end if
end if
response.write "<script language='javascript'>"
response.write vbLf
response.write vbLf
response.write "window.opener=null;"
response.write vbLf
response.write "window.close();"
response.write vbLf
response.write "</script>"
cnn.close
set hxrcount=nothing
set hxr=nothing
set fhxrcount=nothing
set fhxr=nothing
set cnn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -