<!--#include virtual="/incs/constr.asp"-->
<!--#include virtual="/incs/sitename.asp"-->
<!--#include virtual="/incs/setup.asp"-->
<object runat="server" id="conn" scope="page" progid="ADODB.Connection"></object>
<object runat="server" id="conn2" scope="page" progid="ADODB.Connection"></object>
<object runat="server" id="rs" scope="page" progid="ADODB.Recordset"></object>
<object runat="server" id="rs1" scope="page" progid="ADODB.Recordset"></object>
<object runat="server" id="rs2" scope="page" progid="ADODB.Recordset"></object>
<object runat="server" id="rs3" scope="page" progid="ADODB.Recordset"></object>
<%
'on error resume next
public  tmenmes(7)
tmenmes(0)="天"
tmenmes(1)="周"
tmenmes(2)="月"
tmenmes(3)="季"
tmenmes(4)="半年"
tmenmes(5)="年"
tmenmes(6)="份"
tmenmes(7)="套"
VEnd="{}"
DVEnd="|-|"
Function mylen(ByVal str)
 If Len("厦门华众网络") = 6 Then
    Dim a, b, c, d
     a = Len(str)
     b = a
     For d = 1 To a
          c = Asc(Mid(str, d, 1))
           If c < 0 Then
              c = c + 65536
           End If
           If c > 255 Then
                b = b + 1
           End If
      Next
    mylen = b
 Else
  mylen = Len(str)
 End If
End Function

if session("usrid")<>"" and isnull(session("usrid"))=false then
entryuser=session("usrname")
entrypass=session("usrpass")
else
entryuser=pl_usrnme_gst
entrypass=pl_usrpss_gst
end if
agentname=session("agentname")
agentpass=session("agentpass")
%>

<%
'''''''''''''''''''''''''''''''''''''''''''''''错误页面处理
function errorpage(urlstep,str) 
     session("errmsg")=str
turnpage="/mst_error.asp?urlstep="&urlstep&"&errorid="&server.urlencode("511")
%>
<script language=javascript>
location.href="<%=turnpage%>";
</script>
<%
response.end
end function
'''''''''''''''''''''''''''''''''''''''''''''''成功但是有提示 
function infpage(str,url)
if len(str)<=6 then
str="10000 恭喜您，操作成功！"
end if

 	session("infmsg")=str
	  turnpage="/infmsg.asp?okid="&Server.URLEncode("200")&"&turn="&Server.URLEncode(url)
	%>
 <script language="javascript">
location.href="<%=turnpage%>";
</script>
<%

	response.end
end function

function transip(sip)
	tip=cstr(sip)
	sip1=left(tip,cint(instr(tip,".")-1))
	tip=mid(tip,cint(instr(tip,".")+1))
	sip2=left(tip,cint(instr(tip,".")-1))
	tip=mid(tip,cint(instr(tip,".")+1))
	sip3=left(tip,cint(instr(tip,".")-1))
	sip4=mid(tip,cint(instr(tip,".")+1))
	transip=cint(sip1)*256*256*256+cint(sip2)*256*256+cint(sip3)*256+cint(sip4)
end function
'''''''''''''''''''''''''''''''''''''''''''''''成功页面处理

function okpage(str)
   
        turnpage="/mst_ok.asp?okid="&Server.URLEncode("200")&"&turn="&Server.URLEncode(str)
	
	%>
 <script language="javascript">
location.href="<%=turnpage%>";
</script>
<%
	
	response.end
end function

'''''''''''''''''''''''''''''''''''''''''''''''用户名和密码检查


