<?php
   require_once "../../cmsAdmin/lib/viewer_functions.php";

    list($menu_newRecords, $menu_newMetaData) = getRecords(array(
    'tableName'   => 'menu_new',
    'allowSearch' => '0',
    'limit'       => '1',
  ));
  $menu_newRecord = @$menu_newRecords[0]; // get first record
  
  list($directories_menuRecords, $directories_menuMetaData) = getRecords(array(
    'tableName'   => 'directories_menu',
  ));
  
  list($publicationsmenuRecords, $publicationsmenuMetaData) = getRecords(array(
    'tableName'   => 'publicationsmenu',
  ));
   
  list($globalRecords, $globalMetaData) = getRecords(array(
    'tableName'   => 'global',
    'allowSearch' => '0',
    'limit'       => '1',
  ));
  $globalRecord = @$globalRecords[0]; // get first 
  
   list($directory_membershipRecords, $directory_membershipMetaData) = getRecords(array(
    'tableName'   => 'directory_membership',
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $directory_membershipRecord = @$directory_membershipRecords[0]; // get first record
  
 
	  
  
  ########################################################################################
  ##   Form Code
  
  $schema = loadSchema('dir_listings');
  
  // save?
  $errorsAndAlerts = '';
  
 
  
  if (@$_REQUEST['save']) {
    
    
    if ($errorsAndAlerts) {
    
   if (!@$_REQUEST['title'])            	{ $errorsAndAlerts .= "You must enter your listing name!<br/>\n"; }
    if (!@$_REQUEST['state'])            { $errorsAndAlerts .= "You must enter your state!<br/>\n"; }
    if (!@$_REQUEST['city'])             { $errorsAndAlerts .= "You must enter your city!<br/>\n"; }
    if (!@$_REQUEST['zipcode'])          { $errorsAndAlerts .= "You must enter your zip!<br/>\n"; }
    if (!@$_REQUEST['address'])          { $errorsAndAlerts .= "You must enter your address!<br/>\n"; }
    if (!@$_REQUEST['summary'])          { $errorsAndAlerts .= "You must choose a description!<br/>\n"; }
   
  }
    
    
    // save!
    if (!$errorsAndAlerts) {
		mysqlStrictMode(false); // disable Mysql strict errors for when a field isn't defined below (can be caused when fields are added later)
      require_once("../../cmsAdmin/lib/user_functions.php");
      $record = array_slice_keys($_REQUEST, explode(', ', 'title, address, city, state, zipcode, summary'));
      
      $record = array_merge($record, array(
        'hidden'           => 1,
       'createdDate'      => mysql_datetime(),
        'createdByUserNum' => intval( @$CURRENT_USER['num'] ),
        'updatedDate'      => mysql_datetime(),
        'updatedByUserNum' => intval( @$CURRENT_USER['num'] ),
        'publishDate'      => mysql_datetime(),
		 'date'             => mysql_datetime(),
        'reg_listing'      => 1,
		 'url_link'     	  => 0,
        'neverRemove'      => 1,
      ));
	  
	
      
      if (!$errorsAndAlerts) {

        $errorsAndAlerts = "<strong>Thank you! Your submission has been received.</strong><br> <br>\n";
        
   
       
       mysql_insert('dir_listings', $record);
        }
        
        $dirLink = "http://www.charlotteparent.com/cmsadmin/admin.php?menu=dir_listings&action=edit&num=" . mysql_insert_id();
        
        
        
        $_REQUEST = array();
      }
  }


  
  $_REQUEST['preSaveTempId'] = coalesce(@$_REQUEST['preSaveTempId'], uniqid());
  
?>

  
  
  
  
<!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 $directory_membershipRecord['page_title'] ?></title>
<meta name="description" content="<?php echo $directory_membershipRecord['page_description'] ?>" />
<meta name="keywords" content="<?php echo $directory_membershipRecord['page_keywords'] ?>" />
<link href="../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">
<link rel="stylesheet" href="jquery/thickbox.css" type="text/css" media="screen" />

<!--[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]-->
<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">
<link rel="stylesheet" href="jquery/thickbox.css" type="text/css" media="screen" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery/jquery-latest.pack.js"></script>
<script type="text/javascript" src="jquery/thickbox-compressed.js"></script>
<script type="text/javascript" src="formpreview.js"></script>
<script type="text/javascript" src="niceforms.js"></script>

<script src="../../jsnew/respond.min.js"></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 src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../word.js"></script>
<script type="text/javascript" src="count.js"></script>
<script src="set_action.js"></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"><? include "C:/Inetpub/charlotteparent/templates/search.php"; ?></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 $directory_membershipRecord['banner_ad'] ?><!--End ad--></div>
  <!--End header--></div>
  
   <div id="logo-res"><? include "C:/Inetpub/charlotteparent/templates/headerlogores.php"; ?><!--End logo-res--></div>
  
 <div id="nav"><? include "C:/Inetpub/charlotteparent/templates/newnavigation.php"; ?> <!--End nav--></div>
 <div id="tablet-nav"><? include "C:/Inetpub/charlotteparent/templates/tabletnav.php"; ?> <!--End res-nav--></div>
  <div id="responsive-nav"><? include "C:/Inetpub/charlotteparent/templates/resnav.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>Free directory Listing Form</h1></div>
<div id="divider"><img src="../../imagesnew/newdivider1.jpg" alt="divider"></div>

<div id="content">
       

<span class="red">* = Required</span><br />
<br />
 <h3 class="diagonal-header"><span><img src="../../imagesnew/step1_30.png" vertical-align="text-top" alt=""/> - Select a Category</span></h3><br>  


<?php /* ********************** FORM START ********************** */ ?>
    
    <?php if (@$errorsAndAlerts): ?>
      <p style="color: red;"><?php echo $errorsAndAlerts ?></p>
    <?php endif ?>


    
    <form action="preview.php" method="POST"   "> 
    <input type="hidden" name="save" value="1">
    <input type="hidden" name="preSaveTempId" value="<?php echo htmlencode(@$_REQUEST['preSaveTempId']) ?>">
    

 

<div class="form-label">Listing Name:&nbsp;*</div>
<div class="form-field"> <input type="text" name="title" value="<?php echo htmlspecialchars(@$_REQUEST['title']) ?>" size="40"></div>

<div class="form-label">Address:&nbsp;*</div>
<div class="form-field"> <input type="text" name="address" value="<?php echo htmlspecialchars(@$_REQUEST['address']) ?>" size="40"></div>

<div class="form-label">City:&nbsp;*</div>
<div class="form-field"><input type="text" name="city" value="<?php echo htmlspecialchars(@$_REQUEST['city']) ?>" size="40"></div>

<div class="form-label">State:&nbsp;*</div>
<div class="form-field"><input type="text" name="state" value="<?php echo htmlspecialchars(@$_REQUEST['state']) ?>" size="40"></div>

<div class="form-label">Zip:&nbsp;*</div>
<div class="form-field"><input type="text" name="zipcode" value="<?php echo htmlspecialchars(@$_REQUEST['zipcode']) ?>" size="40"></div>


<div class="form-label"><span class="red">*</span>Brief Description:</div>
<div class="form-field">
<textarea name="summary" id="demo1" rows="5" cols="50" value="<?php echo htmlspecialchars(@$_REQUEST['summary']) ?>"><?php echo htmlspecialchars(@$_REQUEST['summary']) ?></textarea><br>
<p>35 word limit. You have <span id="counter"></span> words left.</p><br></div>


<div class="form-label"><input type="submit" value="Confirm"  /> </div>
</form>
			

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


 <div id="photosponsor-adres"><?php echo $directory_membershipRecord['mobilead_1'] ?>
   <?php echo $directory_membershipRecord['mobilead_2'] ?>
   <?php echo $directory_membershipRecord['mobilead_3'] ?></div>
  
                        


<!----Global Text Area---->
<div class="container">
 <h3 class="green"><?php echo $globalRecord['title_text'] ?></h3>
<div class="container-content">
		<?php foreach ($globalRecord['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 $globalRecord['content_text'] ?></p>
       
</div></div> 



<div id="newsres"><? include "C:/Inetpub/charlotteparent/templates/headernewsressec.php"; ?> <!--End newsres--></div>
 <div id="info-socialres">
<a  href="https://www.facebook.com/cltparent"><img src="../../imagesnew/facebook-icon.png" class="info-icon"></a>
<a href="https://twitter.com/CharlotteParent"><img src="../../imagesnew/twitter-icon.png" class="info-icon" ></a>
<a  href="http://pinterest.com/charlotteparent/"><img src="../../imagesnew/pinterest-icon.png" class="info-icon"></a>

<!--End info-social--></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="copyright"><?php echo $globalRecord['copyright'] ?> <!--End copyright--></div>
  <div id="mmlogo"><? include "C:/Inetpub/charlotteparent/templates/footerlogo.php"; ?></div>
    
 <!--End grid--></div>
<!--End footerwrapper--></div>



<!-- Share This Scripts -->
<script type="text/javascript">var switchTo5x=true;</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", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>

<!-- Meganizr Scripts -->

<script src="../../jsnew/meganizr.js"></script>
<!-- end Meganizr Scripts -->



 <!-- The JavaScript -->
        <script type="text/javascript">
            $(function() {
                $('#activator').click(function(){
                    $('#overlay').fadeIn('fast',function(){
                        $('#box').animate({'top':'160px'},500);
                    });
                });
                $('#boxclose').click(function(){
                    $('#box').animate({'top':'-200px'},500,function(){
                        $('#overlay').fadeOut('fast');
                    });
                });

            });
        </script>	
        
<script src="../hide.js"></script>
<script src="../view.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"> 
var $buoop = {} 
$buoop.ol = window.onload; 
window.onload=function(){ 
 try {if ($buoop.ol) $buoop.ol();}catch (e) {} 
 var e = document.createElement("script"); 
 e.setAttribute("type", "text/javascript"); 
 e.setAttribute("src", "http://browser-update.org/update.js"); 
 document.body.appendChild(e); 
} 
</script>  

</body>
</html>