<%
'-----------------------------------
'Data Table
'=ealie()
'-----------------------------------
Function ealie(eafty)
if eafty="form" then
ealie="ew,el,ep,ef,us,um,ee,eq,sn,bt,jj,ss,nr,tm,xy,px,hi,xi,bd,bc,jg,jy,oz,oy,t1,t2,mm,up,uf,ot,pl,yy,xt"
'@@0ai_id,1ai_sn,2ai_bt,3ai_tm,4ai_hi,5ai_xi,6ai_us,7ai_up,8ai_ss,9ai_xy,10ai_ef,11ai_ep,12ai_um,13ai_el,14ai_px,15ai_jg,16ai_jy,17ai_t1,18ai_t2,19ai_oy,20ai_oz,21ai_bd,22ai_bc,23ai_ee,24ai_jj,25ai_eq,26ai_ot,27ai_yy,28ai_mm
elseif eafty=s_umlb then
ealie="ai_id,ai_sn,ai_bt,ai_tm,ai_hi,ai_xi,ai_us,ai_up,ai_ss,ai_xy,ai_ef,ai_ep,ai_um,ai_el,ai_px,ai_jg,ai_jy,ai_t1,ai_t2,ai_oy,ai_oz,ai_bd,ai_bc,ai_ee,ai_jj,ai_eq,ai_ot,ai_yy,ai_mm"
elseif eafty="pp" then
'@@ai_id,1ai_ep,2ai_ef,3ai_us,4ai_sn,5ai_bt,6ai_tm,7ai_xy,8ai_px,9ai_jg,10ai_jy,11ai_oz,12ai_oy,13ai_t2,14ai_uf
ealie="ai_id,ai_ep,ai_ef,ai_us,ai_sn,ai_bt,ai_tm,ai_xy,ai_px,ai_jg,ai_jy,ai_oz,ai_oy,ai_t2,ai_uf"
elseif eafty="all" then
ealie="ai_id,ai_ew,ai_el,ai_ep,ai_ef,ai_us,ai_um,ai_ee,ai_eq,ai_sn,ai_bt,ai_jj,ai_ss,ai_nr,ai_tm,ai_xy,ai_px,ai_hi,ai_xi,ai_bd,ai_bc,ai_jg,ai_jy,ai_oz,ai_oy,ai_t1,ai_t2,ai_mm,ai_up,ai_uf,ai_ot,ai_pl,ai_yy,ai_xt"
end if
End Function
'-----------------------------------
'top list arr
'=earr(eafnm,eafpf=0ep/1ef/1ssp/2ssf/3ssx/4ssm/5sss,)
'-----------------------------------
Function earr(eafnm,eafps)
Call aiss(0,0)
Call aitj(eafps,ep_ef,0)
if aiint(iclapp)>0 or ew_ap<1 then
g_app=""
else
if not ainull(g_app) then g_app=esapm(3,g_app)
end if
if eafnm=0 or ainull(eafnm) then
eafnm=i_nmhc
else
eafnm=aiint(eafnm)
if not ainull(g_app) then g_app=g_app&"-"&eafnm
end if
if e_aiidl<>"" and e_aiidl<>"," then
if not ainull(g_app) then g_app=g_app&"-1"
dim eadidl
eadidl=left(e_aiidl,len(e_aiidl)-1)
if not ainull(eawhere) then eawhere=eawhere&" and "
eawhere=eawhere&"ai_id not in ("&eadidl&")"
end if
if e_aiids<>"" and e_aiids<>"," then
dim eadids
eadids=left(e_aiids,len(e_aiids)-1)
if ew_cf=0 or (ew_cf=1 and aibj(right(eafps,len(s_umqb)),s_umqb)) then
if not ainull(eawhere) then eawhere=eawhere&" and "
eawhere=eawhere&"ai_id not in ("&eadids&")"
end if
end if
if gystop(eafnm,eabid,ealie(s_umlb),eabiao,eawhere,eaorder,g_app) then
earr=gysar
end if
End Function
'-----------------------------------
'Title link
'=eaurl()
'-----------------------------------
Function eaurl(eafstr,eafum,eafep,eafot)
if i_xklj=2 and len(eafot&"0")>10 and aibj(left(eafot&"0",7),"http://") then
'if aibj(eafep,"link") and i_xklj=2 and aibj(left(eafot&"0",7),"http://") then
eaurl=eafot
else
eaurl=eshref(eafstr,eafum)
end if
End Function
'-----------------------------------
'Title alt
'=eaalt()
'-----------------------------------
Function eaalt(eafbt,eaftm,eafhi,eafxi,eafus,eafee)
eaalt="标题："&eafbt&vbNewLine
if ew_pj>1 then eaalt=eaalt&"我顶："&aiint(eafxi&g_gg&"0")&"次"&vbNewLine
if ew_dj>2 or (e_gdj>1 and ew_dj>0) then eaalt=eaalt&"浏览："&aiint(eafhi&g_gg&"0")&"次"&vbNewLine
if i_xkuhy>1 then
if not ainull(eafus) then eaalt=eaalt&"来自："&aistr(usren(eafus)&g_gg&i_mtm)&vbNewLine
if not ainull(eafee) then eaalt=eaalt&"编辑："&aistr(eafee&g_gg&i_mtm)&vbNewLine
end if
if i_xkatm>1 then eaalt=eaalt&"时间："&eaftm
End Function
'-----------------------------------
'add action
'=eaadd()
'-----------------------------------
Function eaadd(eafqh,eafty)
dim easduq,easdul,easdqx
if left(eafqh,1)="3" or (left(eafqh,1)="7" and len(eafqh)=2) then
easdqx=e_uzj
else
easdqx=e_gdj
end if
if e_gdj>0 or aibj(aireq("tg"),"0")  or aibj(ep_qx,"0")  or (aibj(ep_qx,"1") and e_uzj>1) then
easdul=replace(g_u,g_urg&s_umtj&g_urz,""&g_urz)
if left(eafqh,1)="3" and len(eafqh)=3 then
Call ukread(g_u2)
ew_bt=uk_bt&","&ew_bt:ew_zt=uk_zt&","&ew_zt:ew_nr=uk_co&","&ew_nr
e_wl="<a href="""&eshrej("",uk_ur,"",1)&""">"&uk_mc&"</a>"
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eshrej("",uk_ur,"",1),uk_mc&s_umlbs&g_gy&easdul)
easduq=s_umgl&g_urg&s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="3" and len(eafqh)=2 then
Call ukread(g_u1)
ew_bt=uk_bt&","&ew_bt:ew_zt=uk_zt&","&ew_zt:ew_nr=uk_co&","&ew_nr
e_wl="<a href="""&eshrej("",uk_ur,"",1)&""">"&uk_mc&"</a>"
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eshrej("",uk_ur,"",1),uk_mc&s_umlbs&g_gy&easdul)
easduq=s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="7" and len(eafqh)=3 then
easduq=s_umgl&g_urg
end if

if right(eafqh,1)<>"2" or aibj(aireq("tg"),"0") then
if not aibj(ep_sn,s_umqb) and ep_sn<>"" then
easdul=replace(g_u,s_umtj&g_urz,efhrl(ep_ls)&g_urz)
ew_bt=ep_mc&","&ew_bt:ew_zt=ep_mc&","&ew_zt:ew_nr=ep_mc&","&ew_nr
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(easduq&ep_sn&g_urz,1)&""">"&ep_mc&"</a>"
e_mt=esbts(ep_sx,ep_el,ep_mc&g_gy&eshref(easduq&ep_sn&g_urz,1),ep_dm&s_umlbs&g_gy&easdul)
if not aibj(ef_sn,s_umqb) and ef_sn<>"" then
ew_bt=ef_bt&","&ew_bt:ew_zt=ef_bt&","&ew_zt:ew_nr=ef_bt&","&ew_nr
e_wl=e_wl&efwl(eshref(easduq&ep_sn&g_urg&g_gg&g_urz,1),ef_sn,ef_bt)
e_mt=esbts(ep_sx,ep_el,ef_bt&g_gy&eshref(easduq&ep_sn&g_urg&ef_sn&g_urz,1),ep_dm&s_umlbs&g_gy&easdul)
end if
e_wl=e_wl&" &gt;&gt; "&s_umtjs&ep_dm&""
else
if left(eafqh,1)="7" then
'uk_mc=s_udeas
e_mt=esbts(s_udxea,s_udlea,s_udeas,"")
end if
e_wl=e_wl&" &gt;&gt; "&uk_mc&" "&s_umtjs&""
end if


