├── .gitignore ├── .idea └── vcs.xml ├── README.md ├── academics.php ├── admininsert.php ├── attendance.php ├── changepassword.php ├── css ├── bootstrap.min.css └── style.css ├── details.php ├── dtmarks.php ├── editdetails.php ├── entry.php ├── form.css ├── header.php ├── home.php ├── images └── Logo.png ├── includes ├── _notes │ └── dwsync.xml ├── connection.php ├── constants.php ├── create.php ├── footer.php ├── form_functions.php ├── functions.php ├── header.php └── session.php ├── index.php ├── insertattendance.php ├── insertdt.php ├── insertfee.php ├── insertmonthly.php ├── insertsubjects.php ├── js ├── New Text Document.txt ├── bootstrap.min.js ├── jquery-1.11.0.min.js ├── jquery-1.6.4.min.js ├── jquery.leanModal.min.js ├── jquery.min.js ├── leanModal-modified-for-onload.js ├── multifield.js ├── validator.js └── validator.php ├── leftnavbar.php ├── login.php ├── logout.php ├── marks.php ├── paidclass.php ├── paidfee.php ├── payfee.php ├── resetpassword.php ├── school.sql ├── search.php ├── showimage.php ├── subjects.php ├── substaff.php ├── test.php ├── unitmarks.php └── vehicle.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Example user template template 3 | ### Example user template 4 | 5 | # IntelliJ project files 6 | .idea 7 | out 8 | gen 9 | .xml 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ⚠️ NOT SUPPORTED ⚠️ 2 | 3 | #### This is pet project 👨‍💻 while exploring PHP in 🏫 days without any patterns ❌ and mostly unorganised code (Still learning 🧑‍🎓 ). 4 | 5 | ##### Fork to develop 👨‍💻 at your own risk ☠️. 6 | 7 | 8 | 9 | # School-Management-System 10 | Using PHP, MYSQL, CSS, JS, HTML 11 | -------------------------------------------------------------------------------- /academics.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /admininsert.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 35 | $current_year -= 1; 36 | } 37 | //************* 38 | $current_id_query = mysql_query("select * from current_id where akey = '$akey_query_result[0]' and aca_year = '$current_year'") or die(mysql_error()); 39 | $i = 0; 40 | // inserting staff for a subject 41 | $sub_staff_query = mysql_query("INSERT into sub_staff values ('','$key_sub_query_result[0]','$faculty','$current_year')"); 42 | 43 | while($current_id_query_result = mysql_fetch_array($current_id_query)) 44 | { 45 | $i += 1; 46 | 47 | 48 | //inserting tuples for unit tests. 49 | 50 | //inserting academic key (aca_key) at once in a year 51 | //********************************* 52 | $insert_academic_key_query = mysql_query("INSERT into aca_key values('','$current_id_query_result[0]','$key_sub_query_result[0]')"); 53 | $aca_key_query = mysql_query("select max(sno) from aca_key"); 54 | $aca_key = mysql_fetch_array($aca_key_query); 55 | //checking if DT-1 already exists 56 | //$check_dtno1 = mysql_query("select * from marks_dt where aca_key = '$aca_key[0]' and dtno = '1'"); 57 | $units_test_query = mysql_query("select * from test") or die(mysql_error()); 58 | if($units_test_query) 59 | while($units_test_query_result = mysql_fetch_array($units_test_query)) 60 | { 61 | $insert_unit_test_tuples = mysql_query("INSERT into marks_units values('','$aca_key[0]','$units_test_query_result[0]','','','1')"); 62 | } 63 | 64 | //insering tuples for entire class 65 | $insert_marks_DT_query = mysql_query("INSERT into marks_dts values('','$aca_key[0]','$dtno','','1')") or die(mysql_error()); 66 | } 67 | if($i == 0) 68 | $message = "No records inserted..! Try again..!"; 69 | else $message = ''.$i.' students have their records inserted..!'; 70 | } 71 | else 72 | { 73 | $message = "Please fill all the fields..!"; 74 | } 75 | } 76 | else 77 | { 78 | $medium = ""; 79 | $class = ""; 80 | $section = ""; 81 | $dtno = ""; 82 | $subject = ""; 83 | $faculty = ""; 84 | } 85 | ?> 86 | 87 |
88 |

Master Insert for Academic year (only once in a year)

89 |
90 |
91 |
92 |
93 | 98 |
99 |
100 |
101 |
102 | 118 |
119 |
120 |
121 |
122 | 130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | 152 |
153 |
154 |
155 |
156 | 169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 | 181 |
182 |
183 |
184 |
185 |
186 |
187 | '.$message.''; ?> 188 | 189 |
190 | 201 | 202 | -------------------------------------------------------------------------------- /attendance.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $j) 23 | { 24 | if($noc != 0) 25 | $noca[$i] = ($nocp[$i]/$noc)*100; 26 | else $noca[$i] = 0; 27 | $qry = mysql_query("UPDATE attendance set noc = '$noc', nocp = '$nocp[$i]', noca = '$noca[$i]' where current_id = '$current_id[$i]'") or die(mysql_error()); 28 | $i += 1; 29 | } 30 | if($i != 0) 31 | $message = 'Updated successfully..!'; 32 | else 33 | $message = "Something went wrong. Try again..!"; 34 | } 35 | ?> 36 | 50 | 51 |
52 |

Attendance of class

53 |
54 |
55 |
56 |
57 | 62 |
63 |
64 |
65 |
66 | 82 |
83 |
84 |
85 |
86 | 94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | 102 |
103 |
104 |
105 | $year_from_current_id_result[0]) 122 | $current_year -= 1; 123 | } 124 | 125 | //************* 126 | $current_id_query = mysql_query("select * from current_id where akey = '$akey_query_result[0]' and aca_year = '$current_year'") or die(mysql_error()); 127 | $i = 0; 128 | $color = "#000"; 129 | while($current_id_query_result = mysql_fetch_array($current_id_query)) 130 | { 131 | $i += 1; 132 | if($i == 1) 133 | echo '
134 |
135 |

SNO.

136 |
137 |
138 |

Student

139 |
140 |
141 |

No: of days

142 |
143 |
144 |

Present

145 |
146 |
147 |

Percentage

148 |
149 |
'; 150 | //static student details 151 | $student_query = mysql_query("select * from student where id = '$current_id_query_result[1]'") or die(mysql_error()); 152 | $student_query_result = mysql_fetch_array($student_query); 153 | $attendance_query = mysql_query("select * from attendance where current_id = '$current_id_query_result[0]'") or die(mysql_error()); 154 | $attendance_query_result = mysql_fetch_array($attendance_query); 155 | if($color == "#FFF") $color = "#000"; 156 | else $color = "#FFF"; 157 | echo '
158 | 159 |
160 |
161 | 162 |
163 |
164 |
165 |
166 | 167 |
168 |
169 |
170 |
'; 171 | if($i == 1) 172 | echo ''; 173 | else 174 | echo''; 175 | echo '
176 |
177 |
178 |
179 | 180 |
181 |
182 |
183 |
184 | 185 |
186 |
187 |
'; 188 | 189 | } 190 | if($i == 0) 191 | $message = "No results found..!"; 192 | else 193 | echo '
194 |
195 |
196 |
197 |
198 | 199 |
200 |
201 |
202 |
203 |
'; 204 | } 205 | else $message = 'Select all fields to update..!'; 206 | 207 | } 208 | else 209 | { 210 | 211 | } 212 | ?> 213 | 214 |
215 | '.$message.''; ?> 216 |
217 | 218 | -------------------------------------------------------------------------------- /changepassword.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 28 | Please make sure your caps lock key is off and try again."; 29 | 30 | } 31 | } 32 | } 33 | ?> 34 | 35 |
36 |
37 |
38 |
39 |

Cabs on Hire

40 |
41 | " . $_SESSION['name']. ""; 45 | echo 'Edit Profile |  46 | Logout

'; 47 | } 48 | else 49 | { 50 | echo '

 Sign in

'; 51 | } 52 | ?> 53 |
54 |
55 |
56 |
57 | A@SCARTECH Left 58 |
59 | 60 |
61 | " . $message . "

