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.

177 lines
5.4 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/head-public :: head}"></head>
  4. <meta charset="ISO-8859-1">
  5. <title>Metro Water</title>
  6. <style>
  7. .input-group-append {
  8. cursor: pointer;
  9. }
  10. .loader {
  11. border: 16px solid #f3f3f3;
  12. border-radius: 50%;
  13. border-top: 16px solid blue;
  14. border-bottom: 16px solid blue;
  15. width: 120px;
  16. height: 120px;
  17. -webkit-animation: spin 2s linear infinite;
  18. animation: spin 2s linear infinite;
  19. }
  20. @-webkit-keyframes spin {
  21. 0% { -webkit-transform: rotate(0deg); }
  22. 100% { -webkit-transform: rotate(360deg); }
  23. }
  24. @keyframes spin {
  25. 0% { transform: rotate(0deg); }
  26. 100% { transform: rotate(360deg); }
  27. }
  28. </style>
  29. </head>
  30. <!-- <div class="loader" id="loader"></div> -->
  31. <body>
  32. <div id="page-container" class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  33. <!-- Side Overlay aside (right)-->
  34. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  35. <!-- END Side Overlay (right)-->
  36. <!-- Sidebar Nav-->
  37. <nav th:replace="~{fragments/nav :: nav}"></nav>
  38. <!-- END Sidebar -->
  39. <!-- Header -->
  40. <header th:replace="~{fragments/header :: header}"></header>
  41. <!-- END Header -->
  42. <!-- Main Container -->
  43. <main id="main-container">
  44. <!-- Hero -->
  45. <div class="">
  46. <div class="content content-full">
  47. <div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
  48. <h3 class="flex-grow-1 fs-5 fw-semibold my-2 my-sm-3">Welcome</h3>
  49. <nav class="flex-shrink-0 my-2 my-sm-0 ms-sm-3" aria-label="breadcrumb">
  50. <ol class="breadcrumb">
  51. <li class="breadcrumb-item active" aria-current="page">Home
  52. </ol>
  53. </nav>
  54. </div>
  55. </div>
  56. </div>
  57. <!-- END Hero -->
  58. <div class="content">
  59. <div class="block block-rounded">
  60. <div class="block-header block-header-default">
  61. <h3 class="block-title">Metro Water Dept Report</h3>
  62. <div class="block-options">
  63. </div>
  64. </div>
  65. <form class="" action="/api/download1" onsubmit="getReport()">
  66. <div class="row">
  67. <div class="col">
  68. <label for="fromDate" class="">From Date</label>
  69. <input type="date" class="form-control" id="fromDate" name="fromdate" data-date-format="dd/mm/yy" required/>
  70. </div>
  71. <div class="col">
  72. <label for="toDate" class="">To Date</label>
  73. <input type="date" class="form-control" id="toDate" name="todate" data-date-format="dd/mm/yy" required/>
  74. </div>
  75. <div class="col">
  76. <label for="type" class="">Type</label>
  77. <select class="form-select" id="type" name="type" aria-label="Default select example" required>
  78. <option selected></option>
  79. <option value="new" selected>New</option>
  80. <option value="modify">Modify</option>
  81. <option value="deActive">De Active </option>
  82. <option value="deActiveWithRemark">De Active With Remark</option>
  83. <option value="nameTransfer">Name Transfer </option>
  84. <option value="entries">Metro Water Entries </option>
  85. </select>
  86. </div>
  87. <div class="col">
  88. <br>
  89. <button type="submit" class="btn btn-sm btn-primary btn-lg float-right">Export</button>
  90. </div>
  91. </div>
  92. </form>
  93. <div class="card col-6" id="msg" >
  94. <div class="card-body">
  95. <p>please wait Excel is generating</p>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </main>
  101. </div>
  102. <script th:replace="~{fragments/script :: script}"></script>
  103. <script>
  104. const fromDateInput = document.getElementById('fromDate');
  105. const toDateInput = document.getElementById('toDate');
  106. // Listen for changes to the "from" date
  107. fromDateInput.addEventListener('change', function () {
  108. // Get the selected "from" date
  109. const fromDate = new Date(this.value);
  110. // Enable the "to" date input
  111. toDateInput.disabled = false;
  112. // Set the minimum allowed "to" date to the selected "from" date
  113. toDateInput.min = this.value;
  114. // You can also set a default "to" date (e.g., one day after "from" date)
  115. const toDate = new Date(fromDate);
  116. toDate.setDate(fromDate.getDate() + 1);
  117. toDateInput.valueAsDate = toDate;
  118. });
  119. // Listen for changes to the "to" date
  120. toDateInput.addEventListener('change', function () {
  121. // Get the selected "to" date
  122. const toDate = new Date(this.value);
  123. // Get today's date
  124. const today = new Date();
  125. // If the selected "to" date is greater than today's date, reset it to today's date
  126. if (toDate > today) {
  127. toDateInput.valueAsDate = today;
  128. }
  129. });
  130. function getReport(){
  131. var x = document.getElementById("msg");
  132. if (x.style.display === "none") {
  133. x.style.display = "block";
  134. }
  135. return false;
  136. }
  137. document.onreadystatechange = function() {
  138. if (document.readyState !== "complete") {
  139. document.querySelector("body").style.visibility = "hidden";
  140. document.querySelector("#msg").style.visibility = "visible";
  141. } else {
  142. document.querySelector("#msg").style.display = "none";
  143. document.querySelector("body").style.visibility = "visible";
  144. }
  145. };
  146. </script>
  147. </body>
  148. </html>