<!--#include file = "../inc/dbconn.asp"-->
<!--#include file = "CheckLogin.asp"-->
<!--#include file = "../inc/cache.asp"-->
<!--#include file = "../inc/function.asp"-->
<% LOADING_BUFFER_INI %>
<% LOADING_ADMIN_HEAD %>
<% call dbconn %>
<script language="Javascript">
function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=no,menubar=no,frameborder=0,status=yes' );
}
function openpath()
{ 
openScript('../upload.asp',400,100); 
}
</script>
<%
if gqv("do") = "Del" then
    if not Check_Popedom("H601") then call alertbox("你没有权限操作",2)
	conn.execute("delete * from SJ654_Biz where ID=" & ChkNum(gqv("id")))
	call alertbox("恭喜!删除成功!",2)
elseif gqv("do") = "AddSave" then
	if gfv("BizName") = "" then
		call alertbox("[文件名称]不能为空!",2)
	elseif gfv("Bizurl") = "" then
		call alertbox("[目标路径]不能为空!",2)
	elseif gfv("BizPath") = "" then
		call alertbox("[本地路径]不能为空!",2)
	elseif gfv("BizLevel") = "" then
		call alertbox("[授权等级]不能为空!",2)
	end if
	dim rs,sql
	set rs = server.createobject(G_654_RS)
	    sql = "select top 1 * from SJ654_Biz"
	    rs.open sql,conn,1,3
	    rs.addnew
	    rs("SJ_Name") = gfv("BizName")
	    rs("SJ_Url") = gfv("Bizurl")
	    rs("SJ_Path") = gfv("BizPath")
	    rs("SJ_Level") = gfv("BizLevel")
        rs.update
	    rs.close:set rs = nothing
	call alertbox("添加成功!",2)
elseif gqv("do") = "editSave" then
	if gfv("BizName") = "" then
		call alertbox("[文件名称]不能为空!",2)
	elseif gfv("Bizurl") = "" then
		call alertbox("[目标路径]不能为空!",2)
	elseif gfv("BizPath") = "" then
		call alertbox("[本地路径]不能为空!",2)
	elseif gfv("BizLevel") = "" then
		call alertbox("[授权等级]不能为空!",2)
	end if
	set rs = server.createobject(G_654_RS)
	sql = "select top 1 * from SJ654_Biz where ID=" & trim(gfv("ID")) & ""
	rs.open sql,conn,1,3
	if not rs.eof then
	    rs("SJ_Name") = gfv("BizName")
	    rs("SJ_Url") = gfv("Bizurl")
	    rs("SJ_Path") = gfv("BizPath")
	    rs("SJ_Level") = gfv("BizLevel")
        rs.update
	    rs.close:set rs = nothing
		call alertbox("恭喜!修改成功!",2)
	else
		call alertbox("抱歉!填写错误!",2)
	end if
end if 
' *** ***  www.654.cn  *** ***
    LINE "<table width=""99%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
    LINE "<tr>"
    LINE "<td align=""center""><B>VIP客户管理界面</B></td>"
    LINE "</tr>"
    LINE "<tr>"
    LINE "<td class=""tbl_head""><a href=""TJ_Biz.asp?do=addBiz"">商业授权识别码登记</a> | <a href=""SJ_Biz.asp"">升级路径设置</a> | <a href=""SJ_Biz.asp?do=addBiz"">添加路径</a></td>"
    LINE "</tr>"
    LINE "</table>"
    LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
    LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
    LINE "<tr height=""30"" class=""tbl_head"">"
    LINE "<td width=""5%"">ID</td>"
    LINE "<td width=""15%"">文件名称</td>"
	LINE "<td width=""25%"">目标路径</td>"
	LINE "<td width=""25%"">本地路径</td>"
	LINE "<td width=""10%"">授权等级</td>"
	LINE "<td width=""10%"">修改</td>"
	LINE "<td width=""10%"">删除</td>"
    LINE "</tr>"
  	dim ors
	set ors = new cls_vbspage
	set ors.conn = conn
	with ors
		.pagesize = 20
		.pagename = "page"
		.dbtype = "ac"
		.rectype = 0
		.jsurl = "../inc"
		.pkey = "ID"
		.field = "ID,SJ_Name,SJ_Url,SJ_Path,SJ_Level"
		.table = "SJ654_Biz"
		.condition = "ID > 0" '&tmp_Type
		.orderby = "ID desc"
	end with
	dim ireccount,irs
		ireccount = ors.reccount()
		irs = ors.resultset()
	if ireccount < 1 then
	LINE "<tr>"
	LINE "<td bgcolor=""#ffffff"" align=""center""  height=""30"" colspan=""7""><font color=""red"">暂时没有添加路径</font></td>"
	LINE "</tr>"
	else
	dim i
	for i = 0 to ubound(irs,2)
    LINE "<tr>"
    LINE "<td bgcolor=""#ffffff"">"&irs(0,i)&"</td>"
    LINE "<td bgcolor=""#ffffff"">"&irs(1,i)&"</td>"
    LINE "<td bgcolor=""#ffffff"">"&irs(2,i)&"</td>"
    LINE "<td bgcolor=""#ffffff"">"&irs(3,i)&"</td>"
    LINE "<td bgcolor=""#ffffff"">"&irs(4,i)&"</td>"
	LINE "<td bgcolor=""#ffffff""><input name=""submit1"" type=""button"" value=""编辑"" onclick=""window.location.href('?do=editBiz&id=" & irs(0,i) & "');""></td>"
    LINE "<td bgcolor=""#ffffff""><input name=""submit2"" type=""button"" value=""删除"" onclick=""if(confirm('确定要删除此ip段吗?')){window.location.href('?do=Del&id=" & irs(0,i) & "');}""></td>"
    LINE "</tr>"
    next
	LINE "<tr>"
	%><td bgcolor="#ffffff" align="right" height="30" colspan="7"><% = ors.showpage() %></td><%
	LINE "</tr>"
	end if
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
' *** ***  www.654.cn  *** ***
select case gqv("do")
	case "editBiz"
        if not Check_Popedom("H601") then call alertbox("你没有权限操作",2)
	    Call editBiz
	    Call cursor("#editBiz",0)
	case "addBiz"
        if not Check_Popedom("H601") then call alertbox("你没有权限操作",2)
	    Call addBiz
	    Call cursor("#addBiz",0)
