 <!--#include file="conn.asp"-->
<%
'检查访问的来源是否合法
call checkPrePage()
	
'检查用户访问的权限,只有付费用户才能使用
strM_ID=Trim(Session("UserID"))
strCurrUserName=Trim(Session("UserName"))
strGBName=strCurrUserName
pn=instr(strCurrUserName,"_")
if pn>0 then
	strGBName=left(strCurrUserName,pn-1)
end if

strSQL="Select m_regdate,m_expire,m_landLogin from member Where  m_name='" & strGBName & "'"
rs.open strSQL,conn,1,1
	regdate=rs("m_regdate")
	expire=rs("m_expire")
rs.close

'如果不是付费会员，不能使用
if Not(DateDiff("d",regdate,expire)>7 And DateDiff("d",date,expire)>=0) then
	 ShowMsg "对不起，您不是付费用户，不享受此服务，谢谢光临!"
end if

Set fs = Server.CreateObject( Const_ScriptFileSystem )
strFilter="conn.asp,HtmlEdit.asp,const.asp,editor.asp,ProductList.asp,default.asp"				'指定不能编辑的文件

'删除文件
'-------------------------------------------------------------------------------------
if GetFormVariable("txtaction")="dele" then

	strDeleFiles=GetFormVariable("isDel")
	Set UserFolder=fs.GetFolder(Server.MapPath( "home/" & strCurrUserName))
	For Each objTextFile In UserFolder.Files
		'删除文件
		if (Lcase(Right(objTextFile.Name,4))=".htm" Or Lcase(Right(objTextFile.Name,4))=".asp" Or Lcase(Right(objTextFile.Name,5))=".html") And Instr(strFilter,objTextFile.Name)<=0 And Instr(strDeleFiles,objTextFile.Name)>0 then
			objTextFile.Delete(true)
		end if
	next
end if


%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电子商务自助建站--您理想的助手</title>
<link href="common/styleMain.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function DeleUser(){
	if(!confirm('确定要删除选择的文件吗？　')){
		return false;
	}
	else{
		form1.txtaction.value="dele";
		return true;
	}
}

function CheckAll(objCheck,isChecked){
	if (objCheck==null) return false;
		if (objCheck.length==null){
			objCheck.checked=isChecked;
		}
		else
		{
			for(i=0;i<objCheck.length;i++){
				objCheck[i].checked=isChecked;
			}
		}
}
</script>
</head>
<body leftmargin="0" topmargin="0">
<%
if Trim(request.Cookies("FirstTime"))="" Then
%>
<script language="JavaScript">
alert("警告：\n本功能进行的操作在网站重新生成时有可能造成数据丢失。请慎用！\n如果造成数据丢失请赶快点文件名后面的“还原”按钮。");
</script>
<%
	Response.Cookies("FirstTime")=date
End if
%>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/top.asp"-->
          </td>
        </tr>
        <tr> 
          <td height="100%" align="center" valign="top">
