<!--#include virtual="/incs/config.asp" -->
<!--#include virtual="/incs/top.asp" -->


<%chk_log()%>
<%
chk_newpwr 1,2,1

if session("agentname")<>"" and  mid(session("oldpower"),7,1)<>"1" then
call errorpage(-2,"对不起，您没有产品管理权限")
end if

conn.open constr
dbname=trim(SafeRequestform("dbname"))
sqnme=dbname
module=trim(SafeRequestform("module"))
if dbname=""  then
call errorpage(-2,"对不起，请选择需要操作的数据库！")
end if
if module="" or  isnull(module) then
call errorpage(-2,"对不起，请选择需要操作的类型！")
end if
module=lcase(module)
if session("sysclass")>=5 then
query="select * from v_sqllst   where sq_nme ='"&sqnme&"'"
elseif session("sysclass")>=4 then
query="select * from v_sqllst  where sq_nme ='"&sqnme&"'  and  ((("&session("sysarestr")&" or u_myare=0) and u_rotnme='') or u_rotnme='"&session("usrname")&"')"
else
query="select * from v_sqllst   where sq_nme ='"&sqnme&"' sq_unme='"&session("usrname")&"'"
end if
rs.open query,conn,1,1
if rs.recordcount<>1 then
call errorpage(-2,"对不起，该数据库不存在！")
response.end 
else
if session("sysclass")<=4 then
if  rs("sq_regstt")<>1  and rs("sq_regstt")<>2 and rs("sq_regstt")<>5 then
call errorpage(-2,"对不起，该数据库没有开通！")
end if
end if
end if
sqid=rs("sq_id")
rs.close
select case module
case "sql_regstt"
   substrContent = "entryclass:sql_mng"&Vend
   substrContent =substrContent& "entrytype:sql_regstt"&Vend
   substrContent =substrContent& "entryuser:"&entryuser&Vend
   substrContent =substrContent& "entrypass:"&entrypass&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "dbname:" & dbname & Vend
   substrContent = substrContent & "sq_regstt:" & trim(SafeRequestform("sq_regstt")) & Vend
   substrContent = substrContent & "oldstatus:" & trim(SafeRequestform("oldstatus")) & Vend
   substrContent = substrContent & "." & Vend
      turnurl= "/master/pdtmng/sql_mng/sql_idx.asp?sqnme=" & sqnme
case "sql_pss"
   substrContent = "entryclass:sql_mng"&Vend
   substrContent =substrContent& "entrytype:sql_pss"&Vend
   substrContent =substrContent& "entryuser:"&entryuser&Vend
   substrContent =substrContent& "entrypass:"&entrypass&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "dbname:" & dbname & Vend
   substrContent = substrContent & "sq_pss:" & trim(SafeRequestform("sq_pss")) & Vend
   substrContent = substrContent & "." & Vend
      turnurl= "/master/pdtmng/sql_mng/sql_idx.asp?sqnme="&sqnme
case "sql_ftppss"
   substrContent = "entryclass:sql_mng"&Vend
   substrContent =substrContent& "entrytype:sql_ftppss"&Vend
   substrContent =substrContent& "entryuser:"&entryuser&Vend
   substrContent =substrContent& "entrypass:"&entrypass&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "dbname:" & dbname & Vend
   substrContent = substrContent & "sq_ftppss:" & trim(SafeRequestform("sq_ftppss")) & Vend
   substrContent = substrContent & "." & Vend
      turnurl= "/master/pdtmng/sql_mng/sql_idx.asp?sqnme="&sqnme

'''''''''''''''''''''''''''''''

case "sql_ftpstt"
   substrContent = "entryclass:sql_mng"&Vend
   substrContent =substrContent& "entrytype:sql_ftpstt"&Vend
   substrContent =substrContent& "entryuser:"&entryuser&Vend
   substrContent =substrContent& "entrypass:"&entrypass&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "dbname:" & dbname & Vend
   substrContent = substrContent & "sq_ftpstt:" & trim(SafeRequestform("sq_ftpstt")) & Vend
   substrContent = substrContent & "." & Vend

   turnurl= "/master/pdtmng/sql_mng/sql_idx.asp?sqnme="&sqnme
case "sql_bkp"
   substrContent = "entryclass:sql_mng"&Vend
   substrContent =substrContent& "entrytype:sql_bkp"&Vend
   substrContent =substrContent& "entryuser:"&entryuser&Vend
   substrContent =substrContent& "entrypass:"&entrypass&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "dbname:" & dbname & Vend
   substrContent = substrContent & "sq_bkpnum:" & trim(SafeRequestform("sq_bkpnum")) & Vend
   substrContent = substrContent & "." & Vend

   turnurl= "/master/pdtmng/sql_mng/sql_idx.asp?sqnme="&sqnme
case "sql_rst"
   substrContent = "entryclass:sql_mng"&Vend
   substrContent =substrContent& "entrytype:sql_rst"&Vend
   substrContent =substrContent& "entryuser:"&entryuser&Vend
   substrContent =substrContent& "entrypass:"&entrypass&Vend
   substrContent =substrContent& "agentname:"&agentname&Vend
   substrContent = substrContent & "dbname:" & dbname & Vend
   substrContent = substrContent & "sq_bkpnum:" & trim(SafeRequestform("sq_bkpnum")) & Vend
   substrContent = substrContent & "." & Vend

   turnurl= "/master/pdtmng/sql_mng/sql_idx.asp?sqnme="&sqnme

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
end select

   doresult = hzsocket(substrContent)

   left5=left(doresult,5)
   If left5= "10000" Then
      call okpage( turnurl)
   Else
      call errorpage(-2,doresult)
   end if

 ''''''''''''''''''''''''''''''''''''''''''''''''''''

%>

