
<div class="modal fade" id="myModal" tabindex="-1" role="form" 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"> Cancel &times;</button>
                <h4 class="modal-title" id="myModalLabel"> Admin </h4>
            </div>
				<div class="modal-body">
			   
					<form name="form1" data-parsley-validate class="form-horizontal form-label-left" method="post" action="" onsubmit="return validate()" >
						<div style="margin-bottom: 25px" class="input-group">
                                        <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
                                        <input id="login-username" type="text" class="form-control" name="username" placeholder="username">                                        
                                    </div>
                                
                            <div style="margin-bottom: 25px" class="input-group">
                                        <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
                                        <input id="login-password" type="password" class="form-control" name="password" placeholder="password">
                                    </div>
							
					  
							<div class="form-group">
								<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
									<input type="submit"  class="btn btn-success" name="login" value="Login"/>
								   <input id="lft" type="reset"  class="btn btn-primary" name="cancel" value="Cancel" />
								</div>
							</div>
					</form>
				</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-right" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
	
			   	<?php 
	if(isset($_POST['login'])){
					
		$username = $_POST['username'];   
		 $password = $_POST['password']; 
		 
		 
		 $query = mysql_query("select * from customer where username = '$username' and password = '$password' and user_type='admin' ") or die (mysql_error());
		 $nums = mysql_num_rows($query);
		 $rows = mysql_fetch_array($query);
		 
		 if ($nums > 0){
			 $id = $rows['customer_id'];
			 
			 $_SESSION['id'] = $rows['customer_id'];
			 
		?>
		<script>
		window.location="admin/adminpage.php";
		</script>
		<?php
		 }
		 else
		 {
			 echo ' <div class="col-md-offset-3 col-md-9">
                      <button id="btn-signup" type="button" class="btn btn-error"><i class="icon-hand-right"></i>Invalid Username or Password! </button>
                                         
                    </div>';
	     }
		}
				?>
			