<?php 
include ('../ro_head.php'); 
 if($_SESSION['level'] != 1){

	header('Location: dashboard.php');
}
//include ('methodlist.php');

?>

<!-- BEGIN PAGE LEVEL STYLES -->
<!-- END THEME STYLES -->

<link rel="shortcut icon" href="favicon.ico"/>

</head>

<script>
function validate() {
 // check if input is bigger than 3
 var value = document.getElementById('pass').value;
 
 if (value.length >4 && value.length <9 ) {
   
   return true; // keep form from submitting
 }
 
 else{
	
	alert("Password must be 5 to 8 characters.");
    return false;
 }
 
}

</script>
<!-- END HEAD -->

<!-- BEGIN CONTAINER -->

<div class="page-container">


<?php include_once("../ro_sidebar.php"); ?>


	<!-- BEGIN CONTENT -->



	<div class="page-content-wrapper">



		<div class="page-content">



			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->



			<div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">



				<div class="modal-dialog">



					<div class="modal-content">



						<div class="modal-header">



							<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>



							<h4 class="modal-title">Modal title</h4>



						</div>



						<div class="modal-body">



							 Widget settings form goes here



						</div>



						<div class="modal-footer">



							<button type="button" class="btn blue">Save changes</button>



							<button type="button" class="btn default" data-dismiss="modal">Close</button>


						</div>

					</div>


					<!-- /.modal-content -->

				</div>


				<!-- /.modal-dialog -->

			</div>



			<!-- /.modal -->



			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->


			<?php // include_once("ro_style_customizer.php"); ?>



			<!-- BEGIN PAGE HEADER-->



			<!-- <h3 class="page-title">

			User Add <small>Create Your User</small>

			</h3>
		 -->



			<!-- END PAGE HEADER-->



			<!-- BEGIN PAGE CONTENT-->



			<div class="row">



				<div class="col-md-12">	



				<?php 



									if(isset($_GET['msg'])){	



										



										if($_GET['msg']==2){





								echo "<div class='note note-danger'><p>
								NOTE: Your provided username is already exists. Please choose different one.
								</p></div>";

								} 

							}          	
						?>				

					<form name="addproduct" class="form-horizontal form-row-seperated" onsubmit="return validate();" action="user_crud.php" method="post">



						<div class="portlet">



							<div class="portlet-body">



								<div class="tabbable">



									<ul class="nav nav-tabs">



										<li class="active">



											<a href="#tab_general" data-toggle="tab">



											Add User </a>



										</li>

									</ul>



									<div class="tab-content no-space">



										<div class="tab-pane active" id="tab_general">



											<div class="form-body">






					<div class="form-group">
								
                            <div class="form-group">



								<label class="col-md-2 control-label">
									Name: <span class="required">* </span>
								</label>



								<div class="col-md-4">
									<input type="text" class="form-control" name="user[name]" placeholder="" required>
								</div>

							</div>


                        </div>

                        
                        <div class="form-group">


							<div class="form-group">



								<label class="col-md-2 control-label">
									Email: <span class="required">* </span>
								</label>



								<div class="col-md-4">
									<input type="email" class="form-control" name="user[u_email]" placeholder="" required>
								</div>

							</div>
							
						</div>
						 	
						<div class="form-group">


							<div class="form-group">



								<label class="col-md-2 control-label">
									User Name: <span class="required">* </span>
								</label>



								<div class="col-md-4">
									<input type="text" class="form-control" name="user[u_name]" placeholder="" required>
								</div>

							</div>
							
						</div>
						

						<div class="form-group">


							<div class="form-group">



								<label class="col-md-2 control-label">
									Password: <span class="required">* </span>
								</label>



								<div class="col-md-4">
									<input type="password" class="form-control" name="user[u_password]" id="pass" required> note: password must be 5 to 8 characters.
								</div>

							</div>
							
						</div>
						
						<div class="form-group">

							<div class="form-group">
								<label class="col-md-2 control-label">
									Delivery Center: <span class="required">* </span>
								</label>

								<div class="col-md-3">
									<select name="user[delcenter]" class="form-control" required>
									  	<option value=""> - Select -</option>
								
								<?php    
		                            $delrs = mysqli_query($con,"select * from deli_location_table where status=1 order by deliloc_name ASC");
                            		while($delrow=mysqli_fetch_array($delrs)){ 
                                
                                 	  	echo "<option value=".$delrow["deliloc_id"]."> ".$delrow["deliloc_name"]." </option>";
									  	
									} 
								?>	
									</select>	
                                
								</div>

							</div>
							
						</div>

						<div class="form-group">


							<div class="form-group">



								<label class="col-md-2 control-label">
									Restrictions: <span class="required">* </span>
								</label>



								<div class="col-md-4">
									

									<?php 
									
									for ($row = 0; $row < count($rules); $row++) {
									  
										?>

									  <label class="">										
											<input type="checkbox" name="rule[]" value="<?php echo $rules[$row];?>" class="icheck" style="position: absolute; ">
											 <div style="position: relative; padding-left:25px;"> <?php echo $rules[$row]; ?> </div>
											</label><br/>

									 
									<?php
									}
									?>
									
								</div>

							</div>
							
						</div>

		                <div class="form-group">



		                	<label class="col-sm-2 control-label" ></label>



		                	<input type='hidden' name='actionid' value='insert'>



		                  <div class="col-sm-10"><button class="btn green"><i class="fa fa-check"></i> Save</button></div>



		                </div>		                







					</div>



				</div>





									</div>



								</div>



							</div>



						</div>



					</form>



				</div>



			</div>



			<!-- END PAGE CONTENT-->



		</div>



	</div>



	<!-- END CONTENT -->






	</div>



<!-- END CONTAINER -->



<!-- BEGIN FOOTER -->



<?php include_once("../ro_footer.php"); ?>







<!-- END FOOTER -->



<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->



<!-- BEGIN CORE PLUGINS -->



<!--[if lt IE 9]>



<script src="../assets/global/plugins/respond.min.js"></script>



<script src="../assets/global/plugins/excanvas.min.js"></script> 



<![endif]-->

<?php include_once("../ro_js.php"); ?>

<!-- END PAGE LEVEL SCRIPTS -->



<script>



        jQuery(document).ready(function() {    



           Metronic.init(); // init metronic core components



Layout.init(); // init current layout



QuickSidebar.init(); // init quick sidebar



Demo.init(); // init demo features





        });



    </script>



<!-- END JAVASCRIPTS -->



</body>



<!-- END BODY -->



</html>

