<?php
   require_once "C:/Inetpub/charlotteparent/cmsAdmin/lib/viewer_functions.php";
    list($main_menuRecords, $main_menuMetaData) = getRecords(array(
    'tableName'   => 'main_menu',
    'limit'       => '1',     
	'allowSearch' => false,
  ));
  $main_menuRecord = @$main_menuRecords[0]; // get first record
  
  list($secondary_menuRecords, $secondary_menuMetaData) = getRecords(array(
    'tableName'   => 'secondary_menu',
    'limit'       => '1',     
	'allowSearch' => false,
  ));
  $secondary_menuRecord = @$secondary_menuRecords[0]; // get first record
  
  list($directories_menuRecords, $directories_menuMetaData) = getRecords(array(
    'tableName'   => 'directories_menu',
  ));
  
  list($publicationsmenuRecords, $publicationsmenuMetaData) = getRecords(array(
    'tableName'   => 'publicationsmenu',
  ));
  
  list($textimage_areaRecords, $textimage_areaMetaData) = getRecords(array(
    'tableName'   => 'textimage_area',
    'limit'       => '1',     
	'allowSearch' => false,
  ));
  $textimage_areaRecord = @$textimage_areaRecords[0]; // get first record

   list($tipofthe_weekRecords, $tipofthe_weekMetaData) = getRecords(array(
    'tableName'   => 'tipofthe_week',
    'limit'       => '1',     
	'allowSearch' => false,
  ));
  $tipofthe_weekRecord = @$tipofthe_weekRecords[0]; // get first record
  
   list($copyright_textRecords, $copyright_textMetaData) = getRecords(array(
    'tableName'   => 'copyright_text',
    'limit'       => '1',     
	'allowSearch' => false,
  ));
  $copyright_textRecord = @$copyright_textRecords[0]; // get first record
  

 list($charlotte_tearsheetsRecords, $charlotte_tearsheetsMetaData) = getRecords(array(
    'tableName'   => 'charlotte_tearsheets',
 	'where' => 'month(date) = month(now())',
)); 
	   

 list($advertisingRecords, $advertisingMetaData) = getRecords(array(
    'tableName'   => 'advertising',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $advertisingRecord = @$advertisingRecords[0]; // get first record 
  
  list($tearsheet_mainRecords, $tearsheet_mainMetaData) = getRecords(array(
    'tableName'   => 'tearsheet_main',
    'allowSearch' => '0',
    'limit'       => '1',
  ));
  $tearsheet_mainRecord = @$tearsheet_mainRecords[0]; // get first record
  
 
  
   ?>
  
   <!doctype html>
<!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
<!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
<!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title><?php echo $tearsheet_mainRecord['page_title'] ?></title>
<meta name="description" content="<?php echo $tearsheet_mainRecord['page_description'] ?>" />
<meta name="keywords" content="<?php echo $tearsheet_mainRecord['page_keywords'] ?>" />
<link href="../../css/boilerplate.css" rel="stylesheet" type="text/css">
<link href="../../css/main.css" rel="stylesheet" type="text/css">
<link href="../../css/new.css" rel="stylesheet" type="text/css">
<link href="../../css/meganizr.css" rel="stylesheet" type="text/css">
<!--[if lt IE 9]><link href="responsive/meganizr-ie.css" rel="stylesheet" type="text/css"><![endif]-->

<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<script src="../../jsnew/respond.min.js"></script>
<script type="text/javascript">var switchTo5x=false;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'19f48c6c-364e-4e0a-9e27-f4b71609270b'});</script>
<script type="text/javascript" src="//use.typekit.net/lzt6wua.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<script src="../../js/google.js" type="text/javascript"></script>

<script language="JavaScript">
function loadPage(list) {
  location.href=list.options[list.selectedIndex].value
}
</script>