";} ?> 62 | 89 |
90 | 91 |
92 | A@SCAR right Ads 93 |
94 | 95 | 98 | 129 | 130 | -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /* CSS Document */ 2 | body{ 3 | width:100%; height:100%; font-family:Georgia, "Times New Roman", Times, serif; margin: 0 0 0 0; padding:0px; 4 | } 5 | 6 | .leftnavbar{ 7 | background-color:#9CE; 8 | } 9 | 10 | .header{ 11 | background-color:#9CE; 12 | } 13 | 14 | .main{ 15 | background-color:#9EF; padding:20px; height:100%; width: 100%;; 16 | } 17 | .row{ 18 | margin-bottom:0px; 19 | } 20 | div{margin:0 0 0 0;} 21 | 22 | li a{ 23 | text-decoration:none; color:#FFF; 24 | } 25 | .must-field{ 26 | border-color: red !important; 27 | } -------------------------------------------------------------------------------- /details.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 22 | $current_year -= 1; 23 | } 24 | 25 | //************* 26 | 27 | ?> 28 | 73 | 74 | 75 |

Student Details

76 |
77 |

Personal Details

78 |
79 |
80 |
81 |

Name:

82 |

Aadhar:

83 |

Ration:

84 |

Address:

85 |

Contact:

86 |

Transport:

87 |

Fee Due:

88 |
89 |
90 |

91 |

92 |

93 |

94 |

95 |

102 |

View Details

103 |
104 |
105 |

Medium:

106 |

Class:

107 |

Section:

108 |

Gender:

109 |

Caste:

110 |

Religion:

111 |

Date of Joining:

112 |
113 |
114 |

115 |

116 |

117 |

118 |

125 |

132 |

133 |
134 |
135 |
136 | 137 |
138 |
139 |

Date of Birth:

140 |
141 |
142 |
143 |
144 |

Parent Details:

145 |
146 |
147 |
148 |

Father:

149 |

Qualification:

150 |

Occupation:

151 |
152 |
153 |

154 |

155 |

156 |
157 |
158 |
159 | 160 |
161 |
162 |
163 |
164 | 165 |
166 |
167 |
168 |

169 |

170 |

171 |
172 |
173 |

:Mother

174 |

:Qualification

175 |

:Occupation

176 |
177 |
178 | 210 |
211 |
212 |

Weekly Assessments

213 |
214 | 215 |
216 |

Monthly Assessments

217 |
218 | 219 |
220 | 221 | -------------------------------------------------------------------------------- /dtmarks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $j) 23 | { 24 | 25 | $qry = mysql_query("UPDATE marks_dts set marks = '$marks[$i]' where aca_key = '$acakey[$i]' and dtno = '$dtno'") or die(mysql_error()); 26 | $i += 1; 27 | } 28 | if($i != 0) 29 | $message = 'Updated successfully..!'; 30 | else 31 | $message = "Something went wrong. Try again..!"; 32 | } 33 | ?> 34 | 52 | 53 |
54 |

Daily-Test(DT) Marks of class

55 |
56 |
57 |
58 |
59 | 64 |
65 |
66 |
67 |
68 | 84 |
85 |
86 |
87 |
88 | 96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | 124 |
125 |
126 |
127 |
128 | 142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | 152 |
153 |
154 |
155 | $year_from_current_id_result[0]) 172 | $current_year -= 1; 173 | } 174 | 175 | //************* 176 | $current_id_query = mysql_query("select * from current_id where akey = '$akey_query_result[0]' and aca_year = '$current_year'") or die(mysql_error()); 177 | $i = 0; 178 | $color = "#000"; 179 | while($current_id_query_result = mysql_fetch_array($current_id_query)) 180 | { 181 | //academic key query for sujects in unit tests 182 | $aca_key_query = mysql_query("select * from aca_key where current_id = '$current_id_query_result[0]' and key_sub = '$key_sub_query_result[0]'"); 183 | $aca_key = mysql_fetch_array($aca_key_query); 184 | if($aca_key[0]) 185 | { 186 | $i += 1; 187 | if($i == 1) 188 | echo '
189 |
190 |

SNO.

191 |
192 |
193 |

Student

194 |
195 |
196 |

Marks

197 |
198 |
'; 199 | //static student details 200 | $student_query = mysql_query("select * from student where id = '$current_id_query_result[1]'") or die(mysql_error()); 201 | $student_query_result = mysql_fetch_array($student_query); 202 | $tests_query = mysql_query("select * from marks_dts where aca_key = '$aca_key[0]' and dtno = '$dtno'") or die(mysql_error()); 203 | $tests_query_result = mysql_fetch_array($tests_query); 204 | if($color == "#FFF") $color = "#000"; 205 | else $color = "#FFF"; 206 | echo '
207 | 208 |
209 |
210 | 211 |
212 |
213 |
214 |
215 | 216 |
217 |
218 |
219 |
220 | 221 |
222 |
223 |
'; 224 | } 225 | } 226 | if($i == 0) 227 | $message = "No results found..!"; 228 | else 229 | echo '
230 |
231 |
232 |
233 |
234 | 235 |
236 |
237 |
238 |
239 |
'; 240 | } 241 | else $message = 'Select all fields to update..!'; 242 | 243 | } 244 | else 245 | { 246 | 247 | } 248 | ?> 249 | 250 |
251 | '.$message.''; ?> 252 |
253 | 254 | -------------------------------------------------------------------------------- /entry.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 145 | 146 |

New Admission

147 | '.$message.'';?> 148 |

Personal Details

149 |
150 |
151 |
152 |
153 | 154 |
155 |
156 | 157 |
158 |
159 | 171 |
172 |
173 |
174 |
175 | 176 |
177 |
178 | 179 |
180 |
181 | 192 |
193 |
194 |
195 |
196 | 201 |
202 |
203 | 219 |
220 |
221 | 226 |
227 |
228 | 229 |
230 |
231 |
232 |
233 | 234 |
235 |
236 |
237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 |
246 |
247 |
248 |
249 | 257 |
258 |
259 |
260 |
261 |
262 | 263 |
264 |
265 | 266 | 267 |
268 |
269 | 270 | 271 |
272 |
273 |
274 |
275 | 276 | 277 |
278 |
279 | 280 |
281 |
282 | 283 |
284 |

Parent Details

