<!--#include virtual="/incs/config.asp"-->
<!--#include virtual="/incs/web_top.asp"-->
<%
chk_log_usr()
''''''''''''''''''''''''''''''''
querytype=SafeRequest("querytype")
if chk_int(querytype)=false then
   ErrMsg="<font color=#ff0000>对不起</font>，非法操作！..."
elseif querytype=2 then
    qu1=SafeRequest("qu1")
    qu2=SafeRequest("qu2")
    qu3=SafeRequest("qu3")
    qu4=SafeRequest("qu4")
    qu5=SafeRequest("qu5")
    qu6=SafeRequest("qu6")				
    d1=dateserial(qu1,qu2,qu3)
    d2=dateserial(qu4,qu5,qu6)
	qstring=" and ( sq_addtme>='"&d1&"' and sq_addtme<='"&d2&"') "
elseif querytype=3 then
    qu1=SafeRequest("qu1")
    qu2=SafeRequest("qu2")
    qu3=SafeRequest("qu3")
    qu4=SafeRequest("qu4")
    qu5=SafeRequest("qu5")
    qu6=SafeRequest("qu6")				
    d1=dateserial(qu1,qu2,qu3)
    d2=dateserial(qu4,qu5,qu6)
	qstring=" and ( sq_exptme>='"&d1&"' and sq_exptme<='"&d2&"') "
elseif querytype=4 then
  qu1=SafeRequest("qu1")
	    qstring=" and (sq_nme like '%"&qu1&"%' or sq_ftpusr like '%"&qu1&"%' ) "

elseif querytype=5 then
  qu1=cint(SafeRequest("qu1"))
	    qstring=" and sq_regstt="&qu1&" "


elseif querytype=7 then
	 qstring=" and (sq_exptme-getdate()<30)"
elseif querytype=8 then
         datestring=date()
	 qstring=" and (sq_addtme-'"&datestring&"')>=0 "
elseif querytype=9 then
     weekd=weekday(now())
     datestring=date()-weekd+1
	 qstring=" and (sq_addtme-'"&datestring&"')>=0 "
elseif querytype=10 then
     weekd=weekday(now())
	 qstring=" and (sq_exptme-getdate())>=-"&weekd&" and (sq_exptme-getdate())<7-"&weekd&" "
elseif querytype=11 then
	 weekd=dateadd("m",1,now())-now()
	 weekd2=day(now())
	 qstring="and (sq_exptme-getdate())>=-"&weekd2&" and (sq_exptme-getdate())<"&weekd&"-"&weekd2&" "
elseif querytype=21 then
         qu1=trim(SafeRequest("qu1"))
		 if qu1="" then
		      call errorpage(-2,"对不起，请输入IP地址!")

		 end if
	 qstring=" and sq_svrip='"&qu1&"' "
end if 
qu7=trim(SafeRequest("qu7")) 
if qu7<>"" then
qstring2=" and memlst.sq_unme='"&qu7&"'"
end if 
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
perpage=SafeRequest("perpage")
if chk_int(perpage)=false then
perpage=10
end if 
perpage=clng(perpage)
if perpage>50  then
perpage=50
end if
ThePage=0
page=0
rcount=0
thepage=0
'''''''''''''''''''''''''''''''''
ordernum=SafeRequest("ordernum")
if chk_int(ordernum)=true then
if ordernum=11 then
orderstring=" sq_ftpusr asc"
elseif ordernum=12 then
orderstring=" sq_ftpusr desc"
elseif ordernum=21 then
orderstring=" sq_svrip asc"
elseif ordernum=22 then
orderstring=" sq_svrip desc"
elseif ordernum=31 then
orderstring=" sq_addtme asc"
elseif ordernum=32 then
orderstring=" sq_addtme desc"
elseif ordernum=41 then
orderstring=" sq_exptme asc"
elseif ordernum=42 then
orderstring=" sq_exptme desc"
elseif ordernum=51 then
orderstring=" sq_prd asc"
elseif ordernum=52 then
orderstring=" sq_prd desc"
elseif ordernum=61 then
orderstring=" sq_regstt asc"
elseif ordernum=62 then
orderstring=" sq_regstt desc"
elseif ordernum=71 then
orderstring=" sq_yarcnt asc"
elseif ordernum=72 then
orderstring=" sq_yarcnt desc"
elseif ordernum=81 then
orderstring=" sq_unme asc"
elseif ordernum=82 then
orderstring=" sq_unme desc"
else
end if
else
ordernum=32
orderstring=" sq_addtme desc"
end if
'''''''''''''''''''''''''''''''''''''''''

