
<?php
// dvdstoresearch.php3
// Search for DVDs

require( 'dvdstorecommon.php3' );

GenerateHTMLHeader( "DVD titles search" );

if ( empty( $title ) && empty( $director )){
	//First call to this script
	DisplaySearchMenu($memberID);
}else {
	//The case where search criteria is sent to the script through the form
	if (dvd_title_search( $title, $director, $matches)== false) {
		DisplayErrorMessage( "dvd_title_search() failed" );
	} else if ( count($matches)== 0) {
		//Zero matches
		DisplayErrorMessage( "No matches found" );
	} else {
		//Display all the matches found
		for ( $i = 0; $i < count($matches); ++$i ) {
			DisplayDVDDetails( $matches[$i], SEARCH );
		}
	}
}

?>