285 | 286 |
287 |
288 | 289 |
290 |
291 | 292 |
293 |
294 |
295 |
296 | 297 |
298 |
299 | 300 |
301 |
302 |
303 |
304 | 305 |
306 |
307 | 308 |
309 |
310 | 311 |
312 |
313 | 314 |
315 | 316 |
317 |
318 | 319 |
320 |
321 |
322 |
323 | 324 |
325 |
326 | 335 |
336 |
337 |
338 | 339 |
340 | 341 |
342 | 343 |
344 |
345 | 346 | 347 |
348 |
349 |
350 |
351 | 352 | 353 |
354 |
355 |
356 |
357 | 358 | 359 |
360 |
361 | 362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 | 370 |
371 |
372 |
373 |
374 | 375 |
376 |
377 |
378 | 379 | 380 | -------------------------------------------------------------------------------- /form.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | body { 7 | background: #2E3740; 8 | color: #FFF; 9 | font-family: "Arial"; 10 | } 11 | 12 | .aalok { 13 | color: #6D7781; 14 | font-family: "TR2N"; 15 | font-size: 15px; 16 | font-weight: bold; 17 | font-size: 3.6em; 18 | text-align: center; 19 | } 20 | .head{ 21 | color: #6D7781; 22 | font-family: "Arial"; 23 | font-size: 15px; 24 | font-weight: bold; 25 | font-size: 3.6em; 26 | text-align: center; 27 | } 28 | a { 29 | color: #435160; 30 | text-decoration: none; 31 | } 32 | 33 | .login { 34 | width: 450px; 35 | position: absolute; 36 | margin-left: 300px; 37 | } 38 | 39 | input[type="text"], input[type="password"] { 40 | width: 350px; 41 | padding: 20px 0px; 42 | background: transparent; 43 | border: 0; 44 | border-bottom: 1px solid #435160; 45 | outline: none; 46 | color: #FFF; 47 | font-size: 16px; 48 | } 49 | input[type=checkbox] { 50 | display: none; 51 | } 52 | 53 | label { 54 | display: block; 55 | position: absolute; 56 | margin-right: 10px; 57 | width: 8px; 58 | height: 8px; 59 | border-radius: 50%; 60 | background: transparent; 61 | content: ""; 62 | transition: all 0.3s ease-in-out; 63 | cursor: pointer; 64 | border: 3px solid #435160; 65 | } 66 | 67 | #agree:checked ~ label[for=agree] { 68 | background: #435160; 69 | } 70 | 71 | input[type="submit"] { 72 | background: #1FCE6D; 73 | border: 0; 74 | width: 350px; 75 | height: 40px; 76 | border-radius: 3px; 77 | color: #fff; 78 | font-size: 12px; 79 | cursor: pointer; 80 | transition: background 0.3s ease-in-out; 81 | } 82 | input[type="submit"]:hover { 83 | background: #16aa56; 84 | animation-name: shake; 85 | } 86 | 87 | .forgot { 88 | margin-top: 30px; 89 | display: block; 90 | font-size: 11px; 91 | text-align: center; 92 | font-weight: bold; 93 | } 94 | .forgot:hover { 95 | margin-top: 30px; 96 | display: block; 97 | font-size: 11px; 98 | text-align: center; 99 | font-weight: bold; 100 | color: #6D7781; 101 | } 102 | 103 | .agree { 104 | padding: 30px 0px; 105 | font-size: 12px; 106 | text-indent: 25px; 107 | line-height: 15px; 108 | } 109 | 110 | ::-webkit-input-placeholder { 111 | color: #435160; 112 | font-size: 12px; 113 | } 114 | 115 | .animated { 116 | animation-fill-mode: both; 117 | animation-duration: 1s; 118 | } -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
School Logo

Nagarjuna Educational Institutions

15 | 16 | -------------------------------------------------------------------------------- /home.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /images/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arajajyothibabu/School-Management-System/bae5aaf37a44ee90163a1b81726ea27dabb26e06/images/Logo.png -------------------------------------------------------------------------------- /includes/_notes/dwsync.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /includes/connection.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /includes/constants.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /includes/create.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | Academic Results 6 | 7 | 8 | 36 | 37 |
9 |
10 | 11 | 12 | 15 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
13 | 14 | 16 | 17 | 19 | 20 | 22 | 23 |
Simply select subject if creation completes(Create for only subjects you have..!)
34 |
35 |
'; 61 | while($mark = mysql_fetch_array($queryset)){ 62 | echo '
Marks of Semister-'. $mark["semister"].'
SUBJECTQ-1A-1M-1I-1Q-2A-2M-2I-2I-FFinal
'. $mark["suid"] . '' . $mark["q1"] .''.$mark["a1"].''.$mark["m1"].''.$mark["i1"].''.$mark["q2"].''.$mark["a2"].''.$mark["m2"].''.$mark["i2"].''.$mark["inf"].''.$mark["f"].'
'; 63 | } 64 | } 65 | ?> 66 | 67 |
-------------------------------------------------------------------------------- /includes/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /includes/form_functions.php: -------------------------------------------------------------------------------- 1 | $maxlength ) { 15 | if (strlen(trim(mysql_prep($_POST[$fieldname]))) > $maxlength) { $field_errors[] = $fieldname; } 16 | } 17 | return $field_errors; 18 | } 19 | 20 | function display_errors($error_array) { 21 | echo "

"; 22 | echo "Please review the following fields:
"; 23 | foreach($error_array as $error) { 24 | echo " - " . $error . "
"; 25 | } 26 | echo "

"; 27 | } 28 | 29 | function hmd5($value) 30 | { 31 | 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /includes/functions.php: -------------------------------------------------------------------------------- 1 | 2 | = 65 && $ascii <= 90) { //uppercase bound 13 | $newstring .= chr(($ascii - 15 -65 + 26) % 26 + 65); //reset back to 'A' 14 | } 15 | else if($ascii >= 97 && $ascii <= 122) { //lowercase bound 16 | $newstring .= chr(($ascii - 15 -97 + 26) % 26 + 97); //reset back to 'a' 17 | } 18 | else if($ascii >= 48 && $ascii <= 57) { //lowercase bound 19 | $newstring .= chr(($ascii - 5 -48 + 10) % 10 + 48); 20 | } 21 | else { 22 | $newstring .= chr($ascii); 23 | } 24 | 25 | } 26 | return $newstring; 27 | } 28 | //function to encryption. 29 | function encrypt($string) 30 | { 31 | $newstring = ""; 32 | for ($i=0;$i= 65 && $ascii <= 90) { //uppercase bound 37 | $newstring .= chr(($ascii + 15 -65) % 26 + 65); //reset back to 'A' 38 | } 39 | else if($ascii >= 97 && $ascii <= 122) { //lowercase bound 40 | $newstring .= chr(($ascii + 15 -97) % 26 + 97); //reset back to 'a' 41 | } 42 | else if($ascii >= 48 && $ascii <= 57) { //lowercase bound 43 | $newstring .= chr(($ascii + 5 -48) % 10 + 48); //reset back to 'a' 44 | } 45 | else { 46 | $newstring .= chr($ascii); 47 | } 48 | 49 | } 50 | return $newstring; 51 | } 52 | 53 | 54 | 55 | function day() 56 | { 57 | $txt=""; 58 | for($i=1;$i<32;$i++) 59 | $txt .=''; 60 | echo $txt; 61 | } 62 | 63 | function caste() 64 | { 65 | $txt=""; 66 | $castes = array('Kamma','Kapu','Mudiraju','Brahmin','Padmasali','Mala','Madiga','Vysya','Reddy','Gowda','Rajaka','Muslim','Yadava','Yerukala','Sugali','Agnikula Kshatriya','Jangam','BudagaJangam','Devangula','Boyilu'); 67 | foreach($castes as $c) 68 | $txt .=''; 69 | echo $txt; 70 | } 71 | 72 | function religion() 73 | { 74 | $txt=""; 75 | $religions = array('Hindu','Christian','Muslim','Jain'); 76 | foreach($religions as $r) 77 | $txt .=''; 78 | echo $txt; 79 | } 80 | 81 | 82 | function month() 83 | { 84 | $txt=""; 85 | for($i=1;$i<13;$i++) 86 | $txt .=''; 87 | echo $txt; 88 | } 89 | 90 | function year() 91 | { 92 | $txt=""; 93 | for($i=1960;$i<2050;$i++) 94 | $txt .=''; 95 | echo $txt; 96 | 97 | } 98 | 99 | 100 | function ts($val){ 101 | settype($val,"string"); 102 | return $val; 103 | } 104 | 105 | function mysql_prep( $value ) { 106 | $magic_quotes_active = get_magic_quotes_gpc(); 107 | $new_enough_php = function_exists( "mysql_real_escape_string" ); // i.e. PHP >= v4.3.0 108 | if( $new_enough_php ) { // PHP v4.3.0 or higher 109 | // undo any magic quote effects so mysql_real_escape_string can do the work 110 | if( $magic_quotes_active ) { $value = stripslashes( $value ); } 111 | $value = mysql_real_escape_string( $value ); 112 | } else { // before PHP v4.3.0 113 | // if magic quotes aren't already on then add slashes manually 114 | if( !$magic_quotes_active ) { $value = addslashes( $value ); } 115 | // if magic quotes are active, then the slashes already exist 116 | } 117 | return $value; 118 | } 119 | 120 | function redirect_to( $location = NULL ) { 121 | if ($location != NULL) { 122 | header("Location: {$location}"); 123 | exit; 124 | } 125 | } 126 | 127 | function confirm_query($result_set) { 128 | if (!$result_set) { 129 | die("Database query failed: " . mysql_error()); 130 | } 131 | } 132 | 133 | 134 | 135 | function notnull($value){ 136 | if($value != "" ||$value != NULL){ 137 | return true; 138 | } 139 | else return false; 140 | } 141 | function validateMobile($value){ 142 | if(strlen($value)<10) 143 | { 144 | return false; 145 | } 146 | else return true; 147 | } 148 | 149 | /* function get_all_subjects($public = true) { 150 | global $connection; 151 | $query = "SELECT * 152 | FROM subjects "; 153 | if ($public) { 154 | $query .= "WHERE visible = 1 "; 155 | } 156 | $query .= "ORDER BY position ASC"; 157 | $subject_set = mysql_query($query, $connection); 158 | confirm_query($subject_set); 159 | return $subject_set; 160 | } 161 | 162 | function get_pages_for_subject($subject_id, $public = true) { 163 | global $connection; 164 | $query = "SELECT * 165 | FROM pages "; 166 | $query .= "WHERE subject_id = {$subject_id} "; 167 | if ($public) { 168 | $query .= "AND visible = 1 "; 169 | } 170 | $query .= "ORDER BY position ASC"; 171 | $page_set = mysql_query($query, $connection); 172 | confirm_query($page_set); 173 | return $page_set; 174 | } 175 | 176 | function get_subject_by_id($subject_id) { 177 | global $connection; 178 | $query = "SELECT * "; 179 | $query .= "FROM subjects "; 180 | $query .= "WHERE id=" . $subject_id ." "; 181 | $query .= "LIMIT 1"; 182 | $result_set = mysql_query($query, $connection); 183 | confirm_query($result_set); 184 | // REMEMBER: 185 | // if no rows are returned, fetch_array will return false 186 | if ($subject = mysql_fetch_array($result_set)) { 187 | return $subject; 188 | } else { 189 | return NULL; 190 | } 191 | } 192 | 193 | function get_page_by_id($page_id) { 194 | global $connection; 195 | $query = "SELECT * "; 196 | $query .= "FROM pages "; 197 | $query .= "WHERE id=" . $page_id ." "; 198 | $query .= "LIMIT 1"; 199 | $result_set = mysql_query($query, $connection); 200 | confirm_query($result_set); 201 | // REMEMBER: 202 | // if no rows are returned, fetch_array will return false 203 | if ($page = mysql_fetch_array($result_set)) { 204 | return $page; 205 | } else { 206 | return NULL; 207 | } 208 | } 209 | 210 | function get_default_page($subject_id) { 211 | // Get all visible pages 212 | $page_set = get_pages_for_subject($subject_id, true); 213 | if ($first_page = mysql_fetch_array($page_set)) { 214 | return $first_page; 215 | } else { 216 | return NULL; 217 | } 218 | } 219 | 220 | function find_selected_page() { 221 | global $sel_subject; 222 | global $sel_page; 223 | if (isset($_GET['subj'])) { 224 | $sel_subject = get_subject_by_id($_GET['subj']); 225 | $sel_page = get_default_page($sel_subject['id']); 226 | } elseif (isset($_GET['page'])) { 227 | $sel_subject = NULL; 228 | $sel_page = get_page_by_id($_GET['page']); 229 | } else { 230 | $sel_subject = NULL; 231 | $sel_page = NULL; 232 | } 233 | } 234 | 235 | function navigation($sel_subject, $sel_page, $public = false) { 236 | $output = ""; 254 | return $output; 255 | } 256 | 257 | function public_navigation($sel_subject, $sel_page, $public = true) { 258 | $output = ""; 278 | return $output; 279 | } 280 | -------------------------------------------------------------------------------- /includes/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BookMyCab 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /includes/session.php: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Nagarjuna Public School 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /insertattendance.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 29 | $current_year -= 1; 30 | } 31 | //************* 32 | $current_id_query = mysql_query("select * from current_id where akey = '$akey_query_result[0]' and aca_year = '$current_year'") or die(mysql_error()); 33 | $i = 0; 34 | while($current_id_query_result = mysql_fetch_array($current_id_query)) 35 | { 36 | $i += 1; 37 | 38 | $insert_attendance = mysql_query("INSERT into attendance values('','$current_id_query_result[0]','','','','1')"); 39 | 40 | } 41 | if($i == 0) 42 | $message = "No records inserted..! Try again..!"; 43 | else $message = ''.$i.' students have their records inserted..!'; 44 | } 45 | else 46 | { 47 | $message = "Please fill all the fields..!"; 48 | } 49 | } 50 | else 51 | { 52 | $medium = ""; 53 | $class = ""; 54 | $section = ""; 55 | } 56 | ?> 57 | 58 |
59 |

Insert Attendance records for a class

60 |
61 |
62 |
63 |
64 | 69 |
70 |
71 |
72 |
73 | 89 |
90 |
91 |
92 |
93 | 101 |
102 |
103 |
104 | 105 |
106 |
107 |
108 |
109 |
110 |
111 | 112 |
113 |
114 |
115 |
116 |
117 |
118 | '.$message.''; ?> 119 | 120 |
121 | 122 | -------------------------------------------------------------------------------- /insertdt.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 35 | $current_year -= 1; 36 | } 37 | //************* 38 | $current_id_query = mysql_query("select * from current_id where akey = '$akey_query_result[0]' and aca_year = '$current_year'") or die(mysql_error()); 39 | $i = 0; 40 | // inserting staff for a subject 41 | if($dtno == 1) 42 | { 43 | $sub_staff_query = mysql_query("INSERT into sub_staff values ('','$key_sub_query_result[0]','$faculty','$current_year')"); 44 | } 45 | 46 | while($current_id_query_result = mysql_fetch_array($current_id_query)) 47 | { 48 | $i += 1; 49 | 50 | 51 | //inserting tuples for unit tests. 52 | if($dtno == 1) 53 | { 54 | 55 | //inserting academic key (aca_key) at once in a year 56 | //********************************* 57 | $insert_academic_key_query = mysql_query("INSERT into aca_key values('','$current_id_query_result[0]','$key_sub_query_result[0]')"); 58 | $aca_key_query = mysql_query("select max(sno) from aca_key"); 59 | $aca_key = mysql_fetch_array($aca_key_query); 60 | //checking if DT-1 already exists 61 | //$check_dtno1 = mysql_query("select * from marks_dt where aca_key = '$aca_key[0]' and dtno = '1'"); 62 | $units_test_query = mysql_query("select * from test") or die(mysql_error()); 63 | if($units_test_query) 64 | while($units_test_query_result = mysql_fetch_array($units_test_query)) 65 | { 66 | $insert_unit_test_tuples = mysql_query("INSERT into marks_units values('','$aca_key[0]','$units_test_query_result[0]','','','1')"); 67 | } 68 | } 69 | else 70 | { 71 | $aca_key_query = mysql_query("select * from aca_key where current_id = '$current_id_query_result[0]' and key_sub = '$key_sub_query_result[0]'"); 72 | $aca_key = mysql_fetch_array($aca_key_query); 73 | } 74 | //insering tuples for entire class 75 | $insert_marks_DT_query = mysql_query("INSERT into marks_dts values('','$aca_key[0]','$dtno','','1')") or die(mysql_error()); 76 | } 77 | if($i == 0) 78 | $message = "No records inserted..! Try again..!"; 79 | else $message = ''.$i.' students have their records inserted..!'; 80 | } 81 | else 82 | { 83 | $message = "Please fill all the fields..!"; 84 | } 85 | } 86 | else 87 | { 88 | $medium = ""; 89 | $class = ""; 90 | $section = ""; 91 | $dtno = ""; 92 | $subject = ""; 93 | $faculty = ""; 94 | } 95 | ?> 96 | 97 |
98 |