function Chk_usrpss(Str,strname,lenmin,lenmax)'lenmin表长度下限，lenmax表长度上限 
b=""
c=true
if str="" then
session("errmsg")="对不起，"&strname&"不能为空！"
response.redirect "/mst_error.asp?errorid=511"
response.end
end if
if len(str)<lenmin then
session("errmsg")="对不起，"&strname&"长度应该大于"&lenmin&"位！"
response.redirect "/mst_error.asp?errorid=511"
response.end
end if
if len(str)>lenmax then
session("errmsg")="对不起，"&strname&"长度应该小于"&lenmax&"位！"
response.redirect "/mst_error.asp?errorid=511"
response.end
end if
bString="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
for i=1  to len(str)
b=mid(str,i,1)
if instr(bstring,b)<=0 then
c=false
exit for
end if
next
if c=false then
session("errmsg")="对不起，"&strname&"不符合规范！"
response.redirect "/mst_error.asp?errorid=511"
response.end
end if
end function 
'''''''''''''''''''''''''''''''''''''''''''''''寻找产品价格

function find_prc(proid)'寻找产品价格
if  trim(proid)="" then
    call errorpage(-2,"对不起，意外错误！(101)")
end if
if chk_int(session("usrclass")) then
p_cls=session("usrclass")
else
p_cls=pl_dftprc
end if
query="select top 1 * from v_prclst where p_prd='"&proid&"' and p_cls="&p_cls&" order by p_yar"
rs2.open query,conn,1,1
if rs2.recordcount<>1 then
find_prc="未知"
rs2.close
exit function
end if
if rs2("p_yar")="1" then
pyar=""
else
pyar=rs2("p_yar")
end if
find_prc=cstr(rs2("p_prc"))&"元/"&pyar&tmenmes(rs2("p_tmetpe"))
rs2.close
end function

'''''''''''''''''''''''''''''''''''''''''''''''寻找默认价格等级
function find_dftprccls()
find_dftprccls=pl_dftprc
end function


function find_prc_set(usrid,proid1,proid2)'寻找产品价格 
if  trim(proid1)=""  or trim(proid2)="" then
    call errorpage(-2,"对不起，意外错误！(101)")
end if
if clng(usrid)=0 then
query="select * from prclst  where p_pwr=5"
rs2.open query,conn,1,1
if rs2.recordcount<>1 then
rs2.close
   call errorpage(-2,"对不起，意外错误！(102)")
else
   prc_prd1=clng(rs2(proid1))
   prc_prd2=clng(rs2(proid2))
   find_prc_set=prc_prd1+prc_prd2
end if
rs2.close
exit function
end if

if clng(usrid)<>0 then
query="select u_prc from memlst where u_id="&usrid
rs2.open query,conn,1,1
if rs2.recordcount<>1 then
rs2.close
   call errorpage(-2,"对不起，意外错误！(103)")
else
   usrclass=rs2("u_prc")
end if
rs2.close
query="select * from prclst where p_cls="&usrclass
rs2.open query,conn,1,1
if rs2.recordcount<>1 then
rs2.close
call errorpage(-2,"对不起，意外错误！(104)")
end if
   prc_prd1=clng(rs2(proid1))
   prc_prd2=clng(rs2(proid2))
   find_set1=prc_prd1+prc_prd2
rs2.close
query="select * from prclst  where p_pwr=5"
rs2.open query,conn,1,1
if rs2.recordcount<>1 then
rs2.close
   call errorpage(-2,"对不起，意外错误！(105)")
else
   prc_prd3=clng(rs2(proid1))
   prc_prd4=clng(rs2(proid2))
   find_set2=prc_prd3+prc_prd4
end if
rs2.close
if  find_set1>find_set2 then
find_prc_set=find_set2
else
find_prc_set=find_set1
end if
end if
end function



'''''''''''''''''''''''''''''''''''''''''''''''寻找公开价

function find_dftprc(proid)'寻找公开价格
if  trim(proid)="" then
    call errorpage(-2,"对不起，意外错误！(101)")
end if
usrclass=pl_dftprc
query="select top 1 * from v_prclst where p_cls="&usrclass &" and g_prd='"&proid&"' order by p_yar"
rs2.open query,conn,1,1
if rs2.recordcount<1 then
find_dftprc="未知"
rs2.close
exit function
end if
if rs2("p_yar")="1" then
pyar=""
else
pyar=rs2("p_yar")
end if
find_dftprc=cstr(rs2("p_prc"))&"元/"&pyar&tmenmes(rs2("p_tmetpe"))
rs2.close
end function
'''''''''''''''''''''''''''''''''''''''''''''''会员登录检查

function chk_log()
if session("usrname")="" or session("usrpass")="" then
   err_log=true
else
   query="select * from memlst where u_nme='"&session("usrname")&"'"
   conn2.open constr
   rs2.open query,conn2,1,1
      if rs2.recordcount<>1 then
         err_log=true
      elseif session("usrpass")<>trim(rs2("u_pss")) then
         err_log=true
      end if
   rs2.close
   conn2.close
