<?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 */
  
  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/home/illumina/public_html/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // load record from 'home_page_content'
  list($home_page_contentRecords, $home_page_contentMetaData) = getRecords(array(
    'tableName'   => 'home_page_content',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $home_page_contentRecord = @$home_page_contentRecords[0]; // get first record
  if (!$home_page_contentRecord) { dieWith404("Record not found!"); } // show error message if no record found
  
  // load detail record from 'pages'
  list($pagesRecords, $pagesMetaData) = getRecords(array(
    'tableName'   => 'pages',
    'where'       => whereRecordNumberInUrl(1), // If no record # is specified then latest record is shown
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
 
  $detailRecord = @$pagesRecords[0]; // get first record
  if (!$detailRecord) { dieWith404("Record not found!"); } // show error message if no record found
  
    // load records pages
    list($pagesNavRecords, $selectedCategory) = getCategories(array(
    'tableName'   => 'pages',
    'categoryFormat' => 'showall'
    //'categoryFormat' => 'onelevel' // showall, onelevel, twolevel
  ));
  
     // load records from 'sidebar'
  list($sidebarRecords, $sidebarMetaData) = getRecords(array(
    'tableName'   => 'sidebar',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
  
// load record from 'sponsor_logos'
  list($sponsor_logosRecords, $sponsor_logosMetaData) = getRecords(array(
    'tableName'   => 'sponsor_logos',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $sponsor_logosRecord = @$sponsor_logosRecords[0]; // get first record
  if (!$sponsor_logosRecord) { dieWith404("Record not found!"); } // show error message if no record found
  
 // load records from 'films'
  list($filmsRecords, $filmsMetaData) = getRecords(array(
    'tableName'   => 'films',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
  
 // load record from 'site_general_information'
list($film_list_page_controlsRecords, $film_list_page_controlsMetaData) = getRecords(array(
  'tableName'   => 'film_list_page_controls',
  'where'       => '', // load first record
  'loadUploads' => true,
  'allowSearch' => false,
  'limit'       => '1',
));
  
    // load record from 'meta_data'
  list($meta_dataRecords, $meta_dataMetaData) = getRecords(array(
    'tableName'   => 'meta_data',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $meta_dataRecord = @$meta_dataRecords[0]; // get first record
  if (!$meta_dataRecord) { dieWith404("Record not found!"); } // show error message if no record found

?>

<!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><?php echo htmlencode($meta_dataRecord['meta_title']) ?></title>
<META NAME="description" content="<?php echo htmlencode($meta_dataRecord['meta_description']) ?>"> 

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
p {
	margin: 0px;
	padding: 0px;
}
</style>
<?php include("includes/css-home.php"); ?>
<?php include("includes/global.php"); ?>
<?php include("includes/layerslider.php"); ?>

</head>
<body>

<div id="maincontainer2">
<?php include("includes/header.php"); ?>
<?php include("includes/nav.php"); ?>
<?php include("includes/film-list-simple_test.php"); ?>
<?php include("includes/sponsors.php"); ?>
</div><!--end maincontainer-->

<?php include("includes/footer.php"); ?>

</body>

</html>