query="select * from v_sqllst  where sq_unme='"&session("usrname")&"'  "&qstring&qstring2&"  order by "&orderstring
rs.open query,conn,1,1
if rs.RecordCount<=0 then
          ErrMsg="<font color=#ff0000>对不起</font>，没有搜索到符合条件的域名记录！..."
	
	   else
	      rcount=rs.recordcount
	      rs.pagesize=perpage
		  ThePage=rs.pagecount
		  if Chk_Int(SafeRequest("page"))=false then
		  page=1
		  else
		   page=cint(SafeRequest("page"))
		    if page<=0  then
		       page=1
		    elseif page>ThePage then
		       page=ThePage
		    end if	  
		  end if
		    rs.absolutepage=page
       end if   

%>
<script language="javascript">
<!--

function tofirst()
{searchform.page.value=1;
searchform.submit();
 }
  function toprev()
{searchform.page.value-=1;
searchform.submit();
 }
  function tonext()
{
searchform.page.value=<%=page%>-1+2;
searchform.submit();
 }
  function tolast()
{searchform.page.value=<%=ThePage%>;
searchform.submit();
 }
 function toorder(ordn)
{searchform.ordernum.value=ordn;
searchform.page.value=1;
searchform.submit();
 }

function deleteit(proid)
{
if (confirm("确认删除此数据库吗？"))
{location.href="/control/sql_mng/sql_del.asp?dbname="+proid;
}
}
 //-->
 </script>
      <table cellspacing=0 cellpadding=0 width="100%" border=0>
        <tbody> 
        <tr> 
          <td colspan=2><img height=3 
            src="/imgs/spacer.gif" width=3></td>
        </tr>
        <tr> 
          
          
          <td width=438 
          background=/imgs/bg_inside_pages_link.jpg 
          height=30><img height=11 
            src="/imgs/aword_square.gif" width=11 
            align=absMiddle> <a href="/">首 页</a> <strong>&gt;</strong> <a href="/control/">管理中心</a> 
            <b>&gt;</b> <a href="/control/sql_mng/sql_lst.asp">数据库管理</a></td>
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td colspan=2><img height=10 
            src="/imgs/shadow_inside_pages.jpg" 
        width=438></td>
        </tr>
        </tbody>
      </table>
 <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD vAlign=top width=180 bgColor=#f3f3f3><!--#include virtual="/incs/control_left.asp"-->
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
          </TD>
          <TD vAlign=top width=10 
          background=/imgs/bg_inside_pages_block.jpg><IMG 
            height=1 src="/imgs/bg_inside_pages_block.jpg" 
            width=10></TD>
          <TD vAlign=top> 
            <table cellspacing=2 cellpadding=0 width="100%" border=0>
              <tbody> 
              <tr> 
                <td  colspan=2 valign="middle">
                  <table class=line cellspacing=0 cellpadding=0 width="98%" 
                  border=0 align="center">
                    <tbody> 
                    <tr> 
                      <td valign=bottom width="25%" height=20><font color="#000000" class=ddropshadow><b><span class=enbold><strong><font color="#000000">数据库列表<a href="index.asp"><font color="#FF0000">（查询）</font></a></font></strong></span></b></font></td>
                      <td valign=bottom noWrap align=right 
                        width="75%"><a href="sql_lst.asp?querytype=8"><font color="#000000">今天新开通</font></a> 
                        <font color="#000000">|</font> <a href="sql_lst.asp?querytype=9"><font color="#000000">本周新开通</font></a> 
                        <font color="#000000">|</font> <a href="sql_lst.asp?querytype=10"><font color="#000000">本周到期</font></a> 
                        <font color="#000000">| </font><a href="sql_lst.asp?querytype=11"><font color="#000000">本月到期</font></a></td>
                    </tr>
                    <tr> 
                      <td align=middle width="100%" colspan=2 height=5></td>
                    </tr>
                    <tr> 
                      <td align=middle width="100%" colspan=2 height=2 bgcolor="#5F5F5F"></td>
                    </tr>
                    </tbody> 
                  </table>
                  <br>
                </td>
              </tr>
              <tr> 
                <td  colspan=2 valign="middle" height="28">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tbody> 
  <form action=sql_lst.asp method=post name=searchform2>
          <tr> 
            <td height=20 width="119">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=qu1 value="<%=qu1%>">
                <input type=hidden name=qu2 value="<%=qu2%>">
                <input type=hidden name=qu3 value="<%=qu3%>">
                <input type=hidden name=qu4 value="<%=qu4%>">
                <input type=hidden name=qu5 value="<%=qu5%>">
                <input type=hidden name=qu6 value="<%=qu6%>">
                <input type=hidden name=qu7 value="<%=qu7%>">
                <input type=hidden name=qu8 value="<%=qu8%>">
                <input type=hidden name=querytype value="<%=querytype%>">
                <input type=hidden name=perpage value="<%=perpage%>">
				<input type=hidden name=ordernum value="<%=ordernum%>">
                <%=page_turn%></div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select name="page" onChange="javascript:document.searchform2.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %> 
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>

                  
                  <table border=0 cellpadding=2 
                        cellspacing=1 bordercolordark="#FFFFFF" align="center" width="98%" bgcolor="#666666">
                    <tbody> 
                    <form action="sql_lst.asp" method=post>
                      <tr bgcolor="#8b8b8b" > 
                        <td height="26" width="6%" align=center> 
                          <div align="center"><font color="#FFFFFF">序号</font></div>
                        </td>
                        <%
			if ordernum=11 then
			odr1=12
			else
			odr1=11
			end if
			if ordernum=21 then
			odr2=22
			else
			odr2=21
			end if
			if ordernum=31 then
			odr3=32
			else
			odr3=31
			end if
			if ordernum=41 then
			odr4=42
			else
			odr4=41
			end if
			if ordernum=51 then
			odr5=52
			else
			odr5=51
			end if
			if ordernum=61 then
			odr6=62
			else
			odr6=61
			end if
			if ordernum=71 then
			odr7=72
			else
			odr7=71
			end if
			if ordernum=81 then
			odr8=82
			else
			odr8=81
			end if
			%>
                        <td height="25 width="15%" align=center><a href="javascript:toorder(<%=odr1%>);"><font color=#000000><font color="#FFFFFF">数据库名</font></font></a></td>
                        <td height="25" width="16%" align=center ><a href="javascript:toorder(<%=odr2%>);"><font color=#000000><font color="#FFFFFF">IP地址</font></font></a></td>
                        <td height="25" width="10%" align=center ><a href="javascript:toorder(<%=odr8%>);"><font color=#000000><font color="#FFFFFF">用户名</font></font></a></td>
                        <td height="25" width="11%"  align=center><a href="javascript:toorder(<%=odr3%>);"><font color=#000000><font color="#FFFFFF">注册日期</font></font></a></td>
                        <td height="25" width="11%" align=center><a href="javascript:toorder(<%=odr4%>);"><font color=#000000><font color="#FFFFFF">到期日期</font></font></a></td>
                        <td height="25" width="7%" align=center><a href="javascript:toorder(<%=odr5%>);"><font color=#000000><font color="#FFFFFF">类型</font></font></a></td>
                        <td height="25" width="6%"align=center ><a href="javascript:toorder(<%=odr6%>);"><font color=#000000><font color="#FFFFFF">状态</font></font></a></td>
                        <td height="25" align=center><font color="#FFFFFF">操作</font></td>
                      </tr>
                      <%
		  i=1
	Do While Not rs.eof 
	%>
                      <tr bgcolor="#FFFFFF" > 
                        <td height="25"  align=center><%=i+perpage*(page-1)%></td>
                        <td height="25"  align=center bgcolor="#FFFFFF"><a href="sql_idx.asp?sqnme=<%=rs("sq_nme")%>" target=_self><b><font color=#000000 style="FONT-FAMILY: Tahoma,verdana,arial;"><u><%=rs("sq_ftpusr")%></u></font></b></a></td>
                        <td height="25"  align=center class=okk> <font color=#000000><%=rs("sq_svrip")%></font></td>
                        <td height="25"  align=center><%=rs("sq_unme")%></td>
                        <td height="25"  align=center> 
                          <% 
			Response.Write right(left(replace(rs("sq_addtme")," ","   "),10),8)
 %>
                        </td>
                        <td height="25"  align=center> 
                          <%
		If rs("sq_exptme")<> "" Then
			Response.Write right(left(replace(rs("sq_exptme")," ","   "),10),8)
		End If
		%>
                        </td>
                        <td height="25" align=center> <%=rs("sq_prd")%></td>
                        <td height="25"  align=center><%=showstatus(rs("sq_regstt"),rs("sq_regtpe") , left(replace( rs("sq_exptme")," ","   "),10) )%></td>
                        <td height="25"  align=center> 
                          <% 
			  if rs("sq_regtpe")=0 then %>
                          <input type="button" name="Submit3" value="转正" class=dud_button1 onclick="javascript:location.href='sql_try_pay.asp?proid=<%=trim(rs("sq_prd"))%>&sqnme=<%=rs("sq_nme")%>';">
                          <%elseif rs("sq_regstt")=0 then %>
                          <input type="button" name="Submit3" value="购买" class=dud_button1 onclick="javascript:location.href='/pdtshw/sqlshw/sql_pay.asp?sqnme=<%=rs("sq_nme")%>';">
                          <% elseif rs("sq_regstt")=1 then %>
                          <input type="button" name="Submit3" value="续费" class=dud_button1 onclick="javascript:location.href='sql_rnw.asp?sqnme=<%=rs("sq_nme")%>';">
                          <% end if %>
                          <% if rs("sq_regstt")=0 then
			  response.write "<input type=button class=dud_button1 name=abcd value='删除' onclick=""javascript:deleteit('"&rs("sq_nme")&"');"">"
			  end if %>
                        </td>
                      </tr>
                      <%
  rs.movenext
