love_php/resources/views/report_forms.blade.php
2026-04-02 09:20:51 +08:00

70 lines
2.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<title>报表下载</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<script src="/js/jquery.min.js"></script>
<!-- HTML5 shim Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询media queries功能 -->
<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
<!--[if lt IE 9]>
<![endif]-->
</head>
<body>
<div class="container">
<h1 class="text-center">福恋报表</h1>
<div>
<label for="start_date" class="col-md-3">开始时间</label>
<input type="month" id="start_date">
<label for="end_date" class="col-md-3">结束时间</label>
<input type="month" id="end_date">
<button class="btn btn-default" onclick="makeReport()">生成报表</button>
</div>
<div class="col-md-3" id="file_div">
<labe>当前文件</labe>
<a href="http://love.ufutx.com" target="_blank">http://love.ufutx.com</a>
</div>
</div>
</body>
<script type="text/javascript">
function makeReport()
{
var start_date = $("#start_date").val()
var end_date = $("#end_date").val()
var url = "/report/forms";
var axi= new XMLHttpRequest();
axi.open('POST', url, true);
axi.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
axi.send("start_date="+start_date+"&end_date="+end_date);
axi.onreadystatechange =function () {
if (axi.readyState === 4) {
if (axi.status === 200) {
console.log(axi.responseText);
var content = JSON.parse(axi.responseText);
if (content.code) {
alert(content.message)
}
} else {
console.error(axi.statusText);
}
}else {
console.error(1);
}
}
}
</script>
</html>