|
- <!DOCTYPE html>
- <html>
-
- <head>
- <meta charset="UTF-8">
- <title>导出次日出发游客和班次信息</title>
- <link rel="stylesheet" href="css/bootstrap.min.css" />
- <link rel="stylesheet" href="css/bootstrap-timepicker.css" />
- <link rel="stylesheet" href="css/font-awesome.min.css" />
- <link rel="stylesheet" href="css/daterangepicker.css" />
- <link rel="stylesheet" href="css/datepicker.css" />
-
-
- <script type="text/javascript" src="js/jquery-2.0.3.min.js"></script>
-
- <script type="text/javascript" src="js/date-time/bootstrap-datepicker.min.js"></script>
- <script type="text/javascript" src="js/date-time/bootstrap-timepicker.min.js"></script>
-
- </head>
-
- <body>
- <!--
- 作者:fuhongcheng_fhc@163.com
- 时间:2016-07-14
- 描述:export_customer_run_info.html导出次日出发游客和班次信息
- -->
- <div class="" style="overflow: hidden;width: 75%;margin-left: 25%;margin-top: 200px;">
- <span style="float: left;line-height: 30px;">出发日期:</span>
- <div class="col-sm-1" style="float:left;width: 150px;padding-right: 3px;">
- <div class="input-group">
- <input id="id-date-picker-1" class="form-control date-picker" data-date-format="yyyy-mm-dd" type="text" placeholder="出发日期" style="font-size: 12px;height: 30px;">
- <span class="input-group-addon">
- <i class="icon-calendar bigger-110"></i>
- </span>
- </div>
- </div>
-
- </div>
- <div style="margin-top: 100px;"></div>
- <button style="margin-left: 25%;height: 100px;background: gray;cursor: pointer;" onclick="daochu_btn()">导出次日出发游客和班次信息</button>
-
- </body>
- <script>
- $(document).ready(function(){
- $("#id-date-picker-1").val(after(getDateTime(0)));
- });
- function daochu_btn() {
- var starttime=$("#id-date-picker-1").val();
- if(!starttime){
- alert('请输入日期!!!');return;
- }
- var endtime = starttime;
- var url = "http://temp.zhizhuchuxing.com/st-xm/Api/order_list2.php?starttime=" + starttime + "&endtime=" + endtime;
- var listURL = url;
- // 跳转前将URL编码
- listURL = encodeURI(listURL);
- window.location.href = listURL;
- }
- function after(dateStr) {
- if (dateStr) {
- var now = ConvertDateFromString(dateStr);
- now.setDate(now.getDate() - 0 + 1);
- var year = ";" + now.getFullYear() + ";";
- var month = ";" + now.getMonth() + ";";
- var day = ";" + now.getDate() + ";";
- if (year.length < 4) {
- year = "0" + year;
- }
- if (month.length < 4) {
- month = "0" + month;
- }
- if (day.length < 4) {
- day = "0" + day;
- }
- var datestr = year + "-" + month + "-" + day;
- datestr = datestr.replace(/;/g, "");
- return datestr;
- }
- }
-
- function ConvertDateFromString(dateString) {
- if (dateString) {
- var sdate = dateString.split('-');
- var date = new Date(sdate[0], sdate[1], sdate[2]);
- return date;
- }
- }
-
- function getDateTime(nTypeFlag) {
- var tNowTime = new Date();
- var myYear = ';' + tNowTime.getFullYear() + ';';
- var myMonth = ';' + (tNowTime.getMonth() + 1 - 0) + ';';
- var myDay = ';' + tNowTime.getDate() + ';';
- var myHour = ';' + tNowTime.getHours() + ';';
- var myMinu = ';' + tNowTime.getMinutes() + ';';
- var mySecond = ';' + tNowTime.getSeconds() + ';';
-
- if (myMonth.length < 4) myMonth = '0' + myMonth;
- if (myDay.length < 4) myDay = '0' + myDay;
- if (myHour.length < 4) myHour = '0' + myHour;
- if (myMinu.length < 4) myMinu = '0' + myMinu;
- if (mySecond.length < 4) mySecond = '0' + mySecond;
-
- var cNewTimeStr;
- //alert(tNowTime);
- switch (nTypeFlag + 1 - 1) {
- case 0:
- cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
- break;
- case 1:
- cNewTimeStr = myYear + myMonth + myDay;
- break;
- case 2:
- cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
- break;
- case 3:
- cNewTimeStr = myHour + myMinu + mySecond;
- break;
- case 4:
- cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
- break;
- case 5:
- cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
- break;
- case 6:
- cNewTimeStr = myYear;
- break;
- case 7:
- cNewTimeStr = myYear + '-' + myMonth;
- break;
- case 8: //得到上一个月的今天
- var date = getDateTime(0);
- var arr = date.split('-');
- var year = arr[0]; //获取当前日期的年份
- var month = arr[1]; //获取当前日期的月份
- var day = arr[2]; //获取当前日期的日
- var days = new Date(year, month, 0);
- days = days.getDate(); //获取当前日期中月的天数
- var year2 = year;
- var month2 = parseInt(month) - 1;
- if (month2 == 0) {
- year2 = parseInt(year2) - 1;
- month2 = 12;
- }
- var day2 = day;
- var days2 = new Date(year2, month2, 0);
- days2 = days2.getDate();
- if (day2 > days2) {
- day2 = days2;
- }
- if (month2 < 10) {
- month2 = '0' + month2;
- }
- cNewTimeStr = year2 + '-' + month2 + '-' + day2;
- break;
- case 9: //得到下一个月的今天
- var date = getDateTime(0);
- var arr = date.split('-');
- var year = arr[0]; //获取当前日期的年份
- var month = arr[1]; //获取当前日期的月份
- var day = arr[2]; //获取当前日期的日
- var days = new Date(year, month, 0);
- days = days.getDate(); //获取当前日期中的月的天数
- var year2 = year;
- var month2 = parseInt(month) + 1;
- if (month2 == 13) {
- year2 = parseInt(year2) + 1;
- month2 = 1;
- }
- var day2 = day;
- var days2 = new Date(year2, month2, 0);
- days2 = days2.getDate();
- if (day2 > days2) {
- day2 = days2;
- }
- if (month2 < 10) {
- month2 = '0' + month2;
- }
-
- var t2 = year2 + '-' + month2 + '-' + day2;
- return t2;
- break;
- default:
- cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
- break;
- }
-
- cNewTimeStr = cNewTimeStr.replace(/;/g, "");
-
- return cNewTimeStr;
-
- }
- </script>
- <script type="text/javascript">
- $(".date-picker").datepicker({
- autoclose: true
- }).next().on("click", function() {
- $(this).prev().focus();
- });
- </script>
- </html>
|