</head>
<body>
<div class="gridContainer clearfix">
  <div id="headertop">
  <div id="news"><? include "C:/Inetpub/charlotteparent/templates/headernews.php"; ?> <!--End news--></div>
    <div id="info-social"><? include "C:/Inetpub/charlotteparent/templates/headerinfo-social.php"; ?><!--End info-social--></div>
    <div id="search"> <form action="http://www.charlotteparent.com/search/results.php" id="cse-search-box">
    
	<input type="text"  size="25" value="Search Charlotte Parent" onfocus="this.value=''" style="font-family: Arial; font-size:11px;" name="q"> 
    <input type="image" src="../../imagesnew/searchiconfinal.png" name="sa" />
    <input type="hidden" name="cx" value="partner-pub-1130980330851222:omewr4pzse6" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
 
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script><!--End search--></div>
  <!--End headertop--></div>
  
  <div id="header">
    <div id="adres"><? include "C:/Inetpub/charlotteparent/templates/headeradres.php"; ?><!--End adres--></div>
    <div id="logo"><? include "C:/Inetpub/charlotteparent/templates/headerlogo.php"; ?><!--End logo--></div>
    <div id="ad"><?php echo $tearsheet_mainRecord['banner_ad'] ?><!--End ad--></div>
  <!--End header--></div>
  
  <div id="nav"><? include "C:/Inetpub/charlotteparent/templates/navigationdrop.php"; ?> <!--End nav--></div>
  <div id="responsive-nav"><? include "C:/Inetpub/charlotteparent/templates/navres.php"; ?> <!--End res-nav--></div>

  
  
<div id="article">
<div id="breadcrumb"><script type="text/javascript" src="../../js/MPBackLinks.js"></script></div>
<div id="page-header"><h1>Charlotte Parent Tearsheets</h1></div>
<div id="divider"><img src="../../imagesnew/newdivider1.jpg" alt="divider"></div>


<div id="content">
  <h3 class="diagonal-header"><span><?php echo $tearsheet_mainRecord['title'] ?></span></h3><br/>
<p><?php echo $tearsheet_mainRecord['content'] ?></p><br>


 <form>
       <select name="adname" size="1"
  onchange="loadPage(this.form.elements[0])"
  target="_blank"
  onmouseclick="this.focus()"
  style="background-color:#ffffff">
         <option value=""><?php echo date('F Y',time()) ?></option>
         <?php foreach ($charlotte_tearsheetsRecords as $record): ?>
         <?php foreach ($record['file'] as $upload): ?>
         <option value="<?php echo $upload['urlPath'] ?>"><?php echo $record['adname'] ?></option>
         <?php endforeach ?>    <?php endforeach ?>
       </select>
     </form>
     <br><br><br>
   <h3 class="diagonal-header"><span>Archives</span></h3><br>
   
   <form>
       <select name="archive" size="1"
  onchange="loadPage(this.form.elements[0])"
  target="_blank"
  onmouseclick="this.focus()"
  style="background-color:#ffffff">
 
         <option value="">Select an Archive</option>
          <?php   // get list of unique months and years with articles   
   $query  = "SELECT DATE_FORMAT(date, '%M %Y') as dateAndYear, YEAR(date) as year, MONTH(date) as month FROM cms_charlotte_tearsheets GROUP BY dateAndYear ORDER BY date DESC";   
   $result = mysql_query($query) or die("MySQL Error: ". htmlspecialchars(mysql_error()) . "\n");   
   while ($record = mysql_fetch_assoc($result)): 
   ?> 
        <option value="http://www.charlotteparent.com/aboutus/advertising/archives.php?date_year=<?php echo $record['year'] ?>&date_month=<?php echo $record['month'] ?>"><?php echo $record['dateAndYear']; ?></a></option>

       <?php endwhile ?>
       </select>
     </form> 

 </div>
  <!--End article--></div>
  
  <div id="aside">

  <div id="toggle">
	  <h3><a href="#">Directories & Resources</a></h3>
		<div><ul class="toggle-list">
                        <?php foreach ($directories_menuRecords as $record): ?>
                            <li><a href="<?php echo $record['dirurl'] ?>"><?php echo $record['title'] ?></a></li>
                          <?php endforeach; ?>                           
                        </ul></div></div>
    <div id="toggle">
		<h3><a href="#"><?php echo $secondary_menuRecord['sidebar_publicationstext'] ?></a></h3>
		<div><ul class="toggle-list">
                       <?php foreach ($publicationsmenuRecords as $record): ?>
                            <li><a href="<?php echo $record['puburl'] ?>"><?php echo $record['title'] ?></a></li>
                            <?php endforeach; ?>                            
                        </ul></div></div>
     <!----Ads---->                       
    <div class="aside-ads">                    
 <?php echo $tearsheet_mainRecord['tower_ad1'] ?><br/>
 <?php echo $tearsheet_mainRecord['tower_ad2'] ?><br/>
   <?php echo $tearsheet_mainRecord['tower_ad3'] ?></div>                   
                        
  <!----Global Text Area---->