end if
if err_log=true then
%>
<script>
alert("对不起,您还没有登录或者登录超时,请重新登录!")
top.location.href="/master/memmng/login.asp";
</script>
<%
end if
end function
function chk_log_usr()
if session("usrname")="" or session("usrpass")="" then
   err_log=true
else
   query="select * from memlst where u_nme='"&session("usrname")&"'"
   conn2.open constr
   rs2.open query,conn2,1,1
      if rs2.recordcount<>1 then
         err_log=true
      elseif session("usrpass")<>trim(rs2("u_pss")) then
         err_log=true
      end if
   rs2.close
   conn2.close
end if
if err_log=true then
%>
<script>
alert("对不起,您还没有登录或者登录超时,请重新登录!")
top.location.href="/";
</script>
<%
end if
end function

'''''''''''''''''''''''''''''''''''''''''''''''翻页文本

page_turn="<input type='button' name='Submit' value='首页' onclick='javascript:tofirst();' class=btxx style='cursor:hand;'><input type='button' name='Submit' value='上一页' onclick='javascript:toprev();' class=btxx  style='cursor:hand;'><input type='button' name='Submit' value='下一页' onclick='javascript:tonext();' class=btxx  style='cursor:hand;'><input type='button' name='Submit' value='尾页' onclick='javascript:tolast();'class=btxx  style='cursor:hand;'>"

'''''''''''''''''''''''''''''''''''''''''''''''权限检查



Function chk_newpwr(pwrcls,pwrid1,pwrid2)
if session("sysclass")="" or isnull(session("sysclass")) or session("sysclass")<pwrcls then
call errorpage(-2,"对不起,您无权执行此操作(a)!")
end if
If Chk_Int(pwrcls) = False Or Chk_Int(pwrid1) = False Or Chk_Int(pwrid2) = False  Then
call errorpage(-2,"对不起,您无权执行此操作(b)!")
   Exit Function
End If
if  pwrid2<>"0" then
sys_strs = Split(session("syspower"), ",")
systring = sys_strs(pwrid1)
If Mid(systring, pwrid2, 1) <> "1" Then
     call errorpage(-2,"对不起,您无权执行此操作(c)!")
   Exit Function
End If
end if
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

function Chk_Phone(Str)
  dim a,i,c,d
  c=true
  a=len(Str)
  if a=0 or a>16 then
  c=false 
  end if
  for i=1 to a
   d=asc(mid(str,i,1))
   if not ((d>=48 and d<=57) or d=45 or mid(str,i,1)="+" or mid(str,i,1)=".")   then
     c=false
     exit for
   end if
  next
  Chk_Phone=c
end function


function chk_email(email)

dim names, name, i, c

'Check for valid syntax in an email address.

chk_email = true
if trim(email)="" or isnull(email)=true then
chk_email = false
exit function
end if
names = Split(email, "@")
if UBound(names) <> 1 then
   chk_email = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     chk_email = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       chk_email = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      chk_email = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   chk_email = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   chk_email = false
   exit function
end if
if InStr(email, "..") > 0 then
   chk_email = false
end if

end function

Function Chk_url(address)
    Dim re
	if address="" or isnull(address)=true then
	Chk_url=false
	exit function
	end if
    Set re = new RegExp
    re.pattern = "[a-zA-Z0-9_-][a-zA-Z0-9_-][a-zA-Z0-9_-]+\.[a-zA-Z]{2,4}$"
    Chk_url=re.Test(address)
end function


Function Chk_Int(TheNumber)
    dim a,b,c
	TheNumber=TheNumber
	if isnull(thenumber) then
     chk_int=false
	 exit function
	 end if     
    a=len(TheNumber)
    c=true
    if a=0 or a>8 then
       Chk_Int=false
       exit function
    else
       for b=1 to a
           if instr("-0123456789",mid(TheNumber,b,1))<=0 then 
              c=false
              exit for
           end if
       next  
    end if
    Chk_Int=c
end function

