<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "d:/hosting/member/acraig/site1/cmsadmin/lib/viewer_functions.php";

  list($articlesRecords, $articlesMetaData) = getRecords(array(
    'tableName'   => 'articles',
    'where' => " category LIKE '%\tElementary Years\t%' ",
   ));

list($elementaryRecords, $elementaryMetaData) = getRecords(array(
    'tableName'   => 'elementary',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $elementaryRecord = @$elementaryRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$elementaryRecord) {
    print "Record not found!";
    exit;
  }
  
  $articleRecords = array(); 
  if ($elementaryRecord['featured_article_nums']) {     
  	list($articlesRecords, $articlesMetaData) = getRecords(array(       
  		'tableName' => 'articles',      
  		'where' => 'num IN (' . $elementaryRecord['featured_article_nums'] . ')',    
  	 ));  
  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<meta name="generator" content="Adobe GoLive">
		<title>Elementary</title>
		<link href="../Styles/CPstyle.css" rel="stylesheet" type="text/css" media="all">
		<style type="text/css" media="screen"><!--
top { }
body {
	background-image: url(../test/Articleselem.jpg);
	background-repeat: no-repeat
	}
	p { 
margin-top: 0; 
margin-bottom: 0; 
} 
a:link {
	color: #4fa40a;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
	color: #4FA40A;
}
a:active {
	text-decoration: none;
}
--></style>
	</head>

<body>
<table width="651" border="0">
  <tr>
    <td width="227" height="886"></td>
    <td width="27">&nbsp;</td>
  </tr>
</table>
		<table width="651" border="0">
  
  
  <tr>
    <td width="48" height="177">&nbsp;</td><?php foreach ($articlesRecords as $record): ?>
				<td colspan="3" width="577" height="177"><a href="<?php echo $record['_link'] ?>"><span class="titlebig"><?php echo $record['title'] ?></span></a><br>
    <span class="bodytext"><?php echo $record['summary'] ?>
    <?php endforeach; ?></span></td>
				<td width="26">&nbsp;</td>
			</tr>
</table>
		<?php foreach ($articlesRecords as $record): ?>
		<table width="650" border="0">
  <tr>
    <td width="47">&nbsp;</td>
    <td width="23"><img src="../greendot.jpg" alt="" width="23" height="22"></td>
    <td width="462"><a href="<?php echo $record['_link'] ?>"><span class="titlebig"><?php echo $record['title'] ?></span></a></td>
    <td width="72"><a href="<?php echo $record['_link'] ?>" class="links"><strong>Read more</strong></a>&nbsp;</td>
    <td width="24">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2"><span class="bodytext"><?php echo $record['summary'] ?>
    </span></td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>
  <?php endforeach; ?>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>


