<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla1<>1 then
response.write "<script>alert('操作权限出错，您没有权限操作些功能');history.go(-1);</Script>"
Response.End 
end if%>
<%cha=request("cha")
if request("Submit")="删 除" then    '共删除 13 项

id=replace(request("id")," ","")
id=split(id,",")
set Fs = Server.CreateObject("Scripting.FileSystemObject")
set rs=Server.CreateObject("Adodb.Recordset")
for i=0 to UBound(id)

sql="select * from dlxf_news where dlxf_yp_id="&id(i)
rs.open sql,conn,1,1
if not rs.eof then
filename="../../html/news/"&year(rs("dlxf_date"))&month(rs("dlxf_date"))&"/"&replace(replace(replace(rs("dlxf_date"),"-",""),":","")," ","")&".html"
If Fs.FileExists(server.mappath(filename)) Then
set Os = Fs.GetFile(server.mappath(filename))
Os.Delete
end if
conn.execute("delete from dlxf_xxnews where dlxf_yp_id=" & rs("dlxf_id"))
end if
rs.close

sql="select * from dlxf_news where dlxf_yp_id="&id(i)
rs.open sql,conn,1,1
if not rs.eof then
filename="../../html/xxnews/"&year(rs("dlxf_date"))&month(rs("dlxf_date"))&"/"&replace(replace(replace(rs("dlxf_date"),"-",""),":","")," ","")&".html"
If Fs.FileExists(server.mappath(filename)) Then
set Os = Fs.GetFile(server.mappath(filename))
Os.Delete
end if
conn.execute("delete from dlxf_xxnews where dlxf_yp_id=" & rs("dlxf_id"))
end if
rs.close

conn.execute("delete from dlxf_cp where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_cp_sort where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_Job_zp where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_sca where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_exhibit where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_collection where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_collection_sort where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_friend where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_upfile where dlxf_yp_id=" & id(i))
conn.execute("delete from dlxf_leaveword where dlxf_book_ypid=" & id(i))
conn.execute("delete from dlxf_message where dlxf_yp_id="&id(i)&" or dlxf_send_id=" & id(i))

'===================================================================

sql="select * from dlxf_yp where dlxf_id="& id(i)
rs.open sql,conn,1,1
if not rs.eof then
userfolder="../../UserDocument/"&rs("dlxf_user")
end if
rs.close

If Fs.folderExists(server.mappath(userfolder)) Then
Fs.DeleteFolder(server.mappath(userfolder))
end if

conn.execute("delete from dlxf_yp where dlxf_id=" & id(i))
'===================================================================
next
set rs=nothing
set fs=nothing

elseif request("Submit")="审 核" then
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
conn.execute("update dlxf_yp set dlxf_key=1 where dlxf_id="&id(i))
next

end if

if request("action")="key" then

conn.execute("update dlxf_yp set dlxf_key1="&request("key")&" where dlxf_id="&request("id"))
conn.execute("update dlxf_cp set dlxf_key2="&request("key")&" where dlxf_yp_id="&request("id"))
conn.execute("update dlxf_job_zp set dlxf_key2="&request("key")&" where dlxf_yp_id="&request("id"))
conn.execute("update dlxf_news set dlxf_key2="&request("key")&" where dlxf_yp_id="&request("id"))
conn.execute("update dlxf_xxnews set dlxf_key2="&request("key")&" where dlxf_yp_id="&request("id"))
conn.execute("update dlxf_sca set dlxf_key2="&request("key")&" where dlxf_yp_id="&request("id"))
conn.execute("update dlxf_exhibit set dlxf_key2="&request("key")&" where dlxf_yp_id="&request("id"))

