<?php
include("header.html");
?>

 <div class="w3-container  " style='padding:0px'>
   <div class="w3-row" style='padding:0px'>
<div class='w3-col m7 show-large  w3-animate-left' id='new_staff' style='padding:5px'>

		<div class="w3-container w3-blue w3-card-4">
		<h2>Registration Form</h2>
		</div>

		<form class="w3-container w3-white w3-card-2 w3-padding-bottom"  METHOD='POST' id='staff_reg'>

			<p class=' w3-border-bottom w3-container w3-padding'>Personal Details</p>
			<p class='w3-half w3-padding'>
			<label>First Name</label>
			<input class="w3-input " type="text" name='fname' required>
			</p>

			<p class='w3-half  w3-padding'>
			<label>Other Name</label>
			<input class="w3-input" type="text" name='lname' required>
			</p>		
			
				<p class='w3-half  w3-padding'>
			<span>National ID</span>
			<input class="w3-input" type="text" name='idno' required>
			</p>	
			
						<p class='w3-half  w3-padding'>
			<span>Date of Birth</span>
			<input class="w3-input" type="text" name='dob' required>
			</p>
			
			<p class=' w3-padding'>
			
				<label>Gender</label><br>
				<input class="w3-radio" type="radio" name="gender" value="male"  checked>
				<label class="w3-validate">Male</label>

				<input class="w3-radio" type="radio" name="gender" value="female">
				<label class="w3-validate">Female</label>

			</p>	

			
			
			
			
			<h3 class=' w3-border-bottom w3-container w3-padding w3-full' style='width:100%;display:table'>Contact Details</h3>
			

			<p class='w3-half  w3-padding'>
			<label>Phone Number</label>
			<input class="w3-input" type="number" name='pno' required>
			</p>
			
			<p class='w3-half  w3-padding'>
			<label>Email</label>
			<input class="w3-input" type="email" name='user_email' required>
			</p>
			
			
			
			<h3 class=' w3-border-bottom w3-container w3-padding' ><br>Education Details</h3>			
			<p class='w3-half  w3-padding'>
			<label>Education level</label>
			<select class="w3-select w3-padding"  name='edulevel' required>
			  <option value=""  selected>Select Level</option>
			  <option value="Doctorate">Doctorate</option>
			  <option value="Masters">Masters</option>
			  <option value="Degree">Degree</option>
			  <option value="Diploma">Diploma</option>
			  <option value="Certificate">Certificate</option>
			</select>
			</p>		
			<p class='w3-half  w3-padding'>
			<label>Course</label>
			<input class="w3-input" type="text" name='course'>
			</p>
			
			<h3 class=' w3-border-bottom w3-container w3-padding'>Employment Details </h3>
			<p class='w3-half  w3-padding'>
			<label>Job Position</label>
			<input class="w3-input" type="text" name='jobpos' required>
			</p>	
			<hr class='' style='display:table;width:100%'>
				<p class='w3-half  w3-padding' style='width:100%;display:table'>
				<input type="hidden" name="btn_action" value='Add' id="btn_action" />
				<input class="w3-btn w3-theme" type="submit" value='Submit' onclick='javascript:void(0)'>
				 <a href='javascript:void(0)' onclick='open_loginfm("staff_login","new_staff")' class='w3-hide-large w3-right w3-text-blue' >Staff login</a>
				</p>

		
		</form>
</div>

 <div class="w3-col m4  w3-right  w3-animate-right" style='padding:5px'>
	   		  <form class="w3-container w3-white w3-round hide-small"  id='staff_login' style='padding:0px' method='post' >
  					<div class="w3-container w3-padding w3-card-2 w3-red ">
					  <h3 class='w3-left'>Staff Login </h3>
			</div>

				<div class="w3-container" style='padding:'>
				  <div class="w3-section">
					<label><b>Username</b></label>
					<input class="w3-input w3-border w3-margin-bottom" type="email"  name='user_name'placeholder="Enter Email" required>

					<label><b>Password</b></label>
					<input class="w3-input w3-border" type="password" name='pass' placeholder="Enter Password" required>
					
					<input type='hidden' name='lbtn_action' id='lbtn_action' value='stafflogin' >
					<input type='submit'  value='Login' class="w3-btn w3-green w3-section w3-left">
					<span class='w3-right w3-padding'><input class="w3-check" type="checkbox" checked="checked"> Remember me</span>
				  </div>
				</div>

				<div class="w3-container w3-border-top " style='padding:'>
				    					  <a href='javascript:void(0)' onclick='open_loginfm("new_staff","staff_login")' class='w3-hide-large w3-left w3-text-blue w3-padding-16' > New Staff</a>
					
				  <span class="w3-right w3-padding ">Forgot <a href="avascript:void(0)" class='w3-text-red'>password?</span></a></span>
				</div>

		  </form>
		  <br>
		  <div class="w3-card-2 w3-round w3-white w3-padding">
			<p>ADS</p>
		  </div>
		  <br>
		  <div class="w3-card-2 w3-round w3-white w3-padding">
			<p>ADS
			</div>
			<br>
		  
		  		
			   <div class="w3-container w3-white w3-card-4" style='padding:0px'>
					<div class="w3-container w3-padding w3-blue">
					  <h5 class=''>Subscribe For Updates</h5>
					</div>
					<div class="w3-container" style='padding:0px'>
					  <form class="w3-container w3-padding-16" style='' method='post' id='subscribe'>
						
						<p>
						<label>Email</label>
						<input class="w3-input w3-border" type="text">
						</p>
						 
						<p >
						<a class="w3-btn-block w3-large w3-red w3-round " >Subscribe</a>
						</p>
					  </form>   
					</div>
			 </div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
	
	$(document).on("submit","#staff_reg",function(event){
		event.preventDefault();
		
		var form_data=$(this).serialize();
		$.ajax({
				url:"new_staff_action.php",
				method:"POST",
				data:form_data,
				success:function(data)
				{
					// $("#staff_reg")[0].reset();
					if(data=="New Staff User Added"){
						$("#staff_reg")[0].reset();
					}
				alert(data);	
				}
			})
	})	
	$(document).on("submit","#staff_login",function(event){
		event.preventDefault();
		
		var form_data=$(this).serialize();
		$.ajax({
				url:"steam_action.php",
				method:"POST",
				data:form_data,
				success:function(data)
				{
					if(data=="admin"){
						window.location="admin/";
					}
					else if(data=="staff"){
						window.location="staff_members.php";
						
					}else{
							alert(data);	
					}	
				}
			})
	})
	
	
})
</script>
<?php
include("footer.html");
?>