uploadmms.jsp
来自「移动彩信管理平台」· JSP 代码 · 共 312 行
JSP
312 行
<%@ page contentType="text/html;charset=utf-8" %>
<%@page import="java.util.Date"%>
<%@ include file="../common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>彩信上传</title>
<link href="${webctx}/css/style.css" rel="stylesheet" type="text/css" />
<SCRIPT language="javaScript" SRC="${webctx}/js/fcnclander.js"></SCRIPT>
<script language="javaScript" src="${webctx}/js/validate.js"></script>
<script language="javaScript">
//添加彩信元素js
var i =0;
function addElements(){
//彩信标题验证
if(!checkEmpty(form.mmsTitle)){
alert("请填写彩信标题!");
form.mmsTitle.focus();
return false;
}
if(Trim(form.mmsTitle.value).length>6){
alert("彩信标题请勿超过6个字符!");
form.mmsTitle.focus();
return false;
}
//关键词验证
if(!checkEmpty(form.mmsKey1)){
alert("请至少填写一个彩信关键词!");
form.mmsKey1.focus();
return false;
}
if(Trim(form.mmsKey1.value).length>6){
alert("彩信关键词请勿超过6个字符!");
form.mmsKey1.focus();
return false;
}
if(Trim(form.mmsKey2.value).length>6){
alert("彩信关键词请勿超过6个字符!");
form.mmsKey2.focus();
return false;
}
//下发时间验证
if(!checkEmpty(form.startDate)){
alert("请选择彩信下发时间!");
form.startDate.focus();
return false;
}
//栏目验证
if(form.typeChoose.value=="0"){
alert("请选择录入栏目!");
form.typeChoose.focus();
return false;
}
//备注验证
if(Trim(form.txtDes.value).length>100){
alert("彩信备注内容不能超过100个字符!");
form.txtDes.focus();
return false;
}
document.getElementById("up").outerHTML=('<p id="pxp'+i+'" align="left"><tr><td align="center"><input onkeyup="zhencheck(this);" onafterpaste="zhencheck(this);" size="3" maxlength="3" name="xfile('+i+')" id="csc'+i+'" type="text"></td> <td align="center"><input name="file('+i+')" type="file" id="txt'+i+'"></td> <td align="center"><input onkeyup="zhencheck(this);" onafterpaste="zhencheck(this);" size="5" maxlength="5" name="mfile('+i+')" id="mxm'+i+'" type="text"></td> <td align="center"><select name="bfile('+i+')" id="bxb'+i+'"><option value="1">上方</option><option value="2" selected="selected">中间</option><option value="3">下方</option></select></td> <td align="center"><input type="button" onclick="delElements(this)" value="删除" id="btn'+i+'"></td></tr></p>')+document.getElementById("up").outerHTML;
i++;
return true;
}
function delElements(obj){
var p=document.getElementById('pxp'+obj.id.replace(/[^\d]/g,''));
var o=document.getElementById('txt'+obj.id.replace(/[^\d]/g,''));
var r=document.getElementById('csc'+obj.id.replace(/[^\d]/g,''));
var m=document.getElementById('mxm'+obj.id.replace(/[^\d]/g,''));
var b=document.getElementById('bxb'+obj.id.replace(/[^\d]/g,''));
m.removeNode(true);
r.removeNode(true);
o.removeNode(true);
p.removeNode(true);
b.removeNode(true);
obj.removeNode(true);
}
function zhencheck(zc){
zc.value = zc.value.replace(/\D/g,"");
}
</script>
</head>
<body>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="8" align="left"><img src="${webctx}/images/pny_01.jpg" width="8" height="25" /></td>
<td width="100" align="center" background="${webctx}/images/pny_bg.gif" class="psize3">基本信息录入</td>
<td width="8" align="right"><img src="${webctx}/images/pny_02.jpg" width="8" height="25" /></td>
</tr>
</table></td>
</tr>
</table>
<table width="98%" border="0" cellspacing="1" cellpadding="4" style="border:1px solid #5C92B7;">
<tr>
<td height="20" align="center" bgcolor="#FFFFFF">
<table width="99%" border="0" cellspacing="1" cellpadding="4" style="border:1px solid #5C92B7;">
<!-- 上传操作表单开始 -->
<form method="post" name="form" action = "">
<tr>
<td height="20" align="right" bgcolor="#CEE8EA">彩信标题:</td>
<td height="20" align="left" bgcolor="#CEE8EA">
<input name="mmsTitle" type="text" value="" size="20" />
<span class="psize5">*</span></td>
<td height="20" align="right" bgcolor="#CEE8EA">关键字1:</td>
<td height="20" align="left" bgcolor="#CEE8EA">
<input name="mmsKey1" type="text" value="" size="20" />
<span class="psize5">*</span></td>
<td height="20" align="right" bgcolor="#CEE8EA">关键字2:</td>
<td height="20" align="left" bgcolor="#CEE8EA">
<input name="mmsKey2" type="text" value="" size="20" />
</td>
</tr>
<tr>
<td height="20" align="right" bgcolor="#F2FAFD">下发时间:</td>
<td height="20" align="left" bgcolor="#F2FAFD">
<input type="text" name="startDate" CLASS="txtInp" readonly="true" size="10" maxlength="10"/>
<input class="sBtn" type="button" name="selectStartDate" size="20" value="选择日期" onclick="fPopCalendar(startDate,startDate)" style="cursor:hand"/>
<span class="psize5">*</span></td>
<td height="20" align="right" bgcolor="#F2FAFD">栏目:</td>
<td height="20" align="left" bgcolor="#F2FAFD">
<select name="typeChoose" style="WIDTH: 105px">
<option value="0" selected="selected">请选择</option>
<s:iterator value="mmsTypeList">
<option value="<s:property value="sortIndex"/>+1"><s:property value="sortName"/>点播</option>
</s:iterator>
<s:iterator value="mmsTypeList">
<option value="<s:property value="sortIndex"/>+2"><s:property value="sortName"/>群发</option>
</s:iterator>
</select>
<span class="psize5">*</span>
</td>
<td height="20" align="center" bgcolor="#F2FAFD"> </td>
<td height="20" align="center" bgcolor="#F2FAFD"> </td>
</tr>
<tr>
<td height="20" align="right" bgcolor="#CEE8EA">彩信说明备注:</td>
<td height="20" align="left" bgcolor="#CEE8EA" colspan="5">
<textarea name="txtDes" cols="100"></textarea>
</td>
</tr>
<tr>
<td height="20" align="center" bgcolor="#F2FAFD" colspan="6">
<input type="button" class="pal" value="添加彩信帧" onclick="return addElements()"/>
</td>
</tr>
<tr>
<td height="20" align="center" bgcolor="#CEE8EA">次序</td>
<td height="20" align="center" bgcolor="#CEE8EA" colspan="2">文件(总大小不能超过40k)</td>
<td height="20" align="center" bgcolor="#CEE8EA">时间(毫秒)</td>
<td height="20" align="center" bgcolor="#CEE8EA">布局</td>
<td height="20" align="center" bgcolor="#CEE8EA">操作</td>
</tr>
<tr bgcolor="#F2FAFD">
<td colspan="6">
<div id="up"></div>
<br/>
</td>
</tr>
<tr>
<td height="20" colspan="6" align="center" bgcolor="#CEE8EA">
<input name="Submit422" type="submit" class="pal" value="生成smil" />
<input type="button" name="button2" class="pal" value="预览smil" onclick="rcheck();" />
<input name="reset" type="reset" class="pal" value="返回" />
</td>
</tr>
</form>
<!-- 上传操作表单结束 -->
<tr>
<td width="10%" bgcolor="#CEE8EA">【说明】</td>
<td bgcolor="#F2FAFD" colspan="5" align="left"> ● 首先输入要查询的用户号码。<br/>
● 点击查询按钮后显示用户基本资料和开销户历史记录。<br/>
● 若用户当前状态是已开户,可在操作区选择是否下发通知消息后点击销户按钮,给当前用户销户。<br/>
● 若用户当前状态是未开户,可在操作区选择用户类型和是否下发欢迎词/提示语后点击开户按钮,给当前用户开户。
</td>
</tr>
</table>
<table width="99%" border="0" cellspacing="1" cellpadding="1">
</table>
</td>
</tr>
</table>
</body>
</html>
<script type="text/javascript">
<!--
function rformToRequestString(form_obj)
{
var query_string='';
var and='';
//alert(form_obj.length);
for (i=0;i<form_obj.length ;i++ )
{
e=form_obj[i];
if (e.name.indexOf(")")!=-1)
{
if (e.type=='select-one')
{
element_value=e.options[e.selectedIndex].value;
}
else if (e.type=='checkbox' || e.type=='radio')
{
if (e.checked==false)
{
break;
}
element_value=e.value;
}
else
{
element_value=e.value;
}
query_string+=and+'z'+e.name+'='+element_value.replace(/\&/g,"%26");
and="&"
}
}
return query_string;
}
//预览表单验证
function rcheck(){
if(document.forms[0].elements[9].value =="生成smil"){
alert("必须添加彩信文件!");
return false;
}
var fgeshu = 0;
for (var v=0;v<document.forms[0].length;v++){
if(document.forms[0].elements[v].type=="file"){
fgeshu++;
if(fgeshu>14){
alert("最多上传13个文件!");
return false;
}
}
}
for (var x=0;x<document.forms[0].length;x++){
if(x==2|x==4|x==6){
continue;
}
if(document.forms[0].elements[x].value.length == 0){
alert("添加彩信帧必填输入项不能为空!");
return false;
}
}
for (var j=0;j<document.forms[0].length;j++){
if(document.forms[0].elements[j].type == "file"&&document.forms[0].elements[j].name!="fengmian"){
var houzui = document.forms[0].elements[j].value.toLowerCase();
houzui = houzui.split("\.");
houzui = houzui[houzui.length-1];
if((houzui.indexOf("txt")==-1)&&(houzui.indexOf("gif")==-1)&&(houzui.indexOf("jpg")==-1)&&(houzui.indexOf("mid")==-1)&&(houzui.indexOf("arm")==-1)&&(houzui.indexOf("mp3")==-1)){
alert("请选择正确的文件txt,gif,jpg,arm,mid,mp3");
return false;
}
}
}
document.forms[0].action = "${webctx}/previewmmsaction.do?"+rformToRequestString(document.forms[0]);
//alert("?"+rformToRequestString(document.forms[0]));
document.forms[0].submit();
//sendRequest("/mmsmarket/uploadtest.do");
}
//-->
</script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?