end if%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>
<script>
function oa_tool1(){
window.parent.mm.rows="20,200,10,*";
}
</script>
<%=citycss%>
<body style="margin:5">
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#6C90D1" bordercolordark="#FFFFFF">
<form name="form1" method="post">
<tr align=center bgcolor=#D6DFF7><td height=25 align=center><input type="text" name="word">　　<input type="submit" name="Submit" value="企业搜索">　<a href="yp.asp?cha=yes">10天内到期</a>　<a href="yp.asp?key1=false">已关闭</a>　<a href="yp.asp?key2=0">待审</a>　<a href="yp.asp?key2=4">待邮件确认</a>　<a href="yp.asp?key2=1">正常</a>　<a href="yp.asp?key2=2">到期</a>　<a href="yp.asp?key2=3">推荐</a>　<a href="yp.asp">所有</a></td></tr>
<tr align=center bgcolor=#D6DFF7><td height=25 align=center>
<a href="yp.asp?vip=1">VIP申请中</a>
<a href="yp.asp?vip=2">VIP正式</a>
<a href="yp.asp?vip=3">试用申请中</a>
<a href="yp.asp?vip=4">试用正试</a>
<a href="yp.asp?vip=5">普通申请中</a>
<a href="yp.asp?vip=6">普通正试</a>
</td></tr>
</form>
</table>
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#6C90D1" bordercolordark="#FFFFFF">
<form name="from1" method="post" action="yp.asp?word=<%=request("word")%>&vip=<%=request("vip")%>&cha=<%=request("cha")%>&chag=<%=request("chag")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>">
<tr align=center bgcolor=#D6DFF7>
<%if request("word")<>"" then
sql= "select *  from dlxf_yp where dlxf_coname like'%"&request("word")&"%' order by dlxf_id desc"
elseif request("vip")<>"" then
sql="select * from dlxf_yp where dlxf_vip="&request("vip")&" and (dlxf_key=1 or dlxf_key=3) and dlxf_ktdate>"&dlxf_citytime&" order by dlxf_id desc"
elseif request("cha")<>"" then
sql= "select *  from dlxf_yp where dlxf_ktdate<("&dlxf_citytime&"+10) and (dlxf_ktdate-"&dlxf_citytime&")>0 order by dlxf_id desc"
elseif request("key1")<>"" then
sql="select *  from dlxf_yp where dlxf_key1=0 order by dlxf_id desc"
elseif request("key2")<>"" then
sql="select *  from dlxf_yp where dlxf_key="&request("key2")&" order by dlxf_id desc"
else
sql="select *  from dlxf_yp order by dlxf_id desc"
end if
set rs=server.createobject("adodb.recordset")                     
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
	response.write "暂无内容"
else  
'分页的实现 
listnum=22
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
 <td width="4%" height=22>编号</td>
 <td>企业名称<font color=red>(点击修改)</font></td>
 <td width="4%">来源</td>
 <td width="4%">查看</td>
 <td width="7%">登录/点击</td>
 <td width="9%">开始时间</td>
 <td width="9%">到期时间</td>
 <td width="8%">剩余时间</td>
 <td width="4%">状态</td>
 <td width="4%">操作</td>
 <td width="4%">管理</td>
 <td width="4%">选择</td>
</tr>
<%do while not rs.eof and i<listnum
n=n+1
zdate=cdate(year(rs("dlxf_date"))&"-"&month(rs("dlxf_date"))&"-"&day(rs("dlxf_date")))
ktdate=cdate(year(rs("dlxf_ktdate"))&"-"&month(rs("dlxf_ktdate"))&"-"&day(rs("dlxf_ktdate")))
ksdate=cdate(year(rs("dlxf_ksdate"))&"-"&month(rs("dlxf_ksdate"))&"-"&day(rs("dlxf_ksdate")))
tian=ktdate-date()
ztian=ktdate-ksdate
page=request("page")
if page="" then page=1
vip=rs("dlxf_vip")
if vip=1 then
aaa="<font color=red>[VIP申请中]</font>"
elseif vip=2 then
aaa="<font color=red><strong>[VIP会员]</strong></font>"
elseif vip=3 then
aaa="<font color=green>[试用申请中]</font>"
elseif vip=4 then
aaa="<font color=green><strong>[试用会员]</strong></font>"
elseif vip=5 then
aaa="<font color=blue>[普通申请中]</font>"
elseif vip=6 then
aaa="<font color=blue><strong>[普通会员]</strong></font>"
end if 
%>
<tr align=center height=22>
 <td><%=n%></td>
 <td align=left>&nbsp;<a href=chkadmin.asp?user=<%=rs("dlxf_user")%>&pass=<%=rs("dlxf_pass")%>><%=rs("dlxf_coname")%></a> <%=aaa%></td>
 <td><%if rs("dlxf_enrol")=0 then%>前台<%elseif rs("dlxf_enrol")=1 then%><font color=blue>代理</font><%end if%></td>
