<%
'-----------------------------------
'PS:open conn
'Call saic(0,"access")||Call saic(0,"access,pass")||Call saic(0,"ip,dataneme,userid,pass")||
'-----------------------------------
Sub saic(saicdbty,saicdbstr)
dim saidbarr
saidbarr=split(saicdbstr,",")
on error resume next
if saicdbty=1 then'MSSQL
Set conn=Server.CreateObject("ADODB.CONNECTION")
adoconn="Provider=Sqloledb;Data Source="&saidbarr(0)&";Initial Catalog="&saidbarr(1)&";User ID="&saidbarr(2)&";Password="&saidbarr(3)&";"
else'ACCESS
set conn=server.CreateObject("ADODB.CONNECTION")
if ubound(saidbarr)>0 then
adoconn="DBQ="+server.mappath(""&saidbarr(0)&"")+";PWD="+""&saidbarr(1)&""+";DefaultDir=;DRIVER={Microsoft Access Driver(*.mdb)};"
else
adoconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&saidbarr(0)&"")
'adoconn="DRIVER={Microsoft Access Driver(*.mdb)};DBQ="&Server.MapPath(""&saidbarr(0)&"")
'adoconn="Provider=Microsoft.ACE.OLEDB.12.0;Data Source="&Server.MapPath(""&saidbarr(0)&"")'for win10
end if
end if
'Response.Write adoconn
if err then
err.Clear
Set conn=Nothing
response.Write "Sorry!Err..."
Response.End
else
conn.open adoconn
end if
End Sub
'-----------------------------------
'PS:colse conn
'Call saio()
'-----------------------------------
Sub saio()
conn.Close
Set conn=Nothing
End Sub
'-----------------------------------
'PS:open rs
'Call saik(sairs,saisql,1,1)
'-----------------------------------
Sub saik(sairs,saisql,saic1,saic2)
dim saisqlw
saisqlw="<div class=sqlerr><b>"&g_sqln&"</b><i>"&timer&"</i><u>"&saisql&"</u></div>"
if g_errs=2 then
g_sqln=g_sqln+1
response.Write saisqlw
elseif g_errs=1 then
g_sqln=g_sqln+1:g_sqls=g_sqls&saisqlw&"<br>"
if g_sqln=1 then response.Cookies("gyssqltm")=timer
end if
set sairs=server.CreateObject("adodb.recordset")
sairs.open saisql,conn,saic1,saic2
End Sub
'-----------------------------------
'PS:close rs
'Call saig(sairs)
'-----------------------------------
Sub saig(sairs)
'on error resume next
sairs.close
set sairs=nothing
End Sub
'-----------------------------------
'PS:show err
'=sqlerr()
'-----------------------------------
Function sqlerr()
if g_errs=1 and request.Cookies("gyssqltm")<>"" then:sqlerr="<h1>Conn Times:"&g_sqln&" times,Consuming "&int(timer-request.Cookies("gyssqltm"))&" ms</h1>"&g_sqls
End Function
'=====================================================================conn end!
'-----------------------------------
'PS:check/LV conn str
'=gysg("gysstr")
'-----------------------------------
Function gysg(gysstr)
if ainull(gysstr) then
gysg=""
else
gysg=gysstr
gysg=Replace(gysg,g_gx,"*")
gysg=Replace(gysg,g_gy,"*")
gysg=trim(gysg)
end if
End Function
'-----------------------------------
'PS:make arr str
'=gyscarr(0,"gysstr")
'-----------------------------------
Function gyscarr(gysffty,gysstr)
if ainull(gysstr) then
gyscarr=""
else
gyscarr=gysstr
gyscarr=Replace(gyscarr,g_gx,"*")
gyscarr=Replace(gyscarr,g_gy,"*")
gyscarr=Replace(gyscarr,g_gr,"*")
if gysffty=0 then
gyscarr=Replace(gyscarr,VbCrlf,"")
gyscarr=Replace(gyscarr,CHR(10),"")
gyscarr=Replace(gyscarr,CHR(13),"")
gyscarr=trim(gyscarr)
else
gyscarr=Replace(gyscarr,VbCrlf,g_gr)
gyscarr=Replace(gyscarr,CHR(10),g_gr)
gyscarr=Replace(gyscarr,CHR(13),g_gr)
gyscarr=trim(gyscarr)
end if
end if
end Function
'-----------------------------------
'PS:make arr str ""-"
'=gyscarrr(0,"gysstr")
'-----------------------------------
Function gyscarrr(gysffty,gysstr)
if ainull(gysstr) and gysffty=0 then
gyscarrr=""
else
gyscarrr=gysstr
gyscarrr=gyscarr(gysffty,gysstr)
gyscarrr=Replace(gyscarrr,"""","""""")
gyscarrr=trim(gyscarrr)
end if
end Function
'-----------------------------------
'PS:content page
'=gysnr("gysstr","?pg=|*|&ty=1","") showmo||gysnr("gysstr","?pg=|*|&ty=1","0") showall||gysnr("gysstr","?pg=|*|&ty=1","1") showpage
'-----------------------------------
Function gysnr(gysstr,gyskpu,gyskpg)
gysnr=aihtml(gysstr)
gyspage=gyskpg
if gyskpg="0" or g_pgcx=0 or ainull(gyskpu) or ainull(gysnr) then
gysnr=replace(gysnr,g_pgcg,g_pgct)
else
Dim gysnrrr,gysnrj,gyskpurr
gyskpu=replace(gyskpu,g_urg&g_urz,g_urz)
if g_html=1 then gyskpu=replace(gyskpu,g_urg&g_urk&g_urz,g_urz)
gysnrrr=split(gysnr,g_pgcg)
gysnrj=ubound(gysnrrr)
if gysnrj=0 then
gysnr=gysnr
else
if ainull(gyskpg) then
gysnr=gysnrrr(0)
gyskpg=1
else
if int(gyskpg)>gysnrj+1 then
gysnr=gysnrrr(gysnrj)
gyskpg=gysnrj+1
else
gysnr=gysnrrr(int(gyskpg)-1)
gyskpg=int(gyskpg)
end if
end if
gyskpurr=split(gyskpu,g_gp)
gysnr=gysnr&"<p class=""gsnrpg"">"
gysnr=gysnr&"<a class=""y-d"" href="""&gyskpurr(0)&"0"&gyskpurr(1)&""" title=""Show all"">1-"&gysnrj+1&"</a> "
for gysii=1 to gysnrj+1
if gyskpg=gysii then
gysnr=gysnr&"<a class=""y-e"" href="""&gyskpurr(0)&gysii&gyskpurr(1)&""">"&gysii&"</a>"
else
gysnr=gysnr&"<a class=""y-d"" href="""&gyskpurr(0)&gysii&gyskpurr(1)&""">"&gysii&"</a>"
end if
next
gysnr=gysnr&"</p>"
end if
end if
End Function
'=====================================================================check str end!
'-----------------------------------
'PS:add/edit save from where(1=number/2=string/other=gyskt) form/request(1=add;2=edit;11=adds;22=edits)
'if gysfm("mc,cs,px,tm","ees_ss","ss_mc='"&request("mc")&"'","ss_",1) 1add||gysfm("mc,cs,px,tm","ees_ss","ss_id="&request("id")&"","ss_",2) 2edit||gysfm("mc,cs,px,tm","ees_ss",2,"ss_",11) 11adds||gysfm("id,cs,px,tm","ees_ss",1,"ss_",11) then
'response.Write "ok!"
'else
'response.Write "err!"
'end if
'-----------------------------------
Function gysfm(gyskl,gyskb,gyskt,gyskq,gysky)
if ainull(gyskl) or ainull(gyskb) then
gysfm=False
else
dim gysfmli
gysfmli=0
gysal=split(gyskl,",")
for gysii=0 to ubound(gysal)
if gysal(gysii)<>"" then
if gysfmli=0 then
gyskl=gysal(gysii)
else
gyskl=gyskl&","&gysal(gysii)
end if
gysfmli=gysfmli+1
end if
next
gysfmli=gysfmli-1
gysal=split(gyskl,",")
gyskl=gyskq&replace(gyskl,",",","&gyskq)
gysar=split(gyskl,",")
gysalinx=""
if gysky<10 then'one do
gyssql="select "&gyskl&" from "&gyskb&""
if gyskt<>"" then gyssql=gyssql&" where "&gyskt
'response.Write gyssql
Call saik(gysrs,gyssql,1,3)
if gysrs.eof and gysrs.bof then
if gysky=2 then'edit
gysfm=False
else'add
gysrs.addnew
for gysjj=0 to gysfmli
gysalinx=aireq(gysal(gysjj))
'response.Write gysalinx&"=["&gysjj&"]=("&gysal(gysjj)&")"&ubound(gysar)
'if i_xkzy>0 and aibj(right(gyskb,2),"ai") and aibj(right(gysal(gysjj),2),"ss") then'for EESai nr to ss
'if ainull(gysalinx) then
'gysrs(gysjj)=left(aitit(aireq("nr")),180)
'else
'gysrs(gysjj)=aitit(gysalinx)
'end if
'else
if aistr(gysalinx)<>"" or aibj(right(gysal(gysjj),2),"tj") then'pass manage input name
gysrs(gysjj)=gysalinx
end if
gysalinx=""
next
gysrs.update
gysfm=True
end if
else
if gysky=2 then'edit
if gysrs.recordcount=1 then
for gysjj=0 to gysfmli
gysalinx=aireq(gysal(gysjj))
'response.Write gysalinx&"="&gysrs(gysjj)&"<br><br>"
'response.Write gysal(gysjj)&"="&gysalinx&"<br>"
if ainull(gysalinx) and ainull(gysrs(gysjj)) then
'
elseif gysalinx=gysrs(gysjj) then
'
elseif aistr(gysalinx)<>"" or aibj(right(gysal(gysjj),2),"tj") then'pass manage input name
gysrs(gysjj)=gysalinx
elseif aibj(aireq(g_ckks&"kz"),"1")  then
gysrs(gysjj)=""
end if
gysalinx=""
next
gysrs.update
gysfm=True
else
gysfm=False
end if
else'add
gysfm=False
end if
end if
Call saig(gysrs)
else'some do
for gysjj=0 to gysfmli
if gysjj=0 then
gysalinx=aireq(gysal(gysjj))
else
gysalinx=gysalinx&g_gx&aireq(gysal(gysjj))
end if
next
gysax=split(gysalinx,g_gx)
dim gysaxx
gysaxx=split(gysax(0),", ")
for gysj=0 to ubound(gysaxx)
if ainull(gysaxx(gysj)) then
gysfm=False
else
gyssql="select "&gyskl&" from "&gyskb&""
if gyskt="1" then'number
gyssql=gyssql&" where "&gysar(0)&"="&gysaxx(gysj)&""
elseif gyskt="2" then'string
gyssql=gyssql&" where "&gysar(0)&"='"&gysaxx(gysj)&"'"
elseif gyskt<>"" and gyskt<>"0" then'where
gyssql=gyssql&" where "&gyskt
end if
Call saik(gysrs,gyssql,1,3)
if gysrs.eof and gysrs.bof then
if gysky=22 then'edit some
gysfm=False
else'add some
gysrs.addnew
for gysjj=0 to gysfmli
gysaliny=split(gysax(gysjj),", ")
if gysaliny(gysj)<>"" then gysrs(gysjj)=trim(gysaliny(gysj))
gysaliny=""
next
gysrs.update
gysfm=True
end if
else
if gysky=22 then'edit some
for gysjj=1 to gysfmli
if (gyskt<>"1" or gysjj>0) and not ainull(gysax(gysjj)) then
gysaliny=split(gysax(gysjj),", ")
'if not ainull(gysaliny(gysj)) then response.Write(gysjj&"==="&trim(gysaliny(gysj))&"<br />")
if not ainull(gysaliny(gysj)) then gysrs(gysjj)=trim(gysaliny(gysj))
gysaliny=""
end if
next
gysrs.update
gysfm=True
else'add some
gysfm=False
end if
end if
end if
next
Call saig(gysrs)
end if
end if
End Function
'-----------------------------------
'PS:insert value
'if gysin("ees_ss","ss_xy,ss_ty","1,'uu'","1=2") then
'response.Write "ok!"
'else
'response.Write "err!"
'end if
'-----------------------------------
Function gysin(gyskb,gyskl,gyskz,gyskt)
gyskb=gysg(gyskb):gyskl=gysg(gyskl):gyskz=gysg(gyskz):gyskt=gysg(gyskt)
if ainull(gyskb) or ainull(gyskl) or ainull(gyskz) then
gysin=False
else
dim gysinck
if ainull(gyskt) then
gysinck=1
else
if gyscc(gyskl,gyskb,gyskt) then
gysinck=0
else
gysinck=1
end if
end if
if gysinck=1 then
gyssql="INSERT INTO "&gyskb&" ("&gyskl&") VALUES ("&gyskz&")"
'response.Write gyssql&"<br /><br />"
if g_errs=1 then:g_sqln=g_sqln+1:g_sqls=g_sqls&g_sqln&", "&gyssql&"<br>"
conn.execute(gyssql)
gysin=True
else
gysin=False
end if
end if
End Function
'-----------------------------------
'PS:update some value
'if gysgx("ees_ss","ss_xy=2","ss_xy=0"/"ss_id in (12,10,1,3,5)"/"ss_mc in ('as','ees','sai')") then
'response.Write "ok!"
'else
'response.Write "err!"
'end if
'-----------------------------------
Function gysgx(gyskb,gysks,gyskt)
gyskb=gysg(gyskb):gysks=gysg(gysks):gyskt=gysg(gyskt)
if ainull(gyskb) or ainull(gysks) then
gysgx=False
else
gyssql="update "&gyskb&" set "&gysks&""
if not ainull(gyskt) then gyssql=gyssql&" where "&gyskt&""
'response.Write gyssql
if g_errs=1 then:g_sqln=g_sqln+1:g_sqls=g_sqls&g_sqln&", "&gyssql&"<br>"
conn.execute(gyssql)
gysgx=True
'if gyscc("*",gyskb,gyskt) then
'else
'gysgx=false
'end if
end if
End Function
'-----------------------------------
'PS:replace some value
'=gysth("ss_mc","ees_ss","ss_xy=2","guoyansai","shipe.cn")
'-----------------------------------
Function gysth(gyskl,gyskb,gyskt,gyshx,gyshy)
gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt):gyshx=gysg(gyshx):gyshy=gysg(gyshy)
gysth=0
if not ainull(gyskl) and not ainull(gyskb) and not ainull(gyshx) then
gyssql="select "&gyskl&" from "&gyskb&" where "&gyskl&" like '%"&gyshx&"%'"
if not ainull(gyskt) then gyssql=gyssql&" and "&gyskt&""
Call saik(gysrs,gyssql,1,3)
Do While Not gysrs.eof
gysth=gysth+1
gysrs(gyskl)=replace(gysrs(gyskl),gyshx,gyshy)
gysrs.update
gysrs.movenext
loop
Call saig(gysrs)
end if
End Function
'-----------------------------------
'PS:auto save tag/search *1 use to add+1
'=gysat("ss_mc,ss_hi","ees_ss","ss_xy=2","guoyansai&g_gx&shipe.cn")
'=gysat("ss_hi","ees_ss","ss_id=20","0=+num|-num")1=true
'-----------------------------------
Function gysat(gyskl,gyskb,gyskt,gyshx)
gysat=False
gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt):gyshx=gysg(gyshx)
if not ainull(gyskl) and not ainull(gyskb) and not ainull(gyshx) then
gyssql="select "&gyskl&" from "&gyskb
if not ainull(gyskt) then gyssql=gyssql&" where "&gyskt&""
if len(gyshx)<5 and len(gyshx)>1 and (left(gyshx,1)="+" or left(gyshx,1)="-") then
Call saik(gysrs,gyssql,1,3)
if gysrs.eof and gysrs.bof then
else
dim grsdgl
Do While Not gysrs.eof
grsdgl=gysrs(gyskl)
if not IsNumeric(grsdgl) then grsdgl=0
if left(gyshx,1)="+" then
grsdgl=grsdgl+int(right(gyshx,len(gyshx)-1))
else
grsdgl=grsdgl-int(right(gyshx,len(gyshx)-1))
end if
if grsdgl<0 then grsdgl=0
gysrs(gyskl)=grsdgl
gysat=true
gysrs.update
gysrs.movenext
loop
end if
Call saig(gysrs)
else
Call saik(gysrs,gyssql,1,3)
if gysrs.eof and gysrs.bof then
gysrs.addnew
gysax=split(gyshx,g_gg)
for gysi=0 to ubound(gysax)
'response.Write "<br />"&gysi&"="&gysax(gysi)&"<br />"
gysrs(gysi)=gysax(gysi)
next
gysat=true
else
'LIE add+1
gysrs(0)=gysrs(0)+1
gysat=true
end if
gysrs.update
Call saig(gysrs)
end if
end if
End Function
'-----------------------------------
'PS:del/clear
'if gysdel("ss_id","ees_ss","ss_id in (3,12,11)"/"ss_xy=3"/0=del all) then
'response.Write "ok!"
'else
'response.Write "err!"
'end if
'-----------------------------------
Function gysdel(gyskl,gyskb,gyskt)
gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt)
gysdel=False
if ainull(gyskb) or ainull(gyskt) then
gysdel=False
else
if gyskt="0" then'clear
gyssql="delete from "&gyskb&""
'response.Write gyssql
if g_errs=1 then:g_sqln=g_sqln+1:g_sqls=g_sqls&g_sqln&", "&gyssql&"<br>"
conn.execute(gyssql)
'if show('80004005') err,hidden the alter line
'conn.execute("alter table "&gyskb&" alter "&gyskl&" counter(1,1)")
gysdel=True
else'del some
gyssql="delete from "&gyskb&" where "&gyskt&""
if g_errs=1 then:g_sqln=g_sqln+1:g_sqls=g_sqls&g_sqln&", "&gyssql&"<br>"
conn.execute(gyssql)
gysdel=True
end if
end if
End Function
'-----------------------------------
'PS:read
'if gysread("ss_mc,ss_ct,ss_px,ss_tm","ees_ss","ss_id=1","ss1") then
'response.Write("save in gyskl,read gyskl is ok.<br />")
'else
'response.Write "none"
'end if
'-----------------------------------
Function gysread(gyskl,gyskb,gyskt,gysko)
dim gysdml,gysdms
gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt)
if ainull(gyskl) or ainull(gyskb) or ainull(gyskt) then
gysread=False
else
gysal=split(gyskl,",")
if ankck(gysko) then
gysread=False
gyssql="select "&gyskl&" from "&gyskb&" where "&gyskt&""
'response.Write gyssql
Call saik(gysrs,gyssql,1,1)
if gysrs.eof and gysrs.bof then
gysread=False
else
for gysjj=0 to ubound(gysal)
gysdml=gysal(gysjj)
if instr(g_gn,","&right(gysdml,2)&",")>0 then
gysdms=gysrs(gysjj)
gysalinx=gysalinx&gysdms&g_gx
gysdms=gyscarrr(1,gysdms)
Execute(gysdml&"=cstr("""&gysdms&""")")
else
gysdms=gysrs(gysjj)
gysalinx=gysalinx&gysdms&g_gx
gysdms=gyscarrr(0,gysdms)
Execute(gysdml&"=cstr("""&gysdms&""")")
end if
next
Call ankop(2,0,ansav(gysalinx),gysko)
gysalinx=""
gysread=True
end if
Call saig(gysrs)
else
gysax=split(anreq(ankop(1,0,0,gysko)),g_gx)
dim gysaud
if ubound(gysal)>ubound(gysax) then
gysaud=ubound(gysax)
else
gysaud=ubound(gysal)
end if
for gysjj=0 to gysaud
gysdml=gysal(gysjj)
if instr(g_gn,","&right(gysdml,2)&",")>0 then
gysdms=gyscarrr(1,gysax(gysjj))
if not ainull(gysdms) then Execute(gysdml&"=cstr("""&gysdms&""")")
else
gysdms=gyscarrr(0,gysax(gysjj))
if not ainull(gysdms) then Execute(gysdml&"=cstr("""&gysdms&""")")
end if
next
gysread=True
end if
end if
End Function
'-----------------------------------
'PS:read one
'=gysro("ss_mc","ees_ss","ss_id=1","ro1")
'-----------------------------------
Function gysro(gyskl,gyskb,gyskt,gysko)
gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt)
if ainull(gyskl) or ainull(gyskb) or ainull(gyskt) then
gysro=""
else
if ankck(gysko) then
gyssql="select "&gyskl&" from "&gyskb&" where "&gyskt&""
Call saik(gysrs,gyssql,1,1)
if gysrs.eof and gysrs.bof then
gysro=""
else
gysro=gysrs(0)
Call ankop(2,0,ansav(gysro),gysko)
end if
Call saig(gysrs)
else
gysro=anreq(ankop(1,0,0,gysko))
end if
end if
End Function
'-----------------------------------
'PS:check value
'=gyscc("ss_mc","ees_ss","ss_id=1")
'-----------------------------------
Function gyscc(gyskl,gyskb,gyskt)
gyscc=false
gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt)
if ainull(gyskl) or ainull(gyskb) or ainull(gyskt) then
gyscc=false
else
gyssql="select "&gyskl&" from "&gyskb&" where "&gyskt&""
Call saik(gysrs,gyssql,1,1)
if gysrs.eof and gysrs.bof then
gyscc=false
else
gyscc=true
end if
Call saig(gysrs)
end if
End Function
'-----------------------------------
'PS:where not in ...
'=gysnot(12,10,1,3,5/'as','ees','sai')
'-----------------------------------
Function gysnot(gysty,gysstr)
if ainull(gysty) or ainull(gysstr) then
gysnot=""
else
gysstr=replace(gysstr,",,",",")
if left(gysstr,1)="," then gysstr=right(gysstr,len(gysstr)-1)
if right(gysstr,1)="," then gysstr=left(gysstr,len(gysstr)-1)
dim gysntrr,gysntii,gysntnt,gysntss,gysntsx'replace same chr 0
gysntrr=split(gysstr,",")
gysntnt=ubound(gysntrr)
gysntsx=""
for gysntii=0 to gysntnt
gysntss=replace(gysstr,gysntrr(gysntii),"")
if gysntss<>gysstr then
gysstr=replace(gysstr,gysntrr(gysntii),"")
gysntsx=gysntsx&","&gysntrr(gysntii)
end if
next
gysstr=gysntsx
if left(gysstr,1)="," then gysstr=right(gysstr,len(gysstr)-1)'replace same chr 1
gysnot=""&gysty&" not in("&gysstr&")"
end if
End Function
'-----------------------------------
'PS:select top ***
'if gystop(10,"ai_id","ss_mc,ss_ct,ss_px,ss_tm","ees_ss","ss_xy=0","ss_id desc","tp1") then
'response.Write("save in gysax,user loop read<br />")
'gysax=split(gysar,g_gx)
'for gysi=0 to ubound(gysax)
'gysay=split(gysax(gysi),g_gy)
'for gysj=0 to ubound(gysay)
'response.Write "<br />["&gysj&"]"&gysay(gysj)&"<br />"
'next
'response.Write "<br />-------------------------------------------["&gysi&"]<br />"
'next
'else
'response.Write "none"
'end if
'-----------------------------------
Function gystop(gyskn,gyskid,gyskl,gyskb,gyskt,gyskp,gysko)
gyskn=aiint(gyskn):gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt):gyskp=gysg(gyskp)
gysar=""
if ainull(gyskl) or ainull(gyskb) then
gystop=False
else
if ankck(gysko) then
gystop=False
if g_pgly>10000 and right(gyskb,4)="list" then
dim gysqwr,gysqwi,gysqws,gysqwk
gysqwr=split(gyskl,",")
if gyskid="" then
gysqwk=gysqwr(0)
else
gysqwk=gyskid
end if
for gysqwi=0 to ubound(gysqwr)
if gysqwi=0 then
gysqws="b."&gysqwr(0)
else
gysqws=gysqws&",b."&gysqwr(gysqwi)
end if
next
gyssql="select "&gysqws&" from (select"
if gyskn>0 then gyssql=gyssql&" top "&gyskn&""
gyssql=gyssql&" a."&gysqwk&" from ("
gyssql=gyssql&"select top "&g_pgly&" "&gysqwk&" from "&gyskb&""
if not ainull(gyskt) then gyssql=gyssql&" where "&gyskt&""
if not ainull(gyskp) then gyssql=gyssql&" order by "&gyskp&""
gyssql=gyssql&") a "
gyssql=gyssql&") c inner join "&gyskb&" b on c."&gysqwk&"=b."&gysqwk&""
if not ainull(gyskp) then gyssql=gyssql&" order by "&replace(gyskp,gysqwk,"b."&gysqwk)&""
else
gyssql="select"
if gyskn>0 then gyssql=gyssql&" top "&gyskn&""
gyssql=gyssql&" "&gyskl&" from "&gyskb&""
if not ainull(gyskt) then gyssql=gyssql&" where "&gyskt&""
if not ainull(gyskp) then gyssql=gyssql&" order by "&gyskp&""
end if
'response.Write gyssql&"<br />"
Call saik(gysrs,gyssql,1,1)
if gysrs.eof and gysrs.bof then
gystop=False
else
gysii=0
Do While Not gysrs.eof
if gysii>0 then
gysar=gysar&g_gx
end if
gysii=gysii+1
gysal=split(gyskl,",")
for gysjj=0 to ubound(gysal)
if gysjj=0 then
if gysal(gysjj)="ed_nr" or gysal(gysjj)="bb_nr" then'X-NoHTML
gysar=gysar&gyscarr(0,gysrs(gysjj))
else'X-NoHTML
gysar=gysar&gyscarr(0,aititlen(gysrs(gysjj),g_lcn))
end if'X-NoHTML
else
if gysal(gysjj)="ed_nr" or gysal(gysjj)="bb_nr" then'X-NoHTML
gysar=gysar&g_gy&gyscarr(0,gysrs(gysjj))
else'X-NoHTML
gysar=gysar&g_gy&gyscarr(0,aititlen(gysrs(gysjj),g_lcn))
end if'X-NoHTML
end if
next
if gyskn>0 and gysii>gyskn then exit Do
gysrs.movenext
loop
gystop=True
end if
gysar=ansav(gysar)
Call saig(gysrs)
Call ankop(2,0,ansav(gysar),gysko)
else
gysar=anreq(ankop(1,0,0,gysko))
gystop=True
end if
end if
if ainull(gysar) then gystop=False
End Function
'-----------------------------------
'PS:list and page ***
'if gyslist("ss_id","ss_mc,ss_ct,ss_px,ss_tm","ees_ss","ss_xy>0","ss_id desc","?ps=|*|&pg=|*|&ty=1","","",200,"tp1") then
'response.Write("save in gysax,user loop read<br />")
'gysax=split(gysar,g_gx)
'for gysi=0 to ubound(gysax)
'gysay=split(gysax(gysi),g_gy)
'for gysj=0 to ubound(gysay)
'response.Write "<br />["&gysj&"]"&gysay(gysj)&"<br />"
'next
'response.Write "<br />-------------------------------------------["&gysi&"]<br />"
'next
'response.Write gyspage
'else
'response.Write "none"
'end if

'#CSS
'.y-a{padding:8px 12px;}
'.y-b{color:#0077DD;}
'.y-c{width:28px;text-align:center;vertical-align:middle;margin:2px;border-top:0px;border-left:0px;border-right:0px;border:#0077DD 1px solid;color:#0077DD;}
'a.y-d,a.y-d:link,a.y-d:active,a.y-d:visited{margin:2px;padding-top:1px;padding-bottom:1px;padding-left:5px;padding-right:5px;text-decoration:none;border:#0099FF 1px solid;background-color:#FFFFFE;color:#0099FF;}
'a.y-d:hover{border:#0077DD 1px solid;background-color:#0077DD;color:#FFFFFE;}
'a.y-e,a.y-e:link,a.y-e:active,a.y-e:visited{margin:2px;padding-top:1px;padding-bottom:1px;padding-left:5px;padding-right:5px;text-decoration:none;border:#0099FF 1px solid;background-color:#0099FF;color:#FFFFFE;}
'a.y-e:hover{border:#0077DD 1px solid;background-color:#0077DD;color:#FFFFFE;}
'-----------------------------------
Function gyslist(gyskid,gyskl,gyskb,gyskt,gyskp,gyskpu,gyskpg,gyskps,gyskm,gysko)
dim gyskprecord,gyskoprc
gyskl=gysg(gyskl):gyskb=gysg(gyskb):gyskt=gysg(gyskt):gyskp=gysg(gyskp)
if ainull(gyskl) or ainull(gyskb) then
gyslist=False
else
if not isnumeric(gyskps) or gyskps="0" then:gyskps=g_pgls:else:gyskps=int(gyskps):end if'get pagesize
if not isnumeric(gyskpg) or gyskpg="0" then:gyskpg=1:else:gyskpg=int(gyskpg):end if'get page
if not ainull(gysko) then
gyskoprc=gysko&"precd"
else
gyskoprc=""
end if
if not ainull(gysko) then gysko=gysko&"ps-"&gyskps&"-pg-"&gyskpg'save to gysar
if ankck(gysko) or ankck(gyskoprc) then
if g_pgly>10000 and instr(gyskb,"_ai")>0 and saidbty=1 then'>100000
gyskprecord=gyslistsql(gyskid,gyskl,gyskb,gyskt,gyskp,gyskpg,gyskps,gyskm,gyskoprc)
else'<10000
gyskprecord=gyslistmdb(gyskid,gyskl,gyskb,gyskt,gyskp,gyskpg,gyskps,gyskm,gyskoprc)
end if
if gyskprecord="0" or gyskprecord="" then gyslist=false:exit function
gysar=replace(ansav(gysar),g_pgcg,g_pgct)
Call ankop(2,0,ansav(gysar),gysko)
gyslist=True
else
gysar=anreq(ankop(1,0,0,gysko))
gyskprecord=anreq(ankop(1,0,0,gyskoprc))
gyslist=True
end if
gyspage=gyspageshow(gyskpu,gyskpg,gyskps,gyskprecord)
end if
if ainull(gysar) then gyslist=False
End Function
'get arr from access
Function gyslistmdb(gyskid,gyskl,gyskb,gyskt,gyskp,gyskpg,gyskps,gyskm,gyskoc)
gyslistmdb=anreq(ankop(1,0,0,gyskoc))
dim gysrscontent,gysrscontentc,gysrscontentn
gyssql="select "&gyskl&" from "&gyskb&""
if not ainull(gyskt) then gyssql=gyssql&" where "&gyskt&""
if not ainull(gyskp) then gyssql=gyssql&" order by "&gyskp&""
'response.Write gyssql&"<br />"
Call saik(gysrs,gyssql,1,1)
gysar=""
if gysrs.eof and gysrs.bof then
gysar=""
gyslistmdb=0
exit function
else
gysrs.pagesize=gyskps
if ankck(gyskoc) then
gyslistmdb=gysrs.recordcount
Call ankop(2,0,ansav(gyslistmdb),gyskoc)
end if
if gyskpg>gyslistmdb then gyskpg=gyslistmdb
gysrs.AbsolutePage=gyskpg'page now
for gysii=1 to gyskps
if not gysrs.eof then
if gysii>1 then gysar=gysar&g_gx
gysal=split(gyskl,",")
for gysjj=0 to ubound(gysal)
if aiint(gyskm)=0 then
gysrscontent=gysrs(gysjj)
gysrscontentc=gyscarr(0,gysrscontent)
else
gysrscontent=gyscarr(0,gysrs(gysjj))
gysrscontentc=gysrscontent
end if
gysrscontentc=aititp(gysrscontentc)
gysrscontentn=len(gysrscontentc)
if aiint(gyskm)>0 and gysrscontentn>aiint(gyskm) then
gysrscontentc=left(gysrscontentc,aiint(gyskm))&".."
elseif gysrscontentn>200 then
gysrscontentc=gysrscontentc
else
gysrscontentc=gysrscontent
end if
if gysjj=0 then
gysar=gysar&gysrscontentc
else
gysar=gysar&g_gy&gysrscontentc
end if
next
gysrs.movenext
else
exit for
end if
next
end if
Call saig(gysrs)
End Function
'get arr from mssql
Function gyslistsql(gyskid,gyskl,gyskb,gyskt,gyskp,gyskpg,gyskps,gyskm,gyskoc)
gyslistsql=anreq(ankop(1,0,0,gyskoc))
dim gysrscontent,gysrscontentc,gysrscontentn
dim gyslscmd
Set gyslscmd=server.CreateObject("Adodb.Command")
gyslscmd.ActiveConnection=conn
gyslscmd.CommandText="EESAI_Page"
gyslscmd.CommandType=4
gyslscmd.prepared=true
gyslscmd.Parameters.Item("@Qbiao").Value=gyskb
gyslscmd.Parameters.Item("@Qid").Value=gyskid
gyslscmd.Parameters.Item("@Qlie").Value=gyskl
gyslscmd.Parameters.Item("@Qwhere").Value=gyskt
gyslscmd.Parameters.Item("@Qpx").Value=gyskp
gyslscmd.Parameters.Item("@Qpage").Value=gyskpg
gyslscmd.Parameters.Item("@Qpagesize").Value=gyskps
if ankck(gyskoc) then
gyslscmd.Parameters.Item("@Qrows").Value=0
else
gyslscmd.Parameters.Item("@Qrows").Value=1
end if
set gysrs=gyslscmd.execute
gysii=0
gysar=""
while not gysrs.eof
gysii=gysii+1
if gysii>1 then gysar=gysar&g_gx
gysal=split(gyskl,",")
for gysjj=0 to ubound(gysal)
gysrscontent=gyscarr(0,gysrs(gysjj))
gysrscontentc=gysrscontent
gysrscontentc=aititp(gysrscontentc)
gysrscontentn=len(gysrscontentc)
if aiint(gyskm)>0 and gysrscontentn>aiint(gyskm) then
gysrscontentc=left(gysrscontentc,aiint(gyskm))&".."
elseif gysrscontentn>200 then
gysrscontentc=gysrscontentc
else
gysrscontentc=gysrscontent
end if
if gysjj=0 then
gysar=gysar&gysrscontentc
else
gysar=gysar&g_gy&gysrscontentc
end if
next
gysrs.movenext
wend
gysrs.close
set gysrs=nothing
if ankck(gyskoc) then
gyslistsql=gyslscmd.Parameters("@Qrows").Value
Call ankop(2,0,ansav(gyslistsql),gyskoc)
end if
set gyslscmd=nothing
End Function
'gyspageshow("?ty=1&page="&g_gp&"&psize="&g_gp,11/PAGE,20/PAGESIZE,220/RECORDCOUNT)
function gyspageshow(gyskpu,gyskpg,gyskps,gyskrc)
gyspageshow=""
if gyskrc>gyskps then
dim gyskpurr,gyslpa,gyslpb,gyslpc,gyslpq
if gyskrc="" or gyskrc="0" then
gyslpq=1
else
if gyskrc mod gyskps=0 then
gyslpq=int(gyskrc/gyskps)
else
gyslpq=int(gyskrc/gyskps)+1
end if
end if
gyskpurr=split(gyskpu,g_gp)
if gyslpq>1 then'>1
gyspageshow=gyspageshow&""
if gyslpq>g_pgln and gyskpg>int(g_pgln/2)+1 then'a
gyspageshow=gyspageshow&"<a class=""y-d"" href="""&gyskpurr(0)&"1"&gyskpurr(1)&gyskps&gyskpurr(2)&""">1</a><a class=""y-d"" href="""&gyskpurr(0)&gyskpg-1&gyskpurr(1)&gyskps&gyskpurr(2)&""">&#8249;&#8249;</a>"
end if'a
if gyslpq<g_pgln+1 then'b
gyslpa=1:gyslpb=gyslpq
elseif gyslpq>g_pgln and gyskpg<int(g_pgln/2)+2 then'b++
gyslpa=1:gyslpb=g_pgln-2
elseif gyslpq>g_pgln and gyslpq-gyskpg>int(g_pgln/2) then'++b++
gyslpa=gyskpg-int(g_pgln/2)+2:gyslpb=gyskpg+int(g_pgln/2)-2
elseif gyslpq>g_pgln and gyslpq-gyskpg<int(g_pgln/2)+1 then'++b
gyslpa=gyslpq-g_pgln+3:gyslpb=gyslpq
end if'b
for gyslpc=gyslpa to gyslpb
if gyslpc=gyskpg then
gyspageshow=gyspageshow&"<a class=""y-e"" href="""&gyskpurr(0)&gyslpc&gyskpurr(1)&gyskps&gyskpurr(2)&""">"&gyslpc&"</a>"
else
gyspageshow=gyspageshow&"<a class=""y-d"" href="""&gyskpurr(0)&gyslpc&gyskpurr(1)&gyskps&gyskpurr(2)&""">"&gyslpc&"</a>"
end if
next
if gyslpq>g_pgln and gyslpq-gyskpg>int(g_pgln/2) then'c
gyspageshow=gyspageshow&"<a class=""y-d"" href="""&gyskpurr(0)&gyskpg+1&gyskpurr(1)&gyskps&gyskpurr(2)&""">&#8250;&#8250;</a><a class=""y-d"" href="""&gyskpurr(0)&gyslpq&gyskpurr(1)&gyskps&gyskpurr(2)&""">"&gyslpq&"</a>"
end if'c
if g_pglt=1 and gyslpq>g_pgln then'show fly
gyspageshow=gyspageshow&"<span class=""y-b"">Pagesize=<input class=""y-c"" name=""psi"" id=""psi"" title=""Prompt:Input number, press enter."&vbcrlf&gyskps&" Line/Page, total "&gyskrc&" Line."" value="""&gyskps&""" onKeyDown=""if(event.keyCode==13) {window.location='"&gyskpurr(0)&"1"&gyskpurr(1)&"'+psi.value+'"&gyskpurr(2)&"'; return false;}""> Page=<input class=""y-c"" name=""pat"" id=""pat"" title=""Prompt:Input number, press enter."&vbcrlf&"Page "&gyskpg&" / "&gyslpq&" ."" value="""&gyskpg&""" onKeyDown=""if(event.keyCode==13) {window.location='"&gyskpurr(0)&"'+pat.value+'"&gyskpurr(1)&gyskps&gyskpurr(2)&"'; return false;}""></span>"
end if
gyspageshow=replace(gyspageshow,g_urg&g_pgls&g_urz,g_urz)
if g_html=1 then gyspageshow=replace(gyspageshow,g_urg&g_pgls&g_urg&g_urk&g_urg&g_urk&g_urg&g_urk&g_urg&g_urk&g_urg&g_urk&g_urz,g_urz)
End if'>1
end if
end function
%>