<!--#include file="top.asp"--><%usertopview%>
<%if userflag23=0 then
response.redirect"ok.asp?action=flag"
end if

if request("action")="sc" then
id=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_upfile where dlxf_yp_id="&session("id")&" and dlxf_sort=0 and dlxf_id="& id(i)
rs.open sql,conn,1,1
do while not rs.eof
pic="../"&rs("dlxf_fileadd")
If Fs.FileExists(server.mappath(pic)) Then
set Os = Fs.GetFile(server.mappath(pic))
Os.delete
end if
rs.movenext
loop
rs.close
conn.execute("delete from dlxf_upfile where dlxf_yp_id="&session("id")&" and dlxf_sort=0 and dlxf_id="& id(i)&" and dlxf_yp_id="&session("id"))
'=====================================
next
set rs=nothing
set fs=nothing
response.redirect"ok.asp?url=my_picture.asp"
end if%>
<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 language="JavaScript">
<!--
function checkdata() {
if( addform.dlxf_filename.value =="") {
alert("\上传文件出错，下面是产生错误的可能原因：\n\n·请输入文件名称")
return false;
}
return true;
}
// -->
</script>

<table width="760" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="150" valign=top bgcolor=#efefef>
<!--==============-->
<!--#include file="left.asp"-->
<!--==============-->
</td>
<td width="610" valign=top>
<!--==============-->
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height=25>您现在的位置是：我的公文包 > 我的图片</td></tr>
  <tr>
    <td>
<!--####################################-->
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor=#6C94D1>
  <tr>
    <td height=25 bgcolor=#6C94D1>　　<font color=white>上传图片</font></td>
  </tr>
  <tr>
    <td bgcolor=#ffffff height=25>
<!--======-->
<table width="80%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
  <td height=20>
<%filesize=conn.execute("select sum(dlxf_filesize) from [dlxf_upfile] where [dlxf_yp_id]="&session("id")&" and [dlxf_sort]=0")(0)
if filesize<>"" then filesize=filesize else filesize=0
if round(filesize/1024,2)<1 and  round(filesize/1024,2)<>0 then dlxf_filesize="0"&round(filesize/1024,2) else dlxf_filesize=round(filesize/1024,2)%>
<table width="100%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="addform" method="post" action="my_picture_Upload.asp" enctype="multipart/form-data">
<input name="dlxf_sort" type="hidden" value="0">
<input name="yysize" type="hidden" value="<%=filesize%>">

    <tr> 
      <td colspan="2" height="50"><p style="line-height:150%">可上传类型：<font color=red><%=Application("OKArpic")%></font><br>允许单个上传大小：<font color=red><%=OKsizepic/1024%> K</font><br>
文档总空间：<font color=red><%=userflag7%> K</font>　　已用空间：<font color=red><%=dlxf_filesize%> K</font></td>
    </tr>
    <tr> 
      <td width="21%" height="25" align="center">图片名称</td>
      <td width="79%">　<input type="text" name="dlxf_filename" class=input maxlength="30"></td>
    </tr>
    <tr> 
      <td height="25" align="center">选择地址</td>
      <td>　<input name="filedata" type="file" class="TextBoxT" id="filedata" size="30"></td>
    </tr>
    <tr align="center"> 
      <td colspan="2" height="25"><input type="submit" name="Submit" value="上 传" class=input1>　<input type="reset" name="Submit" value="重 设" class=input1></td>
    </tr>
  </form>
</table>
  
  </td>
</tr>
</table>
<!--======-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
  <tr>
    <td height=10></td>
  </tr>
  <tr>
    <td>
<!--####################################-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height=25 bgcolor=#6C94D1 style="border:1px #6c94d1 solid">　　<font color=white>文件管理</font></td>
  </tr>
  <tr>
    <td bgcolor=#ffffff height=25>
<!--======-->
<table width="100%" border="0" cellspacing="1" cellpadding="5" align=center bgcolor=#6C94D1>
<form name="from1" method="post" action="my_picture.asp?action=sc">
<tr bgcolor=#efefef align=center>
  <td width="6%"><img src="../img/islx.gif" align=absmiddle alt="文件属性"></td>
  <td width=*>文件名</td>
  <td width=11%>大小(K)</td>
  <td width="25%">上传时间</td>
  <td width="6%"><img src="../img/isok.gif" align=absmiddle alt="文件是否存在"></td>
  <td width="6%"><input name="chkall" type="checkbox" id="chkall" value="select" onclick="CheckAll(this.form)" style="border:0"></td>
</tr>
<%sql="select * from dlxf_upfile where dlxf_yp_id="&session("id")&" and dlxf_sort=0 order by dlxf_id desc"
set rs=server.createobject("adodb.recordset")                     
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
	response.write "<tr><td height=194 colspan=6 align=center bgcolor=#ffffff>暂无内容</td></tr>"
else  
'分页的实现 
listnum=10
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
do while not rs.eof and i<listnum%>
<tr bgcolor=#ffffff>
<%dlxf_fileadd=split(rs("dlxf_fileadd"),".")%>
  <td align=center><%set fs = Server.CreateObject("Scripting.FileSystemObject")
If Fs.fileExists(server.mappath("../img/images/"&dlxf_fileadd(1)&".gif")) Then
response.write "<img src=""../img/images/"&dlxf_fileadd(1)&".gif"" align=absmiddle alt='"&dlxf_fileadd(1)&" 文件格式'>"
else
response.write "<img src=""../img/images/x.gif"" align=absmiddle alt='"&dlxf_fileadd(1)&" 文件格式'>"
end if%></td>
  <td><a href="<%="../"&rs("dlxf_fileadd")%>" target=_blank><%=rs("dlxf_filename")%></a></td>
<%dlxf_filesize=round(rs("dlxf_filesize")/1024,2)%>
  <td align=right><%if dlxf_filesize<1 then response.write "0"&dlxf_filesize else response.write dlxf_filesize%></td>
  <td><%=rs("dlxf_date")%></td>
  <td align=center><%If Fs.fileExists(server.mappath("../"&rs("dlxf_fileadd"))) Then
response.write "<img src=../img/isok.gif align=absmiddle alt='此文件存在'>"
end if
set fs =nothing%></td>
  <td align=center><input type="checkbox" name="ID" value="<%=rs("dlxf_id")%>" style="border:0"></td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<%filename="my_picture.asp"%>
<tr><td colspan=6 align=right bgcolor=#efefef height=20>共 <%=Rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>>|<<</a>
      <a href=<%=filename%>?page=<%=page-1%>><<</a>
      <a href=<%=filename%>?page=<%=page-1%>>[<%=page-1%>]</a>
<%end if%><% if Rs.pagecount=1 then %>
<%else%>[<%=page%>]
<%end if%>
	  <% if Rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>?page=<%=page+1%>>[<%=page+1%>]</a>
      <a href=<%=filename%>?page=<%=page+1%>>>></a>
      <a href=<%=filename%>?page=<%=Rs.pagecount%>>>>|</a>
	  <%end if%> <input type="submit" name="Submit" value="删 除" class=input1 style="height:18"></td>
<%end if%></tr>
</form>
</table>
<!--======-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
</table>
<!--####################################-->
	</td>
  </tr>
</table>
<!--==============-->
</td>
</tr>
</table>
<!--====== bottom ========-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="img/bottom_bg.gif">
<tr><td height=2 bgcolor=#6C94D1></td></tr>
  <tr>
    <td align="center" height=80><%=citybottom%></td>
  </tr>
</table>
</body>
</html>