-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_std_form.php
66 lines (61 loc) · 2.1 KB
/
edit_std_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<div class="row">
<div class="col-md-4">
<form method="post" action="" id="login_form1">
<div class="form-group">
<label class="control-label">Student Name</label>
<input type="text" name="std_name" value="<?php echo $name ?>" class="form-control input-sm" required>
</div>
<div class="form-group">
<label class="control-label">Student Reg. No</label>
<input type="text" name="std_no" value="<?php echo $matric; ?>" class="form-control input-sm" required>
</div>
<div class="form-group">
<label class="control-label">Department</label>
<input type="text" name="std_dept" value="<?php echo $department; ?>" class="form-control input-sm" required>
</div>
<div class="form-group">
<label class="control-label">Class</label>
<select name="std_class" class="form-control input-sm " required>
<option value="<?php echo $level; ?>" selected><?php echo $level; ?></option>
<option value="ND">ND 1</option>
<option value="ND 2">ND 2</option>
<option value="ND 3">ND 3</option>
<option value="HND 1">HND 1</option>
<option value="HND 2">HND 2</option>
<option value="HND 3">HND 3</option>
</select>
</div>
<input type="hidden" name="std_id" value="<?php echo $id; ?>">
<button type="submit" class="btn btn-sm btn-default">Submit</button>
</form>
</div>
<div class="col-md-8">
<?php include 'all_student.php'; ?>
</div>
</div>
<script>
$(document).ready(function(){
$("#login_form1").submit(function(e){
e.preventDefault();
var formData = $(this).serialize();
$.ajax({
type: "POST",
url: "updatestudent.php",
data: formData,
success: function(html){
if(html=='true')
{
$.jGrowl("Please Wait......", { sticky: true });
$.jGrowl("Student successfully updated", { header: 'Success !!' });
var delay = 5000;
setTimeout(function(){ window.location = 'create-student.php' }, delay);
}else
{
$.jGrowl("Error creating project", { header: 'Project creation failed' });
}
}
});
return false;
});
});
</script>