i=i+1
if i>perpage then
exit do
end if

  loop 
  	rs.close
  %>
                    </form>
                    </tbody> 
                  </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tbody> 
  <form action=sql_lst.asp method=post name=searchform>
          <tr> 
            <td height=20 width="120">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=qu1 value="<%=qu1%>">
                <input type=hidden name=qu2 value="<%=qu2%>">
                <input type=hidden name=qu3 value="<%=qu3%>">
                <input type=hidden name=qu4 value="<%=qu4%>">
                <input type=hidden name=qu5 value="<%=qu5%>">
                <input type=hidden name=qu6 value="<%=qu6%>">
                <input type=hidden name=qu7 value="<%=qu7%>">
                <input type=hidden name=qu8 value="<%=qu8%>">
                <input type=hidden name=querytype value="<%=querytype%>">
                <input type=hidden name=perpage value="<%=perpage%>">
                <input type=hidden name=ordernum value="<%=ordernum%>">
                <%=page_turn%>
              </div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select name="page" onChange="javascript:document.searchform.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %>
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>  <%
Function showstatus(regstt,regtpe,exptme)
if regstt=1 or regstt=2 then
if cdate(exptme)-date()<0 then
regstt=20
elseif cdate(exptme)-date()<7 and regtpe<>0 then
regstt=19
elseif cdate(exptme)-date()<30 and regtpe<>0 then
regstt=18
end if
end if
regtpe_str=right("000"&cstr(regtpe),2)
regstt_str=right("000"&cstr(regstt),2)
regtitle=showtitle(regtpe_str,regstt_str)
gifstr=regtpe_str&regstt_str&".gif"
showstatus="<img src=/icons/"&gifstr&" title="&regtitle&" style='cursor:hand;'>"   

