Changeset 3d60932 for src/main/resources/static
- Timestamp:
- 02/13/25 10:05:35 (4 months ago)
- Branches:
- master
- Children:
- a70b5a4
- Parents:
- 57e58a3
- Location:
- src/main/resources/static
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/resources/static/FlightSearch.html
r57e58a3 r3d60932 165 165 const bookingDate = new Date().toISOString().split('T')[0]; 166 166 167 167 168 const bookingData = { 168 flightId: flight.flightI d,169 flightId: flight.flightID, 169 170 bookingDate: bookingDate, 170 171 status: 'PENDING', … … 174 175 axios.post('/api/bookings', bookingData) 175 176 .then(response => { 177 const bookingID = response.data.bookingID; 176 178 alert("Booked successfully!"); 177 window.location.href = `/transaction?amount=${encodeURIComponent(totalCost)} `;179 window.location.href = `/transaction?amount=${encodeURIComponent(totalCost)}&bookingId=${encodeURIComponent(bookingID)}&flightId=${encodeURIComponent(flight.flightID)}`; 178 180 }) 179 181 .catch(error => { … … 189 191 190 192 const wishlistData = { 191 targetId: flight.flightI d,193 targetId: flight.flightID, 192 194 wishlisted: flight.wishlisted 193 195 }; … … 274 276 console.error("Error fetching flights", error); 275 277 }); 276 axios.get('api/bookings/getAll/${flight.flightI D}')278 axios.get('api/bookings/getAll/${flight.flightId}') 277 279 .then(response => { 278 280 console.log(response.data); -
src/main/resources/static/ReviewPage.html
r57e58a3 r3d60932 20 20 21 21 <div class="review-list"> 22 <div v-for="review in reviews" :key="review. id" class="review-item">23 <h3> {{ review.subject }}</h3>24 <p>{{ review. description}}</p>22 <div v-for="review in reviews" :key="review.reviewid" class="review-item"> 23 <h3>Description</h3> 24 <p>{{ review.review_comment }}</p> 25 25 <span>{{ review.date }}</span> 26 26 </div> … … 29 29 </div> 30 30 </div> 31 31 <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script> 32 <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> 32 33 <script> 33 34 new Vue({ 34 35 el: '#app', 35 36 data: { 36 reviews: [ 37 { 38 id: 1, 39 subject: 'Great experience!', 40 description: 'The flight was amazing, the service was excellent, and the views were breathtaking.', 41 date: '2025-02-01', 42 }, 43 { 44 id: 2, 45 subject: 'Good but delayed', 46 description: 'The flight was comfortable, but it was delayed by two hours, which caused some inconvenience.', 47 date: '2025-02-02', 48 }, 49 { 50 id: 3, 51 subject: 'Okay, but not perfect', 52 description: 'Everything was fine, but the food options could have been better.', 53 date: '2025-02-03', 54 }, 55 ] 37 reviews: [] 56 38 }, 57 39 methods: { 58 40 logout() { 59 // Logic to log out the user, e.g., clearing session or redirecting to home page 60 window.location.href = '/'; // Redirecting to home page 41 window.location.href = '/'; 61 42 } 43 }, 44 mounted() { 45 axios.get('api/reviews') 46 .then(response => { 47 this.reviews = response.data; 48 console.log(response.data); 49 }) 50 .catch(error => { 51 console.error("Error fetching reviews", error); 52 }); 62 53 } 63 54 }); -
src/main/resources/static/TransactionPage.html
r57e58a3 r3d60932 53 53 el: '#app', 54 54 data: { 55 bookingId: '', 55 56 cardholder: '', 56 57 cardNumber: '', … … 63 64 this.flightId = urlParams.get('flightId'); 64 65 this.amount = urlParams.get('amount'); 66 this.bookingId = urlParams.get('bookingId') 65 67 66 68 const user = JSON.parse(localStorage.getItem("user")); … … 79 81 bookingId:this.bookingId 80 82 }; 81 83 console.log(transaction); 82 84 axios.post('api/payments', transaction) 83 85 .then(response => { 84 console.log( "Payment successful");86 console.log(response.data); 85 87 this.paymentSuccess = true; 86 88 setTimeout(() => window.location.href = '/flights',2000); -
src/main/resources/static/UserSignup.html
r57e58a3 r3d60932 35 35 <div class="form-group"> 36 36 <label for="phoneNumber">Phone Number</label> 37 <input type="text" id="phoneNumber" v-model="phone Number" required placeholder="Enter your phone number" />37 <input type="text" id="phoneNumber" v-model="phone_number" required placeholder="Enter your phone number" /> 38 38 </div> 39 39 … … 53 53 email: '', 54 54 password: '', 55 phone Number: ''55 phone_number: '' 56 56 }, 57 57 methods: { 58 58 signupUser() { 59 // Create user data object60 59 const userData = { 61 60 name: this.name, … … 63 62 email: this.email, 64 63 password: this.password, 65 phone Number: this.phoneNumber64 phone_number: this.phone_number 66 65 }; 67 66 68 // Send POST request to the backend69 67 axios.post('http://localhost:8080/api/user/signup', userData) 70 68 .then(response => { -
src/main/resources/static/WishlistPage.html
r57e58a3 r3d60932 81 81 }, 82 82 showReviews(flight) { 83 window.location.href = `/review ?flightId=${flight.id}`;83 window.location.href = `/reviews?flightId=${flight.flightid}`; 84 84 }, 85 85 logout() {
Note:
See TracChangeset
for help on using the changeset viewer.