跳至
[1]
[全屏预览]
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>批量发短信-小雨在线-excel导入数据库</title>
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="jquery.uploadify.min.js" type="text/javascript"></script>
<link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/Buttons/2.0.0/css/buttons.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="uploadify.css">
<style>
fieldset {
padding: .35em .625em .75em;
margin: 0 2px;
border: 1px solid silver
}
legend {
padding: .5em;
border: 0;
width: auto
}
body {
margin-top: 15px;
}
#mess {
color: #ff291a;
font-weight: bold;
}
</style>
</head>
<body>
<script type="text/javascript">
$(function () {
$('#studata').uploadify({
'auto': false,
'formData': {
'stuid': '',
},
'buttonText': '请选择excel文件',
'fileSizeLimit': '100MB',
'fileTypeDesc': 'excel文件',
'fileObjName': "studata",
'fileTypeExts': '*.xlsx;*.xls',//文件类型过滤
'swf': 'uploadify.swf',
'multi': false,
'successTimeout': 1800,
'queueSizeLimit': 100,
'uploader': 'uploadify.php',
'onUploadStart': function (file) {
//alert('Starting to upload ' + file.name);
//正在上传中...
// $('#alert-content').html('正在上传文件');
// modal.modal();
},
//onUploadSuccess为上传完后回调的方法,
'onUploadSuccess': function (file, data, response) {
$('#mess').html('正在发送短信,请稍后...');
data = eval("(" + data + ")");
$.ajax({
type: 'POST',
url: '../reader.php',
dataType: 'html',
data: {'exceldir': data.updir},
success: function (retdata) {
// alert(retdata);
console.log(retdata);
$("#mess").hide();
$("#tellist").html(retdata);
//modal.modal('close');
// if(retdata==1){
// alert('导入成功');
// }else{
// alert('导入失败');
// }
}
});
}
});
});
</script>
<div class="container">
<fieldset>
<legend>小雨在线批量导入EXCEL平台注册用户数据发短信,目前暂时支持一次性发送100条短信</legend>
<p>
<input type="file" value="studata" id="studata">
<input type="button" class="button button-highlight button-pill "
onclick="javascript:$('#studata').uploadify('upload','*')" value="批量发送短信">
</p>
<hr>
<p id="mess"></p>
<p id="tellist"></p>
</fieldset>
</div>
</body>
</html>
登录后复制