<!--#include file="up.inc"-->
<!--#include file="../ubb/ubb.asp" -->
<!--#include file="../Connections/sale.asp" -->
<%
call up()
sub up()
Server.ScriptTimeOut=5000
dim upload,file,formElement,formFile,iCount,fileExt,formPath,filename,c_yn,objFSO,newscontent,newstitle
iCount=0
set upload = new sjCat_upload
Set file = upload.file("fname")
filename = ""
if trim(upload.Form("G_Total"))="" or trim(upload.Form("G_LeasePrice"))="" or trim(upload.Form("G_Subscription"))="" or trim(upload.Form("G_Content"))="" or trim(upload.Form("G_Title"))="" or trim(upload.Form("G_Name"))="" then
dd="\n"
aa=""
if trim(upload.Form("G_Total"))="" then
aa=aa+"请输入商品数量!"+dd
end if
if trim(upload.Form("G_LeasePrice"))="" then
aa=aa+"请输入租借价格!"+dd
end if
if trim(upload.Form("G_Subscription"))="" then
aa=aa+"请输入租借订金"+dd
end if
if trim(upload.Form("G_Content"))="" then
aa=aa+"请不要输入空格!"+dd
end if
if trim(upload.Form("G_Title"))="" then
aa=aa+"请不要输入空格!"+dd
end if
if trim(upload.Form("G_Name"))="" then
aa=aa+"请不要输入空格!"+dd
end if
response.Write("<SCRIPT>alert('")
response.Write(aa)
response.write"');history.back();</SCRIPT>"
response.end()
end if
if file.filesize>=0.1 then
fileExt=lcase(right(file.filename,4))
if fileExt<>".jpg" then
response.Write("文件格式不对,请重新上传!")
response.End()
end if
'response.write file.filesize &file.filename
if file.filesize > 5*1024000 then '这是5M的图片大小数据
'response.write "<font size=2>图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.Write("<script language='javascript'>alert('片大小超过了限制,请重新上传!');</script>")
response.Redirect("index.asp#send" )
end if
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&fileExt
if file.FileSize>0 then
file.Save2File Server.mappath("file") & "\" & FileName
iCount=iCount+1
end if
end if
dim scatid,scatsonid,scatsonidsub,scatsonidsubsub
scatid=upload.Form("catid")
scatsonid=upload.Form("catsonid")
scatsonidsub=upload.Form("catsonidsub")
scatsonidsubsub=upload.Form("catsonidsubsub")
if scatsonidsubsub<>0 then
scatid=scatsonidsub
scatsonid=scatsonidsubsub
elseif scatsonidsub<>0 then
scatid=scatsonid
scatsonid=scatsonidsub
elseif scatsonid<>0 then
scatid=scatsonid
else
scatsonid=scatid
end if
set a=server.createobject("ADODB.recordset")
sqlstr="select G_Title,G_Name,G_LeasePrice,G_Subscription,SO_ID,G_Content,G_Pic,G_IsOnShell,G_Total,G_IsOnLease,SU_ID,SH_ID from goods"
a.open sqlstr,MM_data_STRING,3,2
a.addnew
a("G_Title")=trim(upload.Form("G_Title"))
a("G_Name")=trim(upload.Form("G_Name"))
a("G_LeasePrice")=trim(upload.Form("G_LeasePrice"))
a("G_Subscription")=trim(upload.Form("G_Subscription"))
a("SO_ID")=scatsonid
a("G_Content")=trim(upload.Form("G_Content"))
if FileName<>""then
a("G_Pic")=FileName
end if
a("G_Total")=trim(upload.Form("G_Total"))
a("G_IsOnLease")=1
a("G_IsOnShell")=0
a("SU_ID")=session("SUID")
a("SH_ID")=session("SH_ID")
a.update()
a.close()
set file=nothing
set upload=Nothing
set a=nothing
response.Redirect("shellup.asp")
end sub
%>