-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_student.php
186 lines (136 loc) · 9.57 KB
/
create_student.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?php
require_once 'library.php';
$allSchools=get_AllSchools();
?>
<?php
include "dbConnection.php";
?>
<script src="jquery-1.12.0.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#school_id").change(function(){
var school_id = $(this).val();
$.ajax({
url: 'getClasses.php',
type: 'post',
data: {school:school_id},
dataType: 'json',
success:function(response){
var len = response.length;
$("#class_id").empty();
$("#class_id").append("<option value='0'>Select Class</option>");
for( var i = 0; i<len; i++){
var id = response[i]['id'];
var name = response[i]['name'];
$("#class_id").append("<option value='"+id+"'>"+name+"</option>");
}
}
});
});
});
</script>
<div class="row" style="background-color:#fff; padding-top:10px">
<span class="title1" style="margin-left:40%;font-size:30px;"><center><img src="image/register_student.png" /></center></span><br /><br />
<div class="col-md-3"></div><div class="col-md-6">
<form class="form-horizontal" name="form" action="student_reg.php" onSubmit="return validateForm()" method="POST" enctype="multipart/form-data">
<fieldset>
<!-- Text input-->
<div class="form-group">
<label class="col-md-12" for="regno">Registration Number</label>
<div class="col-md-12">
<input id="regno" name="regno" readonly="readonly" value="" placeholder="Student Registration No. will be genetated" class="form-control input-md" type="regno" />
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-12" id="name" for="name">Fullname</label>
<div class="col-md-12">
<input id="name" name="name" placeholder="Enter your full name (Surname First)" class="form-control input-md" type="text" />
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-12 " id="username" for="username">Username</label>
<div class="col-md-12">
<input id="username" name="username" placeholder="Enter your username" class="form-control input-md" type="text" />
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-12" id="dob" for="dob">Date of Birth</label>
<div class="col-md-12">
<input id="dob" name="dob" placeholder="Enter your date of birth" class="form-control input-md tcal" type="text" />
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-12" for="gender">Gender</label>
<div class="col-md-12">
<select id="gender" name="gender" placeholder="Select your gender" class="form-control input-md" >
<option value="Male">Select you Gender</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-12" for="right">School</label>
<div class="col-md-12">
<select id="school_id" name="school_id" placeholder="Select your school name" class="form-control input-md">
<option value="0">Select School</option>
<?php
// Fetch Department
$sql_school = "SELECT * FROM schools";
$school_data = mysqli_query($con,$sql_school);
while($row = mysqli_fetch_assoc($school_data) ){
$school_code = $row['id'];
$school_name = $row['school_name'];
// Option
echo "<option value='".$school_code."' >".$school_name."</option>";
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-12" for="right">Class</label>
<div class="col-md-12">
<select id="class_id" name="class_id" class="form-control input-md">
<option value="0">Select Class</option>
</select>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-12" for="mob">Mobile Number</label>
<div class="col-md-12">
<input id="mob" name="mob" placeholder="Enter your mobile number" class="form-control input-md" type="text" />
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-12" for="password">Password</label>
<div class="col-md-12">
<input id="password" name="password" placeholder="Enter your password" class="form-control input-md" type="password" />
</div>
</div>
<div class="form-group">
<label class="col-md-12" for="cpassword">Confirm Password</label>
<div class="col-md-12">
<input id="cpassword" name="cpassword" placeholder="Confirm Password" class="form-control input-md" type="password"/>
</div>
</div>
<?php if(@$_GET['q7'])
{ echo'<p style="color:red;font-size:15px;">'.@$_GET['q7'];}
?>
<!-- Button -->
<div class="form-group">
<label class="col-md-12 control-label" for=""></label>
<div class="col-md-12" align="center">
<button type="submit" class="btn btn-primary">Register</button>
<br>
</div>
</div>
</fieldset>
</form>
</div>