You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

201 lines
6.0 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>导出次日出发游客和班次信息</title>
  6. <link rel="stylesheet" href="css/bootstrap.min.css" />
  7. <link rel="stylesheet" href="css/bootstrap-timepicker.css" />
  8. <link rel="stylesheet" href="css/font-awesome.min.css" />
  9. <link rel="stylesheet" href="css/daterangepicker.css" />
  10. <link rel="stylesheet" href="css/datepicker.css" />
  11. <script type="text/javascript" src="js/jquery-2.0.3.min.js"></script>
  12. <script type="text/javascript" src="js/date-time/bootstrap-datepicker.min.js"></script>
  13. <script type="text/javascript" src="js/date-time/bootstrap-timepicker.min.js"></script>
  14. </head>
  15. <body>
  16. <!--
  17. 作者:fuhongcheng_fhc@163.com
  18. 时间:2016-07-14
  19. 描述:export_customer_run_info.html导出次日出发游客和班次信息
  20. -->
  21. <div class="" style="overflow: hidden;width: 75%;margin-left: 25%;margin-top: 200px;">
  22. <span style="float: left;line-height: 30px;">出发日期:</span>
  23. <div class="col-sm-1" style="float:left;width: 150px;padding-right: 3px;">
  24. <div class="input-group">
  25. <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;">
  26. <span class="input-group-addon">
  27. <i class="icon-calendar bigger-110"></i>
  28. </span>
  29. </div>
  30. </div>
  31. </div>
  32. <div style="margin-top: 100px;"></div>
  33. <button style="margin-left: 25%;height: 100px;background: gray;cursor: pointer;" onclick="daochu_btn()">导出次日出发游客和班次信息</button>
  34. </body>
  35. <script>
  36. $(document).ready(function(){
  37. $("#id-date-picker-1").val(after(getDateTime(0)));
  38. });
  39. function daochu_btn() {
  40. var starttime=$("#id-date-picker-1").val();
  41. if(!starttime){
  42. alert('请输入日期!!!');return;
  43. }
  44. var endtime = starttime;
  45. var url = "http://temp.zhizhuchuxing.com/st-xm/Api/order_list2.php?starttime=" + starttime + "&endtime=" + endtime;
  46. var listURL = url;
  47. // 跳转前将URL编码
  48. listURL = encodeURI(listURL);
  49. window.location.href = listURL;
  50. }
  51. function after(dateStr) {
  52. if (dateStr) {
  53. var now = ConvertDateFromString(dateStr);
  54. now.setDate(now.getDate() - 0 + 1);
  55. var year = ";" + now.getFullYear() + ";";
  56. var month = ";" + now.getMonth() + ";";
  57. var day = ";" + now.getDate() + ";";
  58. if (year.length < 4) {
  59. year = "0" + year;
  60. }
  61. if (month.length < 4) {
  62. month = "0" + month;
  63. }
  64. if (day.length < 4) {
  65. day = "0" + day;
  66. }
  67. var datestr = year + "-" + month + "-" + day;
  68. datestr = datestr.replace(/;/g, "");
  69. return datestr;
  70. }
  71. }
  72. function ConvertDateFromString(dateString) {
  73. if (dateString) {
  74. var sdate = dateString.split('-');
  75. var date = new Date(sdate[0], sdate[1], sdate[2]);
  76. return date;
  77. }
  78. }
  79. function getDateTime(nTypeFlag) {
  80. var tNowTime = new Date();
  81. var myYear = ';' + tNowTime.getFullYear() + ';';
  82. var myMonth = ';' + (tNowTime.getMonth() + 1 - 0) + ';';
  83. var myDay = ';' + tNowTime.getDate() + ';';
  84. var myHour = ';' + tNowTime.getHours() + ';';
  85. var myMinu = ';' + tNowTime.getMinutes() + ';';
  86. var mySecond = ';' + tNowTime.getSeconds() + ';';
  87. if (myMonth.length < 4) myMonth = '0' + myMonth;
  88. if (myDay.length < 4) myDay = '0' + myDay;
  89. if (myHour.length < 4) myHour = '0' + myHour;
  90. if (myMinu.length < 4) myMinu = '0' + myMinu;
  91. if (mySecond.length < 4) mySecond = '0' + mySecond;
  92. var cNewTimeStr;
  93. //alert(tNowTime);
  94. switch (nTypeFlag + 1 - 1) {
  95. case 0:
  96. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
  97. break;
  98. case 1:
  99. cNewTimeStr = myYear + myMonth + myDay;
  100. break;
  101. case 2:
  102. cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
  103. break;
  104. case 3:
  105. cNewTimeStr = myHour + myMinu + mySecond;
  106. break;
  107. case 4:
  108. cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
  109. break;
  110. case 5:
  111. cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
  112. break;
  113. case 6:
  114. cNewTimeStr = myYear;
  115. break;
  116. case 7:
  117. cNewTimeStr = myYear + '-' + myMonth;
  118. break;
  119. case 8: //得到上一个月的今天
  120. var date = getDateTime(0);
  121. var arr = date.split('-');
  122. var year = arr[0]; //获取当前日期的年份
  123. var month = arr[1]; //获取当前日期的月份
  124. var day = arr[2]; //获取当前日期的日
  125. var days = new Date(year, month, 0);
  126. days = days.getDate(); //获取当前日期中月的天数
  127. var year2 = year;
  128. var month2 = parseInt(month) - 1;
  129. if (month2 == 0) {
  130. year2 = parseInt(year2) - 1;
  131. month2 = 12;
  132. }
  133. var day2 = day;
  134. var days2 = new Date(year2, month2, 0);
  135. days2 = days2.getDate();
  136. if (day2 > days2) {
  137. day2 = days2;
  138. }
  139. if (month2 < 10) {
  140. month2 = '0' + month2;
  141. }
  142. cNewTimeStr = year2 + '-' + month2 + '-' + day2;
  143. break;
  144. case 9: //得到下一个月的今天
  145. var date = getDateTime(0);
  146. var arr = date.split('-');
  147. var year = arr[0]; //获取当前日期的年份
  148. var month = arr[1]; //获取当前日期的月份
  149. var day = arr[2]; //获取当前日期的日
  150. var days = new Date(year, month, 0);
  151. days = days.getDate(); //获取当前日期中的月的天数
  152. var year2 = year;
  153. var month2 = parseInt(month) + 1;
  154. if (month2 == 13) {
  155. year2 = parseInt(year2) + 1;
  156. month2 = 1;
  157. }
  158. var day2 = day;
  159. var days2 = new Date(year2, month2, 0);
  160. days2 = days2.getDate();
  161. if (day2 > days2) {
  162. day2 = days2;
  163. }
  164. if (month2 < 10) {
  165. month2 = '0' + month2;
  166. }
  167. var t2 = year2 + '-' + month2 + '-' + day2;
  168. return t2;
  169. break;
  170. default:
  171. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
  172. break;
  173. }
  174. cNewTimeStr = cNewTimeStr.replace(/;/g, "");
  175. return cNewTimeStr;
  176. }
  177. </script>
  178. <script type="text/javascript">
  179. $(".date-picker").datepicker({
  180. autoclose: true
  181. }).next().on("click", function() {
  182. $(this).prev().focus();
  183. });
  184. </script>
  185. </html>