-
Notifications
You must be signed in to change notification settings - Fork 0
/
createstd.php
98 lines (90 loc) · 2.97 KB
/
createstd.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<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" 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" class="form-control input-sm" required>
</div>
<div class="form-group">
<label class="control-label">Department</label>
<input type="text" name="std_dept" 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="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>
<div class="form-group">
<div class="well well-sm">
<h5>Please wait while the system generate project topic for this student....</h5>
<p id="project_title"><img src="image/ajax-loader.gif"> </p>
<input type="hidden" name="project_id" value="" id="project_id">
<button class="btn btn-xs btn-primary" title="refresh"><i class="fa fa-refresh"></i></button>
</div>
</div>
<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: "addstudent.php",
data: formData,
success: function(html){
if(html=='true')
{
$.jGrowl("Please Wait......", { sticky: true });
$.jGrowl("Student successfully added & assigned", { header: 'Success !!' });
var delay = 5000;
setTimeout(function(){ window.location = 'dashboard.php' }, delay);
}else
{
$.jGrowl("Error creating project", { header: 'Project creation failed' });
}
}
});
return false;
});
});
</script>
<script>
$(document).ready(function(){
$("#login_form1 .well").on('mouseover',function(){
$.ajax({
type: 'POST',
url: 'assign.php',
data: 'action=yes',
cache: false,
dataType: 'json',
success: function(data){
setTimeout(function(){
var project = data[0]['project_name'];
var case_ = data[0]['project_case'];
var id = data[0]['id'];
$("#project_title").html("");
$("#project_title").append(project+"<br>"+case_);
$("#project_id").val(id);
},500);
}
})
})
})
</script>