Insert DT inforamtion for a class

99 |
100 |
101 |
102 |
103 | 108 |
109 |
110 |
111 |
112 | 128 |
129 |
130 |
131 |
132 | 140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 | 162 |
163 |
164 |
165 |
166 | 181 |
182 |
183 |
184 |
185 |
186 |
187 | 210 |
211 |
212 |
213 |
214 |
215 |
216 | 217 |
218 |
219 |
220 |
221 |
222 |
223 | '.$message.''; ?> 224 | 225 |
226 | 237 | 238 | -------------------------------------------------------------------------------- /insertfee.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 30 | $current_year -= 1; 31 | } 32 | //************* 33 | $fee_query = mysql_query("INSERT into fee values('','$akey_query_result[0]','$amount')") or die(mysql_error()); 34 | if($fee_query) 35 | $message = "Inserted successfully..!"; 36 | } 37 | else 38 | { 39 | $message = "Please fill all the fields..!"; 40 | } 41 | } 42 | else 43 | { 44 | $medium = ""; 45 | $class = ""; 46 | $section = ""; 47 | } 48 | ?> 49 | 50 |
51 |

Insert fee for a class

52 |
53 |
54 |
55 |
56 | 61 |
62 |
63 |
64 |
65 | 81 |
82 |
83 |
84 |
85 | 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 | '.$message.''; ?> 122 | 123 |
124 | 125 | -------------------------------------------------------------------------------- /insertmonthly.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | '.$i.' students have their records inserted..!'; 48 | } 49 | else 50 | { 51 | $message = "Please fill all the fields..!"; 52 | } 53 | } 54 | else 55 | { 56 | $medium = ""; 57 | $class = ""; 58 | $section = ""; 59 | $dtno = ""; 60 | $subject = ""; 61 | } 62 | ?> 63 | 64 |
65 |

Insert DT inforamtion for a class

66 |
67 |
68 |
69 |
70 | 75 |
76 |
77 |
78 |
79 | 95 |
96 |
97 |
98 |
99 | 107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | 129 |
130 |
131 |
132 |
133 | 148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 | 160 |
161 |
162 |
163 |
164 |
165 |
166 | '.$message.''; ?> 167 | 168 |
169 | 170 | -------------------------------------------------------------------------------- /insertsubjects.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $j) 24 | { 25 | $key_sub_query = mysql_query("select * into key_sub where sub = '$subject[$i]' and akey = '$akey_query_result[0]'") or die(mysql_error()); 26 | $i += 1; 27 | } 28 | $message = "Subjects inserted successfully..!"; 29 | //$key_sub_query_result = mysql_fetch_array($key_sub_query); 30 | } 31 | else 32 | { 33 | $message = "Please fill all the fields..!"; 34 | } 35 | } 36 | else 37 | { 38 | $medium = ""; 39 | $class = ""; 40 | $section = ""; 41 | $subject = ""; 42 | } 43 | ?> 44 | 45 |
46 |

Insert subjects for a class

47 |
48 |
49 |
50 |
51 | 56 |
57 |
58 |
59 |
60 | 76 |
77 |
78 |
79 |
80 | 88 |
89 |
90 |
91 |
92 |

Select subjects

