<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XACTI呼叫系统客户添加页面</title>
<link href="../all.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all"/>
<script type="text/javascript" src="Jscript/common.js"></script>
</head>
<body onLoad="putFaxNo();">
<div style="width:99%;padding-left: 1px;">
<div style="font-size: 12px; font-weight: bold;color:#426EB4;"><img src="../Image/cus.gif" style="margin-bottom: -3px;"/> 发送传真</div>
<br>
<table class="tform">
<tbody>
<tr>
<td>公司名称:
<td colspan="4">
<input type="text" id="fullNmae" name="fullName" class="cfb" style="width: 324px;" onMouseDown="this.className='cfb2'" onBlur="this.className='cfb'"/></td>
</tr>
<tr>
<td width="60">
传真号码: </td>
<td>
<input type="text" id="phoneNo" name="phoneNo" class="cfb" onMouseDown="this.className='cfb1'" onBlur="this.className='cfb'"/>
</td>
<td>拔通电话:</td>
<td colspan="2"><img src="../img/ic2.gif" onclick="callClient();" style="cursor: hand;"/></td>
</tr>
<tr>
<td>文件编码:</td>
<td width="160">
<input type="text" id="faxname" name="faxname" readonly="readonly" class="cfb" onMouseDown="this.className='cfb1'" onBlur="this.className='cfb'"/> </td>
<td width="62">文件名称:</td>
<td width="442" colspan="2">
<input type="text" id="uploadname" name="uploadname" style="width: 100%;" class="cfb" onMouseDown="this.className='cfb1'" onBlur="this.className='cfb'"/> </td>
</tr>
<tr>
<td>上传时间:</td>
<td>
<input type="text" id="uploadtime" name="uploadtime" readonly="readonly" class="cfb" onMouseDown="this.className='cfb1'" onBlur="this.className='cfb'"/> </td>
<td>打开浏览: </td>
<td colspan="2"><img src="../Image/down2.gif" onclick="openuploadfile();" style="margin-bottom: -3px;cursor: hand;"/> </td>
</tr>
<tr>
<td>文件大小:</td>
<td>
<input type="text" class="cfb" id="faxsize" name="faxsize" readonly="readonly" onMouseDown="this.className='cfb1'" onBlur="this.className='cfb'"/> </td>
<td> 发送人: </td>
<td colspan="2">
<input type="text" class="cfb" id="workName" name="workName" readonly="readonly" /></td>
</tr>
<tr>
<td>发送时间:</td>
<td>
<input type="text" class="cfb" id="sendtime" name="sendtime" readonly="readonly" onMouseDown="this.className='cfb1'" onBlur="this.className='cfb'"/> </td>
<td>发送状态: </td>
<td colspan="2">
<input type="text" class="cfb" id="sendstate" name="sendstate" readonly="readonly"/></td>
</tr>
<tr>
<html:form action="/AjaxUpload" styleId="uploadForm" target="upload_frame" method="post" enctype="multipart/form-data">
<td>上传路径:</td>
<td>
<input name="fax1" type="file" id="fax1" style="width: 160px;" />
</td>
<td>开始上传:</td>
<td><img src="../Image/up2.gif" style="margin-bottom: -3px; cursor: hand;" onclick="uploadprintfile();"/> </td>
<td>上传状态: <span id="suc" style="color: red;"> 未上传</span></td>
</html:form>
</tr>
<tr>
<td>
上传备注: </td>
<td colspan="4">
<textarea name="faxRemark" id="faxRemark" rows="8" style="width: 100%;"></textarea>
</td>
</tr>
</tbody>
</table>
<input type="hidden" id="faxpath" value="" />
<div style="text-align: right;">
<img src="../Image/zs.gif" style="margin-bottom: -3px;"/> <font color="#426EB4">提示:请上传doc、tiff文件</font>
<br><br>
<input type="button" value="发送传真" id="button" class="but" onclick="sendFax();" style="margin-right: 200px; cursor: hand;"/><input type="button" value="查看记录" id="button" class="but" onclick="location.href='../getSendFaxRecord.do';" style="margin-right: 300px;cursor: hand;"/>
</div>
<div id="hiddenDiv">
<iframe id='upload_frame' name='upload_frame' src='' style="display: none;"></iframe>
</div>
<div id="massage_box">
<div class="massage">
<div class="header" onmousedown=MDown(massage_box)>
<div style="display: inline; width: 150px; position: absolute">
传真发送中请稍候
</div>
<span
onClick="massage_box.style.visibility='hidden'; mask.style.visibility='hidden'"
style="float: right; display: inline; cursor: hand">×</span>
</div><br><br>
<span id="fax_send_state" style="margin-left: 80px;color: green;">传真发送当中...</span>
</div>
</div>
<div id="mask"></div>
</div>
</body>
<script type="text/javascript">
var workName='<bean:write scope="session" name="workerInfo" property="workername"/>';
function putFaxNo(){
var faxNo='<%=String.valueOf(request.getParameter("faxNo"))%>';
<%
String fullname=String .valueOf(request.getParameter("fullName"));
fullname= new String(fullname.getBytes("ISO8859-1"),"gb2312");
%>
var fullName='<%=fullname%>';
if('null'==faxNo &&'null'==fullName){
faxNo='';fullName='';
}
document.getElementById("phoneNo").value=faxNo;
document.getElementById("fullName").value=fullName;
document.getElementById("workName").value=workName;
}
function callClient(){
var phone=document.getElementById("phoneNo").value;
if(''!=phone&&null!=phone)
parent.tops.OutCall2(phone);
}
function sendFax(){
var path=document.getElementById("faxpath").value;
if(path!=''&&path!=null){
parent.tops.sendFax(path,1);
document.getElementById("massage_box").style.visibility='visible';
document.getElementById("mask").style.visibility='visible';
window.setTimeout(send_state,3000);
var d=new Date();
document.getElementById("sendtime").value=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
document.getElementById("sendstate").value="传真已发送";
}
}
function uploadSuc(uploadTime,uploadName,faxName,faxpath,faxsize){
document.getElementById("uploadtime").value=uploadTime;
document.getElementById("uploadname").value=uploadName;
document.getElementById("faxname").value=faxName;
document.getElementById("faxpath").value=faxpath;
document.getElementById("faxsize").value=faxsize+"KB";
document.getElementById("suc").innerHTML="<img src='../Image/suc.gif' style='margin-bottom: -4px;'/>";
}
function uploadprintfile(){
var regstr=/\\/;
var reg=new RegExp(regstr);
var fval=document.getElementById("fax1").value;
var full=document.getElementById("fullNmae").value;
if(""==fval||""==full){
if(full=="")alert("请填写接收传真公司名称!");else{
alert("提示:未选择上传路径!");
}
}else{
var s1=fval.split(reg,'100');
fval=s1[s1.length-1];
fval=fval.substring(fval.length-3);
if("doc"==fval||"iff"==fval||"IFF"==fval){
document.getElementById("suc").innerHTML="<img src='../Image/loading.gif' style='margin-bottom: -4px;'/>文件上传中请稍等...";
document.uploadForm.submit();
}else{
alert("上传文件类型不匹配!");
}
}
}
function openuploadfile(){
var path=document.getElementById("faxpath").value;
if(''!=path&&null!=path)
document.location.href="../downloadSendFax.do?path="+path;
}
function send_state(){
document.getElementById("massage_box").style.visibility='hidden';
document.getElementById("mask").style.visibility='hidden';
}
</script>
</html>
分享到:
相关推荐
ajax异步上传文件实现,主要是使用h5的技术,大家可以试试看
codeproject中介绍的使用jquery ajax异步上传文件,demo使用mvc方式
c# FTP操作类 上传、异步上传文件、下载、异步下载文件 、建立目录
异步上传文件图片js http://www.cnblogs.com/kissdodog/archive/2012/12/15/2819025.html
使用jsp + servlet 利用ajaxFileupload.js插件实现异步文件上传
很好的ajax异步上传插件是jquery
JavaScript js Ajax 异步 上传文件 包含servlet action 以及JSP 代码
ajax异步上传文件插件,ajax异步上传文件插件,ajax异步上传文件插件,无奈要50个字
asp.net ajax异步上传文件 代码是从一系统中取出来的并作了修改..感觉非常好用,借助此demo还可以实现异步读取信息 验证用户名 更改信息等... 如出现object error错误 请检查function.js submitUrl参数的提交路径...
Silverlight 多文件异步上传文件,动态显示上传进度
java文件异步上传
js异步上传文件插件, 三种异步上传方式, 包含相关html页面, js代码等
java实现多文件异步上传
纯JS异步上传文件实例
利用jquery,实现界面的无刷新的上传。后台是struts。实例,可直接运行
jquery的一款异步文件上传插件,我博客中有关于此插件的详细教程。 handleError: function( s, xhr, status, e ) { // If a local callback was specified, fire it if ( s.error ) { s.error.call( s....
ajax 异步上传 需要的js文件 ajax 异步上传
异步上传插件
swfupload 异步上传文件,支持进度条上传
springmvc上传文件+ajax异步上传不刷新页面;springmvc上传文件+ajax异步上传不刷新页面