<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"--><!--#INCLUDE FILE="../HXINCLUDE/SelectDate.asp"--><!--#INCLUDE FILE="../HXINCLUDE/HX_photo.asp"-->
<%if WS_S.MemberPriv("WS_WORKFLOWAdd")<>1 then HX_GoBack "对不起,您的权限不够!",""
action=request("action")
if action="saveinfo" then
ColumnName="":Tablename="HX_WorkFlow":Orderby=" ORDER BY WS_FCID DESC"
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
 set upload=new upload_file
  Module=upload.form("Module"):Title=upload.form("Title"):ComeDate=upload.form("ComeDate"):FlowType=upload.form("FlowType"):Content=upload.form("Content"):Grade=upload.form("Grade")
  call WS_S.ChkIsOuter()
  filepath="workannex/"
  for each formName in upload.File
	set file=upload.File(formName)
    fileExt=lcase(file.FileExt)	'得到的文件扩展名不含有.
	if fileext<>"doc" and fileext<>"txt" and fileext<>"rar" then
		fileExt="gif"
		response.write "<script language=javascript>alert('只能上传DOC、TXT、RAR格式的文件！');history.go(-1);</script>"
		response.end
    end if
	if file.filesize>(200000*1024) then
		response.write "<script language=javascript>alert('文件大小不能超过200M！');history.go(-1);</script>"
		response.end
	end if
  randomize
  ranNum=int(90000*rnd)+10000
  filename=filepath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt 
  if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
	WS_S.CheckDir filepath,True
    FileSeverPath=Server.mappath(filename)
    file.SaveToFile FileSeverPath
	if WS_S.HX_ScanFile(FileSeverPath) then
    WS_S.CheckFile FileSeverPath,True 
    HX_GoBack "对不起,您上传的文件中含有木马程序,所以不能上传!",""
    end if
  end if 
next 
rs.addnew:rs("WS_WorkFlowModule")=Module:rs("WS_WorkFlowTitle")=Title:rs("WS_WorkFlowMan")=loginuid:rs("WS_WorkFlowDate")=ComeDate:rs("WS_WorkFlowContent")=Content:rs("WS_WorkFlowGrade")=Grade:rs("WS_WorkFlowFlowType")=FlowType		   
if file.FileSize>0 then rs("WS_WorkFlowAnnex")=FileName
rs.update
msg="收文登记成功！"   
set file=nothing 
call WS_S.HX_RSClose(rs)
set upload=nothing
 call WS_S.SaveAdminLog(LOGINUSERNAME,LogAppointment,msg)
HX_GoBack msg,"WorkFlow.asp"
end if
response.write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>收文登记</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'><script>function workflowcheck(form){if(form.Module.value=='')     {alert('请输入来文单位!');form.Module.focus();return false;}if(form.Title.value==''){alert('请输入来文标题!');form.Title.focus();return false;}if(form.ComeDate.value==''){alert('请输入来文日期!');form.ComeDate.focus();return false;}if(form.Content.value=='') {alert('请输入具体公文内容!');form.Content.focus();return false;     }return true}</script></head><body topmargin='20' leftmargin='0' bottommargin='0'><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>收文登记</font></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor=e1e1e1><form name='form1' method='post' action='?action=saveinfo' onSubmit='return workflowcheck(this);' enctype='multipart/form-data' target='_self'><tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td height='20' align='center' bgcolor='#FFFBE8'>登 记 人</td><td width='163'>"
Call WS_S.HX_OutUserInfo(LOGINUid):response.Write OutName&"</td><td width='68' bgcolor='#FFFBE8'>收文日期</td><td width='239'><input type='text' name='ComeDate' size=10 value='"&date&"' readonly> <input name='button' type='button' title='选择收文日期' onClick=""popUpcalendar(this, form1.ComeDate, 'yyyy-mm-dd')"" value='选择'></td></tr><tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td height='20' align='CENTER' bgcolor='#FFFBE8'> 来文单位</td><td colspan='3'><INPUT name='Module' title='来文单位' value='' size='55' maxlength='100'></td></tr><tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td height='20' align='CENTER' bgcolor='#FFFBE8'>标　　题</td><td colspan='3'><input type='text' name='Title'  size='55' maxlength='100'></td></tr><tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td height='20' align='CENTER' bgcolor='#FFFBE8'>公文类别</td><td colspan='3'><select name='FlowType'>"
ColumnName="":Tablename="HX_WorkFlowType":Orderby=" order by WS_WTID asc"
set tyrs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if tyrs.recordcount>0 then
do until tyrs.eof
 response.write "<option value='"&tyrs("WS_WTID")&"'>"&tyrs("WS_WorkFlowTypeName")&"</option>"
tyrs.movenext
loop	
end if
response.write "</select></td></tr><tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td height='100' align='CENTER' bgcolor='#FFFBE8'>正　　文</td><td height='100' colspan='3'><textarea name='Content' cols='55' rows='6' class='bgline'></textarea></td></tr><tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td height='20' align='CENTER' bgcolor='#FFFBE8'>附　　件</td><td colspan='3'><input type='file' name='WS_Annex' maxlength='300' size='46'></td></tr><tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td align='center' bgcolor='#FFFBE8'>保密级别</td><td colspan='3'><SELECT name='Grade' title=密级><OPTION value=普通 selected>普通</OPTION><OPTION value=秘密>秘密</OPTION><OPTION value=机密>机密</OPTION><OPTION value=绝密>绝密</OPTION></SELECT></td></tr><tr bgcolor='#FFFBE8'><td height='20'>&nbsp;</td><td height='20' colspan='3'><input type='submit' name='提交' value=' 提 交 '> <input name='reset' type='reset' value=' 重 填 ' ></td></tr></form></table></td></tr></table>"
%>