Function Chk_num(TheNumber)
    dim a,b,c
	TheNumber=TheNumber
	if isnull(thenumber) then
     Chk_num=false
	 exit function
	 end if     
    a=len(TheNumber)
    c=true
    if a=0 or a>10 then
       Chk_num=false
       exit function
    else
       for b=1 to a
           if instr("-0123456789.",mid(TheNumber,b,1))<=0 then 
              c=false
              exit for
           end if
       next  
    end if
    Chk_num=c
end function

Function Chk_tme(TheNumber)
    dim a,b,c
	TheNumber=TheNumber
 	if isnull(thenumber) then
     Chk_tme=false
	 exit function
	 end if     
   a=len(TheNumber)
    c=true
    if a=0 or a>10 then
       Chk_tme=false
       exit function
    else
       for b=1 to a
           if instr("-0123456789",mid(TheNumber,b,1))<=0 then 
              c=false
              exit for
           end if
       next  
    end if
    Chk_tme=c
end function

	
function findlastid(byref lastid)
query="select @@identity as lastid"
rs.open query,conn,1,1
if not rs.eof  then
lastid=rs("lastid")
else
call errorpage(-2,"对不起，意外错误！")
end if
rs.close
end function


function find_prd(tag)' 根据系统标志寻求产品编号
if tag="" then
call errorpage(-2,"对不起，系统错误!")
end if
query="select * from pdtlst where g_tag='"&tag&"'"
rs2.open query,conn,1,1
if rs2.eof then
rs2.close
call errorpage(-2,"对不起，产品编号未找到！")

end if
find_prd=trim(rs2("g_prd"))
rs2.close
end function

function find_prdnew(byval tag,byval g_sst)' 根据系统标志寻求产品编号
if tag="" then
call errorpage(-2,"对不起，系统错误!")
end if
query="select * from pdtlst where g_sst="&g_sst&" and g_tag='"&tag&"'"
rs2.open query,conn,1,1
if rs2.eof then
find_prdnew=""
rs2.close
exit function
end if
find_prdnew=trim(rs2("g_prd"))
rs2.close
end function


function find_prdhst(tag,pdtcls)' 根据系统标志寻求产品编号(虚拟主机升级专用)
if tag="" then
call errorpage(-2,"对不起，系统错误!")
end if
query="select * from pdtlst where g_tag='"&tag&"' and g_pdtcls="&pdtcls
rs2.open query,conn,1,1
if rs2.eof then
rs2.close
find_prdhst=""
exit function
end if
find_prdhst=trim(rs2("g_prd"))
rs2.close
end function


function hzsocket(byval str)
on error resume next
err.clear
if instr(str,"agentname:")<=0 then
   str =str& "agentname:"&agentname&Vend
end if
if instr(str,"agentpass:")<=0 then
   str =str& "agentpass:"&agentpass&Vend
end if
set recs=server.createobject("hzagent.modules")
if err.number<>0 then
if instr(lcase(err.description),"asp 0178")>0 then
hzsocket="10001 对不起，核心组件访问失败，请检查该组件是否安装正确！"
err.clear
else
hzsocket="10001 对不起，系统访问失败！"&err.description
err.clear
end if
else
str=str&"selfsite:"&pl_stetag&Vend 
hzsocket=recs.enties(str,constr)
end if
set recs=nothing
end function


Function getval(ByVal strl, ByVal strs) '从strl中提取strs的值
If  InStr(strl, Vend) <= 0 or instr(strl,strs&":")<=0 Or strs = "" Then
   getval = ""
   Exit Function
End If
strl = Mid(strl, (InStr(strl, strs & ":") + Len(strs) + 1))
spotofcrlf = InStr(strl, Vend)
getval = Trim(Left(strl, spotofcrlf - 1))
End Function

function Html_Encode(Str)
 
   if trim(Str)="" or isnull(str) then
   exit function
   end if
    str=replace(str,"&#39;",chr(39))
    Str = Replace(Str,chr(13), "")
    Str = Replace(Str,chr(10),"<BR>")
   Html_Encode = Str
end function

function aff_add(a_uid,a_unme,a_prd,a_pid,a_ttl,a_cnt,byref lstid)'agentname表示切换身份代理操作 
if session("agentname")<>"" and isnull(session("agentname"))=false then
a_agtnme=session("agentname")
else
a_agtnme=""
end if

