<script type="text/javascript">
$(document).ready(function(e) {
$("#department").on('submit' ,(function(e) {
e .preventDefault();
$("#message").empty();
$('#loading').show();
$ .ajax({
url : "control.php" , //Url to which the request issend
type : "POST" , //Type of request to be send,called as method
data : new FormData(this), //Data sent to server, a set of key/value pairs(i.e.form fields and values)
contentType : false, //The content type used when sending data to the server.
cache : false , //To unable request pages to be cached
processData : false, //To send DOMDocument or non processed data file it is set to false
beforeSend : function(){
            $('#loading').show();
        },
success: function(data) //A function to be called if request succeeds
{
$('#loading').hide();
document.getElementById('inputHere').innerHTML = data;
$('#myModal').modal('show');
document.getElementById('cname').value = "";
}
});
}));
});
</script>
<!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3><a href="main.php">Dashboard</a>/<a href=" ">Add Student</a></h3>
              </div>
            </div>

            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <div class="row">
                        <h4>Add Student</h4>
                    </div>
                    
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <form id="department" action ="" method ="post">
                            <div class="row">
                            <div class="col-md-3">
                            <div class="form-group">
                                <label for="student" >Student Surname</label>
                                <input type="text" name="student" id="student" placeholder="Surname" class="form-control">
                            </div>
                            </div>
                            <div class="col-md-3">
                            <div class="form-group">
                                <label for="ostudent" >Other Names</label>
                                <input type="text" name="ostudent" id="ostudent" placeholder="Other Names" class="form-control">
                            </div>
                            </div>
                            <div class="col-md-3">
                            <div class="form-group">
                                <label for="matric" >Matric</label>
                                <input type="text" name="matric" id="matric" placeholder="matric" class="form-control">
                            </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4">
                            <div class="form-group">
                                <label for="level" >Level</label>
                                <select class="form-control" name="level" id="level">
                                    <option value="">.. Choose Level</option>
                                    <option value="100">100</option>
                                    <option value="200">200</option>
                                    <option value="300">300</option>
                                    <option value="400">400</option>
                                </select>
                            </div>
                            <input type="hidden" name="department" value="<?php echo "$id2s" ?>">
                            </div>
                            

                            </div>
                            <button class="btn btn-success submit" type="submit" name="addcourse">Submit</button>
                            <span id="loading" style="display:none;"><img src="../img/loading.gif"></span>

                            </form>
                            </div>
                            </div>
                </div>
              </div>
            </div>
          </div>
        <!-- /page content -->

<div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog modal-sm">
      <div class="modal-content">
        <div class="modal-body text-center">
        <div id="inputHere">

        </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button>
        </div>
      </div>
    </div>
  </div>
</div>