<TABLE class=table002 cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
                <TR> 
                  <!--左边开始-->
                  <TD width="20%" align=right vAlign=top> <!--#include file="common/left.asp" --> </TD>
                  <!--左边结束-->
                  <TD width="2%" background="images/rowline.gif">&nbsp;</TD>
                  <!--右边开始-->
                  <TD vAlign=top align=center width="78%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td><form name="form1" method="post" action="?action=dele">
                            <TABLE width="100%" height="100%" border=0 cellPadding=6 cellSpacing=0>
                              <TBODY>
                                <TR> 
                                  <TD vAlign=top align=left bgColor=#ffffff><strong><font color="#FF0000">全站编辑</font></strong>
                                    <input name="txtaction" type="hidden" id="txtaction">
                                    <BR> <HR SIZE=1> 
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td> 
                                          <table width="573" height="51" border="0" cellpadding="2" cellspacing="1" bgcolor="#5F8AC5">
                                            <tr bgcolor="#5F8AC5"> 
                                              <td width="32" height="25" align="center"><b><font color="#FFFFFF" face=verdana>序号</font></b></td>
                                              <td width="125" align="center" bgcolor="#5F8AC5"><font color="#FFFFFF"><b>文件名</b></font></td>
                                              <td width="69" align="center"><strong><font color="#FFFFFF">文件大小</font></strong></td>
                                              <td width="130" align="center"><font color="#FFFFFF"><strong>修改时间</strong></font></td>
                                              <td width="79" align="center"><font color="#FFFFFF"><strong>说明</strong></font></td>
                                              <td width="40" align="center"><font color="#FFFFFF"><strong>还原</strong></font></td>
                                              <td width="62" align="center"> <font color="#FFFFFF"> 
                                                <input type="submit" name="submit3" value="删除" onClick="return DeleUser()">
                                                </font></td>
                                            </tr>
                                            <%
										 '循环输出
										Set UserFolder=fs.GetFolder(Server.MapPath( "home/" & strCurrUserName))
										i=0

										For Each objTextFile In UserFolder.Files
											'检查只能编辑WEB文件
											if (Lcase(Right(objTextFile.Name,4))=".htm" Or Lcase(Right(objTextFile.Name,4))=".asp" Or Lcase(Right(objTextFile.Name,5))=".html") And Instr(strFilter,objTextFile.Name)<=0 then
												if i mod 2=0 then
													strColor="#F8F8F8"
												else
													strColor="#fFfFfF"
												end if
												i=i+1

										 %>
                                            <tr bgcolor="<%=strColor%>"> 
                                              <td height="25" align="center"><%=i%></td>
                                              <td><a href="Admin_Editor.asp?File=<%=objTextFile.Name%>" target="_blank" title="点击进入编辑"><%=objTextFile.Name%></a></td>
                                              <td><%
											  if objTextFile.Size>1024 then
											  	response.Write Int((objTextFile.Size/1024)*100)/100
												response.Write(" KB")
											  else
												response.Write("0")
											  	response.Write Int((objTextFile.Size/1024)*100)/100
												response.Write(" KB")
											  end if
											  
											  %></td>
                                              <td align="center"><%=objTextFile.DateLastModified%></td>
                                              <td> <%
												strSQL="Select mn_name From menu Where m_id=" & strM_ID & " And mn_href='" & objTextFile.Name & "'"
												Set rsSub=Server.CreateObject("ADODB.RecordSet")
												rsSub.open strSQL,conn,1,1
												if rsSub.recordcount>0 then
													response.Write "<font color=red>" & Trim(rsSub("mn_name")) & "</font>"
												else
													response.Write("未知")
												end if
												rsSub.close
												Set rsSub=nothing
												%> </td>
                                              <td align="center"> 
                                                <%
												strSQL="Select id,e_edittime From EditFile Where m_id=" & strM_ID & " And e_file='" & objTextFile.Name & "'"
												Set rsSub=Server.CreateObject("ADODB.RecordSet")
												rsSub.open strSQL,conn,1,1
												if rsSub.recordcount>0 then
                                                 	response.Write "<a href=comeback.asp?id=" & rsSub("id") & " title=上次全站编辑时间:" & rsSub("e_edittime") & " target=BackFrame>[还原]</a>"
												end if
												rsSub.close
												Set rsSub=nothing
												%>
                                              </td>
                                              <td align="center"> <input type="checkbox" name="isDel" value="<%=objTextFile.Name%>"></td>
                                            </tr>
                                            <%
											end if
									  next
									  %>
                                          </table></td>
                                      </tr>
                                      <tr> 
                                        <td><table width="573" height="20" border="0" cellpadding="0" cellspacing="0">
                                            <tr> 
                                              <td width="504" height="25" align="right">&nbsp;</td>
                                              <td width="72">全选 <input name="chkAllDele" type="checkbox" id="chkAllDele" onClick="CheckAll(form1.isDel,this.checked)"> 
                                              </td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                    </table></TD>
                                </TR>
                              </TBODY>
                            </TABLE>
                          </form>
						 </td>
                      </tr>
                   <tr>
                        <td align="center">
                            <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#5F8AC5">
                              <tr bgcolor="#5F8AC5"> 
                                <td>&nbsp;<font color="#FFFFFF"><strong>上传文件</strong></font></td>
                              </tr>
                              <tr bgcolor="F9F9F9"> 
                                <td height="40" align="center" bgcolor="F9F9F9">
                            <form action="upsave.asp" method="post" enctype="multipart/form-data" name="XingerUPForm">
                                  <input type="file" name="FileFrom" size="50" maxlength="250">
                              <input type="submit" name="Submit" value="上传">  </form>
                                </td>
                              </tr>
                            </table>
                            <br>
                          </td>
                      </tr>
                    </table> 
                  </TD>
                </TR>
              </TBODY>
            </TABLE>
          </td>
        </tr>
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/bottom.asp"-->
		  </td>
        </tr>
      </table></td>
  </tr>
</table>
<iframe name="BackFrame" width="0" height="0" src="about:blank"></iframe>
</body>
</html>
<%
'清除aspcode表中1小时没用的记录
strSQL="Delete From aspcode Where DateDiff(hour,a_createtime,getdate())>=2"
conn.execute strSQL,0,1

set rs=nothing
conn.close
set conn=nothing
%>