if esky(1,aiint(easdqx)) or aireq("usx")="1" then'aireq("usx")="1"用来规避验证
if aireqx("bt,sn,xy,tm,nr") or e_gdj>3 then
if aireq("usx")="1" and e_uid=0 then
e_ma=e_ma&aitiao("您的"&ep_dm&"提交失败！原因：您暂时无权此操作，请注册会员帐户后操作。",e_uuser,5)
exit Function
end if
if gysfm(ealie("form"),eabiao,"ai_sn='"&aistr(aireq("sn"))&"'","ai_",1) then
Call eqin(aireq("eq"))
Call aisn(0)
if i_xkuhy>0 and i_xkuhj=1 and aiint(e_uid)>0 then
if gysgx(saidbqz&"us","us_jb=us_jb+"&i_jcjb&"","us_id="&e_uid&"") then e_ma=e_ma&usergx("jb",e_ujb+i_jcjb)
end if
if aibj(aireq("tg"),"0") then
e_ma=e_ma&aitiao("恭喜您，您的投稿已经成功提交，请等待管理员审核，谢谢配合！",easdul,i_nmtz)
else
if aibj(g_u1,s_umtj) then easdul="/?"&ep_sn&"/"&s_umqb&"//0///19"&g_urz
if i_xkuhj=1 and e_gxy>0 and e_gmc<>"" and aiint(e_gdj)>0 then
Call gysgx(saidbqz&"ee","ee_jb=ee_jb+"&i_jcee&"","ee_mc='"&e_gmc&"'")
e_ma=e_ma&aitiao(s_umtjs&ep_dm&s_ztcg&"<br>(奖励"&e_gmc&"金币<b>"&i_jcee&"</b>枚)",easdul,i_nmtz)
else
e_ma=e_ma&aitiao(s_umtjs&ep_dm&s_ztcg,easdul,i_nmtz)
end if
end if
if aireq("email")="1" then e_ma=e_ma&"<p align=center><script language=""JavaScript"" charset=""GB2312"" src="""&g_email&"?"&ew_le&"-i-5-i-"&e_uer&"-i-http://"&g_uhost&g_uurl&"?"&ep_sn&"/"&s_umqb&"/"&s_umzs&"/"&aireq("sn")&g_urz&"""></script></p>"
if left(eafqh,1)="7" and len(eafqh)=3 then e_ma=e_ma&eskod(11,11,aireq("ep")&g_apj&esnf(aireq("ef"))&g_apj&aireq("sn"))
else
e_ma=e_ma&aigo("很抱歉！已存在的信息，"&s_umtjs&ep_dm&s_ztsb,1)
end if
else
e_ma=e_ma&aigo("请填写完整各带*号的文本框，"&s_umtjs&ep_dm&s_ztsb,1)
end if
else
'=================================================ADD
e_ma=eaform(eafqh,eafty,"")&e_ma
end if

else
Response.Redirect(e_ur0)
end if
else
e_ma=e_ma&aitiao(s_umtjs&ep_dm&s_ztsb&"您暂时无权此操作。",e_uuser,5)
end if
End Function
'-----------------------------------
'edit action
'=eaedit()
'-----------------------------------
Function eaedit(eafqh,eafty,eafsn)
dim easdur,easduq,easdul,easdqx
if left(eafqh,1)="3" then
easdqx=e_uzj
else
easdqx=e_gdj
end if
if aiint(easdqx)>0 then
easdur=replace(g_u,s_umxg&g_urg&eafsn&g_urz,s_umtj&g_urz)
easdul=replace(g_u,g_urg&s_umxg&g_urg&eafsn&g_urz,""&g_urz)
if left(eafqh,1)="3" and len(eafqh)=3 then
Call ukread(g_u2)
ew_bt=uk_bt&","&ew_bt:ew_zt=uk_zt&","&ew_zt:ew_nr=uk_co&","&ew_nr
e_wl="<a href="""&eshrej("",uk_ur,"",1)&""">"&uk_mc&"</a>"
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eshrej("",uk_ur,"",1),uk_mc&s_umtjs&g_gy&easdur&g_gx&uk_mc&s_umlbs&g_gy&easdul)
easduq=s_umgl&g_urg&s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="3" and len(eafqh)=2 then
Call ukread(g_u1)
ew_bt=uk_bt&","&ew_bt:ew_zt=uk_zt&","&ew_zt:ew_nr=uk_co&","&ew_nr
e_wl="<a href="""&eshrej("",uk_ur,"",1)&""">"&uk_mc&"</a>"
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eshrej("",uk_ur,"",1),uk_mc&s_umtjs&g_gy&easdur&g_gx&uk_mc&s_umlbs&g_gy&easdul)
easduq=s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="7" and len(eafqh)=3 then
easduq=s_umgl&g_urg
end if

if right(eafqh,1)<>"2" then
if not aibj(ep_sn,s_umqb) and ep_sn<>"" then
easdul=replace(g_u,s_umxg&g_urg&eafsn&g_urz,efhrl(ep_ls)&g_urz)
ew_bt=ep_mc&","&ew_bt:ew_zt=ep_mc&","&ew_zt:ew_nr=ep_mc&","&ew_nr
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(easduq&ep_sn&g_urz,1)&""">"&ep_mc&"</a>"
e_mt=esbts(ep_sx,ep_el,ep_mc&g_gy&eshref(easduq&ep_sn&g_urz,1),s_umtjs&ep_dm&g_gy&easdur&g_gx&ep_dm&s_umlbs&g_gy&easdul)
if not aibj(ef_sn,s_umqb) and ef_sn<>"" then
ew_bt=ef_bt&","&ew_bt:ew_zt=ef_bt&","&ew_zt:ew_nr=ef_bt&","&ew_nr
e_wl=e_wl&efwl(eshref(easduq&ep_sn&g_urg&g_gg&g_urz,1),ef_sn,ef_bt)
e_mt=esbts(ep_sx,ep_el,ef_bt&g_gy&eshref(easduq&ep_sn&g_urg&ef_sn&g_urz,1),s_umtjs&ep_dm&g_gy&easdur&g_gx&ep_dm&s_umlbs&g_gy&easdul)
end if
end if
e_wl=e_wl&" &gt;&gt; "&s_umxgs&ep_dm&""
else
if left(eafqh,1)="7" then
'uk_mc=s_udeas
e_mt=esbts(s_udxea,s_udlea,s_udeas,"")
end if
e_wl=e_wl&" &gt;&gt; "&uk_mc&" "&s_umxgs&""
end if

