Browse Source

building id dynamically and live issue fixed (wrong build & category) booking by user & fixed the changes officerdashboard page for caretaker2

master
AJITHKUMAR12 9 months ago
parent
commit
d9358e997e
  1. 498
      src/main/java/com/gcc/coworkspace/controller/BookingController.java
  2. 1356
      src/main/java/com/gcc/coworkspace/controller/controller.java
  3. 1236
      src/main/java/com/gcc/coworkspace/service/BookingService.java
  4. 4
      src/main/resources/application.properties
  5. 1860
      src/main/resources/templates/caretaker/officer-dashboard.html
  6. 1633
      src/main/resources/templates/user/book-Conferance.html
  7. 1485
      src/main/resources/templates/user/book-reading.html
  8. 35
      src/main/resources/templates/user/book-workdesk.html

498
src/main/java/com/gcc/coworkspace/controller/BookingController.java

@ -1,11 +1,10 @@
package com.gcc.coworkspace.controller;
import com.gcc.coworkspace.component.UserSession;
import com.gcc.coworkspace.configuration.AppConfig;
import com.gcc.coworkspace.configuration.QrGenerator;
import com.gcc.coworkspace.constants.AppConstants;
import com.gcc.coworkspace.exception.NoSlotAvailable;
import com.gcc.coworkspace.service.BookingService;
import com.gcc.coworkspace.service.NormalSMS;
import com.gcc.coworkspace.service.PaymentService;
@ -50,66 +49,117 @@ public class BookingController {
@Autowired
private PaymentService paymentService;
@Autowired
private NormalSMS normalSMS;
/*
* @PostMapping("/saveInTemp")
* public Map<String, Object> booking(@RequestParam("catId") int catId,
*
* @RequestParam("buildId") int buildId,
*
* @RequestParam("subId") int subId,
*
* @RequestParam("noOfPeople") int noOfPeople,
*
* @RequestParam("fromDate") LocalDate fromDate,
*
* @RequestParam("toDate") LocalDate toDate,
*
* @RequestParam("userName") String userName,
*
* @RequestParam("userMobile") long userMobile,
* // @RequestParam("amount") double amount,
*
* @RequestParam("slots") List<Integer> slots) {
*
* System.out.println(catId);
* System.out.println(slots);
* return bookingService.saveTempBooking(userName, userMobile, slots, fromDate,
* toDate, noOfPeople, catId, buildId,
* subId);
*
* }
*/
@PostMapping("/saveInTemp")
public Map<String, Object> booking(@RequestParam("catId") int catId,
@RequestParam("buildId") int buildId,
@RequestParam("subId") int subId,
@RequestParam("noOfPeople") int noOfPeople,
@RequestParam("fromDate") LocalDate fromDate,
@RequestParam("toDate") LocalDate toDate,
@RequestParam("userName") String userName,
@RequestParam("userMobile") long userMobile,
// @RequestParam("amount") double amount,
@RequestParam("slots") List<Integer> slots){
System.out.println(catId);
System.out.println(slots);
return bookingService.saveTempBooking(userName,userMobile, slots, fromDate, toDate,noOfPeople,catId,buildId,subId) ;
public ResponseEntity<Map<String, Object>> booking(
@RequestParam("catId") int catId,
@RequestParam("buildId") int buildId,
@RequestParam("subId") int subId,
@RequestParam("noOfPeople") int noOfPeople,
@RequestParam("fromDate") LocalDate fromDate,
@RequestParam("toDate") LocalDate toDate,
@RequestParam("userName") String userName,
@RequestParam("userMobile") long userMobile,
@RequestParam("slots") List<Integer> slots) {
System.out.println("buildId" + buildId);
System.out.println("catId" + catId);
}
Map<String, Object> response = new HashMap<>();
// @PostMapping("/saveBooking")
// public int saveBooking(@RequestParam("tempBookId") int tempBookId){
//
// return bookingService.saveBooking(tempBookId);
// }
/*
@GetMapping("/checkAvail")
public Boolean checkAvailability(int bid,int cid,LocalDate bDate,int scid,int noOfPerson,int slotId){
System.out.println("check Availability");
return bookingService.checkAvailabilityByBdate(bid,cid,bDate,scid,noOfPerson,slotId);
try {
Map<String, Object> result = bookingService.saveTempBooking(
userName, userMobile, slots,
fromDate, toDate, noOfPeople,
catId, buildId, subId);
response.put("status", "SUCCESS");
response.putAll(result);
return ResponseEntity.ok(response);
} catch (NoSlotAvailable e) {
response.put("status", "ERROR");
response.put("message", e.getMessage());
return ResponseEntity
.status(HttpStatus.BAD_REQUEST)
.body(response);
}
}
*/
// @PostMapping("/saveBooking")
// public int saveBooking(@RequestParam("tempBookId") int tempBookId){
//
// return bookingService.saveBooking(tempBookId);
// }
/*
* @GetMapping("/checkAvail")
* public Boolean checkAvailability(int bid,int cid,LocalDate bDate,int scid,int
* noOfPerson,int slotId){
* System.out.println("check Availability");
* return
* bookingService.checkAvailabilityByBdate(bid,cid,bDate,scid,noOfPerson,slotId)
* ;
* }
*/
@GetMapping("/checkAvail")
public Boolean checkAvailability(int bid,int cid,LocalDate bDate,int scid,int noOfPerson,int slotId){
public Boolean checkAvailability(int bid, int cid, LocalDate bDate, int scid, int noOfPerson, int slotId) {
System.out.println("check Availability");
return bookingService.checkAvailabilityByBdate(bid,cid,bDate,scid,noOfPerson,slotId);
return bookingService.checkAvailabilityByBdate(bid, cid, bDate, scid, noOfPerson, slotId);
}
@GetMapping("/hasTodayAttendance")
public ResponseEntity<Map<String,Object>> hasTodayAttendance(
public ResponseEntity<Map<String, Object>> hasTodayAttendance(
@RequestParam("buildingid") int buildingid) {
boolean exists = bookingService.hasTodayAttendance(buildingid);
Map<String,Object> response = new HashMap<>();
Map<String, Object> response = new HashMap<>();
response.put("exists", exists);
return ResponseEntity.ok(response);
}
@PostMapping(value="/create_order")
public String create_order(HttpServletRequest request,@RequestParam("id") int tempid) throws RazorpayException {
@PostMapping(value = "/create_order")
public String create_order(HttpServletRequest request, @RequestParam("id") int tempid) throws RazorpayException {
// Get data from the service
Map<String, Object> tempBookingInfo = bookingService.getTempBookingByTempId(tempid);
// Check if the list is not empty
if (tempBookingInfo!=null && !tempBookingInfo.isEmpty()) {
if (tempBookingInfo != null && !tempBookingInfo.isEmpty()) {
String tempbookid = tempBookingInfo.get("tempbookid").toString();
String amount = tempBookingInfo.get("amount").toString();
@ -121,54 +171,52 @@ public class BookingController {
System.out.println("Invalid number format for amount: " + amount);
}
//To enable testing mode in appConstants if required for testing & development
var client = new RazorpayClient(AppConstants.key_id,AppConstants.key_secret);
// To enable testing mode in appConstants if required for testing & development
var client = new RazorpayClient(AppConstants.key_id, AppConstants.key_secret);
JSONObject options = new JSONObject();
options.put("amount", amountDouble * 100);
options.put("currency", "INR");
Order od = client.orders.create(options);
System.out.println(od);
paymentService.saveorderLog(od.get("id").toString(),od.toString(),tempbookid);
paymentService.saveorderLog(od.get("id").toString(), od.toString(), tempbookid);
return od.toString();
} else {
System.out.println("No data found for tempid: " + tempid);
return "No data found for tempid: " + tempid;
}
// return "error";
// return "error";
}
@PostMapping("/Confirm")
public String updateOrder(@RequestBody Map<String,Object> data){
String tempid=data.get("id").toString();;
String pay_id= data.get("payment_id").toString();
String order_id=data.get("order_id").toString();
String status=data.get("status").toString();
String amount =(Double.parseDouble(data.get("amount").toString())/100)+"";
int pid = paymentService.savePayment(amount,pay_id,order_id,status,0+"",0+"");
public String updateOrder(@RequestBody Map<String, Object> data) {
String tempid = data.get("id").toString();
;
String pay_id = data.get("payment_id").toString();
String order_id = data.get("order_id").toString();
String status = data.get("status").toString();
String amount = (Double.parseDouble(data.get("amount").toString()) / 100) + "";
int pid = paymentService.savePayment(amount, pay_id, order_id, status, 0 + "", 0 + "");
try {
int bookingId = bookingser.saveBooking(Integer.parseInt(tempid),pid);
//
// Print or use the values as required
System.out.println("Temp ID: " + tempid);
System.out.println("Booking ID:- "+bookingId);
return bookingId+"";
int bookingId = bookingser.saveBooking(Integer.parseInt(tempid), pid);
//
// Print or use the values as required
System.out.println("Temp ID: " + tempid);
System.out.println("Booking ID:- " + bookingId);
return bookingId + "";
}catch (Exception e){
System.out.println("error: "+e.getMessage());
} catch (Exception e) {
System.out.println("error: " + e.getMessage());
System.out.println("No booking data found for tempid: " + tempid);
return "error";
}
}
//mobile app development
// mobile app development
@GetMapping("/bookings")
public ResponseEntity<List<Map<String, Object>>> getBookingsByMobileNo(@RequestParam long mobileNo) {
List<Map<String, Object>> bookings = bookingService.getBookingByMobileNo(mobileNo);
@ -177,6 +225,7 @@ public class BookingController {
}
return ResponseEntity.ok(bookings); // Return 200 with the bookings data
}
@GetMapping("/generate-qrcode")
public ResponseEntity<?> generateQRCode(@RequestParam(required = true) String booking_id) {
if (booking_id == null) {
@ -184,7 +233,7 @@ public class BookingController {
}
try {
// URL for the booking details API
String url = appConfig.getFull_URL()+"/bookingQRCode?booking_id=" + booking_id;
String url = appConfig.getFull_URL() + "/bookingQRCode?booking_id=" + booking_id;
// Generate QR code as base64 string
String base64QRCode = QrGenerator.generateQRCode(url);
@ -214,15 +263,14 @@ public class BookingController {
int otp = rand.nextInt(90000) + 10000;
System.out.print("\n otp---:" + otp);
String bodyMessage = normalSMS.sendOTPNsms(mobileNo,otp+"");
String bodyMessage = normalSMS.sendOTPNsms(mobileNo, otp + "");
HttpSession session = request.getSession();
session.setAttribute("otp", otp);
session.setAttribute("mobileNo", mobileNo);
return bodyMessage;
}
@GetMapping(value = "/verifyOTP")
@ResponseBody
public Map<String, Object> verifyOtp(HttpServletRequest request, @RequestParam String otp) {
@ -270,103 +318,103 @@ public class BookingController {
return response;
}
/*
@GetMapping(value = "/verifyOTP")
public String verifyOtp(HttpServletRequest request, @RequestParam String otp) {
HttpSession session = request.getSession();
* @GetMapping(value = "/verifyOTP")
* public String verifyOtp(HttpServletRequest request, @RequestParam String otp)
* {
* HttpSession session = request.getSession();
*
* try {
* Integer session_otp = (Integer) session.getAttribute("otp");
* System.out.println("session_otp---:" + session_otp);
* Integer entered_otp = Integer.parseInt(otp);
*
* if (session_otp != null && session_otp.equals(entered_otp)) {
* System.out.println("Entered OTP Correct");
* session.setAttribute("verifiedotp", "success");
* userSession.setMobileno(Long.parseLong(session.getAttribute("mobileNo").
* toString()));
* return "Success";
* } else {
* System.out.println("Incorrect OTP. Please enter correct OTPs.");
* session.setAttribute("verifiedotp", "error");
* return "Error";
* }
* } catch (NumberFormatException e) {
* System.out.println("Invalid OTP format: " + otp);
* return "Error";
* } catch (Exception e) {
* System.out.println("Error verifying OTP: " + e.getMessage());
* return "Error";
* }
* }
*/
try {
Integer session_otp = (Integer) session.getAttribute("otp");
System.out.println("session_otp---:" + session_otp);
Integer entered_otp = Integer.parseInt(otp);
if (session_otp != null && session_otp.equals(entered_otp)) {
System.out.println("Entered OTP Correct");
session.setAttribute("verifiedotp", "success");
userSession.setMobileno(Long.parseLong(session.getAttribute("mobileNo").toString()));
return "Success";
} else {
System.out.println("Incorrect OTP. Please enter correct OTPs.");
session.setAttribute("verifiedotp", "error");
return "Error";
}
} catch (NumberFormatException e) {
System.out.println("Invalid OTP format: " + otp);
return "Error";
} catch (Exception e) {
System.out.println("Error verifying OTP: " + e.getMessage());
return "Error";
}
}
*/
// @PostMapping("/validatelogin")
// public ResponseEntity<?> checkLogin(@RequestParam String usernametxt, @RequestParam String passwordtxt, HttpSession session) {
// try {
// String userName = bookingser.validateLogin(usernametxt, passwordtxt);
// if (userName != null) {
// // Set user info in the session
// session.setAttribute("mobileno", usernametxt);
// session.setAttribute("user_name",userName );
// return ResponseEntity.ok(userName);
// } else {
// return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body("error");
// }
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Internal server error occurred");
// }
// }
// public ResponseEntity<?> checkLogin(@RequestParam String usernametxt,
// @RequestParam String passwordtxt, HttpSession session) {
// try {
// String userName = bookingser.validateLogin(usernametxt, passwordtxt);
// added by yogi
@PostMapping("/validatelogin")
public ResponseEntity<?> checkLogin(
@RequestParam String usernametxt,
@RequestParam String passwordtxt,
HttpSession session) {
// if (userName != null) {
// // Set user info in the session
// session.setAttribute("mobileno", usernametxt);
// session.setAttribute("user_name",userName );
try {
Map<String, Object> userData = bookingser.validateLogin(usernametxt, passwordtxt);
// return ResponseEntity.ok(userName);
// } else {
// return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body("error");
// }
// } catch (Exception e) {
// e.printStackTrace();
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Internal
// server error occurred");
// }
// }
if (userData != null) {
// added by yogi
@PostMapping("/validatelogin")
public ResponseEntity<?> checkLogin(
@RequestParam String usernametxt,
@RequestParam String passwordtxt,
HttpSession session) {
String userName = (String) userData.get("user_name");
//Integer bid = (Integer) userData.get("bid");
try {
Map<String, Object> userData = bookingser.validateLogin(usernametxt, passwordtxt);
// FIX: Convert BID safely
Integer bid = Integer.valueOf(userData.get("bid").toString());
if (userData != null) {
// Store in session
// Store in session
session.setAttribute("user_name", userName);
session.setAttribute("bid", bid);
// Return clean JSON
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("user_name", userName);
response.put("bid", bid);
String userName = (String) userData.get("user_name");
// Integer bid = (Integer) userData.get("bid");
// FIX: Convert BID safely
Integer bid = Integer.valueOf(userData.get("bid").toString());
System.out.println("Logged in user=" + userName + ", BID=" + bid);
// Store in session
// Store in session
session.setAttribute("user_name", userName);
session.setAttribute("bid", bid);
// Return clean JSON
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("user_name", userName);
response.put("bid", bid);
return ResponseEntity.ok(response);
} else {
return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body("error");
}
System.out.println("Logged in user=" + userName + ", BID=" + bid);
} catch (Exception e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Internal server error occurred");
return ResponseEntity.ok(response);
} else {
return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body("error");
}
}
} catch (Exception e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Internal server error occurred");
}
}
//ak
// ak
@GetMapping("/bookinghistorydetails")
@ResponseBody
@ -374,7 +422,7 @@ public class BookingController {
long mobileNo = Long.parseLong(mobileno);
return bookingService.getBookingDetailsByMobileNo(mobileNo);
}
@GetMapping("/bookingDetails")
@ResponseBody
public List<Map<String, Object>> getBookingDetailsByMobileNo(@RequestParam String mobileno) {
@ -383,94 +431,106 @@ public class BookingController {
}
@GetMapping("/getAvailabilityBySlot")
public List<Map<String, Object>> getAvailabilityBySlot(@RequestParam int scid, @RequestParam String selectedDate) {
public List<Map<String, Object>> getAvailabilityBySlot(@RequestParam int scid, @RequestParam String selectedDate) {
return bookingService.getCalendarBasedOnSubCatId(scid, selectedDate);
// Replace with the actual view name
}
/* @GetMapping("/getbookingdetailDashBoard")
public List<Map<String, Object>> getbookingdetailDashBoard(@RequestParam String fromDate, @RequestParam String toDate, @RequestParam String status) {
return bookingService.getbookingdetailDashBoard(fromDate,toDate, status);
}*/
//ak
/*
* @GetMapping("/getbookingdetailDashBoard")
* public List<Map<String, Object>> getbookingdetailDashBoard(@RequestParam
* String fromDate, @RequestParam String toDate, @RequestParam String status) {
* return bookingService.getbookingdetailDashBoard(fromDate,toDate, status);
* }
*/
// ak
@GetMapping("/getbookingdetailDashBoard")
public List<Map<String, Object>> getbookingdetailDashBoard(
@RequestParam String fromDate,
@RequestParam String toDate,
@RequestParam String status,
@RequestParam int bid) {
System.out.println("fromdate: " + fromDate);
System.out.println("bid: " + bid);
System.out.println("status: " + status);
System.out.println("toDate: " + toDate);
return bookingService.getbookingdetailDashBoard(fromDate, toDate, status, bid);
}
public List<Map<String, Object>> getbookingdetailDashBoard(
@RequestParam String fromDate,
@RequestParam String toDate,
@RequestParam String status,
@RequestParam int bid) {
System.out.println("fromdate: " + fromDate);
System.out.println("bid: " + bid);
System.out.println("status: " + status);
System.out.println("toDate: " + toDate);
return bookingService.getbookingdetailDashBoard(fromDate, toDate, status, bid);
}
/*
* @GetMapping("/amountCollected")
* public List<Map<String, Object>> getAmountCollected(@RequestParam("fromDate")
* String fromDate,
*
* @RequestParam("toDate") String toDate) {
* // Convert the string dates to LocalDate
* LocalDate parsedFromDate = LocalDate.parse(fromDate);
* LocalDate parsedToDate = LocalDate.parse(toDate);
* return bookingService.getAmountCollectedByDate(parsedFromDate, parsedToDate);
* }
*/
@GetMapping("/amountCollected")
public List<Map<String, Object>> getAmountCollected(
@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate,
@RequestParam("bid") int bid) {
/* @GetMapping("/amountCollected")
public List<Map<String, Object>> getAmountCollected(@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate) {
// Convert the string dates to LocalDate
LocalDate parsedFromDate = LocalDate.parse(fromDate);
LocalDate parsedToDate = LocalDate.parse(toDate);
return bookingService.getAmountCollectedByDate(parsedFromDate, parsedToDate);
}*/
@GetMapping("/amountCollected")
public List<Map<String, Object>> getAmountCollected(
@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate,
@RequestParam("bid") int bid) {
LocalDate parsedFromDate = LocalDate.parse(fromDate);
LocalDate parsedToDate = LocalDate.parse(toDate);
return bookingService.getAmountCollectedByDate(parsedFromDate, parsedToDate, bid);
}
return bookingService.getAmountCollectedByDate(parsedFromDate, parsedToDate, bid);
}
/*@GetMapping("/bookingCountByCategory")
public List<Map<String, Object>> getBookingCountsByCategory(@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate,) {
// Call the service method to get the booking counts for the specified date range
return bookingService.getBookingCountsByCategory(fromDate, toDate);
}*/
//ak
/*
* @GetMapping("/bookingCountByCategory")
* public List<Map<String, Object>>
* getBookingCountsByCategory(@RequestParam("fromDate") String fromDate,
*
* @RequestParam("toDate") String toDate,) {
* // Call the service method to get the booking counts for the specified date
* range
* return bookingService.getBookingCountsByCategory(fromDate, toDate);
* }
*/
// ak
@GetMapping("/bookingCountByCategory")
public List<Map<String, Object>> getBookingCountsByCategory(
@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate,
@RequestParam("bid") int bid) {
public List<Map<String, Object>> getBookingCountsByCategory(
@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate,
@RequestParam("bid") int bid) {
return bookingService.getBookingCountsByCategory(fromDate, toDate, bid);
}
return bookingService.getBookingCountsByCategory(fromDate, toDate, bid);
}
/* @GetMapping("/totalBookingCounts")
public List<Map<String, Object>> getBookingCounts(@RequestParam("fromDate") String fromDate,@RequestParam("toDate")String toDate) {
// Call service method to get booking counts
return bookingService.getBookingCountsByDate(fromDate,toDate);
}*/
//ak
/*
* @GetMapping("/totalBookingCounts")
* public List<Map<String, Object>> getBookingCounts(@RequestParam("fromDate")
* String fromDate,@RequestParam("toDate")String toDate) {
* // Call service method to get booking counts
* return bookingService.getBookingCountsByDate(fromDate,toDate);
* }
*/
// ak
@GetMapping("/totalBookingCounts")
public List<Map<String, Object>> getBookingCounts(
@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate,
@RequestParam("bid") int bid) {
public List<Map<String, Object>> getBookingCounts(
@RequestParam("fromDate") String fromDate,
@RequestParam("toDate") String toDate,
@RequestParam("bid") int bid) {
return bookingService.getBookingCountsByDate(fromDate, toDate, bid);
}
return bookingService.getBookingCountsByDate(fromDate, toDate, bid);
}
@GetMapping("/bookinghistory")
@ResponseBody
public List<Map<String, Object>> getBookingHistory() {
if (userSession != null && userSession.getMobileno() != 0) {
return bookingService.getBookingByMobileNo(userSession.getMobileno());
}
return Collections.emptyList();
}
@ResponseBody
public List<Map<String, Object>> getBookingHistory() {
if (userSession != null && userSession.getMobileno() != 0) {
return bookingService.getBookingByMobileNo(userSession.getMobileno());
}
return Collections.emptyList();
}
@GetMapping("/getComplaintsByMobile")
public ResponseEntity<?> getComplaintAndUserDetailsByMobile(@RequestParam("mobileNo") String mobileNo) {
Map<String, Object> result = bookingService.getComplaintAndUserDetailsByMobile(mobileNo);

1356
src/main/java/com/gcc/coworkspace/controller/controller.java
File diff suppressed because it is too large
View File

1236
src/main/java/com/gcc/coworkspace/service/BookingService.java
File diff suppressed because it is too large
View File

4
src/main/resources/application.properties

@ -1,6 +1,6 @@
spring.application.name=conferencehall
#spring.profiles.active=dev
spring.profiles.active=prod
spring.profiles.active=dev
#spring.profiles.active=prod
server.port=8074

1860
src/main/resources/templates/caretaker/officer-dashboard.html
File diff suppressed because it is too large
View File

1633
src/main/resources/templates/user/book-Conferance.html
File diff suppressed because it is too large
View File

1485
src/main/resources/templates/user/book-reading.html
File diff suppressed because it is too large
View File

35
src/main/resources/templates/user/book-workdesk.html

@ -282,15 +282,18 @@
class="col-lg-6 col-sm-12 justify-content-center align-items-center">
<!-- Enter Details -->
<!-- <h5 class="mb-3" style="color:#E29D25">Select Your Preference: <button id="backBtn" class="btn btn-sm btn-outline-primary">Back </button></h5> -->
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0" style="color:#E29D25">Select Your Preference:</h5>
<!-- <h5 class="mb-3" style="color:#E29D25">Select Your Preference: <button id="backBtn" class="btn btn-sm btn-outline-primary">Back </button></h5> -->
<div
class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0" style="color:#E29D25">Select Your
Preference:</h5>
<button id="backBtn2" onclick="history.back()"
class="btn btn-primary">Back</button>
</div>
<button id="backBtn2" onclick= "history.back()" class="btn btn-primary">Back</button>
</div>
<div class="mb-3 row">
<label style="font-weight:bold;" for="numSeats"
class="col-sm-12 col-md-4 col-form-label"><strong>Number
@ -308,7 +311,7 @@
</div>
<!-- <div class="mb-3 row">
<!-- <div class="mb-3 row">
<label style="font-weight:bold;" for="buildingname" class="col-sm-4 col-form-label text-end fw-semibold">
Building name:
</label>
@ -655,12 +658,12 @@
window.location.href = '/muthalvarpadaippagam';
});
}
});
$(document).on('click', '#backBtn', function () {
//window.location.href = '/muthalvarpadaippagam/home';
});
//window.location.href = '/muthalvarpadaippagam/home';
});
fetch('/muthalvarpadaippagam/book/api/marquee')
@ -955,10 +958,20 @@
$('#ackModal').modal('show');
}
},
error: function (xhr, status, error) {
/*error: function (xhr, status, error) {
alert("Please select another slot. The selected slot is now full.");
console.log('Error sending data:', error);
console.log('Response text:', xhr.responseText); // Log response text for debugging
}*/
error: function (xhr) {
let msg = "Booking failed. Please try again.";
if (xhr.responseJSON && xhr.responseJSON.message) {
msg = xhr.responseJSON.message;
}
alert(msg);
}
});
}

Loading…
Cancel
Save