List_Save.asp
资源名称:NetPhone.rar [点击查看]
上传用户:xxtaishan
上传日期:2022-01-02
资源大小:4063k
文件大小:3k
源码类别:
IP电话/视频会议
开发平台:
ASP/ASPX
- <!--#include file="../../inc/conn.asp"-->
- <!--#include file="../../inc/FUNC.asp" -->
- <!--#include file="../../inc/upload_5xsoft.inc" -->
- <%
- '-----------------------------
- Dim rs
- Dim sql
- '-----------------------------
- DIM UPLOAD
- SET UPLOAD=NEW UPLOAD_5XSOFT
- If UPLOAD.FORM("operation")="add" Then
- call Add
- elseif UPLOAD.FORM("operation")="edit" Then
- call Edit
- ELSE
- call showerr("系统提示:操作无效!")
- end if
- '-----------------------------
- Function Add
- if UPLOAD.FORM("title")="" then
- call showerr("系统提示:标题不能为空!")
- end if
- DIM FILE
- set file=upload.file("file")
- if Instr(".doc.xls.ppt.rar.exe",GetExtendName(file.FileName)) then
- TypeFlag = 1 '文件为允许的类型
- else
- TypeFlag = 0 '文件为不允许的类型
- Response.write "不支持您所上传的文件类型:"
- Response.write GetExtendName(file.FileName)
- Response.write "<br>"
- response.end
- end if
- 'if file.FileSize<=0 then
- 'call showerr("系统提示:请上传产品图片!")
- 'end if
- set rs=server.createobject("adodb.recordset")
- rs.open "select * from Info2",conn,1,3
- rs.addnew
- rs("title")=UPLOAD.FORM("title")
- rs("content")=UPLOAD.FORM("content")
- rs("postdate")=DATE()
- if file.FileSize>0 then
- file.saveAs Server.mappath("../../upload/"&rs("id")&getfilename(file.FileName))
- rs("pic")=rs("id")&getfilename(file.FileName)
- end if
- rs.Update
- call showmsg("系统提示:信息添加成功!","list.asp")
- End Function
- '-----------------------------
- Function Edit
- if UPLOAD.FORM("gsname")="" then
- call showerr("系统提示:公司名称不能为空!")
- end if
- if UPLOAD.FORM("address")="" then
- call showerr("系统提示:公司地址不能为空!")
- end if
- if UPLOAD.FORM("fr")="" then
- call showerr("系统提示:法人不能为空!")
- end if
- if UPLOAD.FORM("bm")="" then
- call showerr("系统提示:部门不能为空!")
- end if
- if UPLOAD.FORM("email")="" then
- call showerr("系统提示:电子邮件不能为空!")
- end if
- if UPLOAD.FORM("zip")="" then
- call showerr("系统提示:邮编不能为空!")
- end if
- if UPLOAD.FORM("tel")="" then
- call showerr("系统提示:电话不能为空!")
- end if
- if UPLOAD.FORM("cz")="" then
- call showerr("系统提示:传真不能为空!")
- end if
- if UPLOAD.FORM("jj")="" then
- call showerr("系统提示:公司简介不能为空!")
- end if
- set rs=server.createobject("adodb.recordset")
- rs.open "select * from gs where id="&UPLOAD.FORM("id"),conn,1,3
- rs("gsname")=UPLOAD.FORM("gsname")
- rs("address")=UPLOAD.FORM("address")
- rs("fr")=UPLOAD.FORM("fr")
- rs("bm")=UPLOAD.FORM("bm")
- rs("email")=UPLOAD.FORM("email")
- rs("zip")=UPLOAD.FORM("zip")
- rs("tel")=UPLOAD.FORM("tel")
- rs("cz")=UPLOAD.FORM("cz")
- rs("jj")=UPLOAD.FORM("jj")
- DIM FILE
- set file=upload.file("file")
- if file.FileSize>0 then
- IF GETFILENAME(RS("pic"))<>GETFILENAME(FILE.FILENAME) THEN
- CALL DoDelFile("../../upload/"&RS("pic"))
- END IF
- file.saveAs Server.mappath("../../upload/"&rs("id")&getfilename(file.FileName))
- rs("pic")=rs("id")&getfilename(file.FileName)
- end if
- rs.Update
- call showmsg("系统提示:信息修改成功!","list_add.asp")
- End Function
- function GetExtendName(FileName)
- dim ExtName
- ExtName = LCase(FileName)
- ExtName = right(ExtName,3)
- ExtName = right(ExtName,3-Instr(ExtName,"."))
- GetExtendName = ExtName
- end function
- '-----------------------------
- call COCLS
- %>