if not ainull(eafsn) and len(eafsn)<50 then

if esky(1,aiint(easdqx)) then
if aireqx("bt,sn,xy,tm,nr") or e_gdj>3 then
if gysfm(ealie("form"),eabiao,"ai_id="&aiint(aireq("id"))&" or (ai_id<>"&aiint(aireq("id"))&" and ai_sn='"&aistr(aireq("sn"))&"')","ai_",2) then
e_ma=e_ma&aitiao(s_umxgs&ep_dm&s_ztcg,easdul,i_nmtz)
if left(eafqh,1)="7" then e_ma=e_ma&eskod(11,11,aireq("ep")&g_apj&esnf(aireq("ef"))&g_apj&aireq("sn"))
else
e_ma=e_ma&aigo(s_umxgs&ep_dm&s_ztsb&"(不存在或重复的"&ep_dm&"SN编码"&aistr(aireq("sn"))&")",1)
end if
else
e_ma=e_ma&aigo(s_umxgs&ep_dm&s_ztsb,1)
end if
else

'if aibj(eafty,s_umxg) then
if IsNumeric(eafsn) then
eawhere="ai_id="&aiint(eafsn)&""
else
eawhere="ai_sn='"&aitit(eafsn)&"'"
end if

if left(eafqh,1)="3" then
eawhere=eawhere&" and (ai_us='"&uk_us&"' or ai_xy>0)"
elseif left(eafqh,1)="7" and e_gdj<1 then
eawhere=""
end if

