<?php 
require_once("../includes/initialize.php");
$alldept = DEPARTMENTCLASS:: showdept();
$depart ='';
session_start();
$formno =$_SESSION['$formno'];
?>
<html>
<head>
<meta charset="utf-8">
<title>OSCOTECH 2018/2019| JAMB Update</title>
<link href="layout/css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all" />
<link href="layout/css/custom.css" rel="stylesheet" type="text/css" media="all" />	
 <script src="layout/js/respond.js" type="text/javascript"></script>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> 
<link rel="shortcut icon" href="images/favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
	background-color: #CCCCCC;
}
.style1 {color: #999999}
</style></head>

<body>
    <div class="container">
	<!-- row 1: navigation -->
    <div class="row" style="text-align: center">
        <div class="col-md-offset-4 col-md-4 col-md-offset-4">
            <h2>&nbsp;</h2>
            <h2>&nbsp;</h2>
            <h2><img src="../images/logo.png"></h2>
            <div class="panel-group">
                <!--<div class="panel panel-primary">-->
                    <div class="panel-heading"><h3>Select the Department on your JAMB Admission Letter</h3></div>
                    <div class="panel-body">
                                <form id ="myform" method ="post">
                                    <fieldset class="form-group">
                                        <p> <?echo $formno?></p><p id ="form"></p>
                                        <select name="department" id="department" class="form-control action" style="width:200px">
                                    		<option value="">Select Department</option>
                                    			<?php foreach($alldept as $dept){?>
                                        			<option value="<?php echo $dept->department;?>"><?php 
                                                    $depart= strtolower($dept->department);
                                                    echo ucwords($depart);?></option><?php }?>
                                                    
                                    	</select>
                                    </fieldset>
                                   <input type='submit' name ="submit" id="submit"class="btn btn-warning" value = "Update">
                                    <INPUT TYPE="button" class="btn btn-warning" VALUE="Close" ONCLICK="window.location='http://oscotechesaoke.edu.ng'">
                                </form>
                    </div>
                <!--</div>-->
            </div>
        </div>
    </div>

</div> 
</body>
</html>

<script>
$(document).ready(function(){

 $('#submit').click(function(e){
     e.preventDefault(e);
		if($(this).val() != '')
		{
			var department = $('#department').val();
			alert(department);
			{
				$.ajax({
					url: 'pu_update.php',
					method:'POST',
					data:{department:department},
					success:function(data)
					{
						alert(data); 
					}
				})
			}
		}
	}); 
});
</script>
