<?php include ("_website_init.php"); 
?>
<?php // load records from 'books'
  list($booksRecords, $booksMetaData) = getRecords(array(
    'tableName'   => 'books',
    'loadUploads' => true,
    'allowSearch' => true,

  ));
  
  // load records from 'faq'
   list($faqRecords, $faqMetaData) = getRecords(array(
    'tableName'   => 'faq',
    'loadUploads' => true,
    'allowSearch' => false,

  ));
  
 // load records from 'navigation_menu'
  list($navigation_menuRecords, $navigation_menuMetaData) = getRecords(array(
    'tableName'   => 'navigation_menu',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
  
  // 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="description" content="<?php echo $common_informationRecord['site_description']?>">
<meta name="keywords" content="<?php echo $common_informationRecord['site_keywords']?>">
<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 />
        <div align="center" style="width:80%; " class="heading_font"><?php echo $common_informationRecord['home_page_head'] ?></div>
        <br />
        <div align="center" class="text_font" style="width:80%; text-align:left"><?php echo $common_informationRecord['home_page_text'];?></div>
        <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= "?">
          <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>Genre:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "genre_keyword[]"  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>
            <tr>
              <td  align="right" class="text_font"><b>Book Location:</b><br /></td>
              <td align="left" valign="bottom" colspan="2"><select name = "location_keyword[]"  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>
            <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_keyword[]"  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>
            <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>
            <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>
            <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>
        </form>
        <?php endif ?>
        <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
		
		  //Start Genre
		  @$genresearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['genre_keyword']) {
		   @$genresearchCriteria = "<b>Genre: </b>";  // set default value 
		   // cycle through each genre selected
		   foreach ($_REQUEST['genre_keyword'] as $genre) {
			 
			 // lookup genre number in database
			 $genreRecord = mysql_get("genre_categories", $genre);
			 
			 if ($genreRecord) {
			   // add "genre" value to output
			   @$genresearchCriteria .= $genreRecord['genre_names'] .", ";
			 }
		   }
		  }
		  //EndGenre
		  
		   //Start Book Location
		  @$locationsearchCriteria = "";  // set default value
		  if  ((@$_REQUEST['save'] == 1) && @$_REQUEST['location_keyword']) {
		   @$locationsearchCriteria = "<b>Location: </b>";  // set default value 
		   // cycle through each location selected
		   foreach ($_REQUEST['location_keyword'] 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_keyword']) {
		   @$qualitysearchCriteria = "<b>Quality: </b>";  // set default value 
		   // cycle through each quality selected
		   foreach ($_REQUEST['quality_keyword'] 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
		 
		  
		 
    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['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
		 
		  @$bettercopysearchCriteria = chop(@$bettercopysearchCriteria, ', '); // remove trailing , or spaces
		 @$bettercopysearchCriteria = chop(@$bettercopysearchCriteria, '- '); // 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 = '';?></td>
          </tr>
          <tr>
            <td colspan="2"><div align="left"> <span class="text_font">
                <?php if (!$errorsAndAlerts) :?>
                <?php $count = '' ?>
                <?php if(@$_REQUEST['save']):?>
                <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($booksMetaData['totalRecords'] == 0 ||$booksMetaData['totalRecords'] >= 2):?>
                There are
                <?php elseif($booksMetaData['totalRecords'] == 1):?>
                There is
                <?php endif ?>
                <?php echo $booksMetaData['totalRecords']; ?>
                <?php if($booksMetaData['totalRecords'] == 0 ||$booksMetaData['totalRecords'] >= 2):?>
                listings
                <?php elseif($booksMetaData['totalRecords'] == 1):?>
                listing
                <?php endif ?>
                that
                <?php if($booksMetaData['totalRecords'] == 0 ||$booksMetaData['totalRecords'] >= 2):?>
                match
                <?php elseif($booksMetaData['totalRecords'] == 1):?>
                matches
                <?php endif ?>
                your search for:
                <?php if (@$locationsearchCriteria || @$genresearchCriteria || @$qualitysearchCriteria ||  @$bettercopysearchCriteria || @$searchCriteria || @$searchCriteria2 || @$searchCriteria3 || @$searchCriteria4 || @$searchCriteria5 || @$searchCriteria6 || @$searchCriteria7|| @$searchCriteria || @$searchCriteria8 || @$searchCriteria9 || @$searchCriteria10 || @$searchCriteria11 || @$searchCriteria12 ): // add searchable field variables here?>
                <br />
                <?php echo @$locationsearchCriteria ?> <br />
                <?php echo @$genresearchCriteria ?> <br />
                <?php echo @$qualitysearchCriteria ?><br />
                <?php echo @$bettercopysearchCriteria ?>
                <?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['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 (@$_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?>
                </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="index.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']):?>
              <br /><a href="http://jkwebdesigns.com/eg/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 />
    	   <a href="<?php foreach ($record['book_cover_image'] as $index => $upload): ?><?php echo $upload['urlPath'] ?><?php endforeach ?>">
		   <?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 />
              <b>Title:</b> <?php echo htmlencode($record['title']) ?>
              <?php if($record['location']):?>
              - <b>Book Location:</b> <?php echo htmlencode($record['location:label'])?>
              <?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($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['quality']):?>
              <br/>
              <b>Look For Better Copy:</b> <?php echo $record['get_better_copy: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 if($record['genre']):?>
              <br/>
              <b>Genre:</b> <?php echo $record['genre:label'] ?>
              <?php endif ?>
              <?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']):?>
              <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>
