MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/bosweb/b1705/absoluteresultstechnologies.net/public_html/howcaniserve/
File Upload :
Current < : /hermes/bosweb/b1705/absoluteresultstechnologies.net/public_html/howcaniserve/index.php

<?php
	include_once('includes.php');
	
	if($_SESSION['code'] == '')
	{
		header('location: code.php');
		exit;
	}
	
	if(isset($_POST['name']))
	{		
		$errorMsg = '';
		if($_POST['name'] == '') $errorMsg = 'Please tell us your name';
		else if($_POST['mobilePhone'] == '') $errorMsg = 'Please tell us your mobile phone';
		else if($_POST['email'] == '') $errorMsg = 'Please tell us your email';
		else if($_POST['postalCode'] == '') $errorMsg = 'Please tell us your postal code';
		else if($_POST['age'] == '') $errorMsg = 'Please tell us your age group';
		
		if($errorMsg != '')
		{
			?>
			alert('<?= ajaxHTML($errorMsg) ?>');		
	   		$('#submitBtn').val('Submit Registration');
	   		$('#submitBtn').removeAttr('disabled');	
			<?php
			exit;
		}
		
		$sqlArray = array();
		foreach($_POST as $key => $val) 
		{
			if(is_array($val)) $val = implode(',',$val);
			$sqlArray[$key] = addslashes($val);
		}
		
		$sql = 'INSERT INTO howcaniserve (' . implode(',',array_keys($sqlArray)) . ',dateRegistered) VALUES (
				"' . implode('","',$sqlArray) . '",
				"' . date("Y-m-d H:i:s") . '")';
		
		if(mysql_query($sql))
		{
			?>
			alert('Thank you. \nYou are now registered.');
			location.href="success.php";					
			<?php
		}
		else
		{
			?>
			alert('Error Occurred.\nPlease try again later.');			
	   		$('#submitBtn').val('Submit Registration');
	   		$('#submitBtn').removeAttr('disabled');	
			<?php
		}
		exit;
	}
	
	include_once('header.php');