93 |
'; 98 | //if($subject == $subject_query_result[0]) echo 'selected="selected">'; 99 | echo '
'.$subject_query_result[1].'
'; 100 | } 101 | 102 | ?> 103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | 111 |
112 |
113 |
114 |
115 |
116 | 117 | '.$message.''; ?> 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /js/New Text Document.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arajajyothibabu/School-Management-System/bae5aaf37a44ee90163a1b81726ea27dabb26e06/js/New Text Document.txt -------------------------------------------------------------------------------- /js/jquery.leanModal.min.js: -------------------------------------------------------------------------------- 1 | // leanModal v1.1 by Ray Stone - http://finelysliced.com.au 2 | // Dual licensed under the MIT and GPL 3 | 4 | (function($){$.fn.extend({leanModal:function(options){var defaults={top:100,overlay:0.5,closeButton:null};var overlay=$("
");$("body").append(overlay);options=$.extend(defaults,options);return this.each(function(){var o=options;$(this).click(function(e){var modal_id=$(this).attr("href");$("#lean_overlay").click(function(){close_modal(modal_id)});$(o.closeButton).click(function(){close_modal(modal_id)});var modal_height=$(modal_id).outerHeight();var modal_width=$(modal_id).outerWidth(); 5 | $("#lean_overlay").css({"display":"block",opacity:0});$("#lean_overlay").fadeTo(200,o.overlay);$(modal_id).css({"display":"block","position":"fixed","opacity":0,"z-index":11000,"left":50+"%","margin-left":-(modal_width/2)+"px","top":o.top+"px"});$(modal_id).fadeTo(200,1);e.preventDefault()})});function close_modal(modal_id){$("#lean_overlay").fadeOut(200);$(modal_id).css({"display":"none"})}}})})(jQuery); 6 | -------------------------------------------------------------------------------- /js/leanModal-modified-for-onload.js: -------------------------------------------------------------------------------- 1 | // leanModal v1.1 by Ray Stone - http://finelysliced.com.au 2 | // Dual licensed under the MIT and GPL 3 | (function ($) { 4 | $.fn.extend({ 5 | leanModal: function (options) { 6 | var defaults = { 7 | top: 100, 8 | overlay: 0.5, 9 | closeButton: null 10 | }; 11 | var overlay = $("
"); 12 | $("body").append(overlay); 13 | options = $.extend(defaults, options); 14 | return this.each(function () { 15 | var o = options; 16 | var modal_id = $(this).attr("href"); 17 | 18 | function showModal() { 19 | $("#lean_overlay").click(function () { 20 | close_modal(modal_id) 21 | }); 22 | $(o.closeButton).click(function () { 23 | close_modal(modal_id) 24 | }); 25 | 26 | var modal_height = $(modal_id).outerHeight(); 27 | var modal_width = $(modal_id).outerWidth(); 28 | 29 | $("#lean_overlay").css({ 30 | "display": "block", 31 | opacity: 0 32 | }); 33 | 34 | $("#lean_overlay").fadeTo(200, o.overlay); 35 | 36 | $(modal_id).css({ 37 | "display": "block", 38 | "position": "fixed", 39 | "opacity": 0, 40 | "z-index": 11000, 41 | "left": 50 + "%", 42 | "margin-left": -(modal_width / 2) + "px", 43 | "top": o.top + "px" 44 | }); 45 | 46 | $(modal_id).fadeTo(200, 1); 47 | }; 48 | 49 | $(document).ready(function () { 50 | showModal(); 51 | }); 52 | 53 | $(this).click(function (e) { 54 | showModal(); 55 | e.preventDefault() 56 | }) 57 | }); 58 | 59 | function close_modal(modal_id) { 60 | $("#lean_overlay").fadeOut(200); 61 | $(modal_id).css({ 62 | "display": "none" 63 | }) 64 | } 65 | } 66 | }) 67 | })(jQuery); 68 | -------------------------------------------------------------------------------- /js/multifield.js: -------------------------------------------------------------------------------- 1 | // multifeild - connects several input fields to each-other 2 | // By Yair Even Or / 2011 / dropthebit.com 3 | ;(function(){ 4 | function keypress(e){ 5 | var nextPrevField; 6 | // Ignore: [tab, ctrl, alt, left & right arrows] 7 | if( /9|17|18|37|39/.test(e.keyCode) ) 8 | return; 9 | // if hit Backspace key when the field it empty, go back one field 10 | if( e.keyCode == 8 && !this.value ) 11 | nextPrevField = $(this).prev()[0]; 12 | // automatically move to the next field once user has filled the current one completely 13 | else if( this.value.length == this.maxLength && e.keyCode != 8 ) 14 | nextPrevField = $(this).next(':text')[0]; 15 | 16 | // set the caret at the END of the inupt element 17 | if( nextPrevField ) 18 | setCaret( nextPrevField, 100); 19 | 20 | function setCaret(input, pos){ 21 | if (input.setSelectionRange){ 22 | input.focus(); 23 | input.setSelectionRange(pos, pos); 24 | } 25 | else if( input.createTextRange ){ 26 | var range = input.createTextRange(); 27 | range.collapse(true); 28 | range.moveEnd('character', pos); 29 | range.moveStart('character', pos); 30 | range.select(); 31 | } 32 | } 33 | 34 | combine.apply(this); 35 | }; 36 | // After each 'change' event of any of the fields, combine all the values to the hidden input. 37 | function combine(){ 38 | var hidden = $(this).siblings('input[type=hidden]').val('')[0]; 39 | $(this.parentNode).find(':text').each( function(){ 40 | hidden.value += this.value; 41 | }); 42 | } 43 | 44 | $('div.multi').on({'keyup.multifeild':keypress, 'change.multifeild':combine}, 'input'); 45 | })(); -------------------------------------------------------------------------------- /js/validator.js: -------------------------------------------------------------------------------- 1 | /* 2 | Validator v1.1.0 3 | (c) Yair Even Or 4 | https://github.com/yairEO/validator 5 | 6 | MIT-style license. 7 | */ 8 | 9 | var validator = (function($){ 10 | var message, tests, checkField, validate, mark, unmark, field, minmax, defaults, 11 | validateWords, lengthRange, lengthLimit, pattern, alertTxt, data, 12 | email_illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\]]/, 13 | email_filter = /^.+@.+\..{2,3}$/; 14 | 15 | /* general text messages 16 | */ 17 | message = { 18 | invalid : 'invalid input', 19 | empty : 'please put something here', 20 | min : 'input is too short', 21 | max : 'input is too long', 22 | number_min : 'too low', 23 | number_max : 'too high', 24 | url : 'invalid URL', 25 | number : 'not a number', 26 | email : 'email address is invalid', 27 | email_repeat : 'emails do not match', 28 | password_repeat : 'passwords do not match', 29 | repeat : 'no match', 30 | complete : 'input is not complete', 31 | select : 'Please select an option' 32 | }; 33 | 34 | if(!window.console){ 35 | console={}; 36 | console.log=console.warn=function(){ return; } 37 | } 38 | 39 | // defaults 40 | defaults = { alerts:true }; 41 | 42 | /* Tests for each type of field (including Select element) 43 | */ 44 | tests = { 45 | sameAsPlaceholder : function(a){ 46 | return $.fn.placeholder && a.attr('placeholder') !== undefined && data.val == a.prop('placeholder'); 47 | }, 48 | hasValue : function(a){ 49 | if( !a ){ 50 | alertTxt = message.empty; 51 | return false; 52 | } 53 | return true; 54 | }, 55 | // 'linked' is a special test case for inputs which their values should be equal to each other (ex. confirm email or retype password) 56 | linked : function(a,b){ 57 | if( b != a ){ 58 | // choose a specific message or a general one 59 | alertTxt = message[data.type + '_repeat'] || message.no_match; 60 | return false; 61 | } 62 | return true; 63 | }, 64 | email : function(a){ 65 | if ( !email_filter.test( a ) || a.match( email_illegalChars ) ){ 66 | alertTxt = a ? message.email : message.empty; 67 | return false; 68 | } 69 | return true; 70 | }, 71 | text : function(a){ 72 | // make sure there are at least X number of words, each at least 2 chars long. 73 | // for example 'john F kenedy' should be at least 2 words and will pass validation 74 | if( validateWords ){ 75 | var words = a.split(' '); 76 | // iterrate on all the words 77 | var wordsLength = function(len){ 78 | for( var w = words.length; w--; ) 79 | if( words[w].length < len ) 80 | return false; 81 | return true; 82 | }; 83 | 84 | if( words.length < validateWords || !wordsLength(2) ){ 85 | alertTxt = message.complete; 86 | return false; 87 | } 88 | return true; 89 | } 90 | if( lengthRange && a.length < lengthRange[0] ){ 91 | alertTxt = message.min; 92 | return false; 93 | } 94 | 95 | // check if there is max length & field length is greater than the allowed 96 | if( lengthRange && lengthRange[1] && a.length > lengthRange[1] ){ 97 | alertTxt = message.max; 98 | return false; 99 | } 100 | // check if the field's value should obey any length limits, and if so, make sure the length of the value is as specified 101 | if( lengthLimit && lengthLimit.length ){ 102 | var obeyLimit = false; 103 | while( lengthLimit.length ){ 104 | if( lengthLimit.pop() == a.length ) 105 | obeyLimit = true; 106 | } 107 | if( !obeyLimit ){ 108 | alertTxt = message.complete; 109 | return false; 110 | } 111 | } 112 | 113 | if( pattern ){ 114 | var regex, jsRegex; 115 | switch( pattern ){ 116 | case 'alphanumeric' : 117 | regex = /^[a-z0-9]+$/i; 118 | break; 119 | case 'numeric' : 120 | regex = /^[0-9]+$/i; 121 | break; 122 | case 'phone' : 123 | regex = /^\+?([0-9]|[-|' '])+$/i; 124 | break; 125 | default : 126 | regex = pattern; 127 | } 128 | try{ 129 | jsRegex = new RegExp(regex).test(a); 130 | if( a && !jsRegex ) 131 | return false; 132 | } 133 | catch(err){ 134 | console.log(err, field, 'regex is invalid'); 135 | return false; 136 | } 137 | } 138 | return true; 139 | }, 140 | number : function(a){ 141 | // if not not a number 142 | if( isNaN(parseFloat(a)) && !isFinite(a) ){ 143 | alertTxt = message.number; 144 | return false; 145 | } 146 | // not enough numbers 147 | else if( lengthRange && a.length < lengthRange[0] ){ 148 | alertTxt = message.min; 149 | return false; 150 | } 151 | // check if there is max length & field length is greater than the allowed 152 | else if( lengthRange && lengthRange[1] && a.length > lengthRange[1] ){ 153 | alertTxt = message.max; 154 | return false; 155 | } 156 | else if( minmax[0] && (a|0) < minmax[0] ){ 157 | alertTxt = message.number_min; 158 | return false; 159 | } 160 | else if( minmax[1] && (a|0) > minmax[1] ){ 161 | alertTxt = message.number_max; 162 | return false; 163 | } 164 | return true; 165 | }, 166 | // Date is validated in European format (day,month,year) 167 | date : function(a){ 168 | var day, A = a.split(/[-./]/g), i; 169 | // if there is native HTML5 support: 170 | if( field[0].valueAsNumber ) 171 | return true; 172 | 173 | for( i = A.length; i--; ){ 174 | if( isNaN(parseFloat(a)) && !isFinite(a) ) 175 | return false; 176 | } 177 | try{ 178 | day = new Date(A[2], A[1]-1, A[0]); 179 | if( day.getMonth()+1 == A[1] && day.getDate() == A[0] ) 180 | return day; 181 | return false; 182 | } 183 | catch(er){ 184 | console.log('date test: ', err); 185 | return false; 186 | } 187 | }, 188 | url : function(a){ 189 | // minimalistic URL validation 190 | function testUrl(url){ 191 | return /^(https?:\/\/)?([\w\d\-_]+\.+[A-Za-z]{2,})+\/?/.test( url ); 192 | } 193 | if( !testUrl( a ) ){ 194 | console.log(a); 195 | alertTxt = a ? message.url : message.empty; 196 | return false; 197 | } 198 | return true; 199 | }, 200 | hidden : function(a){ 201 | if( lengthRange && a.length < lengthRange[0] ){ 202 | alertTxt = message.min; 203 | return false; 204 | } 205 | if( pattern ){ 206 | var regex; 207 | if( pattern == 'alphanumeric' ){ 208 | regex = /^[a-z0-9]+$/i; 209 | if( !regex.test(a) ){ 210 | return false; 211 | } 212 | } 213 | } 214 | return true; 215 | }, 216 | select : function(a){ 217 | if( !tests.hasValue(a) ){ 218 | alertTxt = message.select; 219 | return false; 220 | } 221 | return true; 222 | } 223 | }; 224 | 225 | /* marks invalid fields 226 | */ 227 | mark = function( field, text ){ 228 | if( !text || !field || !field.length ) 229 | return false; 230 | 231 | // check if not already marked as a 'bad' record and add the 'alert' object. 232 | // if already is marked as 'bad', then make sure the text is set again because i might change depending on validation 233 | var item = field.parents('.item'), 234 | warning; 235 | 236 | if( item.hasClass('bad') ){ 237 | if( defaults.alerts ) 238 | item.find('.alert').html(text); 239 | } 240 | 241 | 242 | else if( defaults.alerts ){ 243 | warning = $('
').html( text ); 244 | item.append( warning ); 245 | } 246 | 247 | item.removeClass('bad'); 248 | // a delay so the "alert" could be transitioned via CSS 249 | setTimeout(function(){ 250 | item.addClass('bad'); 251 | }, 0); 252 | }; 253 | /* un-marks invalid fields 254 | */ 255 | unmark = function( field ){ 256 | if( !field || !field.length ){ 257 | console.warn('no "field" argument, null or DOM object not found'); 258 | return false; 259 | } 260 | 261 | field.parents('.item') 262 | .removeClass('bad') 263 | .find('.alert').remove(); 264 | }; 265 | 266 | function testByType(type, value){ 267 | if( type == 'tel' ) 268 | pattern = pattern || 'phone'; 269 | 270 | if( !type || type == 'password' || type == 'tel' ) 271 | type = 'text'; 272 | 273 | return tests[type](value); 274 | } 275 | 276 | function prepareFieldData(el){ 277 | field = $(el); 278 | 279 | field.data( 'valid', true ); // initialize validness of field by first checking if it's even filled out of now 280 | field.data( 'type', field.attr('type') ); // every field starts as 'valid=true' until proven otherwise 281 | pattern = el.pattern; 282 | } 283 | 284 | /* Validations per-character keypress 285 | */ 286 | function keypress(e){ 287 | prepareFieldData(this); 288 | 289 | if( e.charCode ) 290 | return testByType( data.type, String.fromCharCode(e.charCode) ); 291 | } 292 | 293 | /* Checks a single form field by it's type and specific (custom) attributes 294 | */ 295 | function checkField(){ 296 | // skip testing fields whom their type is not HIDDEN but they are HIDDEN via CSS. 297 | if( this.type !='hidden' && $(this).is(':hidden') ) 298 | return true; 299 | 300 | prepareFieldData(this); 301 | 302 | field.data( 'val', field[0].value.replace(/^\s+|\s+$/g, "") ); // cache the value of the field and trim it 303 | data = field.data(); 304 | 305 | // Check if there is a specific error message for that field, if not, use the default 'invalid' message 306 | alertTxt = message[field.prop('name')] || message.invalid; 307 | 308 | // SELECT / TEXTAREA nodes needs special treatment 309 | if( field[0].nodeName.toLowerCase() === "select" ){ 310 | data.type = 'select'; 311 | } 312 | if( field[0].nodeName.toLowerCase() === "textarea" ){ 313 | data.type = 'text'; 314 | } 315 | /* Gather Custom data attributes for specific validation: 316 | */ 317 | validateWords = data['validateWords'] || 0; 318 | lengthRange = data['validateLengthRange'] ? (data['validateLengthRange']+'').split(',') : [1]; 319 | lengthLimit = data['validateLength'] ? (data['validateLength']+'').split(',') : false; 320 | minmax = data['validateMinmax'] ? (data['validateMinmax']+'').split(',') : ''; // for type 'number', defines the minimum and/or maximum for the value as a number. 321 | 322 | data.valid = tests.hasValue(data.val); 323 | // check if field has any value 324 | if( data.valid ){ 325 | /* Validate the field's value is different than the placeholder attribute (and attribute exists) 326 | * this is needed when fixing the placeholders for older browsers which does not support them. 327 | * in this case, make sure the "placeholder" jQuery plugin was even used before proceeding 328 | */ 329 | if( tests.sameAsPlaceholder(field) ){ 330 | alertTxt = message.empty; 331 | data.valid = false; 332 | } 333 | 334 | // if this field is linked to another field (their values should be the same) 335 | if( data.validateLinked ){ 336 | var linkedTo = data['validateLinked'].indexOf('#') == 0 ? $(data['validateLinked']) : $(':input[name=' + data['validateLinked'] + ']'); 337 | data.valid = tests.linked( data.val, linkedTo.val() ); 338 | } 339 | /* validate by type of field. use 'attr()' is proffered to get the actual value and not what the browsers sees for unsupported types. 340 | */ 341 | else if( data.valid || data.type == 'select' ) 342 | data.valid = testByType(data.type, data.val); 343 | 344 | // optional fields are only validated if they are not empty 345 | if( field.hasClass('optional') && !data.val ) 346 | data.valid = true; 347 | } 348 | 349 | // mark / unmark the field, and set the general 'submit' flag accordingly 350 | if( data.valid ) 351 | unmark( field ); 352 | else{ 353 | mark( field, alertTxt ); 354 | submit = false; 355 | } 356 | 357 | return data.valid; 358 | } 359 | 360 | /* vaildates all the REQUIRED fields prior to submiting the form 361 | */ 362 | function checkAll( $form ){ 363 | $form = $($form); 364 | 365 | if( $form.length == 0 ){ 366 | console.warn('element not found'); 367 | return false; 368 | } 369 | 370 | var that = this, 371 | submit = true, // save the scope 372 | fieldsToCheck = $form.find(':input').filter('[required=required], .required, .optional').not('[disabled=disabled]'); 373 | 374 | fieldsToCheck.each(function(){ 375 | // use an AND operation, so if any of the fields returns 'false' then the submitted result will be also FALSE 376 | submit = submit * checkField.apply(this); 377 | }); 378 | 379 | return !!submit; // casting the variable to make sure it's a boolean 380 | } 381 | 382 | return { 383 | defaults : defaults, 384 | checkField : checkField, 385 | keypress : keypress, 386 | checkAll : checkAll, 387 | mark : mark, 388 | unmark : unmark, 389 | message : message, 390 | tests : tests 391 | } 392 | })(jQuery); -------------------------------------------------------------------------------- /js/validator.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Total Form Validation 7 | 8 | 14 | 15 | 16 | Github 17 | Blog Post 18 |
19 |
20 | 24 | 28 |
29 |

