<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "/home/content/i/t/s/itsplanttech/html/cmsadmin/lib/viewer_functions.php";
	//services description table
   list($plant_training_servicesRecords, $plant_training_servicesMetaData) = getRecords(array(
    'tableName'   => 'plant_training_services',
	'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  
  $plant_training_servicesRecord = @$plant_training_servicesRecords[0]; // get first record
	//courses table which should filter to only show related courses
  list($coursesRecords, $coursesMetaData) = getRecords(array(
    'tableName'   => 'courses',
 	
  ));	

?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>ITS Plant Tech - Macken Co. Fermanagh - <?php echo $plant_training_servicesRecord['name'] ?></title>
<link href="/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/pro_drop_1/pro_drop_1.css" />

<script src="/pro_drop_1/stuHover.js" type="text/javascript"></script>
<body>

<?php //print_r($plant_training_servicesRecords) ?> <br />

<div id="site_wrapper">
  <?php require_once('../includes/header.htm'); ?>


 
  <div id="main_wrapper">
  <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
  
  <!--DISPLAYS SERVICE DESCRIPTION - THIS INFO CHANGES DEPENDING ON WHAT MENU ITEM YOU HAVE SELECTED-->
    <br />
    <h1><?php echo $plant_training_servicesRecord['name'] ?></h1>
      <?php echo $plant_training_servicesRecord['content'] ?><br/>


      <hr/>
      <p>
      
      
        <?php if (!$plant_training_servicesRecord): ?>
      No record found!<br/>
      <br/>
      <?php endif ?>
      
      
      <!-- /STEP2: Display Records -->
      
           
    </p>
      <h2><strong>Courses Available</strong> (These should only include courses that belong to the current section)</h2>
      <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
      <table width="100%" bgcolor="#FFFFCC">
        <tr>
          <td width="31%" bgcolor="#CCCCCC"><strong>Course Title</strong></td>
          <td width="28%" bgcolor="#CCCCCC"><strong>Belongs to (Service)</strong></td>
          <td width="23%" bgcolor="#CCCCCC"><strong>Start Date</strong></td>
          <td width="7%" bgcolor="#CCCCCC"><strong>Duration</strong></td>
          <td width="11%" bgcolor="#CCCCCC"><strong>Places
          </strong>            <div align="right"></div></td>
        </tr>
      </table>

     
     
     <!--DISPLAYS COURSES RELATED TO CURRENT SERVICE - SHOULD BE FILTERING BY USING THE CURRENT SERVICES TITLE -->
        <?php foreach ($coursesRecords as $record): ?>
     
    <table width="100%" bgcolor="#FFFFCC">
  <tr>
    <td width="31%"><?php echo $record['title'] ?></td>
    <td width="28%"><strong><?php echo $record['section'] ?></strong></td>
    <td width="23%"><?php echo date("D, M jS, Y g:i:s a", strtotime($record['start_date'])) ?></td>
    <td width="8%"><?php echo $record['duration'] ?></td>
    <td width="6%"><?php echo $record['number_of_places'] ?></td>
    <td width="4%"><div align="right"><a href="<?php echo $record['_link'] ?>">More</a></div></td>
  </tr>
</table>

    <?php endforeach; ?>

    <?php if (!$coursesRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->

    <p>&nbsp;</p>
      <p>        <a href="<?php echo $plant_training_servicesMetaData['_listPage']; ?>">&lt;&lt; Back to list page</a> - <a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>
        
        
        
                </p>
  </div>
  <br clear="all" />
  <?php require_once('../includes/footer.htm'); ?>
<br clear="all" />
</div>
</body>
</html>





