<?php /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */ 

require_once "/usr/www/users/thephila/cmsAdmin/lib/viewer_functions.php";   
list($selected_stu_resourcesRecords, $stu_resourcesMetaData) = getRecords(array( 
	'tableName' => 'stu_resources', 
	'where' => whereRecordNumberInUrl(1),  )); 

$stu_resourcesRecord = @$selected_stu_resourcesRecords[0]; // get first record   
list($stu_resourcesRecords, $stu_resourcesMetaData) = getRecords(array( 
	'tableName' => 'stu_resources', 
	'loadUploads' => '0', 
	'orderBy' => 'box ASC', ));  
	
// show error message if no matching record is found if (!$stu_resourcesRecord) { print "Record not found!"; exit; }  ?>


<table>
<tr>
<td style="width: 300px; vertical-align:top;" >
<table style="width: 100%">
	<tr>
		<td style="width: 300px; vertical-align:top;" class="subnav_background"> 
		<div id="sub">

		<?php $pg_link = ""; ?>
		<?php $compare = ""; ?>
		<?php $link_class = ""; ?>
		<?php $pg_name = ( $_SERVER['REQUEST_URI']); ?>

		<ul>
		<li><a href="http://www.tpschool.org/stu/overview.php" class="pad">Student Overview Home</a></li>

			<?php $lastBox = ""; ?> 		
			<?php foreach ($stu_resourcesRecords as $record): ?>
			<?php if ($record['box'] != $lastBox): ?>
			<?php $pg_link = $record['_link']; ?>
				<?php $compare = strpos($pg_link,$pg_name); ?>
				<?php if ($compare === false ):?>
					<?php $link_class = "pad"; ?>
					<li><a href="<?php echo $record['_link']; ?>" class="<?php echo $link_class; ?>"><?php echo $record['title']; ?></a></li>
				<?php else: ?>
					<?php $link_class = "idselect"; ?>
					<li class="<?php echo $link_class; ?>"><?php echo $record['title']; ?></li>
				<?php endif; ?>

	        <?php $lastBox = $record['box']; ?>
	        <?php endif ?>
			<?php endforeach; ?>
		</ul>
		</div>
		</td>