Forms: validation, styling & semantics

30 |
31 |
32 |
33 |
34 | 38 |
39 | ? 40 |
41 | 42 |

Name must be at least 2 words

43 |
44 |
45 |
46 |
47 | 51 |
52 | ? 53 |
54 | 55 |

An optional field. This field is only validated when it has a value.
Minimum 5 chars for this example.

56 |
57 |
58 | (optional) 59 |
60 |
61 | 65 |
66 | ? 67 |
68 | 69 |

This field uses HTML5 "pattern" attribute to be validated.
"\d+" - only digits are allowed

70 |
71 |
72 |
73 |
74 | 78 |
79 |
80 | 84 |
85 |
86 | 90 |
91 | ? 92 |
93 | 94 |

Number must be between 10 and 100

95 |
96 |
97 |
98 |
99 | 103 |
104 |
105 | 109 |
110 | ? 111 |
112 | 113 |

Should be of length 6 OR 8 characters

114 |
115 |
116 |
117 |
118 | 122 |
123 |
124 | 128 |
129 | ? 130 |
131 | 132 |

Notice that for a phone number user can input a '+' sign, a dash '-' or a space ' '

133 |
134 |
135 |
136 |
137 | 146 |
147 | ? 148 |
149 | 150 |

Choose something or choose not. what shall it be?

151 |
152 |
153 |
154 |
155 | 159 |
160 |
161 | 164 |
165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 |
173 |
174 | ? 175 |
176 | 177 |

This is a multifield, which let the user input a serial number or credit card number for example, and the trick is to validate the combined result, which is stored in a hidden field

178 |
179 |
180 |
181 |
182 | 186 |
187 |
188 |
189 |

There is a hidden "Required" form field below, notice it will not be validated due to its lack of visibility. The reason for this is that sometimes there is a section in a form that is not visible until some action is taken, but you do not want to change all those fields' "required" attributes on-the-fly, so that is why.

