<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/_scripts/sessions.php');
if(isset($_SESSION['userID'])){
$userID = $_SESSION['userID'];
}
else {
$userID = 0;
}
$ip = $_SERVER['REMOTE_ADDR'];
require_once($_SERVER['DOCUMENT_ROOT'] . '/_functions/users.functions.php');
$data = array('name','email','business_group', 'comments');
$form = formData($_POST, $data);
$contact = signUp($_POST, $userID, $ip);
$page_title = 'Sign Up';
require_once($_SERVER['DOCUMENT_ROOT'] . '/_includes/header.php');
?>
<section>
<article class="whole">
<h2>Sign up</h2>
<?php if(isset($_GET['success']) && !$contact): ?>
<h2 class="success">Thanks for signing up!</h2>
<?php endif; ?>
<?php if($contact): ?>
<ul class="errors">
<?php foreach($contact['errors'] as $msg): ?>
<li><?php echo $msg; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if(!isset($_GET['success']) || $_GET['success'] != 'true'): ?>
<p>
Receive FREE updates to the best local Networking Meetings, Meetups & Events.
</p>
<h3>Sign up – It's Free!</h3>
<form class="standard–form" action="/sign–up.php" method="post">
<p class="exo">
* marks required fields
</p>
<label for="name">What's your name? *</label>
<input type="text" name="name" id="name" placeholder="My name is" value="<?php echo $form['name']; ?>" />
<label for="business_group">What's your business or meeting name? *</label>
<input type="text" name="business_group" id="business_group" placeholder="Business or meeting name" value="<?php echo $form['business_group']; ?>" />
<label for="email">What's your email address? *</label>
<input type="text" name="email" id="email" placeholder="Email address" value="<?php echo $form['email']; ?>" />
<label for="comments">Have questions?</label>
<textarea class="paragraph" name="comments" id="comments" placeholder="Give us some details"><?php echo $form['comments']; ?></textarea>
<button type="submit">Receive FREE Updates</button>
</form>
<?php endif; ?>
<br/>
<h4>Join Our FREE Meetup</h4>
<p>
<a href="https://www.meetup.com/tampabaynetworkers/">https://www.meetup.com/tampabaynetworkers/</a>
</p>
<p>
Brought to you by <a href="//www.successbuilders–tampabay.com">Success Builders Tampa Bay</a>.
</p>
<div></div>
</article>
<?php //include($_SERVER['DOCUMENT_ROOT'] . '/_includes/aside.php'); ?>
</section>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery–cookie/1.4.1/jquery.cookie.min.js"></script>
<script>
jQuery(function($){
$('input#name').change(function(){
$.cookie("robotCheckPassed", {expires : 100});
});
});
</script>
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/_includes/footer.php');
?>