<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  require_once "/home/rsekaly/public_html/nptbuilder/lib/viewer_functions.php";

  list($ipac_articlesRecords, $ipac_articlesMetaData) = getRecords(array(
    'tableName'   => 'ipac_articles',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $ipac_articlesRecord = @$ipac_articlesRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$ipac_articlesRecord) {
    print "Record not found!";
    exit;
  }
  list($ipac_menuRecords, $ipac_menuMetaData) = getRecords(array(
    'tableName'   => 'ipac_menu',
    'loadUploads' => '0',
    'allowSearch' => '0',
  ));
    list($ipac_categoriesRecords, $ipac_categoriesMetaData) = getRecords(array(
    'tableName'   => 'ipac_categories',
    'loadUploads' => '0',
    'allowSearch' => '0',
  ));

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="robots" content="all" />
		<meta name="generator" content="RapidWeaver" />
		
		<title>Case Study Details</title>
	<?php include "includes/style_link.inc"; ?>
		
		
		
	</head>
<body>
<div id="top_grad"></div>
<div id="projector"></div>
<div id="container"><!-- Start container -->
	<div id="pageHeader"><!-- Start page header -->
		<?php include "includes/header.inc"; ?>
	</div><!-- End page header -->
	
	<div id="contentContainer"><!-- Start main content wrapper -->
		<div id="content"><!-- Start content -->

			<h3><font color="yellow"><?php echo $ipac_articlesRecord['title'] ?></font></h3>
	    		Categories: <?php echo join(', ', getListLabels('ipac_articles', 'categories', $ipac_articlesRecord['categories'])); ?><br/>
      			Date: <?php echo date("jS M Y", strtotime($ipac_articlesRecord['date'])) ?><br/> 
		        Author: <?php echo $ipac_articlesRecord['author'] ?><br/>
		        <?php echo $ipac_articlesRecord['content'] ?><br/>
		        
		        <?php foreach ($ipac_articlesRecord['file_attachments'] 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 ?>

		</div><!-- End content -->
    <?php if (!$ipac_articlesRecord): ?>
      No record found!<br/><br/>
    <?php endif ?>
 
  <a href="<?php echo $ipac_articlesMetaData['_listPage']; ?>">&lt;&lt; Back to list page</a> - 
  <a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>			
	</div><!-- End main content wrapper -->
	
	<div id="sidebarContainer"><!-- Start Sidebar wrapper -->
		<div id="navcontainer"><!-- Start Navigation -->
		<?php include "includes/menu.inc"; ?>


		</div><!-- End navigation --> 
		<div id="sidebar"><!-- Start sidebar content -->
			<h1 class="sideHeader"></h1><!-- Sidebar header -->
			<!-- sidebar content you enter in the page inspector -->
			 <!-- sidebar content such as the blog archive links -->
		</div><!-- End sidebar content -->
	</div><!-- End sidebar wrapper -->
	
	<div class="clearer"></div>
	<div id="breadcrumbcontainer"><!-- Start the breadcrumb wrapper -->
				
	</div><!-- End breadcrumb -->
	<div id="footer"><!-- Start Footer -->
		<div id="eraser"></div>
		<div id="chalk"></div>
		<div id="ruler"></div>
		<p>&copy; 2009 IPAC <a href="#" id="rw_email_contact">Contact Us</a><script type="text/javascript">var _rwObsfuscatedHref0 = "mai";var _rwObsfuscatedHref1 = "lto";var _rwObsfuscatedHref2 = ":nt";var _rwObsfuscatedHref3 = "l@i";var _rwObsfuscatedHref4 = "pac";var _rwObsfuscatedHref5 = ".ca";var _rwObsfuscatedHref = _rwObsfuscatedHref0+_rwObsfuscatedHref1+_rwObsfuscatedHref2+_rwObsfuscatedHref3+_rwObsfuscatedHref4+_rwObsfuscatedHref5; document.getElementById('rw_email_contact').href = _rwObsfuscatedHref;</script></p>
	</div><!-- End Footer -->
</div><!-- End container -->
</body>
</html>