<!-- #include file="../conn.asp" -->
<!-- #include file="admin.asp" -->
<%Call Head()
call saycarda("添加文件")
%>


<%
Dim name,laiy,title,fileurl,ggss,lid,idd,size,pay,pic,green,very,ptid
name=trim(request.form("name"))
laiy=trim(request.form("laiy"))
title=trim(request.form("title"))
fileurl=trim(request.form("fileurl"))
pay=trim(request.form("pay"))
very=trim(request.form("very"))
pic=trim(request.form("pic"))
green=trim(request.form("green"))

ggss=trim(request.form("ggss"))
lid=trim(request("lid"))
idd=trim(request("idd"))
size=trim(request.form("size"))
ptid=trim(request.form("ptid"))

if name="" then
 Response.Write "名称不能为空！<br/>"
 Response.Write	"<anchor>返回上级<prev/></anchor> "
Call head1()
 response.end
 End if 

if title="" then
 Response.Write "说明不能为空！<br/>"
 Response.Write	"<anchor>返回上级<prev/></anchor> "
Call head1()
 response.end
 End if 

if fileurl="" then
 Response.Write "地址不能为空！<br/>"
 Response.Write	"<anchor>返回上级<prev/></anchor> "
Call head1()
 response.end
 End if 

 if laiy="" then
 Response.Write "来源不能为空！<br/>"
 Response.Write	"<anchor>返回上级<prev/></anchor> "
Call head1()
 response.end
 End if 




  if lid="" or idd="" then
 Response.Write "栏目类型出错！<br/>"
 Response.Write	"<anchor>返回上级<prev/></anchor> "
Call head1()
 response.end
 End if 


 if pay="" then
 Response.Write "扣费不能为空！<br/>"
 Response.Write	"<anchor>返回上级<prev/></anchor> "
Call head1()
 response.end
 End if 





 
   dim ptname,ptphone
  Set Rs = Server.CreateObject("Adodb.Recordset")
rs.open "SELECT ptname,ptphone from symbian where classid="&idd&" and id="&ptid,conn,1,1
if not rs.eof then
ptname=rs("ptname")
ptphone=rs("ptphone")
else
phname=""
ptphone=""
end if
rs.close
set rs=nothing

	Set Rs1 = Server.CreateObject("Adodb.Recordset")
	Sql1 = "SELECT id from xzlist where lid="&lid
	rs1.open sql1,conn,1,1
          if  not rs1.eof then
           idd=rs1("id")
           end if
         	Rs1.close
		Set Rs1=nothing
		set rs1=server.CreateObject("adodb.recordset")
		sql1="select * from xzfile"
		rs1.open sql1,conn,1,3
		Rs1.addnew
		Rs1("url")=fileurl
		Rs1("name")=name
		Rs1("YD_size")=size
		Rs1("format")=ggss
		Rs1("title")=title
		Rs1("very")=very
		if pic<>"" then Rs1("pic")=pic
		Rs1("pay")=pay
		Rs1("type")=ptname
		Rs1("leibie")=ptphone
		Rs1("green")=green

		Rs1("times")=now()
		Rs1("lid")=lid	
		Rs1("idd")=idd
		Rs1("laiy")=laiy
		Rs1.Update

		dd=rs1("id")
		Rs1.close
		Set Rs1=nothing%>
添加记录成功!<br/>
<a href="Getdz.asp?lid=<%=lid%>&amp;idd=<%=idd%>&amp;saytk=<%=saytk%>&amp;sid=<%=sid%>">[继续添加]</a><br/>

<a href="softview.asp?lid=<%=lid%>&amp;idd=<%=idd%>&amp;id=<%=dd%>&amp;saytk=<%=saytk%>&amp;sid=<%=sid%>">[预览文件]</a><br/>

<%if idd<>"" then%>
<a href='wjlist.asp?lid=<%=lid%>&amp;idd=<%=idd%>&amp;saytk=<%=saytk%>&amp;sid=<%=sid%>'>[返回上级]</a><br/>
<a href='wjdl.asp?idd=<%=idd%>&amp;saytk=<%=saytk%>&amp;sid=<%=sid%>'>[文件小类]</a><br/>
<%end if%>
<a href='wjclass.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>'>[文件分类]</a><br/>
<a href="../index.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>">[后台管理]</a>
<%call headsay()%>