if gysread(ealie("all"),eabiao,eawhere,"") then
ew_bt=ai_bt&","&ew_bt:ew_zt=ai_bt&","&ai_eq&","&ew_zt:ew_nr=ai_bt&","&ew_nr:ew_cp=ai_us&","&ai_ee&","&ew_cp
'=================================================EDIT
e_ma=eaform(eafqh,eafty,eafsn)&e_ma
else
e_ma=e_ma&aigo(ep_dm&s_ztno,1)
end if

end if

else
Response.Redirect(e_ur0)
end if
else
e_ma=e_ma&aigo(s_umxgs&ep_dm&s_ztsb,1)
end if
End Function
'-----------------------------------
'del
'=eadel()
'-----------------------------------
Function eadel(eafqh,eafty,eafid,eafsn)
dim easdur,easduq,easdul,easdqx,easdwhex
if left(eafqh,1)="3" then
easdqx=e_uzj
else
easdqx=e_gdj
end if
if aiint(easdqx)>0 then
easdur=replace(g_u,s_umsc&g_urg&eafid&g_urg&eafsn&g_urz,s_umtj&g_urz)
easdul=replace(g_u,g_urg&s_umsc&g_urg&eafid&g_urg&eafsn&g_urz,""&g_urz)

if left(eafqh,1)="3" and len(eafqh)=3 then
Call ukread(g_u2)
ew_bt=uk_bt&","&ew_bt:ew_zt=uk_zt&","&ew_zt:ew_nr=uk_co&","&ew_nr
e_wl="<a href="""&eshrej("",uk_ur,"",1)&""">"&uk_mc&"</a>"
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eshrej("",uk_ur,"",1),uk_mc&s_umtjs&g_gy&easdur&g_gx&uk_mc&s_umlbs&g_gy&easdul)
easduq=s_umgl&g_urg&s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="3" and len(eafqh)=2 then
Call ukread(g_u1)
ew_bt=uk_bt&","&ew_bt:ew_zt=uk_zt&","&ew_zt:ew_nr=uk_co&","&ew_nr
e_wl="<a href="""&eshrej("",uk_ur,"",1)&""">"&uk_mc&"</a>"
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eshrej("",uk_ur,"",1),uk_mc&s_umtjs&g_gy&easdur&g_gx&uk_mc&s_umlbs&g_gy&easdul)
easduq=s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="7" and len(eafqh)=3 then
easduq=s_umgl&g_urg
end if

easdwhex="ai_ew="&ew_sn

if right(eafqh,1)<>"2" then
if not aibj(ep_sn,s_umqb) and ep_sn<>"" then
easdul=replace(g_u,s_umsc&g_urg&eafid&g_urg&eafsn&g_urz,efhrl(ep_ls)&g_urz)
ew_bt=ep_mc&","&ew_bt:ew_zt=ep_mc&","&ew_zt:ew_nr=ep_mc&","&ew_nr
e_wl=e_wl&" &gt;&gt; <a href="""&eshref(easduq&ep_sn&g_urz,1)&""">"&ep_mc&"</a>"
e_mt=esbts(ep_sx,ep_el,ep_mc&g_gy&eshref(easduq&ep_sn&g_urz,1),s_umtjs&ep_dm&g_gy&easdur&g_gx&ep_dm&s_umlbs&g_gy&easdul)
easdwhex=easdwhex&" and ai_ep='"&ep_sn&"'"
if not aibj(ef_sn,s_umqb) and ef_sn<>"" then
ew_bt=ef_bt&","&ew_bt:ew_zt=ef_bt&","&ew_zt:ew_nr=ef_bt&","&ew_nr
e_wl=e_wl&efwl(eshref(easduq&ep_sn&g_urg&g_gg&g_urz,1),ef_sn,ef_bt)
e_mt=esbts(ep_sx,ep_el,ef_bt&g_gy&eshref(easduq&ep_sn&g_urg&ef_sn&g_urz,1),s_umtjs&ep_dm&g_gy&easdur&g_gx&ep_dm&s_umlbs&g_gy&easdul)
easdwhex=easdwhex&" and ai_ef='"&ef_sn&"'"
end if
end if
e_wl=e_wl&" &gt;&gt; "&s_umscs&ep_dm&""
else
if left(eafqh,1)="7" then
'uk_mc=s_udeas
e_mt=esbts(s_udxea,s_udlea,s_udeas,"")
end if
e_wl=e_wl&" &gt;&gt; "&uk_mc&" "&s_umscs&""
end if

if aibj(eafty,s_umsc&"-x") then
if left(eafqh,1)="3" then easdwhex=easdwhex&" and ai_us='"&uk_us&"' and ai_xy<2"
if gysdel(eabid,eabiao,easdwhex) then
e_ma=e_ma&aitiao(s_umqbs&easdwhex&s_umscs&s_ztcg,replace(g_u,g_urg&s_umsc&"-x",g_urg&d_seals),i_nmtz)
if left(eafqh,1)="7" then e_ma=e_ma&eskod(11,0,ep_sn&g_apj&ef_sn)
else
e_ma=e_ma&aigo(s_umqbs&s_umscs&s_ztsb,1)
end if

elseif not ainull(eafsn) and len(eafsn)<50 then
'if aibj(eafty,s_umsc) then
if IsNumeric(eafid) then
eawhere="ai_id="&aiint(eafid)&""
else
eawhere="ai_sn='"&aitit(eafsn)&"'"
end if
if left(eafqh,1)="3" then eawhere=eawhere&" and ai_us='"&uk_us&"' and ai_xy<2"
if (left(eafqh,1)="7" and e_gdj>1) or left(eafqh,1)="3" then
if gysdel(eabid,eabiao,eawhere) then
if i_updr<>"" then
Call ankop(0,1,0,i_updr&replace(replace(esupcc(ep_sn,eafsn),i_upfh,i_upjj)&eafsn),"/","\")
else
Call ankop(0,1,0,i_dir&replace(esupcc(ep_sn,eafsn),i_upfh,i_upjj)&eafsn)
end if
if aibj(g_u0,s_umgl) and aibj(left(g_u1,len(s_umsc)),s_umsc) then easdul=replace(g_u,g_urg&s_umsc&g_urg&eafid&g_urg&eafsn,g_urg&d_seals)
e_ma=e_ma&aitiao(s_umxgs&ep_dm&s_ztcg,easdul,i_nmtz)
if left(eafqh,1)="7" then e_ma=e_ma&eskod(11,0,ep_sn&g_apj&esnf(esqef)&g_apj&eafsn)
else
e_ma=e_ma&aigo(ep_dm&s_umscs&s_ztsb,1)
end if
end if
end if

else
e_ma=e_ma&aigo(ep_dm&s_ztno,1)
end if
End Function
'-----------------------------------
'show
'=eashow()
'-----------------------------------
Function eashow(eafqh,eafty,eafsn)
if not ainull(eafsn) and len(eafsn)<50 then
eafsn=aitit(eafsn)
if aibj(eafty,"11") then
e_ma=""
else
'where
if left(eafqh,1)="3" then
if ainull(uk_us) then
if aibj(g_u0,s_umgl) then
Call doq(4,g_u2,2,g_u0,g_u3,g_u4)
else
Call doq(4,g_u1,2,g_u0,g_u2,g_u3)
end if
end if
eawhere="ai_sn='"&eafsn&"' and ai_us='"&uk_us&"'"
elseif ((left(eafqh,1)="7" or left(eafqh,1)="3") and len(eafqh)=3 and e_gdj>0) or aibj(eafty,"11") or e_gdj>2 or e_uty>2 then
eawhere="ai_sn='"&eafsn&"'"
elseif not ainull(e_uer) then
eawhere="ai_sn='"&eafsn&"' and (ai_us='"&e_uer&"' or ai_xy>0)"
else
eawhere="ai_sn='"&eafsn&"' and ai_xy>0"
end if

g_app=esapm(1,eafsn)
if len(eafqh)=3 then g_app=""
if gysread(ealie("all"),eabiao,eawhere,g_app) then
if left(eafqh,1)<>"3" then Call doq(1,ai_us,0,g_u0,ai_ep,ai_ef)
dim easduq,easdur
if instr(ep_sk,"y/")=0 then
if aibj(eafty,"0") then
easdur=ep_dm&s_umxxs&g_gy&replace(g_u,s_umzs&g_urg,s_umxx&g_urg)
else
easdur=ep_dm&s_umzss&g_gy&replace(g_u,s_umxx&g_urg,s_umzs&g_urg)
end if
else
easdur=""
end if

if left(eafqh,1)="3" and len(eafqh)=3 then
e_mt=esbts(ep_sx,ep_el,uk_mc&g_gy&eshrej("",uk_ur,"",1),"")
easduq=s_umgl&g_urg&s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="3" and len(eafqh)=2 then
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eshrej("",uk_ur,"",1),"")
easduq=s_udukw&g_urg&uk_ur&g_urg
elseif left(eafqh,1)="7" and len(eafqh)=3 then
easduq=s_umgl&g_urg
end if
if right(eafqh,1)<>"2" then
if not aibj(ep_sn,s_umqb) and ep_sn<>"" then
e_mt=esbts(ep_sx,ep_el,ep_mc&g_gy&eshref(easduq&ep_sn&g_urz,1),easdur)
if not aibj(ef_sn,s_umqb) and ef_sn<>"" then
e_mt=esbts(ep_sx,ep_el,ef_bt&g_gy&eshref(easduq&ep_sn&g_urg&ef_sn&g_urz,1),easdur)
end if
end if
if aibj(eafty,"0") then
e_wl=e_wl&" &gt;&gt; "&ep_dm&s_umxxs&""
else
e_wl=e_wl&" &gt;&gt; "&s_umzss&ep_dm&""
end if
else
if left(eafqh,1)="7" or left(eafqh,1)="3" then
'uk_mc=s_udeas
e_mt=esbts(s_udxea,s_udlea,s_udeas,"")
end if
if aibj(eafty,"0") then
e_wl=e_wl&" &gt;&gt; "&uk_mc&" "&s_umxxs&""
else
e_wl=e_wl&" &gt;&gt; "&s_umzss&" "&uk_mc&""
end if
end if
if not ainull(ep_pl) then
ew_pl=aiint(ep_pl)
ew_pj=aiint(ep_pj)
end if

e_ma=e_ma&easshow(eafqh,eafty,eafsn)
else
e_ma=e_ma&aitiao("抱歉，不存在的编码！",e_ur0,i_nmtz)
end if
end if
else
e_ma=e_ma&aitiao("抱歉，不符合要求的编码请求！",e_ur0,i_nmtz)
end if
End Function
'-----------------------------------
'list
'=ealist()
'-----------------------------------
Function ealist(eafqh,eafuq,eafef,eafls,eafpg,eafps,eafph)
dim eadqx,eadqxyz,eadity,eaduqs,eadtj,eadljs,eadxpur,eadxpms,eadxpum
if len(eafqh)=3 then
eadxpum=77
elseif left(eafqh,1)="5" then
eadxpum=55
elseif left(eafqh,1)="3" then
eadxpum=66
elseif left(eafqh,1)="7" then
eadxpum=1
end if

if not ainull(eafef) and not aibj(eafef,s_umqb) and not aibj(eafef,"0") then
eaduqs=eafuq&g_urg&eafef
eadljs=eshref(eafuq&g_urg&eafef&g_urz,eadxpum)
elseif ainull(eafuq) then
eaduqs=""
eadljs=eshref("",eadxpum)
else
eaduqs=eafuq
eadljs=eshref(eafuq&g_urz,eadxpum)
end if

if ainull(eafls) then
if right(eafqh,1)<>"2" then
eadxpms=efhrl(ep_ls)
else
eadxpms=d_seals
end if
else
eadxpms=eafls
end if

if aibj(g_u0,s_udukw) and ainull(g_u2) then eaduqs=eaduqs&s_umqb

if eaduqs<>"" then
eadtj=eshref(eaduqs&g_urg&s_umtj&g_urz,eadxpum)
eadxpur=eshref(eaduqs&g_urg&eadxpms&g_urg&g_gp&g_urg&g_gp&g_urg&eafph&g_urz,eadxpum)
else
eadtj=eshref(s_umtj&g_urz,eadxpum)
eadxpur=eshref(eadxpms&g_urg&g_gp&g_urg&g_gp&g_urg&eafph&g_urz,eadxpum)
end if

if left(eafqh,1)="5" then eadtj=replace(eadtj,s_umso&g_urg,"")

eadqx=0
if len(eafqh)=3 then
eadity=1
else
eadity=0
end if
if left(eafqh,1)="3" then
eadqxyz=aiint(e_uzj)
if eadqxyz>3 then
eadqx=2
elseif eadqxyz>2 then
eadqx=1
end if
eadqxyz=0
else
eadqxyz=aiint(e_gdj)
if eadqxyz>2 then
eadqx=2
elseif eadqxyz>1 then
eadqx=1
end if
end if

if right(eafqh,1)<>"2" then
if not aibj(ep_sn,s_umqb) and ep_sn<>"" then
e_mt=esbts(ep_sx,ep_el,ep_mc&g_gy&eshref(eafuq&g_urz,1),"")
if not aibj(ef_sn,s_umqb) and ef_sn<>"" then
e_mt=esbts(ep_sx,ep_el,ef_bt&g_gy&eadljs,"")
end if
end if
end if
if ainull(e_mt) then
if aibj(left(eafqh,1),"5") then
e_mt=esbts(s_udxea,s_udlea,ew_mc&" 整站内容列表","")
elseif left(eafqh,1)="3" then
e_mt=esbts(s_udxuk,s_udluk,uk_mc&g_gy&eadljs,"")
else
e_mt=esbts(s_udxea,s_udlea,s_udeas&"列表","")
end if
end if

if instr(lcase(g_ud)&"/",s_drwap)>0 then eadxpum=1
if not ainull(ep_sp) then
ew_sp=aiint(ep_sp)
ew_lm=aiint(ep_lm)
end if

e_ma=e_ma&easlist(eafqh,eafuq,eafef,eafpg,eafps,eafph,eadqx,eadqxyz,eadity,eaduqs,eadxpur,eadxpms,eadxpum)
if not ainull(icvss) then
ew_bt=icvss&","&ew_bt:ew_zt=icvss&","&ew_zt:ew_nr=icvss&","&ew_nr
e_wl=e_wl&" &gt;&gt; 含关键词["&icvss&"]的"&ep_dm&s_umlbs
if aibj(left(eafqh,1),"5") then e_mt=esbts(s_udxea,s_udlea,"含关键词["&icvss&"]的"&s_udeas&s_umlbs&"","")
else
if aibj(left(eafqh,1),"5") then
e_wl=e_wl&" &gt;&gt; 整站内容"&s_umlbs
else
e_wl=e_wl&" &gt;&gt; "&ep_dm&s_umlbs
end if
end if

End Function


'-----------------------------------
'=aiss()
'Call aiss()
'-----------------------------------
Function aiss(eafel,eafty)
dim icdspx,icdsfx,icdsxx
icdssp="排序|浏览|我顶|排序|推荐|时间|榜单|榜次|正序|"
icdspx="ai_id desc|ai_hi desc|ai_xi desc|ai_px desc|ai_xy desc|ai_tm desc|ai_bd desc|ai_bc desc|ai_id asc|"
if aibj(eafel,"2") or aibj(eafel,"10") or aibj(eafel,"12") then
icdssp=icdssp&"售价|原价|"
icdspx=icdspx&"ai_jg desc|ai_jy desc|"
end if
if aibj(eafel,"10") or aibj(eafel,"12") then
icdssp=icdssp&"已售|库存|"
icdspx=icdspx&"ai_oy desc|ai_oz desc|"
end if
if aibj(eafel,"13") then
icdssp=icdssp&"底价|高价|已收|需量|"
icdspx=icdspx&"ai_jg desc|ai_jy desc|ai_oy desc|ai_oz desc|"
end if

icdssf="范围|图片|推荐|三星|四星|五星|"
icdsfx="|(ai_up<>'' and ai_up<>'0' and ai_up<>'null')|ai_xy>1|ai_xy>2|ai_xy>3|ai_xy>4|"
icdssf=icdssf&"T100|T600|"
icdsfx=icdsfx&"T100|T600|"
icdssf=icdssf&"新图|随机|"
Randomize
icdsfx=icdsfx&"T200|T"&left(int(day(date())*888888*Rnd)&"000",3)&"|"
icdssf=icdssf&esqday(0)&"|"
icdsfx=icdsfx&esqday("ai_tm")&"|ai_xy=1|ai_xy=0|(ai_us<>'' and ai_us='"&e_uer&"')|"
if e_gdj>2 then icdssf=icdssf&"普通|禁用|"

icdssx="项目|标题|简介|内容|标签|会员|发布|小编|编码|"
icdsxx="ai_bt|ai_bt|ai_jj|ai_nr|ai_eq|ai_us|ai_um|ai_ee|ai_ot|ai_xt|ai_tm|ai_t1|ai_sn|"
if e_gdj>2 then icdssx=icdssx&"其他|系统|时间|更新|"

if right(icdssp,1)="|" then icdssp=left(icdssp,len(icdssp)-1)
if right(icdssf,1)="|" then icdssf=left(icdssf,len(icdssf)-1)
if right(icdssx,1)="|" then icdssx=left(icdssx,len(icdssx)-1)
icdssm=i_bsm
icdrrp=split(icdspx,"|")
icdrrf=split(icdsfx,"|")
icdrrx=split(icdsxx,"|")
End Function
'-----------------------------------
'=aitj(eafstr=频道ep/1分类ef/2排序ssp/3范围ssf/4项目ssx/5模式ssm/6关键词sss,eaffl=分类样式-多选分类|单选分类,eafty)
'-----------------------------------
Function aitj(eafstr,eaffl,eafty)
dim icdarr,icdsep,icdsef
icdarr=split(eafstr&"//////","/")
eawhere="6=6"
eaorder=eaordermo

'do str
icdsep=trim(icdarr(0))
if aibj(icdsep,s_umqb) or aibj(icdsep,"0") or dkdir(0,icdsep) then icdsep=""
icdsef=trim(icdarr(1))
if aibj(icdsef,s_umqb) or aibj(icdsef,"0") or dkdir(0,icdsef) then icdsef=""
icvsp=aiint(icdarr(2))
icvsf=aiint(icdarr(3))
icvsx=aiint(icdarr(4))
icvsm=aiint(icdarr(5))
icvss=aijie(trim(icdarr(6)))
if aibj(icvss,s_umqb) or aibj(icvss,"0") or dkdir(0,icvss) or aibj(s_ztks,icvss) then icvss=""

'ep
if icdsep<>"" then eawhere=eawhere&" and ai_ep='"&icdsep&"'"

'ef
if icdsef<>"" then
dim icdfvi,icdfvrr,icdfvrrx,icdfvrrxu,icdfvrrxi,icdfvrrxw
'----------------------------------ef0
if aiint(eaffl)>0 then
if len(icdsef&"0")>3 then
icdfvrr=split(icdsef,g_ura)
for icdfvi=0 to ubound(icdfvrr)
if not aibj(icdsef,s_umqb) and icdfvrr(icdfvi)<>"" then
eawhere=eawhere&" and "
if left(icdfvrr(icdfvi),1)="0" then
'★★★★★this do for tags 0
dim ealtlie,ealtliez,ealtliezrr
ealtlie=right(left(icdfvrr(icdfvi),3),2)
if instr("xy,px,hi,xi,bd,bc,jg,jy,oz,oy",ealtlie)>0 then
ealtliez=right(icdfvrr(icdfvi),len(icdfvrr(icdfvi))-3)
ealtliezrr=split(ealtliez&"-","-")
if ealtliezrr(0)=ealtliezrr(1) then
eawhere=eawhere&"ai_"&ealtlie&"="&aiint(ealtliezrr(0))&""
elseif ealtliezrr(0)<>"" and ealtliezrr(1)<>"" then
eawhere=eawhere&"ai_"&ealtlie&">="&aiint(ealtliezrr(0))&" and ai_"&ealtlie&"<="&aiint(ealtliezrr(1))&""
elseif ealtliezrr(0)<>"" then
eawhere=eawhere&"ai_"&ealtlie&">="&aiint(ealtliezrr(0))&""
elseif ealtliezrr(1)<>"" then
eawhere=eawhere&"ai_"&ealtlie&"<="&aiint(ealtliezrr(1))&""
else
eawhere=eawhere&icdfvi&"="&icdfvi
end if
else
if not aibj(icdfvrr(icdfvi),s_umqb) then
eawhere=eawhere&"ai_ef like '"&icdfvrr(icdfvi)&"%'"
else
eawhere=eawhere&"6=6"
end if
end if
'★★★★★this do for tags 1
else
if instr(icdfvrr(icdfvi),g_urb)>1 or (instr(icdfvrr(icdfvi),g_urb)>0 and right(icdfvrr(icdfvi),len(g_urb))<>g_urb) then
icdfvrrx=split(icdfvrr(icdfvi),g_urb)
icdfvrrxu=ubound(icdfvrrx)
icdfvrrxw=""
for icdfvrrxi=0 to icdfvrrxu
if not ainull(icdfvrrxw) and icdfvrrx(icdfvrrxi)<>"" and not aibj(icdfvrrx(icdfvrrxi),s_umqb) then icdfvrrxw=icdfvrrxw&" or "
if icdfvrrx(icdfvrrxi)<>"" and not aibj(icdfvrrx(icdfvrrxi),s_umqb) then icdfvrrxw=icdfvrrxw&"ai_ef like '%"&icdfvrrx(icdfvrrxi)&"%'"
next
if icdfvrrxw<>"" then
eawhere=eawhere&"("&icdfvrrxw&")"
else
eawhere=eawhere&icdfvi&"="&icdfvi
end if
else
if not aibj(icdfvrr(icdfvi),s_umqb) then
eawhere=eawhere&"ai_ef like '%"&icdfvrr(icdfvi)&"%'"
else
eawhere=eawhere&"6=6"
end if
end if
end if
end if
next
end if
'cdv 1
else
'ef
'eawhere="ai_ef='"&icdsef&"'"&eawhere
eawhere=eawhere&" and ai_ef like '"&icdsef&"%'"
end if
'----------------------------------ef1
end if

'sp
if icvsp>0 then eaorder=icdrrp(icvsp)

'ss
if icvss<>"" then
dim icvssrr,icvssi,icvssud,icvsslin
icvssrr=split(icvss," ")
icvssud=ubound(icvssrr)
icvsslin=""
for icvssi=0 to icvssud
if icvsslin<>"" then icvsslin=icvsslin&" or "
if icvssrr(icvssi)<>"" then
if icvsm=2 then
icvsslin=icvsslin&icdrrx(icvsx)&"='"&icvssrr(icvssi)&"'"
else
icvsslin=icvsslin&icdrrx(icvsx)&" like '%"&icvssrr(icvssi)&"%'"
end if
end if
next
if icvsslin<>"" then
eawhere=eawhere&" and ("&icvsslin&")"
end if
g_app=""
iclapp=1
else
g_app="P_"&icdsep&g_apj&"F_"&icdsef&"_"&eaffl&"X_"&icvsp&"W_"&icvsf
iclapp=0
end if

'admin
if (aibj(g_u0,s_umgl) and e_gdj>2) or icvsf=19 then
if instr(eawhere,"ai_xy>0")>0 then eawhere=replace(eawhere," and ai_xy>0","")
else
if instr(eawhere,"ai_xy>0")=0 then eawhere=eawhere&" and ai_xy>0"
end if

'ew
if aiint(ew_sn)>0 and icdsep="" and icdsef="" then eawhere=eawhere&" and ai_ew="&aiint(ew_sn)

eawhere=replace(eawhere,"6=6 and ","")

'sf
if icvsf>0 then
dim icvsflin
icvsflin=icdrrf(icvsf)
if left(icvsflin,1)="T" then
icvsflin=right(icvsflin,len(icvsflin)-1)
eawhere="ai_id in (select top "&aiint(icvsflin)&" ai_id from "&saidbqz&"ai where "&eawhere&" order by ai_id desc)"
else
eawhere=eawhere&" and "&icvsflin
end if
end if
'response.Write eawhere&"<br />"
End Function
%>