<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
|
<%Session.CodePage=65001%>
|
<!--include virtual="/inc/chkadmin.gds"-->
|
<!--#include file='upfileconfig.asp'-->
|
<%
|
PicLinkDatabase = request("PicLinkDatabase")
|
PicLinkDataname = request("PicLinkDataname")
|
PicLinkDataID = request("PicLinkDataID")
|
PICs = request("PICs")
|
PicUp = request("PicUp")
|
|
if PICs="" then
|
PICs=1
|
else
|
PICs=cint(PICs)
|
end If
|
if PicAlbumsID="" then PicAlbumsID=0
|
|
'删除图片
|
DelID = request("DelID")
|
if DelID<>"" then
|
sql="delete from GBR.dbo.Picture where PicID="&DelID
|
objConn.Execute sql
|
end if
|
'删除图片End
|
%>
|
<title>图片管理页面</title>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<style type="text/css">
|
BODY{
|
BACKGROUND-COLOR: #FFFFFF;
|
font-size:9pt
|
}
|
TABLE.Form TD
|
{
|
padding-left:5px;
|
line-height: 20px;
|
background-color:#FFFFFF;
|
font-family:宋体;
|
font-size: 9pt;
|
}
|
.tx1 { height: 20px;font-size: 9pt; border: 1px solid; border-color: #000000; color: #0000FF}
|
.tx2 { font-size: 9pt}
|
</style>
|
</head>
|
<body bgcolor="#d6dff7" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="Menu">
|
<%
|
'On Error Resume Next
|
Server.ScriptTimeOut=999999
|
response.write request("act")
|
if request("act")="upload" Then
|
|
savepath=Server.MapPath("/"&UploadFilePath)
|
'savepath=UploadFilePath
|
'创建文件夹
|
set MyFile=server.CreateObject("Scripting.FileSystemObject")
|
ymd = year(now) & month(now)
|
savepath = savepath & "\" & ymd & "\"
|
filepath = UploadFilePath & "/" & ymd
|
If Not MyFile.FolderExists(savepath) Then
|
MyFile.CreateFolder(savepath)
|
End If
|
CreateFolder(savepath)
|
Set Upload=Server.CreateObject("Persits.Upload")
|
Upload.SetMaxSize UploadLimitSize*1024, True
|
Upload.OverwriteFiles = false
|
if Request.QueryString("PID") = "" then
|
Upload.ProgressID="010D60EB00C5AA4B"
|
else
|
Upload.ProgressID=Request.QueryString("PID")
|
end if
|
Count=Upload.Save(savepath)
|
If Err.Number <> 0 Then
|
Response.Write "<div style=""color:red;font-size:12px;"">出现错误: " & Err.Number & "、" & Err.Description &"<a href=""javascript:history.go(-1)"">重新上传</a></div>"
|
End If
|
If Err.Number = 8 Then
|
Response.Write "<div style=""color:red;font-size:12px;"">你上传的文件超过限制("& UploadLimitSize/1024 &"M)<a href=""javascript:history.go(-1)"">重新上传</a></div>"
|
response.end
|
end If
|
TotalBytesint=UploadLimitSize
|
|
'上传文件
|
dim inputname
|
dim size,rs_upfile
|
For Each File in Upload.Files
|
if not CanUpload(File.ext) then
|
File.Delete
|
response.write "<div style=""color:red;font-size:12px;"">"&file.filename &"("& file.size &") 格式不正确!<a href=""javascript:history.go(-1)"">重新上传</a></div>"
|
Else
|
'文件重命名
|
dim NewName
|
NewName = year(now())&month(now())&day(now())&hour(now())&minute(now())&second(now())&File.ext
|
File.Move savepath & "\" & NewName
|
formPath=savepath&"\"
|
filename=NewName
|
|
'-------自动压缩图片 720*720 -------
|
W = cint(720)
|
H = cint(720)
|
Call BuildSmallPic(formPath&filename, formPath&filename, W, H, 80)
|
|
'-------------end--------------------
|
|
'写入数据库
|
sql="Insert into Picture (PicLinkDatabase,PicLinkDataname,PicLinkDataID,PicAlbumsID,PicUp,PicURL,PicAdminID,PicTotalBytes) values ('"&PicLinkDatabase&"','"&PicLinkDataname&"',"&PicLinkDataID&","&PicAlbumsID&","&PicUp&",'"&filepath&"/"&filename&"','"&session("adminID")&"',"&TotalBytesint&")"
|
'Response.Write sql
|
'objConn.Execute sql
|
end if
|
next
|
end if%>
|
|
<%
|
Set rs = Server.CreateObject("ADODB.Recordset")
|
i=0
|
If 1=2 then
|
sql="select * from GBR.dbo.Picture WHERE PicLinkDatabase='"&PicLinkDatabase&"' and PicLinkDataname='"&PicLinkDataname&"' and PicLinkDataID="&PicLinkDataID&" order by PicUp"
|
'rs.open sql,objConn,1,1
|
|
if not rs.eof then Response.Write "<tr>"
|
do while not rs.eof
|
PicID = rs("PicID")
|
PicURL= rs("PicURL")
|
PicUp = rs("PicUp")
|
i=i+1
|
if i=5 or i=10 or i=15 or i=20 then Response.Write "</tr><tr>"
|
%>
|
<td class="tx2">
|
<a href="/<%=PicURL%>" target="_blank"><img src="/<%=PicURL%>" height="100" border="0"></a>
|
<br>[<a href="upload_products.asp?PicLinkDatabase=<%=PicLinkDatabase%>&PicLinkDataname=<%=PicLinkDataname%>&PicLinkDataID=<%=PicLinkDataID%>&PICs=<%=PICs%>&DelID=<%=PicID%>"><font color="#000000">删除图片</font></a>]
|
<br>
|
</td>
|
<%
|
rs.MoveNext
|
loop
|
rs.close()
|
|
if i<0 then Response.Write "</tr>"
|
End If
|
%>
|
|
<%if i<PICs Then%>
|
|
|
|
|
<tr><FORM NAME="MyForm" method="post" ENCTYPE="multipart/form-data" ACTION="?act=upload&PicLinkDatabase=<%=PicLinkDatabase%>&PicLinkDataname=<%=PicLinkDataname%>&PicLinkDataID=<%=PicLinkDataID%>&PicUp=<%=PicUp+1%>&PICs=<%=PICs%>">
|
<td class="tx2" colspan="<%=i%>">
|
<INPUT NAME="FILE1" TYPE="FILE" SIZE="16"> <input name="Submit" type="submit" value="上传图片" onclick="return chk()">
|
[<a href="upload_products.asp?filename=/TVupfile/LOGO.jpg"><font color="#000000">不使用图片</font></a>]
|
</td>
|
</FORM>
|
</tr>
|
<%end if%>
|
</table>
|
|
</body>
|
</html>
|