/* This page dynamically generates a list of a particular customer's current video rentals. The customer is indicated by the CLIENT.customerID property. The customerID is set when the user signs in (see "client.htm"). */ /* If the customerID property has been set, generate the table of rentals. Otherwise, redirect the user to sign in page, client.htm. */ if(client.customerID != null) { cursor = database.cursor("select * from rentals, videos where rentals.returnDate IS NULL AND rentals.videoId = videos.id AND rentals.customerId = " + client.customerID); } else { redirect("client.htm"); }

## Current Rentals

Title | Rental Date | Due Date
--- | --- | ---
while(cursor.next()) {
write(cursor.title); | write(datetoString(cursor.rentalDate)); | write(datetoString(cursor.dueDate));
}