190 | 191 |
192 | 193 |
194 |
195 |
196 | 197 | 198 | 199 | 200 | 242 | 243 | -------------------------------------------------------------------------------- /leftnavbar.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 |

Menu

15 | 26 |

Update

27 | 34 |

Others

35 | 38 | '; 39 | else echo ' 40 | 41 |

Menu

42 | 54 |

Update

55 | 62 |

Others

63 | 66 | '; 67 | ?> 68 | 69 | -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 27 | Please make sure your caps lock key is off and try again."; 28 | } 29 | } 30 | ?> 31 | 32 |
33 |

Login

34 |
35 |
36 |
37 |
38 |
39 | 40 |
41 |
42 |
43 |
44 | 45 |
46 |
47 |
48 | 49 | 50 | 53 | 56 | 57 |
51 | 52 | 54 | 55 |
58 |
59 |
60 |
61 |
62 | 63 | -------------------------------------------------------------------------------- /logout.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /marks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /paidclass.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 21 | $current_year -= 1; 22 | } 23 | 24 | //************* 25 | 26 | ?> 27 | 41 | 42 |
43 |

Fee- Paid Status of a class

44 |
45 |
46 |
47 |
48 | 53 |
54 |
55 |
56 |
57 | 73 |
74 |
75 |
76 |
77 | 85 |
86 |
87 |
88 | 89 |
90 |
91 |
92 |
93 |
94 | 95 |
96 |
97 |
98 |
99 |
100 |
101 | 102 | 125 |
126 |

SNO.

127 |
128 |
129 |

Student

130 |
131 |
132 |

Due Amount

133 |
134 |
135 | '; 136 | 137 | echo ' 138 |
139 |
140 |
'.$i.'
141 |
142 |
143 |
'.$firstname.' '.$lastname.'
144 |
145 |
146 |
'.$due.'
147 |
148 |
149 | '; 150 | } 151 | if($i == 0) 152 | $message = "No results found..!"; 153 | else echo '
154 |
155 | 156 |
157 |
158 | 164 | '; 165 | //$key_sub_query_result = mysql_fetch_array($key_sub_query); 166 | } 167 | else 168 | { 169 | $message = "Please fill all the fields..!"; 170 | } 171 | } 172 | else 173 | { 174 | 175 | } 176 | ?> 177 | '.$message.''; ?> 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /paidfee.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 21 | $current_year -= 1; 22 | } 23 | 24 | //************* 25 | 26 | 27 | $paid_fee_query = mysql_query("select * from payfee where current_id = '$current_id'"); 28 | $current_id_query = mysql_query("select * from current_id where sno = '$current_id' and aca_year = '$current_year'") or die(mysql_error()); 29 | $current_id_query_result = mysql_fetch_array($current_id_query); 30 | ?> 31 | 32 |
33 |

Paid history of student

34 |
35 |
36 |

Total Amount for academic year:

37 |
38 |
39 | '.$fee_query_result['fee'].''; 43 | ?> 44 |
45 |
46 |
47 |
48 |

SNO.

49 |
50 |
51 |

Date of Payment

52 |
53 |
54 |

Amount Paid

55 |
56 |
57 | 66 |
67 |

'.$i.'

68 |
69 |
70 |

'.$paid_fee_query_result['dop'].'

71 |
72 |
73 |

'.$paid_fee_query_result['amount'].'

74 |
75 |
76 | '; 77 | 78 | } 79 | if($i == 0) 80 | $mesaage = "No paid yet..!"; 81 | 82 | ?> 83 |
84 |
85 |

Total Amount paid:

86 |
87 |
88 | '.$sum.''; 90 | ?> 91 |
92 |
93 |
94 |
95 |
96 |
97 |

Back

'; 99 | ?> 100 |
101 |
102 | '.$message.''; ?> 103 | 104 | 105 | -------------------------------------------------------------------------------- /payfee.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 56 | 57 | 58 | 81 | 82 | 83 |

Pay Fee

84 | '.$message.'';?> 85 |

Student Details

86 |
87 |
88 |
89 |
90 | 91 |
92 |
93 |
94 |
95 | 100 |
101 |
102 |
103 |
104 | 120 |
121 |
122 | 123 |
124 |
125 |
126 |
127 | 128 |
129 |
130 |
131 | 132 | 133 |
134 |
135 |
136 |
137 | 145 |
146 |
147 |
148 |
149 |
150 | 151 |
152 |
153 | 154 |
155 |
156 | 169 |
170 |
171 |
172 |
173 | 174 |
175 |
176 | 177 |
178 |
179 | 180 |
181 | 182 |
183 |
184 | 185 |
186 |
187 |
188 |
189 | 190 |
191 |
192 |
193 |
194 | 195 |
196 |
197 |
198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /resetpassword.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 26 | Please make sure your caps lock key is off and try again."; 27 | 28 | } 29 | } 30 | } 31 | ?> 32 | 33 |
34 |
35 |
36 |
37 |

Cabs for Hire

38 |
39 | " . $_SESSION['name']. ""; 51 | echo 'Edit Profile |  52 | Logout

'; 53 | } 54 | else 55 | { 56 | echo '

 Sign in

'; 57 | } 58 | ?> 59 |
60 |
61 |
62 |
63 | A@SCARTECH Left 64 |
65 |
66 | 90 | 91 |
92 |
93 | A@SCAR right Ads 94 | 95 |
96 | 97 | 100 | 101 | 134 | 135 | -------------------------------------------------------------------------------- /search.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 20 | 21 |
22 |
23 |

Search for the student

24 |
25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 |
37 |
38 |

or

39 |
40 |
41 |
42 |
43 | 48 |
49 |
50 |
51 |
52 | 68 |
69 |
70 |
71 |
72 | 80 |
81 |
82 |
83 |
84 |
85 |
86 | 87 |
88 |
89 |
90 |
91 | 92 |
93 | $year_from_current_id_result[0]) 109 | $current_year -= 1; 110 | } 111 | //*************************** 112 | if(isset($_POST['sid']) && $_POST['sid'] != "") 113 | { 114 | $current_id_query = mysql_query("select * from current_id where id = '$_POST[sid]' and aca_year = '$current_year'"); 115 | if($current_id_query) 116 | { 117 | $current_id_query_result = mysql_fetch_array($current_id_query); 118 | $vstudent_query = mysql_query("select * from vstudent where current_id = '$current_id_query_result[0]'") or die(mysql_error()); 119 | if($vstudent_query) 120 | { 121 | $vstudent_query_result = mysql_fetch_array($vstudent_query); 122 | $student_query = mysql_query("select * from student where id = '$_POST[sid]'"); 123 | $i = 0; 124 | if($student_query) 125 | { 126 | while($search_result = mysql_fetch_array($student_query)) 127 | { 128 | $i = 1; 129 | echo '
130 |
131 |

SNO.

132 |
133 |
134 |

Unique-Id

135 |
136 |
137 |

Student

138 |
139 |
140 | '; 141 | 142 | echo '
143 |
144 |
'.$i.'
145 |
146 |
147 |
'.$search_result[0].'
148 |
149 |
150 |
'.$search_result[1].' '.$search_result[2].'
151 |
152 |
'; 153 | } 154 | } 155 | } 156 | } 157 | } 158 | else 159 | { 160 | $medium = getClearedNull($_POST['medium']); 161 | $class = getClearedNull($_POST['class']); 162 | $section = getClearedNull($_POST['section']); 163 | if($medium != "" && $class != "" && $section != "") { 164 | $i = 0; 165 | $akey_query = mysql_query("select * from akey where medium LIKE '$medium' && class LIKE '$class' && section LIKE '$section'") or die(mysql_error()); 166 | while ($akey = mysql_fetch_array($akey_query)) { 167 | //query for current id 168 | $current_id_query = mysql_query("select * from current_id where akey = '$akey[0]' and aca_year = '$current_year' ORDER BY id"); 169 | 170 | $color = "#000"; 171 | while ($current_id_query_result = mysql_fetch_array($current_id_query)) { 172 | $i += 1; 173 | if ($i == 1) 174 | echo '
175 |
176 |

SNO.

177 |
178 |
179 |

Unique-Id

180 |
181 |
182 |

Student

183 |
184 |
185 | '; 186 | //vstudent and students query 187 | $vstudent_query = mysql_query("select * from vstudent where current_id = '$current_id_query_result[1]'"); 188 | $vstudent_query_result = mysql_fetch_array($vstudent_query); 189 | $student_query = mysql_query("select * from student where id = '$current_id_query_result[id]'"); 190 | $search_result = mysql_fetch_array($student_query); 191 | if ($color == "#FFF") $color = "#000"; 192 | else $color = "#FFF"; 193 | echo '
194 |
195 |
' . $i . '
196 |
197 |
198 |
' . $search_result[0] . '
199 |
200 |
201 |
' . $search_result[1] . ' ' . $search_result[2] . '
202 |
203 |
'; 204 | } 205 | } 206 | } 207 | else 208 | $message = "Kindly select all fields, if search for an entire class..!"; 209 | } 210 | if($i == 0 && empty($message)) 211 | $message = "No results found..!"; 212 | 213 | 214 | //displaying students at a bulk 215 | } 216 | } 217 | ?> 218 | '.$message.''; ?> 219 | 220 |
221 | 222 | -------------------------------------------------------------------------------- /showimage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /subjects.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /substaff.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 22 | $current_year -= 1; 23 | } 24 | 25 | //************* 26 | 27 | ?> 28 | $j) 39 | { 40 | 41 | $qry = mysql_query("UPDATE sub_staff set staff = '$faculty[$i]' where key_sub = '$keysub[$i]' and stamp = '$current_year'") or die(mysql_error()); 42 | $i += 1; 43 | } 44 | if($i != 0) 45 | $message = 'Updated successfully..!'; 46 | else 47 | $message = "Something went wrong. Try again..!"; 48 | } 49 | ?> 50 | 66 | 67 |
68 |