<div class="container">
 <h3 class="green"><?php echo $textimage_areaRecord['title'] ?></h3>
<div class="container-content">
		<?php foreach ($textimage_areaRecord['photo'] as $upload): ?>
          <?php if ($upload['isImage']): ?> 
            <div class="center"><img src="<?php echo $upload['urlPath'] ?>" title="<?php echo $upload['info1'] ?>" /></div><br/><br />

          <?php endif ?>
        <?php endforeach ?>
        <p><?php echo $textimage_areaRecord['content'] ?></p>
       
</div></div> 

<!----Tip---->
 <div class="container">
	 <h3 class="blue"><?php echo $tipofthe_weekRecord['title'] ?></h3>
      <div id="quote-container">
        <blockquote>
         <img class="leftquote" src="../../images/leftquote.png"><?php echo $tipofthe_weekRecord['content'] ?><img class="rightquote" src="../../images/rightquote.png">
        </blockquote>
 
        <p><a href="<?php echo $tipofthe_weekRecord['link_url'] ?>"><?php echo $tipofthe_weekRecord['link_title'] ?></a></p>

</div></div>
<div id="newsres"><? include "C:/Inetpub/charlotteparent/templates/headernewsressec.php"; ?> <!--End newsres--></div>
  <!--End aside--></div>
    <!--End grid--></div>
    
 <div id="footerwrapper">
<div class="gridContainer clearfix">
    <div id="footer">
    	<div id="footerlft"><? include "C:/Inetpub/charlotteparent/templates/footerlft.php"; ?></div>
     	<div id="footerrgt"><? include "C:/Inetpub/charlotteparent/templates/footerrgt.php"; ?></div>
     	<div id="footerrgttab"><? include "C:/Inetpub/charlotteparent/templates/footerrgttab.php"; ?></div>
    <!--End footer--></div>
    <div id="responsive-footer"><? include "C:/Inetpub/charlotteparent/templates/resfooter.php"; ?> <!--End res-footer--></div>
    
    <div id="twitterpic"><a href="http://twitter.com/CLTparentweb" target="_blank"><img src="../../responsive/images/twittericonnew.png" alt="twitter feed"></a> <!--End twitterpic--></div>
    <div id="twitterftr"><ul id="twitter_update_list"></ul> <!--End twitterftr--></div>
    
    <div id="copyright"><?php echo $copyright_textRecord['content'] ?> <!--End copyright--></div>
    
 <!--End grid--></div>
<!--End footerwrapper--></div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="../../jsnew/meganizr.js"></script>

<!-- jquery -->	
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="../../jsnew/jquery.ui-custom.js"></script>
<script src="../../jsnew/jquery.easing.1.3.js"></script>
<script src="../../jsnew/scripts.js"></script>

	<!-- easing plugin ( optional ) -->
	<script src="../../jsnew/easing.js" type="text/javascript"></script>
	<!-- UItoTop plugin -->
	<script src="../../jsnew/jquery.ui.totop.js" type="text/javascript"></script>
	<!-- Starting the plugin -->
	<script type="text/javascript">
		$(document).ready(function() {
			/*
			var defaults = {
	  			containerID: 'toTop', // fading element id
				containerHoverID: 'toTopHover', // fading element hover id
				scrollSpeed: 1200,
				easingType: 'linear' 
	 		};
			*/
			
			$().UItoTop({ easingType: 'easeOutQuart' });
			
		});
	</script>

<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/user_timeline/CharlotteParent.json?callback=twitterCallback2&amp;count=1"></script>
</body>
</html>
