<?php
/*
Template Name: Customer Sign-in
*/
 get_header();
 $msg=$_REQUEST["msg"];
 ?>
<!--.contentPart-->   
      <div id="primary" class="content-area">
		<main id="main" class="site-main">
		  <div class="PageTitleSection">
			  <div class="container">
			  <h2>Sign In</h2>
			 </div>
			 </div>
			  <section id="contentPage">  
			<div class="ContactFormSection">
			<div class="container">
			
			<div class="FormMainContentWrap FormMainContent">
			<h2 class="TitleTxt">Sign In</h2>
			<div class="inquiryForm signin_form">
			<form id="signin_form" class="signin_form" action="/proccessform.php?actions=logincustomer" name="logincustomer" onsubmit="return CheckRecord();" method="post">
			<div class="row">
			<div class="col-sm-12 form-group">
			<label for="email">Email</label>
			<input class="form-control" id="email" name="email" placeholder="you@yourdomain.com" type="email" />
			</div>
			<div class="col-sm-12 form-group">
			<label for="email">Password</label>
			<input  class="form-control" id="password" name="password" type="password" />
			</div>
			</div>
			<div class="FormButtonSection mrgB15">
			<input type="submit" value="Sign in" class="button" />
			<span class="forgotLink"><a href="/forgotyourpassword/">Forgot your password?</a></span>
			</div>
			<div class="HaveAnAccount"><? if($msg==1){?><font color="#FF0000" size="+1">Your account has been disabled by admin!</font><br /><? }elseif($msg==2){?><font color="#FF0000" size="+1">Unrecognized email address or password!</font><br /><? }?> Don't have an account? <a href="/register.php">Sign Up</a> </div>
			</form>
			</div>			
			<? require("needhelp.php");?>
		</div>
	  </div>
	 </div> 			 
	</section>			  
  </main><!-- .site-main -->
 </div>
</section> 
<!--/.contentPart--> 
<script language="JavaScript">
	function CheckRecord()
	{	
		var IsValid = true;
		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 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();?>