end select
' *** ***  www.654.cn  *** ***
Sub addBiz()
	LINE "<a name=""addBiz""></a>"
	LINE "<form name=""form"" action=""?do=AddSave"" method=""post"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td width=""10%"" align=""center"" height=""30"" colspan=""2"" class=""tbl_top0"">商业授权路径登记</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">文件名称:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""BizName"" type=""text"" style=""width:200px;"">&nbsp;<font color=""red"">必填</font>(例：login.asp</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">目标路径:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""BizUrl"" type=""text"" style=""width:200px;"">&nbsp;<font color=""red"">必填</font>(例：admin/)</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">本地路径:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""BizPath"" type=""text"" style=""width:200px;"">&nbsp;<font color=""red"">必填</font>(例：admin/</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">授权等级:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%"">"
	LINE "<select name=""BizLevel"">"
	LINE "<option value=""0"">普通客户</option>"
	LINE "<option value=""1"">收费客户</option>"
	LINE "</select></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td align=""right"" bgcolor=""#ffffff""></td>"
	LINE "<td bgcolor=""#ffffff"">"
	LINE "<input name=""submit1"" type=""submit"" value=""确定添加"" onclick=""this.disabled=true;document.form.submit();"">&nbsp;"
	LINE "<input name=""submit2"" type=""reset"" value=""重新填写"">&nbsp;"
	LINE "<input name=""submit3"" type=""button"" value=""返回"" onclick=""window.history.back();"">"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</form>"
End Sub 
' *** ***  www.654.cn  *** ***
Sub editBiz()
	dim rs,databox
	set rs = conn.execute("select top 1 * from SJ654_Biz where ID=" & ChkNum(gqv("id")))
	if rs.eof then
		rs.close:set rs = nothing
		call alertbox("抱歉!系统没有找到相关记录!",2)
	else
		databox = rs.getrows()
		rs.close:set rs = nothing
	end if
	LINE "<a name=""editBiz""></a>"
	LINE "<form name=""form"" action=""?do=editSave"" method=""post"">"
	LINE "<input name=""ID"" type=""hidden"" value=""" & ChkNum(gqv("id"))&""">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td width=""10%"" align=""center"" height=""30"" colspan=""2"" class=""tbl_top0"">商业授权路径登记</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">文件名称:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""BizName"" type=""text"" value=""" & databox(1,0) & """  style=""width:200px;"">&nbsp;<font color=""red"">必填</font>(例：login.asp</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">目标路径:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""BizUrl"" type=""text"" value=""" & databox(2,0) & """  style=""width:200px;"">&nbsp;<a href=""JavaScript:openpath()"">选择路径</a></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">本地路径:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""BizPath"" type=""text"" value=""" & databox(3,0) & """  style=""width:200px;"">&nbsp;<font color=""red"">必填</font>(例：admin/</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">授权等级:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%"">"
	dim tempstr01,tempstr02
	if databox(4,0) = 0 then tempstr01 = "selected"
	if databox(4,0) = 1 then tempstr02 = "selected"
	LINE "<select name=""BizLevel"">"
	LINE "<option value=""0"" "&tempstr01&">普通客户</option>"
	LINE "<option value=""1"" "&tempstr02&">收费客户</option>"
	LINE "</select></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td align=""right"" bgcolor=""#ffffff""></td>"
	LINE "<td bgcolor=""#ffffff"">"
	LINE "<input name=""submit1"" type=""submit"" value=""保存修改"" onclick=""this.disabled=true;document.form.submit();"">&nbsp;"
	LINE "<input name=""submit2"" type=""reset"" value=""重新填写"">&nbsp;"
	LINE "<input name=""submit3"" type=""button"" value=""返回"" onclick=""window.history.back();"">"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</form>"
	databox = ""
End Sub %>
<% LOADING_ADMIN_FOOT %>
