%@ page language="PL/SQL" %> <%@ page errorPage="Hrs_Error_Page.psp" %> <%@ plsql procedure="room_availability_details" %> <%@ plsql parameter="p_hotel_id" type="NUMBER" %> <%! /** Overview : This PSP is part of the HRS application sample. The PSP displays the details Room availability details for the Hotel id passed in. Modification History: Person Date Comments ------------------------------------------------------------- Srinivas Ramarao 10-AUG-2000 Initial Sample **/ /* Cursor to select the Hotel Name */ CURSOR c_hotels(cp_hotel_id IN NUMBER) IS SELECT name FROM hotels WHERE id = cp_hotel_id; /* Cursor to get the room types for the hotel id passed in */ CURSOR c_room_types(cp_hotel_id IN NUMBER) IS SELECT room_type,standard_rate,currency FROM available_room_types WHERE hot_id = cp_hotel_id; /* Cursor to fetch the room totals for the hotel id passed in */ CURSOR c_room_totals(cp_hotel_id IN NUMBER) IS SELECT total_sglb,total_dble,total_qeen,total_king,total_suit,total_othr FROM room_availability WHERE hot_id = cp_hotel_id; /* Variable Declarations */ l_ra_rec c_room_totals%ROWTYPE; l_h_rec c_hotels%ROWTYPE; %>
Room Type | Standard Rate | Currency | Available Rooms |
---|---|---|---|
<%= l_rt_rec.room_type %> | <%= l_rt_rec.standard_rate %> | <%= l_rt_rec.currency %> | <% IF l_rt_rec.room_type = 'SGLB' THEN %> <%= l_ra_rec.total_sglb %> <% ELSIF l_rt_rec.room_type = 'DBLE' THEN %> <%= l_ra_rec.total_dble %> <% ELSIF l_rt_rec.room_type = 'QEEN' THEN %> <%= l_ra_rec.total_qeen %> <% ELSIF l_rt_rec.room_type = 'KING' THEN %> <%= l_ra_rec.total_king %> <% ELSIF l_rt_rec.room_type = 'SUIT' THEN %> <%= l_ra_rec.total_suit %> <% ELSIF l_rt_rec.room_type = 'OTHR' THEN %> <%= l_ra_rec.total_othr %> <% END IF; %> | <% END LOOP; %>