<?php 	
            include_once('../../config.php');  
  
  
  
			if(isset($_POST['submitF']))
			{    
                $stmt=$conn->prepare("insert into UI__Staff (nm,eml,phm,custId,roll,pwd,regDate) values(:nm,:eml,:phm,:custId,:roll,:pwd,:regDate) "); 
                $stmt->bindValue(':nm', $_POST['nm'] , PDO::PARAM_STR); 
                $stmt->bindValue(':eml', $_POST['eml'], PDO::PARAM_STR); 
                $stmt->bindValue(':phm', $_POST['phm'], PDO::PARAM_STR);  
                $stmt->bindValue(':custId', mt_rand(1000,10000), PDO::PARAM_STR);  
                $stmt->bindValue(':roll', $_POST['roll'], PDO::PARAM_STR);  
                $stmt->bindValue(':pwd', $_POST['pwd'], PDO::PARAM_STR); 
                $stmt->bindValue(':regDate', date("d-M-Y"), PDO::PARAM_STR); 
                $stmt->execute();  
				header("Location: staff_users.php ");  
				die;
			} 

 
		 
		 
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>  


 <script>
	$(function() {
		$( "#datepicker" ).datepicker(); 
	}); 
  
	$(document).ready(function()
	{   

	
	$("#product_frm").validate({
		
		errorElement:'div',
		rules:{ 
			city:{
				required:true				 
			} 
			
			
			
		},
		messages:{				
			 
			 city:{
				required:"Enter city name"				 
			} 
		}
	});


	});
 


</script>
		 
		 <div class="col-md-10">

	  			<div class="row">
	  				<div class="col-md-12">
	  					<div class="content-box-large">
							<div class="panel-heading">
								<div class="panel-title"> <h3> Add New User  </h3></div>    
								
								<div class="panel-options">  
								   <input type="button"  class="btn btn-warning" name="btnback" id="btnback" value=" Back " onClick="javascript:location.href='staff_users.php';" /> 
								</div> 
							</div> 
							
			  				<div class="panel-body">    
			  					<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" id="product_frm"> 
							   	 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Name</label>
								    <div class="col-sm-10">
								      <input name="nm" class="form-control"   placeholder="Username"   required    >
								    </div>
								 </div>
								 <hr>
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
								    <div class="col-sm-10">
								      <input name="eml" class="form-control"   placeholder="Username"      >
								    </div>
								 </div>
								 <hr>
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Mobile</label>
								    <div class="col-sm-10">
								      <input name="phm"  type="number" class="form-control"   placeholder="Username"   required    >
								    </div>
								 </div>
								 <hr>
								  
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Password</label>
								    <div class="col-sm-10">
								      <input name="pwd"  type="text" class="form-control"   placeholder="Username"   required    >
								    </div>
								 </div>
								 <hr>
								 
								 
								 
								   <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Roll</label>
								    <div class="col-sm-10">
								      <select class="form-control" name="roll">
								          <option value="1" > Staff</option>
								           
								      </select>
								    </div>
								 </div>
								 <hr>
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Status</label>
								    <div class="col-sm-10">
								      <select class="form-control" name="status">
								          <option value="1"   > Active</option>
								          <option value="0"   > Inactive</option>
								      </select>
								    </div>
								 </div>
								 <hr>
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Add User</label>
										<div class="col-sm-10">
										  <input type="submit"    class="btn btn-primary"  name="submitF" value="Add User">
										</div>
								  </div>   
								</form>
								
								
							
			  				</div>
			  			</div>
	  				</div>
	  				 
	  			</div>

	  			 


	  		<!--  Page content -->
		  </div>
		</div>
    </div>

<?php  include ABS_PATH.'/admin/footer.php';	?>    