if  trim(a_prd)="" then
a_pid=0
a_afftpe=0
else
   query="select g_pdttpe from pdtlst where g_prd='"&a_prd&"'"
   rs1.open query,conn,1,1
   a_afftpe=rs1("g_pdttpe")
   rs1.close
end if
query="insert into afflst (a_uid,a_unme,a_prd,a_pid,a_afftpe,a_ttl,a_cnt,a_fsh,a_mgr,a_addtme,a_addip,a_agtnme) values("&a_uid&",'"&a_unme&"','"&a_prd&"',"&a_pid&","&a_afftpe&",'"&a_ttl&"','"&a_cnt&"',0,'','"&now()&"','"&request.servervariables("remote_addr")&"','"&a_agtnme&"')"
//selffinish值 0表示未完成，1表示完成，2表示在处理中。
conn.execute query,1,1
query="select @@identity as lstid"
rs1.open query,conn,1,1
if not rs1.eof  then
lstid=rs1("lstid")
else
		call errorpage(-2,"系统发生意外错误，请联系本站管理人员，谢谢！(104)")

end if
rs1.close
end function


'''''''''''''''''''''''''''''''''''''''''''''''邮件发送

function jmailsend(mail_receive,topic,mailbody,ifhtml) ' 邮件发送程序(发信站点ID，收信人，主题，内容，是否html)
on error resume next
jmailsend=true
mailserver=pl_emlsvr
sendmail=pl_emlmbx
smtppass=pl_emlpss
mailname=pl_emlnme
smtpauth=pl_emlath'true(1)则需要认证，否则不认证 
if chk_email(sendmail)=false or mail_receive="" or mailserver="" then
jmailsend=false
exit function
end if
if ifhtml="1" then
ifhtml=true
elseif ifhtml=true then
ifhtml=true
else
ifhtml=false
end if
		if ifhtml=true then
mailbody=html_encode(mailbody)
end if
smtppass=getoutcodelong(smtppass)
Set msg = Server.CreateObject("JMail.Message")
		msg.silent = false
		msg.Logging = true
		msg.Charset = "so-8859-1"
		msg.ContentTransferEncoding="base64"
		if smtpauth then
		msg.MailServerUserName =sendmail  
		msg.MailServerPassword = smtppass 
		end if
		msg.From = sendmail    '  发件人 
		msg.FromName =mailname
if instr(mail_receive,",")>0 then  '收件人
mail_rec=split(mail_receive,",")
msg.AddRecipient   mail_rec(0)
for i=1 to ubound(mail_rec)
msg.AddRecipientBcc   mail_rec(i)
next
else
msg.AddRecipient   mail_receive
end if
		msg.Subject = topic     '  主题
		if ifhtml=true then
		msg.Body="请使用html格式阅读此邮件，谢谢！"&vbcrlf
		mailbody="<html><body><div style='font-size:12px;line-height:150%'>"&mailbody&"</div></body></html>"
		msg.appendhtml(mailbody)
		else
		msg.Body  =mailbody
		end if
		sendok=msg.Send (mailserver)   '  smtp服务器地址
		set msg = nothing
		jmailsend=sendok
		err.clear
end function

function jmail_feedback(byval tomail,byval mailtag,byval paras,byval ifhtml) ' 邮件发送程序(发信站点ID，收信人，主题，内容，是否html)
on error resume next
jmail_feedback=true
mailserver=pl_emlsvr
sendmail=pl_emlmbx
smtppass=pl_emlpss
mailname=pl_emlnme
smtpauth=pl_emlath'true(1)则需要认证，否则不认证 
if chk_email(sendmail)=false or tomail="" or mailserver="" or mailtag="" then
jmail_feedback=false
exit function
end if
query="select * from emlmod where ms_mod='"&mailtag&"'"
rs2.open query,conn,1,1
if rs2.eof then
jmail_feedback=false
exit function
end if
ms_ifhtm=rs2("ms_ifhtm")
if ms_ifhtm="1" then
ms_ttl=html_encode(rs2("ms_ttl"))
ms_bdy=html_encode(rs2("ms_bdy"))
else
ms_ttl=rs2("ms_ttl")
ms_bdy=rs2("ms_bdy")
end if
rs2.close
if ms_ifhtm="1" then
ifhtml=true
else
ifhtml=false
end if
query="select * from emlmod where ms_mod='sign'"
rs2.open query,conn,1,1
if not rs2.eof then
if ms_ifhtm="1" then
signature=html_encode(rs2("ms_bdy"))
else
signature=rs2("ms_bdy")
end if
end if
rs2.close
if paras<>"" then
bdy_paras=split(paras,Vend)
for i=0 to ubound(bdy_paras)-1
bdy_para_nme=left(bdy_paras(i),instr(bdy_paras(i),":")-1)
bdy_para_value=replace(bdy_paras(i),bdy_para_nme&":","")
ms_bdy=replace(ms_bdy,"["&bdy_para_nme&"]",bdy_para_value)
next
end if
ms_bdy=replace(ms_bdy,"[C]",signature)
Set msg = Server.CreateObject("JMail.Message")
		msg.silent = false
		msg.Logging = true
		msg.Charset = "so-8859-1"
		msg.ContentTransferEncoding="base64"
smtppass=getoutcodelong(smtppass)
		if smtpauth then
		msg.MailServerUserName =sendmail  
		msg.MailServerPassword = smtppass 
		end if
		msg.From = sendmail    '  发件人 
		msg.FromName =mailname


if instr(tomail,",")>0 then  '收件人，多个用,号分开
mail_rec=split(tomail,",")
msg.AddRecipient   mail_rec(0)
for i=1 to ubound(mail_rec)
msg.AddRecipientBcc   mail_rec(i)
next
else
msg.AddRecipient   tomail
end if

		msg.Subject = replace(ms_ttl,"[pl_stenme]",pl_stenme)     '  主题
		if ifhtml=true then
		msg.Body="请使用html格式阅读此邮件，谢谢！"&vbcrlf
		ms_bdy="<html><body><div style='font-size:12px;line-height:150%'>"&ms_bdy&"</div></body></html>"
		msg.appendhtml(ms_bdy)
		else
		msg.Body  =ms_bdy
		end if
		sendok=msg.Send (mailserver)   '  smtp服务器地址
		set msg = nothing
		jmail_feedback=sendok
		err.clear
end function

function pss_mak(byVal maxLen)

Dim strNewPass
Dim whatsNext, upper, lower, intCounter
Randomize

For intCounter = 1 To maxLen
whatsNext = Int((1 - 0 + 1) * Rnd + 0)
If whatsNext = 0 Then
upper = 90
lower = 65
Else
upper = 57
lower = 48
End If
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
pss_mak = strNewPass
end function
function getfnc(byval fnc)
fnc=cstr(fnc)
if left(fnc,1)="." then
fnc="0" &fnc
end if
if instr(fnc,".")<=0 then
fnc=fnc&".00"
end if
getfnc=fnc
end function

function getpassoutcode(byval password)
    substrContent = "entryclass:sys2_mng"&Vend
   substrContent =substrContent& "entrytype:getoutcode"&Vend
   substrContent =substrContent& "entryuser:"&pl_usrnme_sys&Vend
   query="select * from memlst where u_nme='"&pl_usrnme_sys&"'"
   rs2.open query,conn,1,1
   if not rs2.eof then
   pl_usrpss_sys=trim(rs2("u_pss"))
   end if
   rs2.close
   substrContent =substrContent& "entrypass:"&pl_usrpss_sys&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "keywords:" &password & Vend
   substrContent = substrContent & "." & Vend
wstr=hzsocket(substrContent)
getpassoutcode=wstr
end function

function getoutcodelong(byval password)
    substrContent = "entryclass:sys2_mng"&Vend
   substrContent =substrContent& "entrytype:getoutcodelong"&Vend
   substrContent =substrContent& "entryuser:"&pl_usrnme_sys&Vend
   query="select * from memlst where u_nme='"&pl_usrnme_sys&"'"
   rs2.open query,conn,1,1
   if not rs2.eof then
   pl_usrpss_sys=trim(rs2("u_pss"))
   end if
   rs2.close
   substrContent =substrContent& "entrypass:"&pl_usrpss_sys&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "keywords:" &password & Vend
   substrContent = substrContent & "." & Vend
wstr=hzsocket(substrContent)
getoutcodelong=wstr
end function

Function SafeRequest(ParaName) 
Dim ParaValue 
ParaValue=Request(ParaName)
if IsNumeric(ParaValue)  then
SafeRequest=ParaValue
exit Function

else
ParaValuetemp=lcase(ParaValue)
tempvalue="select |insert |delete from|'|count(|drop table|update |truncate  |asc(|mid(|char(|xp_cmdshell|exec master|net localgroup administrators|net user| or | and |%20from"
temps=split(tempvalue,"|")
for mycount=0 to ubound(temps)
if  Instr(ParaValuetemp,temps(mycount)) > 0 then
		call errorpage(-2,"非法请求！！！")
		response.end
end if
next
SafeRequest=ParaValue
end if
End function

Function SafeRequestform(ParaName) 
Dim ParaValue 
ParaValue=request.form(ParaName)
if IsNumeric(ParaValue)  then
SafeRequestform=ParaValue
exit Function
else
ParaValuetemp=lcase(ParaValue)
tempvalue="select |insert |delete from|'|count(|drop table|update |truncate  |asc(|mid(|char(|xp_cmdshell|exec master|net localgroup administrators|net user| or | and |%20from"
temps=split(tempvalue,"|")
for mycount=0 to ubound(temps)
if  Instr(ParaValuetemp,temps(mycount)) > 0 then
		call errorpage(-2,"非法请求！！！")
		response.end
end if
next
SafeRequestform=ParaValue
end if
End function

function yarlst(byval selectname,byval tagvalue,byval thenumber)
if thenumber="1" then
thenumber=""
end if
response.write "<select name="&selectname &">"
					for uv=5 to ubound(tmenmes)
					response.write "<option value="&uv
					if  cint(tagvalue)=uv then
					response.write " selected  style='background:#958471' "
					else
					response.write " style='background:#BBB0A4' "
					end if
					response.write ">"&thenumber&tmenmes(uv)&"</option>"
					 next
response.write "</select>"
end function
function tmelst(byval selectname,byval tagvalue)
response.write "<select name="&selectname &">"
					for uv=0 to ubound(tmenmes)
					response.write "<option value="&uv
					if  cint(tagvalue)=uv then
					response.write " selected  style='background:#958471' "
					else
					response.write " style='background:#BBB0A4' "
					end if
					response.write ">"&tmenmes(uv)&"</option>"
					 next
response.write "</select>"
                     
end function
function mynum(byval thenum)
if thenum<>"" then
mynum=FormatNumber(thenum, 2, True, False,false)
end if
end function
Function get_cst(ByVal g_tmetpe, ByVal p_tmetpe, ByVal years, ByVal p_yar, ByVal g_prc)
On Error Resume Next
g_tmetpe = CInt(g_tmetpe)
p_tmetpe = CInt(p_tmetpe)
years = CDbl(years)
p_yar = CDbl(p_yar)
g_prc = CDbl(g_prc)

Select Case g_tmetpe
Case 0
    If p_tmetpe = 0 Then
       get_cst = years * g_prc * p_yar
    ElseIf p_tmetpe = 1 Then
       get_cst = years * g_prc * p_yar * 7
    ElseIf p_tmetpe = 2 Then
       get_cst = years * g_prc * p_yar * 30
    ElseIf p_tmetpe = 3 Then
       get_cst = years * g_prc * p_yar * 91
    ElseIf p_tmetpe = 4 Then
       get_cst = years * g_prc * p_yar * 182
    ElseIf p_tmetpe = 5 Then
       get_cst = years * g_prc * p_yar * 365
    Else
       get_cst = years * g_prc * p_yar
    End If
Case 1
    If p_tmetpe = 0 Then
       get_cst = years * g_prc * p_yar / 7
    ElseIf p_tmetpe = 1 Then
       get_cst = years * g_prc * p_yar
    ElseIf p_tmetpe = 2 Then
       get_cst = years * g_prc * p_yar * 4.23
    ElseIf p_tmetpe = 3 Then
       get_cst = years * g_prc * p_yar * 13
    ElseIf p_tmetpe = 4 Then
       get_cst = years * g_prc * p_yar * 26
    ElseIf p_tmetpe = 5 Then
       get_cst = years * g_prc * p_yar * 52
    Else
       get_cst = years * g_prc * p_yar
    End If
Case 2
    If p_tmetpe = 0 Then
       get_cst = years * g_prc * p_yar / 30
    ElseIf p_tmetpe = 1 Then
       get_cst = years * g_prc * p_yar / 4.23
    ElseIf p_tmetpe = 2 Then
       get_cst = years * g_prc * p_yar
    ElseIf p_tmetpe = 3 Then
       get_cst = years * g_prc * p_yar * 3
    ElseIf p_tmetpe = 4 Then
       get_cst = years * g_prc * p_yar * 6
    ElseIf p_tmetpe = 5 Then
       get_cst = years * g_prc * p_yar * 12
    Else
       get_cst = years * g_prc * p_yar
    End If
Case 3
    If p_tmetpe = 0 Then
       get_cst = years * g_prc * p_yar / 91
    ElseIf p_tmetpe = 1 Then
       get_cst = years * g_prc * p_yar / 13
    ElseIf p_tmetpe = 2 Then
       get_cst = years * g_prc * p_yar / 3
    ElseIf p_tmetpe = 3 Then
       get_cst = years * g_prc * p_yar
    ElseIf p_tmetpe = 4 Then
       get_cst = years * g_prc * p_yar * 2
    ElseIf p_tmetpe = 5 Then
       get_cst = years * g_prc * p_yar * 4
    Else
       get_cst = years * g_prc * p_yar
    End If
Case 4
    If p_tmetpe = 0 Then
       get_cst = years * g_prc * p_yar / 182
    ElseIf p_tmetpe = 1 Then
       get_cst = years * g_prc * p_yar / 26
    ElseIf p_tmetpe = 2 Then
       get_cst = years * g_prc * p_yar / 6
    ElseIf p_tmetpe = 3 Then
       get_cst = years * g_prc * p_yar / 2
    ElseIf p_tmetpe = 4 Then
       get_cst = years * g_prc * p_yar
    ElseIf p_tmetpe = 5 Then
       get_cst = years * g_prc * p_yar * 2
    Else
       get_cst = years * g_prc * p_yar
    End If
Case 5
    If p_tmetpe = 0 Then
       get_cst = years * g_prc * p_yar / 365
    ElseIf p_tmetpe = 1 Then
       get_cst = years * g_prc * p_yar / 52
    ElseIf p_tmetpe = 2 Then
       get_cst = years * g_prc * p_yar / 12
    ElseIf p_tmetpe = 3 Then
       get_cst = years * g_prc * p_yar / 4
    ElseIf p_tmetpe = 4 Then
       get_cst = years * g_prc * p_yar / 2
    ElseIf p_tmetpe = 5 Then
       get_cst = years * g_prc * p_yar
    Else
       get_cst = years * g_prc * p_yar
    End If
Case Else
    get_cst = years * g_prc * p_yar

End Select
get_cst = FormatNumber(get_cst, 2, True, False, False)
get_cst = CDbl(get_cst)
End Function
Function get_yarcnt(ByVal years, ByVal p_yar, ByVal p_tmetpe)
On Error Resume Next
p_tmetpe = CDbl(p_tmetpe)
years = CDbl(years)
p_yar = CDbl(p_yar)

Select Case p_tmetpe
Case 0
  tempvalue = years * p_yar / 365
Case 1
  tempvalue = years * p_yar / 365 * 7
Case 2
  tempvalue = years * p_yar / 12
Case 3
  tempvalue = years * p_yar / 4
Case 4
  tempvalue = years * p_yar / 2
Case 5
  tempvalue = years * p_yar
Case Else
  tempvalue = years * p_yar
End Select
  get_yarcnt = FormatNumber(tempvalue, 2, True, False)
  get_yarcnt = CDbl(get_yarcnt)
End Function
%>
<script language="javascript">
function showurl(url)
{
if (top.showurlinfrm_dtl)
{
if ( ! top.canResize )
			{
				parent.parent.frm_btm.chgfrm() ;
				parent.frm_dtl.location.href=url;
			}
else
parent.frm_dtl.location.href=url;			
}
else
location.href=url;
}
function confirmit()
{
if(confirm("是否确认此操作？"))
return true;
else
return false;
}
function tourl(myurl)
{
if(confirm("是否确认此操作？"))
location.href=myurl;
else
return false;
}

</script>

