<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */

  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/var/www/vhosts/finica.com/subdomains/test/httpdocs/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // load records
  list($productsRecords, $productsMetaData) = getRecords(array(
    'tableName'   => 'products',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  
   list($brandsRecords, $brandsMetaData) = getRecords(array(
    'tableName'   => 'brands',
  ));
 
  $productsRecord = @$productsRecords[0]; // get first record
  //$brandsRecord = @$brandsRecords['num']; // get first record

  // show error message if no matching record is found
  if (!$productsRecord) { dieWith404("Record not found!"); }

?>
<!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>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <script type="text/javascript" language="javascript" src="js/jquery.js"></script>
    
     <!-- JQUERY UI ACCORDION  -->
    
	<link rel="stylesheet" href="css/main_style.css" type="text/css" />
    <link rel="stylesheet" href="css/menu.css" type="text/css" />
    <link rel="stylesheet" href="css/jquery.ui.all.css">
	<script src="js/jquery-1.7.1.js"></script>
	<script src="js/ui/jquery.ui.core.js"></script>
	<script src="js/ui/jquery.ui.widget.js"></script>
	<script src="js/ui/jquery.ui.accordion.js"></script>
	
	<script>
	$(function() {
		//configure accordion
		var accOpts = {
		active:"#header3",
		autoHeight:false,
		navigation:true,
		alwaysOpen:false
		}

		$( "#accordion" ).accordion(accOpts); 	
		
	});
	</script>
 </head>
<body>

    <div class="container">
    
      <div class="header">
        <table width="922" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="166" align="right" valign="middle" bgcolor="#b6ab81">
            <div style="padding-right:10px">
            <span class="type4">artisan<br />cheeses<BR />&<BR />specialty<BR />foods</span>
            </div>
            </td>
            <td width="5" align="left" valign="top"><img src="images/spacer.gif" width="5" /></td>
            <td width="288" align="left" valign="top"><img src="images/header_img3.jpg" width="288" height="120" /></td>
            <td width="5" align="left" valign="top"><img src="images/spacer.gif" width="5" /></td>
            <td align="left" valign="top"><a href="index.php"><img src="images/header_logo.gif" width="458" height="120" border="0"/></a></td>
         </tr>
         <tr height="22">
            <td width="922" colspan="5" valign="top" bgcolor="#8b4420"><img src="images/spacer.gif" width="922" height="22" /></td>
         </tr>
        </table>
        <!-- end .header --></div>
     
      <div class="sidebar1">
    <!--Code for menu starts here-->
      <div id="accordion" class="menu_list"> 
		<p class="menu_head"><a href="#section1">Our Company</a></p>
		<div class="menu_body">
		 <a href="about_usDetail.php#section1">About Us</a>
         <a href="newsList.php#section1">Press Room &amp; Awards</a>
         <a href="eventsList.php#section1">Events</a>	
         <a href="career_opportunitiesDetail.php#section1">Career Opportunities</a>
         <a href="contactDetail.php#section1">Contact</a>
		</div>
        <p class="menu_head"><a href="#section2">What's New</a></p>
        <div class="menu_body">
        	<a href="brandsDetail.php?What-s-New-39#section2">View New Products</a>
        </div>
		<p class="menu_head"><a href="#section3">Cheeses</a></p>
		<div class="menu_body">
         <a href="product_categoriesDetail.php?Cheeses-1#section3">View All Products</a>
         <a href="brandsDetail.php?Alimentias-41#section3">Alimentias</a>
         <a href="brandsDetail.php?Beemster-1#section3">Beemster</a>
         <a href="brandsDetail.php?BelGioioso-2#section3">BelGioioso</a>
         <a href="brandsDetail.php?Bothwell-7#section3">Bothwell</a>
         <a href="brandsDetail.php?Celebrity-8#section3">Celebrity</a>
		 <a href="brandsDetail.php?Celebrity-International-10#section3">Celebrity International</a>
		 <a href="brandsDetail.php?Chimay-37#section3">Chimay</a>
         <a href="brandsDetail.php?Cypress-Grove-38#section3">Cypress Grove</a>
         <a href="brandsDetail.php?Finlandia-11#section3">Finlandia</a>
		 <a href="brandsDetail.php?Sartori-14#section3">Sartori</a>
         <a href="brandsDetail.php?St.-John-s-40#section3">St. John's</a>
         <a href="brandsDetail.php?Zerto-13#section3">Zerto</a>
		 <a href="brandsDetail.php?Italian-Specialty-Cheeses-15#section3">Italian Specialty Cheeses</a>
		 <a href="brandsDetail.php?Other-Specialty-Cheeses-16#section3">Other Specialty Cheeses</a></span>	
		</div>
		<p class="menu_head"><a href="#section4">Specialty Grocery</a></p>
		<div class="menu_body">
        <a href="product_categoriesDetail.php?Specialty-Grocery-3#section4">View All Products</a>
        <a href="brandsDetail.php?34-Degrees-21#section4">34 Degrees</a>
        <a href="brandsDetail.php?Dalmatia-17#section4">Dalmatia</a>
        <a href="brandsDetail.php?Del-Destino-5#section4">Del Destino</a>
        <a href="brandsDetail.php?Frutto-D-Italia-19#section4">Frutto D'Italia</a>
        <a href="brandsDetail.php?Les-Trois-Petits-Cochons-35#section4">Le Trois Petits Cochons</a>
        <a href="brandsDetail.php?Menu-6#section4">MENU</a>
        <a href="brandsDetail.php?NY-Flatbreads-33#section4">NY Flatbreads</a>
        <a href="brandsDetail.php?Paiarrop-32#section4">Paiarrop</a>
        <a href="brandsDetail.php?Solo-Italia-34#section4">Solo Italia</a>
        <a href="brandsDetail.php?United-Olive-Oil-36#section4">United Olive Oil</a>
        <a href="brandsDetail.php?Villa-Manodori-24#section4">Villa Manodori</a>
        <a href="brandsDetail.php?Other-Specialties-22#section4">Other Specialties</a>
    </div>
        <p class="menu_head"><a href="#section5">Meats</a></p>
		<div class="menu_body">
        <a href="product_categoriesDetail.php?Meats-Fish-6#section5">View All Products</a>
        <a href="brandsDetail.php?Levoni-29#section5">Levoni</a>
        <a href="brandsDetail.php?Volpi-18#section5">Volpi</a>
        <a href="brandsDetail.php?Zerto-30#section5">Zerto</a>
        </div>
     
     <p class="menu_head"><a href="recipes_main.php" style="text-decoration:none;">Recipes</a></p>
     </div>  		
 	 <!-- Code for Menu ends here -->
     
    <div class="searchbox">
    <span class="heading_search">search</span><BR />
   
    <form method="GET" action="search_results.php">
	<input type="text" name="q" value="<?php echo htmlspecialchars(@$FORM['q']); ?>" size="18"><BR />
    <img src="images/spacer.gif" height="10px" /><BR />
	<input type="submit" name="" value="SEARCH" class="button"></form><br/><br/><BR /><BR /><BR />
    <!-- end .searchbox --></div>
     
  	<!-- end .sidebar1 --></div>
  
  
     <div class="content">
      <span class="heading"><?php echo join(', ', getListLabels('products', 'brand', $productsRecord['brand'])); ?></span><br /><BR />
      
      <div class="content_brand">
      
                <center>
                <!-- PRODUCT IMAGE -->
					<?php foreach ($productsRecord['image'] as $upload): ?>
          				<?php if ($upload['hasThumbnail']): ?>
            				<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/><BR /><BR />

          				<?php elseif ($upload['isImage']): ?>
            				<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/><BR /><BR />
						<?php else: ?>
            			<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
						<?php endif ?>
       				 <?php endforeach ?>
				</center>
            
            <div class="logo_img">
            <!-- LOGO IMAGE -->
			 <table width="700" border="0" cellspacing="0" cellpadding="0">
                <tr>
                <td valign="bottom" align="left">
                <?php foreach ($productsRecord['logo'] as $upload): ?>
          			<?php if ($upload['hasThumbnail']): ?>
            			<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

          			<?php elseif ($upload['isImage']): ?>
            			<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
					<?php else: ?>
            		<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
				 	<?php endif ?>
       			<?php endforeach ?>
				</td>
                <td valign="bottom" align="left" width="100%" style="padding-left:10px"><span class="heading"><?php echo $productsRecord['title'] ?></span></td>
             	</tr>
            	</table>
            	<BR /><hr style color="#8b4420"/><BR />   
                <!-- end .logo_img --></div>
                
                <div class="brand_desc">
					 <?php echo $productsRecord['content'] ?>
                     <p><b>Product Code & Pack Size:</b><BR /> <?php echo $productsRecord['pack_size'] ?><BR /><BR />
                     
					 <?php if ($productsRecord['manufacturer_website']): ?>
       					<b>Website:</b> <?php echo $productsRecord['manufacturer_website'] ?>
					<?php else: ?>
                    	&nbsp;            
                    <?php endif ?> 
                    
                     <BR /><BR />
                <!-- end .brand_desc --></div>

    <?php if (!$productsRecord): ?>
      No record found!<br/><br/>
    <?php endif ?>
    
    
  
    
    <a href="brandsDetail.php?-<?php echo $productsRecord['brand'].$productsRecord['section_number'] ?>">Back to Brand page</a><BR /><BR />
	<!-- end .content_brand --></div>
  	<!-- end .content --></div>

 	<div class="footer"><center>
    <p>Copyright © 2012 Finica Food Specialties, Ltd.</p></center>
    <!-- end .footer --></div>
    
  <!-- end .container --></div>
</body>
</html>