<%goname=rs("dlxf_user")
goid=rs("dlxf_id")%>
<!--#include file="../../dns/dns.asp"-->
 <td><a href="<%=usertwourl%>" target=_blank>查看</a></td>
 <td><%=rs("dlxf_loginhtc")%><font color=red>|</font><%=rs("dlxf_htc")%></td>
 <td><%=ksdate%></td>
 <td><font title="<%="注册时间："&rs("dlxf_date")&vbcrlf&"开始时间："&rs("dlxf_ksdate")&vbcrlf&"结束时间："&rs("dlxf_ktdate")%>"><%=ktdate%></font></td>
<%if tian<=10 and tian>=0 then
stian="<strong><font color=red>"&tian&"</font></strong>"
elseif tian<0 then
stian="<strong><font color=blue>-</font></strong>"
else
stian="<strong>"&tian&"</strong>"
end if%>
 <td title="剩余天数/服务天数<%=vbCrLf%>“-”表示已过期"><%=stian%>/<%=ztian%></td>
 <td><%if rs("dlxf_key")=0 then%><font color=ff9900>待审</font><%elseif rs("dlxf_key")=1 then%>正常<%elseif rs("dlxf_key")=2 then%><font color=red>到期</font><%elseif rs("dlxf_key")=3 then%><font color=green>推荐</font><%elseif rs("dlxf_key")=4 then%><font color=blue>邮件</font><%end if%></td>
 <td><a href=lx.asp?id=<%=rs("dlxf_id")%> onClick="oa_tool1()" target=top>操作</a></td>
 <td><%if rs("dlxf_key1")=1 then%><a href=yp.asp?id=<%=rs("dlxf_id")%>&key=0&action=key&cha=<%=request("cha")%>&chag=<%=request("chag")%>&word=<%=request("word")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>&page=<%=page%>>开通</a><%else%><a href=yp.asp?id=<%=rs("dlxf_id")%>&key=1&action=key&cha=<%=request("cha")%>&chag=<%=request("chag")%>&word=<%=request("word")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>&page=<%=page%>><font color=red>关闭</font></a><%end if%></td>
 <td><input type="checkbox" name="ID" value="<%=rs("dlxf_id")%>" style="border:0"></td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<tr>
<%filename="yp.asp?word="&request("word")&"&vip="&request("vip")&"&cha="&request("cha")&"&chag="&request("chag")&"&key1="&request("key1")&"&key2="&request("key2")&""%>
<td colspan=12 height=20 align=right bgcolor=#6C90D1><%=Rs.recordcount%> 个企业&nbsp;&nbsp;<%=listnum%> 个企业/页&nbsp;&nbsp;共 <%=Rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>><strong>|<<</strong></a>&nbsp; 
      <a href=<%=filename%>&page=<%=page-1%>><strong><<</strong></a>&nbsp; 
      <a href=<%=filename%>&page=<%=page-1%>><b>[<%=page-1%>]</b></a>&nbsp; 
      <%end if%><% if Rs.pagecount=1 then %><%else%><b>[<%=page%>]</b><%end if%>
	  <% if Rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>&page=<%=page+1%>><b>[<%=page+1%>]</b></a>&nbsp; 
      <a href=<%=filename%>&page=<%=page+1%>><strong>>></strong></a>&nbsp; 
      <a href=<%=filename%>&page=<%=Rs.pagecount%>><strong>>>|</strong></a>&nbsp; 
	  <%end if%>　<input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form)" style="border:0">全选
<%if request("key2")="0" then%> <input type="button" name="Submit" value="审 核">
<%else%> <input type="button" name="Submit" value="审 核" disabled>
<%end if%>
　<input type="button" name="Submit" value="删 除">
&nbsp;&nbsp;</td>
<%end if%></tr>
</form>
</table>