?>
	<script>	
		function validateForm()
		{						
	   		$('#submitBtn').val('Please wait...');
	   		$('#submitBtn').attr('disabled','disabled');
	   		
			$.ajax({data:	$('#form').serializeArray(),
					type:	'POST',
					dataType: 'script'
			   	    });
			
			return false;
		}
	</script>	
	<center>
		<p style="font-size:1.8em;line-height:1.2em;text-align:center">
			Welcome to First Baptist of Atlanta's
			<br>
			<font style="color:yellow;font-weight:bold;font-size:1.3em">"How Can I Best Serve?"</font>
			<br>
			Registration Page
		</p>
		<br>
		
		<p style="font-size:1.2em;line-height:1.2em;text-align:center">
			By sharing with us a few quick thoughts on your gifts and abilities, we will be able to show you where you can make a big difference in God’s Kingdom.
		</p>		
		<br>
		
		<form id="form" method="POST" onSubmit="return validateForm();">
			<center>
				<h4>Your Information</h4>
			</center>
			<div class="row">
				<div class="six columns">
					<div class="field"><input class="input" type="text" name="name"  placeholder="Your Name" /></div>
					<div class="field"><input class="input" type="text" name="mobilePhone"  placeholder="Mobile Phone" /></div>
					<div class="field"><input class="input" type="text" name="email"  placeholder="Email" /></div>
				</div>
				<div class="six columns">
					<div class="field"><input class="input" type="text" name="postalCode"  placeholder="Postal Code" /></div>
					<div class="field" style="margin-bottom:3px">
						<div class="picker" style="width:100%">
						    <select name="age">
						    	<option value="" disabled selected>What is your Age Group?</option>		
	<?php
		$arr = array('Youth (under 18)','Adult','Senior (over 65)');
		foreach($arr as $v)
		{
	?>
								<option value="<?= $v ?>"><?= $v ?></option>
	<?php
		}
	?>
						    </select>
						</div>
					</div>	
				</div>
			</div>
			<div class="row">
				<div class="six columns">
					<h4>What is your post secondary education? </h4>
					<div class="field" style="margin-bottom:3px">
						<div class="picker" style="width:100%">
						    <select name="postSecondary">
						    	<option value="" disabled selected>-- Please Choose One --</option>		
	<?php
		$arr = array('College','University','Trade School');
		foreach($arr as $v)
		{
	?>
								<option value="<?= $v ?>"><?= $v ?></option>
	<?php
		}
	?>
						    </select>
						</div>
					</div>					
					<div class="field"><textarea class="input textarea" name="postSecondaryDetails" style="height:82px;"  placeholder="Details"></textarea></div>
				</div>
				<div class="six columns">
					<h4>What industry do you work in?</h4>
					<div class="field" style="margin-bottom:3px">
						<div class="picker" style="width:100%">
						    <select name="industry">
						    	<option value="" disabled selected>-- Please Choose One --</option>		
	<?php
		$arr = array('Student','Homemaker','Medical','Construction','Education','Business','Sales','Hospitality','Agriculture','Fashion','Government','Retail');
		foreach($arr as $v)
		{
	?>
								<option value="<?= $v ?>"><?= $v ?></option>
	<?php
		}
	?>
						    </select>
						</div>
					</div>					
					<div class="field"><textarea class="input textarea" name="industryDetails" style="height:82px;" placeholder="Details"></textarea></div>
				</div>
			</div>	
			<div class="row">
				<div class="six columns">
					<h4>How do you prefer to serve?</h4>
					<div class="field" style="margin-bottom:3px">
						<div class="picker" style="width:100%">
						    <select name="servePreference">
						    	<option value="" disabled selected>-- Please Choose One --</option>		
	<?php
		$arr = array('Acts of service','Teaching','Evangelism','Compassion');
		foreach($arr as $v)
		{
	?>
								<option value="<?= $v ?>"><?= $v ?></option>
	<?php
		}
	?>
						    </select>
						</div>
					</div>	
					<div class="field"><textarea class="input textarea" name="servePreferenceDetails" style="height:100px;" placeholder="Details"></textarea></div>				
				</div>
				<div class="six columns">
					<h4>What are you most passionate about serving? </h4>
					<div class="field" style="margin-bottom:3px">
						<div class="picker" style="width:100%">
						    <select name="servePassion">
						    	<option value="" disabled selected>-- Please Choose One --</option>		
	<?php
		$arr = array('Youth','Elderly','Young children','Couples','Singles','Other');
		foreach($arr as $v)
		{
	?>
								<option value="<?= $v ?>"><?= $v ?></option>
	<?php
		}
	?>
						    </select>
						</div>
					</div>					
					<div class="field"><textarea class="input textarea" name="servePassionDetails" style="height:100px;" placeholder="Details"></textarea></div>
				</div>
			</div>	
			<div class="row">
				<div class="centered six columns">
					<h4>When are you typically available?</h4>
					<div class="row">
						<div class="centered nine columns" style="padding:0px 20px">
							<div class="row">
								<div class="six columns" style="text-align:left">
									<div style="white-space:nowrap"><label><input type="checkbox" name="available[]" value="Morning"> Morning</label></div>
									<div style="white-space:nowrap"><label><input type="checkbox" name="available[]" value="Afternoon"> Afternoon</label></div>
									<div style="white-space:nowrap"><label><input type="checkbox" name="available[]" value="Evening"> Evening</label></div>
								</div>
								<div class="six columns" style="text-align:left">
									<div style="white-space:nowrap"><label><input type="checkbox" name="available[]" value="Monday to Friday"> Monday to Friday</label></div>
									<div style="white-space:nowrap"><label><input type="checkbox" name="available[]" value="Saturday & Sunday"> Saturday & Sunday</label></div>
								</div>
							</div>	
						</div>	
					</div>	
				</div>
			</div>		
			<div style="padding-top:20px">
				<div class="large pretty rounded warning btn"><input type="submit" id="submitBtn" value="Submit Registration" style="font-family:Abel;font-weight:bold" /></div>
			</div>
		</form>
		<br><br>
	</center>
<?php include_once('footer.php'); ?>