1818 href ="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css "
1919 rel ="stylesheet ">
2020
21- < link rel ="shortcut icon " th:href ="@{/images/favicon.ico} "
22- type ="image/png ">
21+ < link rel ="shortcut icon " th:href ="@{/images/favicon.ico} " type ="image/png ">
2322
2423</ head >
2524< style >
26- table th {
27- user-select : none;
28- background : # eee ;
29- }
25+ table th { user-select : none; background : # eee ;}
3026</ style >
3127
3228
3531 < div th:replace ="clerk/header :: navbar "> </ div >
3632 < span class ="glyphicon glyphicon-envelope "> </ span >
3733 < nav class ="bodyMargin " aria-label ="breadcrumb ">
38- < ol class ="breadcrumb ">
39- < li class ="breadcrumb-item "> < a th:href ="@{/clerk/home} "> Home</ a > </ li >
40- < li class ="breadcrumb-item active " aria-current ="page "> Cancel
41- Reservation</ li >
42- </ ol >
34+ < ol class ="breadcrumb ">
35+ < li class ="breadcrumb-item "> < a th:href ="@{/clerk/home} "> Home</ a > </ li >
36+ < li class ="breadcrumb-item active " aria-current ="page "> Cancle Reservation</ li >
37+ </ ol >
4338 </ nav >
44-
39+
4540 < main role ="main " class ="container-fluid ">
41+
42+ < h2 > Reservation Catalog : Cancle Reservation </ h3 >
43+
44+ < br >
45+
46+
47+ < div align ="center " th:if ="${successMessage} " class ="alert alert-success alert-dismissible fade show " role ="alert " th:utext ="${successMessage} ">
48+ </ div >
49+
50+ < table class ="table table-bordered " id ="filterableTable ">
51+ < thead >
52+ < tr >
53+ < th data-sort-prop ="id "> Id</ th >
54+ < th data-sort-prop ="firstName "> FirstName</ th >
55+ < th data-sort-prop ="lastName "> LastName</ th >
56+ < th data-sort-prop ="driverLicienceNo "> Driver Licence No</ th >
57+ < th data-sort-prop ="expiryDate "> Expiry Date</ th >
58+ < th data-sort-prop ="phoneNo "> Phone No</ th >
59+ < th data-sort-prop ="color "> Color</ th >
60+ < th data-sort-prop ="plateNo "> Plate No</ th >
61+ < th data-sort-prop ="make "> Make</ th >
62+ < th data-sort-prop ="year "> Year</ th >
63+ < th data-sort-prop ="fromDateTime "> Booking From</ th >
64+ < th data-sort-prop ="toDateTime "> Booking Due</ th >
65+ < th data-sort-prop ="createdOn "> Reservation Created on</ th >
66+ < th > Cancel Booking</ th >
67+ </ tr >
68+ </ thead >
69+ < tbody >
70+ < tr th:each ="record : ${records} ">
71+ < td th:text ="${record.id} "> </ td >
72+ < td th:text ="${record.client.firstName} "> </ td >
73+ < td th:text ="${record.client.lastName} "> </ td >
74+ < td th:text ="${record.client.driverLicienceNo} "> </ td >
75+ < td th:text ="${#dates.format(record.client.expiryDate, 'MM/dd/yyyy')} "> </ td >
76+ < td th:text ="${record.client.phoneNo} "> </ td >
77+ < td th:text ="${record.vehicle.color} "> </ td >
78+ < td th:text ="${record.vehicle.plateNo} "> </ td >
79+ < td th:text ="${record.vehicle.make} "> </ td >
80+ < td th:text ="${record.vehicle.year} "> </ td >
81+ < td th:text ="${#dates.format(record.fromDateTime, 'MM/dd/yyyy hh:mm')} "> </ td >
82+ < td th:text ="${#dates.format(record.toDateTime, 'MM/dd/yyyy hh:mm')} "> </ td >
83+ < td th:text ="${#dates.format(record.createdOn, 'MM/dd/yyyy hh:mm')} "> </ td >
84+
85+ < td >
86+ < a
87+ th:href ="@{'/clerk/reservation/cancel/' + ${record.id} } ">
88+ < button type ="button " class ="btn btn-labeled btn-danger ">
89+ < span class ="btn-label "> < i class ="glyphicon glyphicon-remove "> </ i > </ span > Cancel</ button >
90+ </ a >
91+ </ td >
92+
93+ </ tr >
94+ </ tbody >
95+ </ table >
4696
47- < h2 >
48- Reservation Catalog : Cancel Reservation
49- </ h3 >
50-
51- < br >
52-
53-
54- < div align ="center " th:if ="${successMessage} "
55- class ="alert alert-success alert-dismissible fade show " role ="alert "
56- th:utext ="${successMessage} "> </ div >
57-
58- < table class ="table table-bordered " id ="filterableTable ">
59- < thead >
60- < tr >
61- < th data-sort-prop ="id "> Id</ th >
62- < th data-sort-prop ="firstName "> FirstName</ th >
63- < th data-sort-prop ="lastName "> LastName</ th >
64- < th data-sort-prop ="driverLicienceNo "> Driver Licence No</ th >
65- < th data-sort-prop ="expiryDate "> Expiry Date</ th >
66- < th data-sort-prop ="phoneNo "> Phone No</ th >
67- < th data-sort-prop ="color "> Color</ th >
68- < th data-sort-prop ="plateNo "> Plate No</ th >
69- < th data-sort-prop ="make "> Make</ th >
70- < th data-sort-prop ="year "> Year</ th >
71- < th data-sort-prop ="fromDateTime "> Booking From</ th >
72- < th data-sort-prop ="toDateTime "> Booking Due</ th >
73- < th data-sort-prop ="createdOn "> Reservation Created on</ th >
74- < th > Cancel Booking</ th >
75- </ tr >
76- </ thead >
77- < tbody >
78- < tr th:each ="record : ${records} ">
79- < td th:text ="${record.id} "> </ td >
80- < td th:text ="${record.client.firstName} "> </ td >
81- < td th:text ="${record.client.lastName} "> </ td >
82- < td th:text ="${record.client.driverLicienceNo} "> </ td >
83- < td
84- th:text ="${#dates.format(record.client.expiryDate, 'MM/dd/yyyy')} "> </ td >
85- < td th:text ="${record.client.phoneNo} "> </ td >
86- < td th:text ="${record.vehicle.color} "> </ td >
87- < td th:text ="${record.vehicle.plateNo} "> </ td >
88- < td th:text ="${record.vehicle.make} "> </ td >
89- < td th:text ="${record.vehicle.year} "> </ td >
90- < td
91- th:text ="${#dates.format(record.fromDateTime, 'MM/dd/yyyy hh:mm')} "> </ td >
92- < td
93- th:text ="${#dates.format(record.toDateTime, 'MM/dd/yyyy hh:mm')} "> </ td >
94- < td
95- th:text ="${#dates.format(record.createdOn, 'MM/dd/yyyy hh:mm')} "> </ td >
9697
97- < td > < a
98- th:href ="@{'/clerk/reservation/cancel/' + ${record.id} } ">
99- < button type ="button " class ="btn btn-labeled btn-danger ">
100- < span class ="btn-label "> < i
101- class ="glyphicon glyphicon-remove "> </ i > </ span > Cancel
102- </ button >
103- </ a > </ td >
10498
105- </ tr >
106- </ tbody >
107- </ table >
10899 </ main >
109100 <!-- /.container -->
110101
@@ -124,52 +115,42 @@ <h2>
124115 integrity ="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k "
125116 crossorigin ="anonymous "> </ script >
126117
127- < script th:src ="@{/js/filter.js} ">
128-
129- </ script >
130- < script th:src ="@{/js/main.js} ">
131-
132- </ script >
133- < script th:inline ="javascript ">
134- //thymeleaf to javascript variables
135- /*<![CDATA[*/
136- var sortProperty = /*[[${sortProperty}]]*/ null ;
137- var sortDesc = /*[[${order}]]*/ null ;
138-
139- /*]]>*/
140-
141- $ ( document )
142- . ready (
143- function ( ) {
144- //show up/down arrows
145- $ ( "table thead th" )
146- . each (
147- function ( ) {
148- var head = $ ( this ) ;
149- if ( head . attr ( 'data-sort-prop' ) == sortProperty ) {
150- head
151- . append ( sortDesc == "desc" ? ' <i class="fa fa-sort-desc"></i>'
152- : ' <i class="fa fa-sort-asc"></i>' ) ;
153- }
154- } ) ;
155-
156- //set click action, reload page on clicking with all query params
157- /* $("table thead th").click(function() {
158- var headerSortPropName = $(this).attr("data-sort-prop");
159- if(headerSortPropName==undefined){
160- return;
161- }
162- if(headerSortPropName==sortProperty){
163- window.location.href = window.location.pathname+
164- '?sort='+ headerSortPropName+'&order='+
165- (sortDesc == "desc" ?'asc':'desc');
166- console.log("a");
167- }else{
168- window.location.href = window.location.pathname+
169- '?sort='+ headerSortPropName+'&order=asc';
170- }
171- }); */
172- } ) ;
173- </ script >
118+ < script th:src ="@{/js/filter.js} "> </ script >
119+ < script th:src ="@{/js/main.js} " > </ script >
120+ < script th:inline ="javascript ">
121+ //thymeleaf to javascript variables
122+ /*<![CDATA[*/
123+ var sortProperty = /*[[${sortProperty}]]*/ null ;
124+ var sortDesc = /*[[${order}]]*/ null ;
125+
126+ /*]]>*/
127+
128+ $ ( document ) . ready ( function ( ) {
129+ //show up/down arrows
130+ $ ( "table thead th" ) . each ( function ( ) {
131+ var head = $ ( this ) ;
132+ if ( head . attr ( 'data-sort-prop' ) == sortProperty ) {
133+ head . append ( sortDesc == "desc" ? ' <i class="fa fa-sort-desc"></i>' : ' <i class="fa fa-sort-asc"></i>' ) ;
134+ }
135+ } ) ;
136+
137+ //set click action, reload page on clicking with all query params
138+ /* $("table thead th").click(function() {
139+ var headerSortPropName = $(this).attr("data-sort-prop");
140+ if(headerSortPropName==undefined){
141+ return;
142+ }
143+ if(headerSortPropName==sortProperty){
144+ window.location.href = window.location.pathname+
145+ '?sort='+ headerSortPropName+'&order='+
146+ (sortDesc == "desc" ?'asc':'desc');
147+ console.log("a");
148+ }else{
149+ window.location.href = window.location.pathname+
150+ '?sort='+ headerSortPropName+'&order=asc';
151+ }
152+ }); */
153+ } ) ;
154+ </ script >
174155</ body >
175156</ html >
0 commit comments