<?php include ("_website_init.php"); 
?>
<?php $CMS_USER = getCurrentUserFromCMS();   ?>
<?php  require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;
// Check for mobile environment.
 if($detect->isMobile()){
   header("Location: https://popupdude.com/m/search.php");
 } 

 // load records from 'navigation_menu'
  list($navigation_menuRecords, $navigation_menuMetaData) = getRecords(array(
    'tableName'   => 'navigation_menu',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
  ?>
<?php 
  // error checking
   $errorsAndAlerts = '';
   if (@$_REQUEST['save']) 
  { 
 
   $action = '' ;
   
  }
?>
<?php if (@$_REQUEST['pdf']==1) { createPDF_fromOutput('inline', 'popup.pdf'); } ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ERIC GREENBERG'S POP UP BOOKS</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
<link href="css/eg.css.php" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/fonts.css.php" />
<?php include ("_preload.php"); ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php 
    $output = ''; 
    foreach ($google_font_namesRecords as $record) { $record['name'] = preg_replace("/[, ]/", "+", $record['name']);
      $output .= $record['name'] . "|"; 
    } 
    $output = rtrim($output,"|"); // remove trailing pipe 
    print $output; 
?>">
<style type="text/css">
input[type=submit] {
	font-weight: bold;
}
</style>
<script type="text/javascript">
jQuery("#zip").click(function() {
  alert( "Handler for .click() called." );
});</script>
</head>
<body >
<p>&nbsp;</p>
<table class="shadow3" bgcolor="#<?php echo $eg_colorsRecord['main_box_background_color'] ?>" width="55%" border="0" align="center" cellpadding="0">
  <tr>
    <td  colspan="2" bgcolor="#<?php echo $eg_colorsRecord['masthead_background_color'] ?>"><div class="under round-corner" align="left">
        <?php foreach ($common_informationRecord['masthead'] as $index => $upload): ?>
        <img src="<?php echo $upload['thumbUrlPath3'] ?>"   alt="EG Masthead" />
        <?php endforeach ?>
      </div></td>
  </tr>
  <tr>
    <td class="shadow3"  width="20%" rowspan="4" align="right" valign="top" bgcolor="#<?php echo $eg_colorsRecord['menu_background_color'] ?>" ><?php include ("_mainnavmenu.php"); ?></td>
    <td width="82%"></td>
  </tr>
  <tr>
    <td align="center" ><br />
      <br />
      <div align="center" style="width:80%; text-align:left"> 
        <!-- Insert Active Code Here --> 
        <br />
        <br />
        <hr  align="left" style="height:2px; background-color:#<?php echo $eg_colorsRecord['menu_background_color'] ?>;" width="90%" color="#<?php echo $eg_colorsRecord['menu_background_color'] ?>"/>
        <br />
        <?php if(@$errorsAndAlerts):?>
        <table align="left" width="90%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td align="left"  colspan="2"><span class="heading_font" style="color: #C00;"><?php echo @$errorsAndAlerts ?></span></td>
          </tr>
        </table>
        <?php endif ?>
        <?php if  (!@$_REQUEST['save'] == 1 || @$errorsAndAlerts):
		    ?>
        <table align="left" width="90%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="2"><span class="heading_font"><b>SEARCH BOOKS</b><br />
              </span></td>
          </tr>
          <tr>
            <td align="left"  colspan="2"><span class=" sub_heading_font">Use any of the pull down fields below to narrow your search. Use only those criteria most important to you.</span> <br />
              <span class="text_font"><br />
              You can always change your search criteria and re-submit. <br />
              <br />
              <b>Hint:</b> to select more than one option for any of the fields below, hold the CTRL (CMD) key and click to highlight each of the options.<br />
              </span><!-- <br />
            <font color="#FF0000">*</font> = Required Field <br />
            <br />--></td>
          </tr>
          <?php if(@$errorsAndAlerts):?>
          <tr>
            <td align="left"  colspan="2"><span class="heading_font" style="color: #C00;"><?php echo @$errorsAndAlerts ?></span></td>
          </tr>
          <?php endif ?>
        </table>
        <br />
        <br />
        <form method="post"  action= "search18.php">
          <input type="hidden" name="save" value="1" />
          <table align="left" width="90%" border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Title</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="title_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['title_query']); ?>"  ></td>
            </tr>
              <tr>
              <td  align="right" class="text_font"><b>Admin Book Type Search:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "genre, genre_2, genre_3_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'genre') as $value => $label13): ?>
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['genre, genre_2, genre_3_match[]']);?>> <?php echo $label13; ?></option>
                  <?php endforeach ?>
                </select></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Public Book Type Search:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "genre, genre_2, genre_3_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'public_genre') as $value => $label13): ?>
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['genre, genre_2, genre_3_match[]']);?>> <?php echo $label13; ?></option>
                  <?php endforeach ?>
                </select></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Genre 1 Book Type Search:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "genre_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'genre') as $value => $label7): ?>
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['genre']);?>> <?php echo $label7; ?></option>
                  <?php endforeach ?>
                </select></td>
            </tr>
            <?php if  (@$CURRENT_USER['isAdmin']): ?><tr>
              <td  align="right" class="text_font"><b>Book Location:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "location_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'location') as $value => $label8): ?>
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['location']);?>> <?php echo $label8; ?></option>
                  <?php endforeach ?>
                </select></td>
            </tr><?php endif ?>
            <tr>
              <td  align="right" class="text_font"><b>Writer</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="writer_1,writer_2_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['writer_1,writer_2_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Illustrator</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="illustrator_1,illustrator_2_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['illustrator_1,illustrator_2_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Paper Engineer</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="paper_engineer_1,paper_engineer_2,paper_engineer_3_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['paper_engineer_1,paper_engineer_2,paper_engineer_3_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Publisher</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="publisher_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['publisher_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Publication Date</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="publication_date_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['publication_date_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Quality:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "quality_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'quality') as $value => $label9): ?>
                  
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['quality']);?>> <?php echo $label9; ?></option>
                  <?php endforeach ?>
                </select></td>
            </tr>
              <?php if (@$CURRENT_USER['isAdmin']): ?>
               <?php // *********************************** ?>
             <tr>
              <td  align="right" class="text_font"><b>Paper Engineer Rating:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "paper_engineer_rating_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'paper_engineer_rating') as $value => $label14): ?>
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['paper_engineer_rating']);?>> <?php echo $label14; ?></option>
                  <?php endforeach ?>
                </select>
                </td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Overall Rating:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "overall_rating_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'overall_rating') as $value => $label16): ?>
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['overall_rating']);?>> <?php echo $label16; ?></option>
                  <?php endforeach ?>
                </select>
                </td>
            </tr>
             <tr>
              <td  align="right" class="text_font"><b>Illustration Rating:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "illustration_rating_match[]"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;"  multiple>
                  <?php foreach (getListOptions('books', 'illustration_rating') as $value => $label15): ?>
                  <option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['illustration_rating']);?>> <?php echo $label15; ?></option>
                  <?php endforeach ?>
                </select>
                </td>
            </tr>
            
            
           <?php // *********************************** ?>
           <?php endif ?>
			   <?php if (@$CURRENT_USER['isAdmin']): ?>
            <tr>
              <td align="right" class="text_font"><b>Get Better Copy: </b></td>
              <td align="left" valign="bottom" colspan="2"><select name = "get_better_copy" width="300" class="text_font" style="width: 300px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;">
                  <option value="">Optional</option>
                  <option value="1">Yes</option>
                  </select></td>
            </tr><?php endif ?>
			<?php if (@$CURRENT_USER['isAdmin']): ?>
            <tr>
              <td align="right" class="text_font"><b>Want This Book: </b></td>
              <td align="left" valign="bottom" colspan="2"><select name = "want_this_book" width="300" class="text_font" style="width: 300px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;">
                  <option value="">Optional</option>
                  <option value="1">Yes</option>
                  </select></td>
            </tr><?php endif ?>
			
          
           <?php if (@$CURRENT_USER['isAdmin']): ?>
            <tr>
              <td  align="right" class="text_font"><b>Purchased From</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="purchased_from_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['purchased_from_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Purchased Date</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="purchase_date_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['purchase _date_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Purchase Price</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="purchase_price_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['purchase_price_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Sold To</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="sold_to_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['sold_to_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Sale Date</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="sale_date_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['sale_date_query']); ?>"  ></td>
            </tr>
            <tr>
              <td  align="right" class="text_font"><b>Sale Price</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><input type="text" name="sale_price_query"  width="300" class="text_font" style="width: 300px; max-height: 50px; background-color:#<?php echo $eg_colorsRecord['main_box_background_color'] ?>;" placeholder="Optional- Partials OK" value="<?php echo htmlencode(@$_REQUEST['sale_price_query']); ?>"  ></td>
            </tr><?php endif ?>
             <tr>
              <td align="right" class="text_font">&nbsp;</td>
              <td align="left" valign="bottom" colspan="2"> <input type = "checkbox" id="pdf" name="pdf" value = "1" <?php checkedIf(1,
@$_REQUEST['pdf']);?> /> <span class="text_font"><b>Check to create a downloadable PDF of the search results instead of a web page. (This may take a few moments.)</b></span><br></td>
                  
            </tr>
            <tr>
              <td align="right" class="text_font"><b>&nbsp;</b></td>
              <td align="left" valign="bottom" colspan="2"><input type="submit" value="Submit Search Filters" ></td>
            </tr>
          </table>
       
        <?php endif ?>
         </form>
        <table align="left" width="90%" border="0" cellspacing="0" cellpadding="2">
          <tr> 
            <!--<td>&nbsp;</td>-->
            <td align="center" colspan="2"><form method="post" action="" >
                <INPUT TYPE="submit" VALUE="Cancel Search Filters - Start Another Search">
              </form></td>
          </tr>
          <!-- </table>--><br />
          <!-- <table align="left" width="90%" border="0" cellspacing="0" cellpadding="2"> --> 
          <!-- BEGIN RESULTS DISPLAY-->
          
          <tr>
            <td colspan="2"><?php
		// EACH PULL DOWNN NEEDS ITS OWN CODE HERE
		
		 // Start Book Type Search
		  @$booksearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['genre, genre_2, genre_3_match[]']) {
		   @$booksearchCriteria = "<b>Book Search 1: </b>";  // set default value 
		   // cycle through each genre selected
		   foreach ($_REQUEST['genre, genre_2, genre_3_match[]'] as $genre_3) {
			 
			 // lookup genre number in database
			 $genreRecord = mysql_get("genre_categories", $genre_3);
			 
			 if ($genreRecord) {
			   // add "genre" value to output
			   @$booksearchCriteria .= $genreRecord['genre_names'] .", ";
			 }
		   }
		  }
		  // End Book Type Search
		
		
		  // Start Genre 1
		  @$genresearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['genre_match']) {
		   @$genresearchCriteria = "<b>Genre 1: </b>";  // set default value 
		   // cycle through each genre selected
		   foreach ($_REQUEST['genre_match'] as $genre) {
			 
			 // lookup genre number in database
			 $genreRecord = mysql_get("genre_categories", $genre);
			 
			 if ($genreRecord) {
			   // add "genre" value to output
			   @$genresearchCriteria .= $genreRecord['genre_names'] .", ";
			 }
		   }
		  }
		  // End Genre 1
		  
		   // Start Genre 2
		  @$genre_2searchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['genre_2_match']) {
		   @$genre_2searchCriteria = "<b>Genre 2: </b>";  // set default value 
		   // cycle through each genre 2 selected
		   foreach ($_REQUEST['genre_2_match'] as $genre_2) {
			 
			 // lookup Genre 2 number in database
			 $genre_2Record = mysql_get("genre_categories", $genre_2);
			 
			 if ($genre_2Record) {
			   // add "genre 2" value to output
			   @$genre_2searchCriteria .= $genre_2Record['genre_names'] .", ";
			 }
		   }
		  }
		  // End Genre 2
		  
		  	   // Start Genre 3
		  @$genre_3searchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['genre_3_match']) {
		   @$genre_3searchCriteria = "<b>Genre 3: </b>";  // set default value 
		   // cycle through each genre 3 selected
		   foreach ($_REQUEST['genre_3_match'] as $genre_3) {
			 
			 // lookup Genre 2 number in database
			 $genre_3Record = mysql_get("genre_categories", $genre_3);
			 
			 if ($genre_3Record) {
			   // add "genre 3" value to output
			   @$genre_3searchCriteria .= $genre_3Record['genre_names'] .", ";
			 }
		   }
		  }
		  // End Genre 3
		   
		   // Start Book Location
		  @$locationsearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['location_match']) {
		   @$locationsearchCriteria = "<b>Location: </b>";  // set default value 
		   // cycle through each location selected
		   foreach ($_REQUEST['location_match'] as $location) {
			 
			 // lookup location number in database
			 $locationRecord = mysql_get("book_location", $location);
			 
			 if ($locationRecord) {
			   // add "location" value to output
			   @$locationsearchCriteria .= $locationRecord['shelf_location'] .", ";
			 }
		   }
		  }
		  // End Book Location
		  
		  	   // Start Quality
		  @$qualitysearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['quality_match']) {
		   @$qualitysearchCriteria = "<b>Quality: </b>";  // set default value 
		   // cycle through each quality selected
		   foreach ($_REQUEST['quality_match'] as $quality_values) {
			 
			 // lookup quality number in database
			 $qualityRecord = mysql_get("quality_categories", $quality_values);
			 
			 if ($qualityRecord) {
			   // add "quality" value to output
			   @$qualitysearchCriteria .= $qualityRecord['quality_values'] .", ";
			 }
		   }
		  }
		  // End Quality
		 
		//********************************************  
		  // Start Paper Engineer Rating
		  @$paper_engineer_ratingsearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['paper_engineer_rating_keyword']) {
		   @$paper_engineer_ratingsearchCriteria = "<b>Paper Engineer Rating: </b>";  // set default value 
		   // cycle through each Paper Engineer Rating selected
		   foreach ($_REQUEST['paper_engineer_rating_keyword'] as $paper_engineer_rating_values) {
			 
			 // lookup Paper Engineer Rating number in database
			 $paper_engineer_ratingRecord = mysql_get("paper_engineer_rating_categories", $paper_engineer_rating_values);
			 
			 if ($paper_engineer_ratingRecord) {
			   // add "Paper Engineer Rating" value to output
			   @$paper_engineer_ratingsearchCriteria .= $paper_engineer_ratingRecord['paper_engineer_rating_values'] .", ";
			 }
		   }
		  }
		  // End Paper Engineer Rating
		  
		  		  	   // Start Overall Rating
		  @$overall_ratingsearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['overall_rating_keyword']) {
		   @$overall_ratingsearchCriteria = "<b>Overall Rating: </b>";  // set default value 
		   // cycle through each Overall rating selected
		   foreach ($_REQUEST['overall_rating_keyword'] as $overall_rating_values) {
			 
			 // lookup Overall Rating number in database
			 $overall_ratingRecord = mysql_get("overall_rating_categories", $overall_rating_values);
			 
			 if ($overall_ratingRecord) {
			   // add "Overall Rating" value to output
			   @$overall_ratingsearchCriteria .= $overall_ratingRecord['overall_rating_values'] .", ";
			 }
		   }
		  }
		  // End Overall Rating
		  
		     		  	   // Start Illustration Rating
		  @$illustration_ratingsearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['illustration_rating_keyword']) {
		   @$illustration_ratingsearchCriteria = "<b>Illustration_Rating: </b>";  // set default value 
		   // cycle through each Illustration Rating selected
		   foreach ($_REQUEST['illustration_rating_keyword'] as $illustration_rating_values) {
			 
			 // lookup Illustration Rating number in database
			 $illustration_ratingRecord = mysql_get("illustration_rating_categories", $illustration_rating_values);
			 
			 if ($illustration_ratingRecord) {
			   // add "Illustration Rating" value to output
			   @$illustration_ratingsearchCriteria .= $illustration_ratingRecord['illustration_rating_values'] .", ";
			 }
		   }
		  }
		  // End Illustration Rating			 
		//***************************************************    
		 
    if ((@$_REQUEST['save'] == 1) && @$_REQUEST['get_better_copy'] && @$_REQUEST['get_better_copy'] == 1) { @$bettercopysearchCriteria .= "<b>Look For A Better Copy:</b> Yes"; }
		 if ((@$_REQUEST['save'] == 1) && @$_REQUEST['want_this_book'] && @$_REQUEST['want_this_book'] == 1) { @$wantbooksearchCriteria .= "<b>Want This Book:</b> Yes"; }
	//  if ((@$_REQUEST['save'] == 1) && @$_REQUEST['get_better_copy'] && (@$_REQUEST['get_better_copy'] == 0 || @$_REQUEST['get_better_copy'] == "")) { @$bettercopysearchCriteria .= "<b>Look For A Better Copy:</b> No"; }
		  
		  @$locationsearchCriteria = chop(@$locationsearchCriteria, ', '); // remove trailing , or spaces
		 @$locationsearchCriteria = chop(@$locationsearchCriteria, '- '); // remove trailing - or spaces
		 
		  @$genresearchCriteria = chop(@$genresearchCriteria, ', '); // remove trailing , or spaces
		 @$genresearchCriteria = chop(@$genresearchCriteria, '- '); // remove trailing - or spaces
		 
		  @$qualitysearchCriteria = chop(@$qualitysearchCriteria, ', '); // remove trailing , or spaces
		  @$qualitysearchCriteria = chop(@$qualitysearchCriteria, '- '); // remove trailing - or spaces
		  
		   //***************************************
		  @$paper_engineer_ratingsearchCriteria = chop(@$paper_engineer_ratingsearchCriteria, ', '); // remove trailing , or spaces
		 @$paper_engineer_ratingsearchCriteria = chop(@$paper_engineer_ratingsearchCriteria, '- '); // remove trailing - or spaces
		 
		  @$overall_ratingsearchCriteria = chop(@$overall_ratingsearchCriteria, ', '); // remove trailing , or spaces
		 @$overall_ratingsearchCriteria = chop(@$overall_ratingsearchCriteria, '- '); // remove trailing - or spaces
		 
		 
		  @$illustration_ratingsearchCriteria = chop(@$illustration_ratingsearchCriteria, ', '); // remove trailing , or spaces
		 @$illustration_ratingsearchCriteria = chop(@$illustration_ratingsearchCriteria, '- '); // remove trailing - or spaces
		 //**************************************
		 
		  @$bettercopysearchCriteria = chop(@$bettercopysearchCriteria, ', '); // remove trailing , or spaces
		  @$bettercopysearchCriteria = chop(@$bettercopysearchCriteria, '- '); // remove trailing - or spaces
		  
		  @$wantbooksearchCriteria = chop(@$wantbooksearchCriteria, ', '); // remove trailing , or spaces
		  @$wantbooksearchCriteria = chop(@$wantbooksearchCriteria, '- '); // remove trailing - or spaces
			 
			 @$booksearchCriteria = chop(@$booksearchCriteria, ', '); // remove trailing , or spaces
		  @$booksearchCriteria = chop(@$booksearchCriteria, '- '); // remove trailing - or spaces
			  
			 
		?>
              <?php @$searchCriteria = '';?>
              <?php @$searchCriteria2 = '';?>
              <?php @$searchCriteria3 = '';?>
              <?php @$searchCriteria4 = '';?>
              <?php @$searchCriteria5 = '';?>
              <?php @$searchCriteria6 = '';?>
              <?php @$searchCriteria7 = '';?>
              <?php @$searchCriteria8 = '';?>
              <?php @$searchCriteria9 = '';?>
              <?php @$searchCriteria10 = '';?>
              <?php @$searchCriteria11 = '';?>
              <?php @$searchCriteria12 = '';?>
              <?php @$searchCriteria13 = '';?>
              <?php @$searchCriteria14 = '';?>
              <?php @$searchCriteria15 = '';?>
              <?php @$searchCriteria16 = '';?>
              <?php @$searchCriteria17 = '';?>
              <?php @$searchCriteria18 = '';?>
              <?php @$searchCriteria19 = '';?>
              <?php @$searchCriteria30 = '';?>
              </td>
          </tr>
          <tr>
            <td colspan="2"><div align="left"> <span class="text_font">
                <?php if (!$errorsAndAlerts) :?>
                
                <?php if(@$_REQUEST['save']):?>
                <?php $count = 0 ?>
             	
                <?php   if (@!$CURRENT_USER['isAdmin']) :?>
                <?php foreach ($booksRecords as $record): ?>
                <?php  if (@$record['want_this_book'] ==1 ) :?>
                <?php $count++ ?>
                <?php  endif ?>
                <?php endforeach?>
                <?php   endif?>
			<?php $nonAdminTotal = -$count + $booksMetaData['totalRecords'] ?>
                <hr  align="left" style="height:2px; background-color:#<?php echo $eg_colorsRecord['menu_background_color'] ?>;" width="90%" color="#<?php echo $eg_colorsRecord['menu_background_color'] ?>"/>
             <?php if($nonAdminTotal == 0 || $nonAdminTotal >= 2):?>
                There are
                <?php elseif($nonAdminTotal == 1):?>
                There is
                <?php endif ?>
                <?php echo $nonAdminTotal; ?>
                <?php if($nonAdminTotal == 0 || $nonAdminTotal >= 2):?>
                listings
                <?php elseif($nonAdminTotal == 1):?>
                listing
                <?php endif ?>
                that
                <?php if($nonAdminTotal == 0 || $nonAdminTotal >= 2):?>
                match
                <?php elseif($nonAdminTotal == 1):?>
                matches
                <?php endif ?>
         
                <?php if (@$booksearchCriteria || @$locationsearchCriteria || @$genresearchCriteria || @$genre_2searchCriteria || @$genre_3searchCriteria || @$wantbooksearchCriteria ||@$qualitysearchCriteria ||  @$bettercopysearchCriteria || @$searchCriteria || @$searchCriteria2 || @$searchCriteria3 || @$searchCriteria4 || @$searchCriteria5 || @$searchCriteria6 || @$searchCriteria7|| @$searchCriteria || @$searchCriteria8 || @$searchCriteria9 || @$searchCriteria10 || @$searchCriteria11 || @$searchCriteria12 || @$searchCriteria13 || @$searchCriteria14 || @$searchCriteria15 || @$searchCriteria16 || @$searchCriteria17 || @$searchCriteria18 || @$searchCriteria19 || @$searchCriteria30): // add searchable field variables here?>
                <br />
                <?php if (@$locationsearchCriteria):?><?php echo @$locationsearchCriteria ?> <br /><?php endif ?>
                <?php if (@$genresearchCriteria):?><?php echo @$genresearchCriteria ?> <br /><?php endif ?>
                <?php if (@$genre_2searchCriteria):?><?php echo @$genre_2searchCriteria ?> <br /><?php endif ?>
                 <?php if (@$genre_3searchCriteria):?><?php echo @$genre_3searchCriteria ?> <br /><?php endif ?>
                <?php if (@$qualitysearchCriteria):?><?php echo @$qualitysearchCriteria ?><br /><?php endif ?>
                <?php if (@$bettercopysearchCriteria):?><?php echo @$bettercopysearchCriteria ?><br /><?php endif ?>
                <?php if (@$wantbooksearchCriteria):?><?php echo @$wantbooksearchCriteria ?><?php endif ?>
             <?php if (@$booksearchCriteria):?><?php echo @$booksearchCriteria ?><?php endif ?>
                
                <?php else :?>
              all listings
                <?php  endif ?>
       
                <?php if (@$_REQUEST['title_query']) { $searchCriteria .= "and with a <b>Title</b> including: {$_REQUEST['title_query']}"; } ?>
                <?php if (  @!$searchCriteria ==''):?>
                <?php echo @$searchCriteria ?>
                <?php endif?>
                <?php if (@$_REQUEST['genre, genre_2, genre_3_match[]']) { $searchCriteria30 .= "and with a <b>Book Search</b> including: {@$booksearchCriteria}"; } ?>
                <?php // if (  @!$searchCriteria30 ==''):?>
                <?php echo @$booksearchCriteria ?>
                 <?php echo @$searchCriteria30 // just to be sure ?>
                 <?php // echo $_REQUEST['genre, genre_2, genre_3_match[]'] // just to be sure ?>
                <?php // endif?>
                
                <?php if (@$_REQUEST['writer_1,writer_2_query']) {@$searchCriteria2 .= "and with a <b>Writer's Name</b> including: {$_REQUEST['writer_1,writer_2_query']}"; } ?>
                <?php if (  @!$searchCriteria2 ==''):?>
                <?php echo @$searchCriteria2 ?>
                <?php endif?>
                <?php if (@$_REQUEST['illustrator_1,illustrator_2_query']) {@$searchCriteria3 .= "and with an <b>Illustrator's Name</b> including: {$_REQUEST['illustrator_1,illustrator_2_query']}"; } ?>
                <?php if (  @!$searchCriteria3 ==''):?>
                <?php echo @$searchCriteria3 ?>
                <?php endif?>
                <?php if (@$_REQUEST['paper_engineer_1,paper_engineer_2,paper_engineer_3_query']) {@$searchCriteria4 .= "and with a <b>Paper Engineer's Name</b> including: {$_REQUEST['paper_engineer_1,paper_engineer_2,paper_engineer_3_query']}"; } ?>
                <?php if (  @!$searchCriteria4 ==''):?>
                <?php echo @$searchCriteria4 ?>
                <?php endif?>
                <?php if (@$_REQUEST['publisher_query']) {@$searchCriteria5 .= "and with a <b>Publisher's Name</b> including: {$_REQUEST['publisher_query']}"; } ?>
                <?php if (  @!$searchCriteria5 ==''):?>
                <?php echo @$searchCriteria5 ?>
                <?php endif?>
                <?php @$searchCriteria6 = '';?>
                <?php if (@$_REQUEST['publication_date_query']) {@$searchCriteria6 .= "and with a <b>Publication Date</b> including: {$_REQUEST['publication_date_query']}"; } ?>
                <?php if (  @!$searchCriteria6 ==''):?>
                <?php echo @$searchCriteria6 ?>
                <?php endif?>
 <?php if (@$CURRENT_USER['isAdmin']): ?>
  <?php  //******************* ?>
                <?php if (@$_REQUEST['paper_engineer_rating_query']) {@$searchCriteria18 .= "and with a <b>Papaer Engineer Rating</b> of: {$_REQUEST['paper_engineer_rating_query']}"; } ?>
                <?php if (  @!$searchCriteria18 ==''):?>
                <?php echo @$searchCriteria18 ?>
                <?php endif?>
				<?php if (@$_REQUEST['overall_rating_query']) {@$searchCriteria17 .= "and with an <b>Overall Rating</b> of: {$_REQUEST['overall_rating_query']}"; } ?>
                <?php if (  @!$searchCriteria17 ==''):?>
                <?php echo @$searchCriteria17 ?>
                <?php endif?>
                 
                 <?php if (@$_REQUEST['illustration_rating_query']) {@$searchCriteria19 .= "and with an <b>Illustration Rating</b> of: {$_REQUEST['illustration_rating_query']}"; } ?>
                <?php if (  @!$searchCriteria19 ==''):?>
                <?php echo @$searchCriteria19 ?>
                <?php endif?>
                <?php  //******************* ?>
                <?php if (@$_REQUEST['purchased_from_query']) {@$searchCriteria7 .= "and <b>Purchased From</b> including: {$_REQUEST['purchased_from_query']}"; } ?>
                <?php if (  @!$searchCriteria7 ==''):?>
                <?php echo @$searchCriteria7 ?>
                <?php endif?>
                <?php if (@$_REQUEST['purchase_date_query']) {@$searchCriteria11 .= "and with a <b>Purchase Date</b> including: {$_REQUEST['purchase_date_query']}"; } ?>
                <?php if (  @!$searchCriteria11 ==''):?>
                <?php echo @$searchCriteria11 ?>
                <?php endif?>
                <?php if (@$_REQUEST['purchaseprice']) {@$searchCriteria12 .= "and with a <b>Purchase Price</b> including: {$_REQUEST['purchase_price']}"; } ?>
                <?php if (  @!$searchCriteria12 ==''):?>
                <?php echo @$searchCriteria12 ?>
                <?php endif?>
                <?php if (@$_REQUEST['sold_to']) {@$searchCriteria7 .= "and <b>Sold To</b> including: {$_REQUEST['sold_to']}"; } ?>
                <?php if (  @!$searchCriteria8 ==''):?>
                <?php echo @$searchCriteria8 ?>
                <?php endif?>
                <?php if (@$_REQUEST['sale_date']) {@$searchCriteria10 .= "and with a <b>Sales Date</b> including: {$_REQUEST['sale_date']}"; } ?>
                <?php if (  @!$searchCriteria10 ==''):?>
                <?php echo @$searchCriteria10 ?>
                <?php endif?>
                <?php if (@$_REQUEST['sale_price']) {@$searchCriteria9 .= "and with a <b>Sales Price</b> including: {$_REQUEST['sale_price']}"; } ?>
                <?php if (  @!$searchCriteria9 ==''):?>
                <?php echo @$searchCriteria9 ?>
                <?php endif?>
                <?php endif?>
                </span> </div>
              <?php endif ?></td>
          </tr>
          <tr>
            <td span class="text_font" colspan="2"><hr  align="left" style="height:2px; background-color:#<?php echo $eg_colorsRecord['menu_background_color'] ?>;" width="90%" color="#<?php echo $eg_colorsRecord['menu_background_color'] ?>"/>
              <?php endif ?>
              <?php //$count2 = 0 ?>
              <?php //$count = 0 ?>
              <?php // if  (@$_REQUEST['save'] == 1):?>
              <!-- <a class=" alt_navigation_font" href="search.php?pdf=1">CLICK TO CONVERT THIS PAGE TO A PDF</a><br />-->
              <br />
              <?php // endif ?>
              <br />
              <?php foreach ($booksRecords as $record): ?>
              <?php //$count2++ ?>
              <?php //$count++; ?>
              <?php if(@$_REQUEST['save'] && @$record['want_this_book'] != 1 ):?>
              <br /><?php if (@$CURRENT_USER['isAdmin']): ?><a href="cmsAdmin/admin.php?menu=books&action=edit&num=<?php echo $record['num'] ?>" ><span class="text_font" style="text-decoration:underline">Modify This Entry</span></a><br /><?php endif ?>
            
              <?php if($record['additional_book_images']):?><br /><span class="text_font" style="text-decoration:none">There are more images for this book. Click/tap the cover image to see them.<br /></span><?php endif ?>
    	   <a href="<?php if($record['additional_book_images']):?>gallery.php?<?php echo $record['num'] ?><?php else : ?><?php foreach ($record['book_cover_image'] as $index => $upload): ?><?php echo $upload['urlPath'] ?><?php endforeach ?><?php endif ?>">
		   <?php foreach ($record['book_cover_image'] as $index => $upload): ?><?php if ($upload['hasThumbnail']): ?><img src="<?php echo htmlencode($upload['thumbUrlPath']) ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><?php endif ?><?php endforeach ?> </a>
           <br />
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			    <?php if($record['want_this_book']):?>
              <br/>
             <b>Want This Book:</b> <?php echo  htmlencode($record['want_this_book:text'])?><br />
              <?php endif ?><?php endif ?>
              <b>Title:</b> <?php echo htmlencode($record['title']) ?>
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			  <?php if($record['location']):?>
              <b>Book Location:</b> <?php echo htmlencode($record['location:label'])?>
              <?php endif ?>
              <?php endif ?>
              <?php if($record['publisher']):?>
              <br/>
              <b>Publisher:</b> <?php echo  htmlencode($record['publisher'])?>
              <?php endif ?>
              <?php if($record['publication_date']):?>
              <br/>
              <b>Publication Date:</b> <?php echo  htmlencode($record['publication_date'])?>
              <?php endif ?>
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			  <?php if($record['purchase_date']):?>
              <br/>
              <b>Purchased On:</b> <?php echo  htmlencode($record['purchase_date'])?>
              <?php endif ?>
              <?php if($record['purchased_from']):?>
              <b> from:</b> <?php echo  htmlencode($record['purchased_from'])?>
              <?php endif ?>
              <?php if($record['purchase_price']):?>
              <b> for:</b> <?php echo  htmlencode($record['purchase_price'])?>
              <?php endif ?>
               <?php if($record['quality']):?>
              <br/>
              <b>Book Quality:</b> <?php echo  htmlencode($record['quality:label'])?>
              <?php endif ?>
               <?php if($record['get_better_copy']):?>
              <br/>
              <b>Look For Better Copy:</b> <?php echo $record['get_better_copy:text'] ?>
              <?php endif ?>
              <?php // ******************** ?>
               <?php if($record['paper_engineer_rating']):?>
              <br/>
              <b>Paper Engineer Rating:</b> <?php echo  htmlencode($record['paper_engineer_rating:label'])?>
              <?php endif ?>
              
                <?php if($record['overall_rating']):?>
              <br/>
              <b>Overall Rating:</b> <?php echo  htmlencode($record['overall_rating:label'])?>
              <?php endif ?>
              
                <?php if($record['illustration_rating']):?>
              <br/>
              <b>Illustration Rating:</b> <?php echo  htmlencode($record['illustration_rating:label'])?>
              <?php endif ?>
              <?php // ******************** ?>
			  <?php if($record['want_this_book']):?>
              <br/>
              <b>Want This Book:</b> <?php echo $record['want_this_book:text'] ?>
              <?php endif ?>
              <?php if($record['sale_date'] ):?>
              <br/>
              <b>And Sold On:</b> <?php echo  htmlencode($record['sale_date'])?>
              <?php endif ?>
              <?php if($record['sold_to']):?>
              <b> to:</b> <?php echo  htmlencode($record['sold_to'])?>
              <?php endif ?>
              <?php if($record['sale_price']):?>
              <b> for:</b> <?php echo  htmlencode($record['sale_price'])?>
              <?php endif ?>
              <?php endif ?>
              <?php if($record['genre']):?>
              <br/>
              <b>Genre 1:</b> <?php echo $record['genre:label'] ?>
              <?php endif ?>
              <?php if($record['genre_2']):?>
              <br/>
              <b>Genre 2:</b> <?php echo $record['genre_2:label'] ?>
              <?php endif ?>
                <?php if($record['genre_3']):?>
              <br/>
              <b>Genre 3:</b> <?php echo $record['genre_3:label'] ?>
              <?php endif ?>
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			  <?php if($record['comments']):?>
              <br />
              <b>Comments:</b> <?php echo htmlencode($record['comments']) ?>
              <?php endif?>
              <?php if($record['special_information']):?>
              <br/>
              <b>Special Information:</b> <?php echo htmlencode($record['special_information'])?>
              <?php endif ?>
              <?php if($record['isbn']):?>
              <?php endif ?>
              <br/>
              <b>ISBN:</b> <?php echo  htmlencode($record['isbn'])?>
              <?php endif ?>
              <?php if($record['writer_1'] || $record['writer_2'] ):?>
              <br />
              <b>Writer(s):</b>
              <?php endif ?>
              <?php if($record['writer_1'] ):?>
              <?php echo  htmlencode($record['writer_1'])?>
              <?php endif ?>
              <?php if($record['writer_2'] ):?>
              , <?php echo  htmlencode($record['writer_2'])?>
              <?php endif ?>
              <?php if($record['illustrator_1'] || $record['illustrator_2'] ):?>
              <br />
              <b>Illustrator(s):</b>
              <?php endif ?>
              <?php if($record['illustrator_1'] ):?>
              <?php echo  htmlencode($record['illustrator_1'])?>
              <?php endif ?>
              <?php if($record['illustrator_2'] ):?>
              , <?php echo  htmlencode($record['illustrator_2'])?>
              <?php endif ?>
              <?php if($record['paper_engineer_1'] || $record['paper_engineer_2'] ):?>
              <br />
              <b>Paper Engineer(s):</b>
              <?php endif ?>
              <?php if($record['paper_engineer_1'] ):?>
              <?php echo  htmlencode($record['paper_engineer_1'])?>
              <?php endif ?>
              <?php if($record['paper_engineer_2'] ):?>
              , <?php echo  htmlencode($record['paper_engineer_2'])?>
              <?php endif ?>
              <?php if($record['paper_engineer_3'] ):?>
              , <?php echo  htmlencode($record['paper_engineer_3'])?>
              <?php endif ?>
              <?php if($record['youtube_link_1'] || $record['youtube_link_2'] || $record['youtube_link_3'] || $record['youtube_link_4']):?>
              <br />
              <br />
              <b>YouTube Links</b>
              <?php endif ?>
              <?php if($record['youtube_link_1'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_1'])?>"><?php echo  htmlencode($record['youtube_link_1'])?></a>
              <?php endif?>
              <?php if($record['youtube_link_2'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_2'])?>"><?php echo  htmlencode($record['youtube_link_2'])?></a>
              <?php endif?>
              <?php if($record['youtube_link_3'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_3'])?>"><?php echo  htmlencode($record['youtube_link_3'])?></a>
              <?php endif?>
              <?php if($record['youtube_link_4'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_4'])?>"><?php echo  htmlencode($record['youtube_link_4'])?></a>
              <?php endif?>
              <hr  align="left" style="height:2px; background-color:#<?php echo $eg_colorsRecord['menu_background_color'] ?>;" width="90%" color="#<?php echo $eg_colorsRecord['menu_background_color'] ?>"/>
              <?php elseif (@$_REQUEST['save'] && (@$record['want_this_book'] == 1 && @$CURRENT_USER['isAdmin'])):?>
			
             <br /><?php if (@$CURRENT_USER['isAdmin']): ?><a href="cmsAdmin/admin.php?menu=books&action=edit&num=<?php echo $record['num'] ?>" ><span class="text_font" style="text-decoration:underline">Modify This Entry</span></a><br /><?php endif ?>
            
              <?php if($record['additional_book_images']):?><br /><span class="text_font" style="text-decoration:none">There are more images for this book. Click/tap the cover image to see them.<br /></span><?php endif ?>
    	   <a href="<?php if($record['additional_book_images']):?>gallery.php?<?php echo $record['num'] ?><?php else : ?><?php foreach ($record['book_cover_image'] as $index => $upload): ?><?php echo $upload['urlPath'] ?><?php endforeach ?><?php endif ?>">
		   <?php foreach ($record['book_cover_image'] as $index => $upload): ?><?php if ($upload['hasThumbnail']): ?><img src="<?php echo htmlencode($upload['thumbUrlPath']) ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><?php endif ?><?php endforeach ?> </a>
           <br />
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			    <?php if($record['want_this_book']):?>
              <br/>
             <b>Want This Book:</b> <?php echo  htmlencode($record['want_this_book:text'])?><br />
              <?php endif ?><?php endif ?>
              <b>Title:</b> <?php echo htmlencode($record['title']) ?><br />
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			  <?php if($record['location']):?>
              <b>Book Location:</b> <?php echo htmlencode($record['location:label'])?>
              <?php endif ?>
              <?php endif ?>
              <?php if($record['publisher']):?>
              <br/>
              <b>Publisher:</b> <?php echo  htmlencode($record['publisher'])?>
              <?php endif ?>
              <?php if($record['publication_date']):?>
              <br/>
              <b>Publication Date:</b> <?php echo  htmlencode($record['publication_date'])?>
              <?php endif ?>
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			  <?php if($record['purchase_date']):?>
              <br/>
              <b>Purchased On:</b> <?php echo  htmlencode($record['purchase_date'])?>
              <?php endif ?>
              <?php if($record['purchased_from']):?>
              <b> from:</b> <?php echo  htmlencode($record['purchased_from'])?>
              <?php endif ?>
              <?php if($record['purchase_price']):?>
              <b> for:</b> <?php echo  htmlencode($record['purchase_price'])?>
              <?php endif ?>
               <?php if($record['quality']):?>
              <br/>
              <b>Book Quality:</b> <?php echo  htmlencode($record['quality:label'])?>
              <?php endif ?>
               <?php // ******************** ?>
               <?php if($record['paper_engineer_rating']):?>
              <br/>
              <b>Paper Engineer Rating:</b> <?php echo  htmlencode($record['paper_engineer_rating:label'])?>
              <?php endif ?>
              
                <?php if($record['overall_rating']):?>
              <br/>
              <b>Overall Rating:</b> <?php echo  htmlencode($record['overall_rating:label'])?>
              <?php endif ?>
              
                <?php if($record['illustration_rating']):?>
              <br/>
              <b>Illustration Rating:</b> <?php echo  htmlencode($record['illustration_rating:label'])?>
              <?php endif ?>
              <?php // ******************** ?>
              
               <?php if($record['get_better_copy']):?>
               
              <br/>
              <b>Look For Better Copy:</b> <?php echo $record['get_better_copy:text'] ?>
              <?php endif ?>
              <?php if($record['want_this_book']):?>
              <br/>
              <b>Want This Book:</b> <?php echo $record['want_this_book:text'] ?>
              <?php endif ?>
              <?php if($record['sale_date'] ):?>
              <br/>
              <b>And Sold On:</b> <?php echo  htmlencode($record['sale_date'])?>
              <?php endif ?>
              <?php if($record['sold_to']):?>
              <b> to:</b> <?php echo  htmlencode($record['sold_to'])?>
              <?php endif ?>
              <?php if($record['sale_price']):?>
              <b> for:</b> <?php echo  htmlencode($record['sale_price'])?>
              <?php endif ?>
              <?php endif ?>
              <?php if($record['genre']):?>
              <br/>
              <b>Genre 1:</b> <?php echo $record['genre:label'] ?>
              <?php endif ?>
              <?php if($record['genre_2']):?>
              <br/>
              <b>Genre 2:</b> <?php echo $record['genre_2:label'] ?>
              <?php endif ?>
               <?php if($record['genre_3']):?>
              <br/>
              <b>Genre 3:</b> <?php echo $record['genre_3:label'] ?>
              <?php endif ?>
              <?php if (@$CURRENT_USER['isAdmin']): ?>
			  <?php if($record['comments']):?>
              <br />
              <b>Comments:</b> <?php echo htmlencode($record['comments']) ?>
              <?php endif?>
              <?php if($record['special_information']):?>
              <br/>
              <b>Special Information:</b> <?php echo htmlencode($record['special_information'])?>
              <?php endif ?>
              <?php if($record['isbn']):?>
              <?php endif ?>
              <br/>
              <b>ISBN:</b> <?php echo  htmlencode($record['isbn'])?>
              <?php endif ?>
              <?php if($record['writer_1'] || $record['writer_2'] ):?>
              <br />
              <b>Writer(s):</b>
              <?php endif ?>
              <?php if($record['writer_1'] ):?>
              <?php echo  htmlencode($record['writer_1'])?>
              <?php endif ?>
              <?php if($record['writer_2'] ):?>
              , <?php echo  htmlencode($record['writer_2'])?>
              <?php endif ?>
              <?php if($record['illustrator_1'] || $record['illustrator_2'] ):?>
              <br />
              <b>Illustrator(s):</b>
              <?php endif ?>
              <?php if($record['illustrator_1'] ):?>
              <?php echo  htmlencode($record['illustrator_1'])?>
              <?php endif ?>
              <?php if($record['illustrator_2'] ):?>
              , <?php echo  htmlencode($record['illustrator_2'])?>
              <?php endif ?>
              <?php if($record['paper_engineer_1'] || $record['paper_engineer_2'] ):?>
              <br />
              <b>Paper Engineer(s):</b>
              <?php endif ?>
              <?php if($record['paper_engineer_1'] ):?>
              <?php echo  htmlencode($record['paper_engineer_1'])?>
              <?php endif ?>
              <?php if($record['paper_engineer_2'] ):?>
              , <?php echo  htmlencode($record['paper_engineer_2'])?>
              <?php endif ?>
              <?php if($record['paper_engineer_3'] ):?>
              , <?php echo  htmlencode($record['paper_engineer_3'])?>
              <?php endif ?>
              <?php if($record['youtube_link_1'] || $record['youtube_link_2'] || $record['youtube_link_3'] || $record['youtube_link_4']):?>
              <br />
              <br />
              <b>YouTube Links</b>
              <?php endif ?>
              <?php if($record['youtube_link_1'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_1'])?>"><?php echo  htmlencode($record['youtube_link_1'])?></a>
              <?php endif?>
              <?php if($record['youtube_link_2'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_2'])?>"><?php echo  htmlencode($record['youtube_link_2'])?></a>
              <?php endif?>
              <?php if($record['youtube_link_3'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_3'])?>"><?php echo  htmlencode($record['youtube_link_3'])?></a>
              <?php endif?>
              <?php if($record['youtube_link_4'] ):?>
              <br />
              <a href="<?php echo  htmlencode($record['youtube_link_4'])?>"><?php echo  htmlencode($record['youtube_link_4'])?></a>
              <?php endif?>
              <hr  align="left" style="height:2px; background-color:#<?php echo $eg_colorsRecord['menu_background_color'] ?>;" width="90%" color="#<?php echo $eg_colorsRecord['menu_background_color'] ?>"/>
        
			  <?php endif ?>
              <?php endforeach ?>
              <br /></td>
          </tr>
        </table>
        <!-- End Active Code Here --> 
      </div></td>
  </tr>
  <tr>
    <td><p>&nbsp;</p>
      <br />
      <br /></td>
  </tr>
</table>
</body>
