<?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 */
  require_once "/home/jdgkiln0/public_html/cmsAdmin/lib/viewer_functions.php";

  list($linksRecords, $linksMetaData) = getRecords(array(
    'tableName'   => 'links',
    'orderBy'     => 'Category',
  ));

?>
<!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"><!-- InstanceBegin template="/Templates/subpage.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Phillips Kiln Links</title>
<!-- InstanceEndEditable -->
<link href="../p7pmm/p7PMMv10sub.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="../p7pmm/p7PMMscripts.js"></script>
<link href="../_css/main.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<script src="../Scripts/swfobject_modified.js" type="text/javascript"></script>
<!-- InstanceEndEditable -->
</head>

<body>
<div id="wrapper">
  <div id="headerbar"><div id="apDiv1">
     <form id="searchform" name="form1" method="post" action=""><table width="196" border="0" align="right" cellpadding="0" cellspacing="0">
      <tr>
        <td width="40"><img src="../_images/hp-gobutton.png" width="46" height="47" /></td>
        <td width="159" align="left" valign="middle" id="searchbox"><input name="searchtextinput" type="text" size="20" /></td>
      </tr>
    </table>
    </form>
  </div><div id="apDiv2"><img src="../_images/hp-logo.png" width="171" height="205" alt="phillips kiln logo" /></div><div id="apDiv3"></div>
  <!-- InstanceBeginEditable name="headerphoto" -->
<?php include("/home/jdgkiln0/public_html/_include/about_us_flash.php"); ?>
  <!-- InstanceEndEditable -->
  </div>
<div id="contentwrappersub"><!-- InstanceBeginEditable name="content" -->
  <div id="contentarea">
    <p><img src="../_images/hd-links.gif" width="521" height="49" alt="phillips  kiln header" /></p>
    
    

		<!-- code added by Ross -->
		<?php $lastCategory = ''; ?> 
		<!-- code added by Ross -->
                 <div class="linklooper">   
    <?php foreach ($linksRecords as $record): ?>

    	<!-- code added by Ross -->
		<?php if ($lastCategory != $record['category']): ?>

		<h2><?php echo $record['category'] ?></h2>
		<?php endif; ?>
		<?php $lastCategory = $record['category']; ?>
		<!-- code added by Ross -->
    
    <div class="linklogo"><table>
      <tr><td height="170" align="center" valign="middle"><p><?php echo $record['category'] ?><br />
      <!-- STEP 2a: Display Uploads for field 'logo' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?php foreach ($record['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 ?>
      <!-- STEP2a: /Display Uploads --><br />
    <strong><a href="<?php echo $record['website'] ?>"><?php echo $record['title'] ?></a></strong><br />
    <span class="smalltext"><?php echo $record['description'] ?></span><br />
    </p></td></tr></table>    </div>
    <?php endforeach ?>
    

        </div>
        
        <?php if (!$linksRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->

</div>
  <script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
  </script>
<!-- InstanceEndEditable -->
<?php include("/home/jdgkiln0/public_html/_include/subnav.php"); ?>
</div>
<?php include("/home/jdgkiln0/public_html/_include/footer.php"); ?>
</body>
<!-- InstanceEnd --></html>
