/* In this page, we dynamically create a list of videos on hand based upon the category of movies that the user selected, which is passed to this page via the "request.category" property. We also make each ID a link that, when clicked, rents the movie for the particular customer, indicated in the "client.id" property. Note that we have chosen to use "write()" statements to dynamically generate all of the HTML for this particular page. We could have also chosen to use backquotes to insert the dynamic text into plain HTML tags, as we have done in other pages in this application. */ project.lock(); if (request.category == null) { write("
"); } else { cursor = database.cursor("select * from videos where videos.numonhand > 0 AND videos.category = '" + request.category + "' order by title"); write("

"); write("
Videos on Hand - " + request.category + "
"); write("
" + "Title" + " | Synopsis" + "
--- | ---
"); while(cursor.next()) { write("
" + "" + cursor.title + ""); /* "" + cursor.title + ""); */ write(" | " + cursor.synopsis + "
"); } // end WHILE loop write("

Home"); } // end if-else project.unlock();