change attribut feedback

This commit is contained in:
2025-06-07 00:50:39 +08:00
parent c1d87b9797
commit 75e93b9d5b

View File

@@ -12,12 +12,13 @@
let checkout_date = ''; let checkout_date = '';
let feedback = ''; let feedback = '';
let errorMessage = ''; let errorMessage = '';
let book_process = '';
let airport_greet = '';
let arrival_greet = '';
let maintenance_proc = '';
let bf_service = '';
// Star ratings (1-5) // Star ratings (1-5)
let book_process = 0;
let airport_greet = 0;
let arrival_greet = 0;
let bf_service = 0;
let overal_star = 0; let overal_star = 0;
// Boolean checkboxes // Boolean checkboxes
@@ -53,6 +54,7 @@
arrival_greet, arrival_greet,
bf_service, bf_service,
overal_star, overal_star,
maintenance_proc,
extend_disc, extend_disc,
nextstay_disc, nextstay_disc,
become_sponsor become_sponsor
@@ -62,7 +64,6 @@
console.error('Error submitting feedback:', error.message); console.error('Error submitting feedback:', error.message);
errorMessage = 'Failed to submit feedback. Please try again.'; errorMessage = 'Failed to submit feedback. Please try again.';
} else { } else {
// ✅ Send webhook
try { try {
await fetch(WEBHOOK_URL, { await fetch(WEBHOOK_URL, {
method: 'POST', method: 'POST',
@@ -76,6 +77,7 @@
book_process, book_process,
airport_greet, airport_greet,
arrival_greet, arrival_greet,
maintenance_proc,
bf_service, bf_service,
overal_star, overal_star,
extend_disc, extend_disc,
@@ -93,10 +95,11 @@
checkin_date = ''; checkin_date = '';
checkout_date = ''; checkout_date = '';
feedback = ''; feedback = '';
book_process = 0; book_process = '';
airport_greet = 0; airport_greet = '';
arrival_greet = 0; arrival_greet = '';
bf_service = 0; maintenance_proc = '';
bf_service = '';
overal_star = 0; overal_star = 0;
extend_disc = false; extend_disc = false;
nextstay_disc = false; nextstay_disc = false;
@@ -145,31 +148,36 @@
<label class="flex flex-col"> <label class="flex flex-col">
Booking Process: Booking Process:
<small class="text-sm text-gray-500 mb-1">Please highlights of the booking process (anything neglected by the staff or something done well by the staff)</small> <small class="text-sm text-gray-500 mb-1">Please highlights of the booking process (anything neglected by the staff or something done well by the staff)</small>
<StarRating bind:value={book_process} name="Booking Process" /> <textarea bind:value={book_process} placeholder="Write your feedback here..." required class="p-2 border rounded-md min-h-[120px]"></textarea>
</label> </label>
<label class="flex flex-col"> <label class="flex flex-col">
Airport Greeting and Transportation: Airport Greeting and Transportation:
<small class="text-sm text-gray-500 mb-1">Please highlights of the airport transfer experience (anything neglected by the staff or something done well by the staff)</small> <small class="text-sm text-gray-500 mb-1">Please highlights of the airport transfer experience (anything neglected by the staff or something done well by the staff)</small>
<StarRating bind:value={airport_greet} name="Airport Greeting" /> <textarea bind:value={airport_greet} placeholder="Write your feedback here..." required class="p-2 border rounded-md min-h-[120px]"></textarea>
</label> </label>
<label class="flex flex-col"> <label class="flex flex-col">
Arrival & Check-in: Arrival & Check-in:
<small class="text-sm text-gray-500 mb-1">Please highlights of the arrival and check-in process(anything neglected by the staff or something done well by the staff)</small> <small class="text-sm text-gray-500 mb-1">Please highlights of the arrival and check-in process(anything neglected by the staff or something done well by the staff)</small>
<StarRating bind:value={arrival_greet} name="Arrival Greeting" /> <textarea bind:value={arrival_greet} placeholder="Write your feedback here..." required class="p-2 border rounded-md min-h-[120px]"></textarea>
</label> </label>
<label class="flex flex-col"> <label class="flex flex-col">
Breakfast Service or other food and beverage service utilized: Breakfast Service or other food and beverage service utilized:
<small class="text-sm text-gray-500 mb-1">Please highlighs of the breakfast service(anything neglected by the staff or something done well by the staff)</small> <small class="text-sm text-gray-500 mb-1">Please highlighs of the breakfast service(anything neglected by the staff or something done well by the staff)</small>
<StarRating bind:value={bf_service} name="Breakfast Service" /> <textarea bind:value={bf_service} placeholder="Write your feedback here..." required class="p-2 border rounded-md min-h-[120px]"></textarea>
</label>
<label class="flex flex-col">
Housekeeping and Maintenance:
<small class="text-sm text-gray-500 mb-1">Please highlighs of the housekeeping and maintenance service(anything neglected by the staff or something done well by the staff)</small>
<textarea bind:value={maintenance_proc} placeholder="Write your feedback here..." required class="p-2 border rounded-md min-h-[120px]"></textarea>
</label>
<label class="flex flex-col">
What did you think of the villa in General:
<small class="text-sm text-gray-500 mb-1">Did you have any other issue of area you would like to highligh during stay? Please let us know any other comments you have - the good, the bad, and the ugly</small>
<textarea bind:value={feedback} placeholder="Write your feedback here..." required class="p-2 border rounded-md min-h-[120px]"></textarea>
</label> </label>
<label for="fb_ov">What did you think of the villa in General</label>
<small class="text-sm text-gray-500 mb-1">Did you have any other issue of area you would like to highligh during stay? Please let us know any other comments you have - the good, the bad, and the ugly</small>
<textarea id="fb_ov" bind:value={feedback} placeholder="Write your feedback here..." required class="p-2 border rounded-md min-h-[120px]"></textarea>
<!-- Centered big star--> <!-- Centered big star-->
<div class="text-center mt-6"> <div class="text-center mt-6">
<small class="text-sm text-gray-500 block mb-2"> <small class="text-sm text-gray-500 block mb-2">