End Function
function showtitle(regtpe_str,regstt_str)
tpestr=""
sttstr=""
select case  regtpe_str
case  "00"
tpestr="购买方式为试用"
case  "01"
tpestr="购买方式为正式购买"
case "05"
tpestr="购买方式为赠送"
case else
tpestr="购买方式为未知"
end select
select case  regstt_str
case  "00"
sttstr="运行状态为未开通"
case  "01"
sttstr="运行状态为运行中"
case  "02"
sttstr="运行状态为暂停中"
case  "03"
sttstr="运行状态为处理中"
case  "04"
sttstr="运行状态为已完全删除"
case  "05"
sttstr="运行状态为禁用中"
case  "06"
sttstr="运行状态为待开通"
case  "17"
sttstr="运行状态为WEB被删除/FTP保留"
case  "18"
sttstr="运行状态为30天后过期"
case  "19"
sttstr="运行状态为7天后过期"
case  "20"
sttstr="运行状态为已过期"
case  else
sttstr="运行状态为未知"
end select
showtitle=tpestr&","&sttstr
end function
%>
<br>
</td>
              </tr>
              </tbody> 
            </table>
          </TD>
        </TR></TBODY></TABLE>
      
	  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD bgColor=#cccccc><IMG height=1 
            src="/imgs/spacer.gif" 
      width=1></TD></TR></TBODY></TABLE>
<!--#include virtual="/incs/web_bottom.asp"-->