<?php
ob_start();
/*
Template Name: Customer Register
*/
 get_header();
 $msg=$_REQUEST["msg"];
 if($CustomerId!=''){
 	wp_redirect("/sign-in/");
	exit();
 }
 ?>
<!--.contentPart-->   
      <div id="primary" class="content-area">
		<main id="main" class="site-main">
		<div class="PageTitleSection">
			<div class="container">
			<h2>Sign Up</h2>
			</div>
			</div>
			<section id="contentPage">
			<div class="ContactFormSection">
			<div class="container">
			<div class="FormMainContentWrap FormMainContent">
			<h2 class="TitleTxt">Sign Up</h2>
			<div class="inquiryForm">
				<form id="register" class="registerForm" action="/proccessform.php?actions=addcustomer" name="addcustomer" onsubmit="return AddRecord();" method="post">
				<input id="accounttype" value="PersonalAccount" name="accounttype" type="hidden" />
				<div class="row">
				<div class="col-sm-6 form-group"><label for="firstname">First Name</label>
				<input id="firstname" class="form-control" name="firstname" type="text" /></div>
				<div class="col-sm-6 form-group"><label for="lastname">Last Name</label>
				<input id="lastname" class="form-control" name="lastname" type="text" /></div>
				</div>
				<div class="row">
				<div class="col-sm-12 form-group"><label for="email">Email</label>
				<input id="email" class="form-control" name="email" type="email" /></div>
				<div class="col-sm-12 form-group"><label for="phone">Mobile Phone</label>
				<input id="phone" class="form-control" name="phone" type="text" /></div>
				<div class="col-sm-12 form-group"><label for="password">Password</label>
				<input id="password" class="form-control" name="password" type="password" /></div>
				</div>
				<div class="checkbox checkboxBsWr"><label><input type="checkbox" id="isdiscount" name="isdiscount" /> Email me discounts and special offers</label></div>
				<div class="FormButtonSection mrgB15"><input class="button" type="submit" value="Register" /> <? if($msg==2){?><font color="#FF0000" size="+1">Your account already registered with us!</font><? }?></div>
				<div class="HaveAnAccount">Have an account? <a href="/sign-in.php">Sign In</a></div>
				</form>
			</div>
				<? require("needhelp.php");?>
			</div>
			</div>
			</div>
		</section>
	</main><!-- .site-main -->
   </div>
   </section> 
<!--/.contentPart--> 
<script language="JavaScript">
	function AddRecord()
	{	
		var IsValid = true;
		var firstname = $('#firstname').val();
		if(firstname == ''){
			$('#firstname').css("border", "2px solid #FF0000");
			IsValid = false;
		}
		else{
			$('#firstname').css("border", "1px solid #a1a1a1");
		}
		var email = $('#email').val();
		if(email == ''){
			$('#email').css("border", "2px solid #FF0000");
			IsValid = false;
		}
		else{
			$('#email').css("border", "1px solid #a1a1a1");
			var eml = new String(email); 
			var val1 = eml.indexOf('@'); 
			var val2 = eml.indexOf("."); 
			if ((val1 == -1) || (val2 == -1)){ 
				$('#email').css("border", "2px solid #FF0000"); 
				IsValid = false; 
			} 
		}
		var lastname = $('#lastname').val();
		if(lastname == ''){
			$('#lastname').css("border", "2px solid #FF0000");
			IsValid = false;
		}
		else{
			$('#lastname').css("border", "1px solid #a1a1a1");
		}
		var phone = $('#phone').val();
		if(phone == ''){
			$('#phone').css("border", "2px solid #FF0000");
			IsValid = false;
		}
		else{
			$('#phone').css("border", "1px solid #a1a1a1");
		}
		var password = $('#password').val();
		if(password == ''){
			$('#password').css("border", "2px solid #FF0000");
			IsValid = false;
		}
		else{
			$('#password').css("border", "1px solid #a1a1a1");
		}
		return IsValid;	
	}
</script>
 <?php get_footer();?>