templates/bus/book_reserve.html.twig line 1

Open in your IDE?
  1. <fieldset style="border: 1px solid #dfffdf;padding: 15px;">
  2. <legend></legend>
  3. <div>
  4. SEAT NUMBER:- <b>{{ seat.seatNumber }}</b>
  5. </div>
  6. <hr>
  7. <div id="form" class="form">
  8. <div class="row">
  9. <div class="col-lg-6 col-md-6" style="text-align: right;">
  10. <button class="btn btn-success" style="width: 110px;" onclick="book({{ seat.seatNumber }})">Book</button>
  11. </div>
  12. <div class="col-lg-6 col-md-6" style="text-align: left;">
  13. <button class="btn btn-warning" style="width: 110px;" onclick="reserve({{ seat.seatNumber }})">Reserve</button>
  14. </div>
  15. </div>
  16. </div>
  17. </fieldset>
  18. <script>
  19. function book(seat){
  20. $.get('/bus/trip/{{ trip.id }}/seat/'+seat).then(function (response){
  21. console.log($($.parseHTML(response)).find("div#seatDetails"));
  22. // $('div#mpesa_id').replaceWith($(response).find('div#mpesa_id'));
  23. $('div#seatDetails').html(response);
  24. });
  25. }
  26. function reserve(seat){
  27. $.get('/bus/trip/{{ trip.id }}/seat/'+seat+'/reserve').then(function (response){
  28. console.log($($.parseHTML(response)).find("div#seatDetails"));
  29. // $('div#mpesa_id').replaceWith($(response).find('div#mpesa_id'));
  30. $('div#seatDetails').html(response);
  31. });
  32. }
  33. </script>