Staff & Subjects

69 |
70 |
71 |
72 |
73 | 78 |
79 |
80 |
81 |
82 | 98 |
99 |
100 |
101 |
102 | 110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | 132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 | 142 |
143 |
144 |
145 | 168 |
169 |

SNO.

170 |
171 |
172 |

Subject

173 |
174 |
175 |

Name

176 |
177 |
'; 178 | $sub_staff_query = mysql_query("select * from sub_staff where key_sub = '$key_sub_query_result[0]' and stamp = '$current_year'") or die(mysql_error()); 179 | if($sub_staff_query_result = mysql_fetch_array($sub_staff_query)) 180 | { 181 | $i += 1; 182 | 183 | //$staff_query = mysql_query("select * from staff where sno = '$sub_staff_query_result[2]'"); 184 | //$staff_query_result = mysql_fetch_array($staff_query); 185 | 186 | $subject_query = mysql_query("select * from subjects where sno = '$key_sub_query_result[sub]'") or die(mysql_error()); 187 | $subject_query_result = mysql_fetch_array($subject_query); 188 | 189 | if($color == "#FFF") $color = "#000"; 190 | else $color = "#FFF"; 191 | echo '
192 | 193 |
194 |
195 | 196 |
197 |
198 |
199 |
200 | 201 |
202 |
203 |
204 |
205 |
206 | 217 |
218 |
219 |
220 |
'; 221 | } 222 | } 223 | if($i == 0) 224 | $message = "No results found..!"; 225 | else 226 | echo '
227 |
228 |
229 |
230 |
231 | 232 |
233 |
234 |
235 |
236 |
'; 237 | } 238 | else $message = 'Select all fields to update..!'; 239 | } 240 | else 241 | { 242 | 243 | } 244 | ?> 245 | 246 | 247 | '.$message.''; ?> 248 | 249 | 250 | -------------------------------------------------------------------------------- /test.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Untitled Document 12 | 13 | $j) 18 | { 19 | $txt .= '

'.$subject[$i].'

'; 20 | } 21 | } 22 | else $txt = ""; 23 | ?> 24 | 25 |
26 |
27 |
'; 32 | //if($subject == $subject_query_result[0]) echo 'selected="selected">'; 33 | echo '
'.$subject_query_result[1].'
'; 34 | } 35 | 36 | ?> 37 | 38 |
39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /unitmarks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $j) 23 | { 24 | 25 | $qry = mysql_query("UPDATE marks_units set marks = '$marks[$i]' where aca_key = '$acakey[$i]' and test = '$test'") or die(mysql_error()); 26 | $i += 1; 27 | } 28 | if($i != 0) 29 | $message = 'Updated successfully..!'; 30 | else 31 | $message = "Something went wrong. Try again..!"; 32 | } 33 | ?> 34 | 52 | 53 |
54 |

UNIT-Test Marks

55 |
56 |
57 |
58 |
59 | 64 |
65 |
66 |
67 |
68 | 84 |
85 |
86 |
87 |
88 | 96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | 118 |
119 |
120 |
121 |
122 | 136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | 146 |
147 |
148 |
149 | $year_from_current_id_result[0]) 166 | $current_year -= 1; 167 | } 168 | 169 | //************* 170 | $current_id_query = mysql_query("select * from current_id where akey = '$akey_query_result[0]' and aca_year = '$current_year'") or die(mysql_error()); 171 | $i = 0; 172 | $color = "#000"; 173 | while($current_id_query_result = mysql_fetch_array($current_id_query)) 174 | { 175 | //academic key query for sujects in unit tests 176 | $aca_key_query = mysql_query("select * from aca_key where current_id = '$current_id_query_result[0]' and key_sub = '$key_sub_query_result[0]'"); 177 | $aca_key = mysql_fetch_array($aca_key_query); 178 | 179 | if($aca_key[0]) 180 | { 181 | $i += 1; 182 | if($i == 1) 183 | echo '
184 |
185 |

SNO.

186 |
187 |
188 |

Student

189 |
190 |
191 |

Marks

192 |
193 |
'; 194 | //static student details 195 | $student_query = mysql_query("select * from student where id = '$current_id_query_result[1]'") or die(mysql_error()); 196 | $student_query_result = mysql_fetch_array($student_query); 197 | $tests_query = mysql_query("select * from marks_units where aca_key = '$aca_key[0]' and test = '$test'") or die(mysql_error()); 198 | if($tests_query) 199 | $tests_query_result = mysql_fetch_array($tests_query); 200 | 201 | if($color == "#FFF") $color = "#000"; 202 | else $color = "#FFF"; 203 | echo '
204 | 205 |
206 |
207 | 208 |
209 |
210 |
211 |
212 | 213 |
214 |
215 |
216 |
217 | 218 |
219 |
220 |
'; 221 | } 222 | } 223 | if($i == 0) 224 | $message = "No results found..!"; 225 | else 226 | echo '
227 |
228 |
229 |
230 |
231 | 232 |
233 |
234 |
235 |
236 |
'; 237 | } 238 | else $message = 'Select all fields to update..!'; 239 | 240 | } 241 | else 242 | { 243 | 244 | } 245 | ?> 246 | 247 |
248 | '.$message.''; ?> 249 |
250 | 251 | -------------------------------------------------------------------------------- /vehicle.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | $year_from_current_id_result[0]) 22 | $current_year -= 1; 23 | } 24 | 25 | //************* 26 | $transport = ""; 27 | if(isset($_POST['submit'])) 28 | $transport = $_POST['transport']; 29 | ?> 30 | 31 | 32 | 33 |

Transport Details

34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | 54 |
55 |
56 |
57 |
58 | 59 |
60 |
61 |
62 |
63 |
64 | 65 |
66 | 79 |
80 |

SNO.

81 |

Student

82 |
83 |

Guardian

84 |
85 |

Address

86 |
87 |

Contact

88 |
89 |
90 | '; 91 | 92 | $current_id_query = mysql_query("select * from current_id where sno = '$vstudent_query_result[1]' and aca_year = '$current_year'") or die(mysql_error()); 93 | $current_id_query_result = mysql_fetch_array($current_id_query); 94 | 95 | $akey_query = mysql_query("select * from akey where sno = '$current_id_query_result[akey]'") or die(mysql_error()); 96 | $akey_query_result = mysql_fetch_array($akey_query); 97 | 98 | $student_query = mysql_query("select * from student where id = '$current_id_query_result[1]'") or die(mysql_error()); 99 | $student_query_result = mysql_fetch_array($student_query); 100 | $parent_query = mysql_query("select * from parent where id = '$current_id_query_result[1]'") or die(mysql_error()); 101 | $parent_query_result = mysql_fetch_array($parent_query); 102 | 103 | 104 | 105 | //storing details 106 | 107 | $id = $current_id_query_result['id']; 108 | $spic = $vstudent_query_result['pic']; 109 | $section = $akey_query_result['section']; 110 | $firstname = $student_query_result['firstname']; 111 | $lastname = $student_query_result['lastname']; 112 | $sex = $student_query_result['sex']; 113 | $class = $akey_query_result['class']; 114 | $medium = $akey_query_result['medium']; 115 | $dob = $student_query_result['dob']; 116 | $doj = $student_query_result['doj']; 117 | $caste = $student_query_result['caste']; 118 | $religion = $student_query_result['religion']; 119 | $siblings = $parent_query_result['siblings']; 120 | $aadhar = $student_query_result['aadhar']; 121 | $ration = $student_query_result['ration']; 122 | $address = $vstudent_query_result['address']; 123 | $contact = $vstudent_query_result['contact']; 124 | $transport = $vstudent_query_result['transport']; 125 | $fname = $parent_query_result['fname']; 126 | $focu = $parent_query_result['focu']; 127 | $fedu = $parent_query_result['fedu']; 128 | $mname = $parent_query_result['mname']; 129 | $mocu = $parent_query_result['mocu']; 130 | $medu = $parent_query_result['medu']; 131 | $fpic = $parent_query_result['fpic']; 132 | $mpic = $parent_query_result['mpic']; 133 | $due = $vstudent_query_result['due']; 134 | echo ' 135 |
136 |
137 | '.$i.'
138 |
'.$firstname.' '.$lastname.'
139 |
140 |
'.$fname.'
141 |
142 |
'.$address.'
143 |
144 |
'.$contact.'
145 |
146 |
147 | '; 148 | } 149 | if($i == 0) 150 | $message = "No records found..!"; 151 | } 152 | else $message = "Select something to find..!"; 153 | } 154 | 155 | ?> 156 | 157 | 158 | 159 | 160 | --------------------------------------------------------------------------------