PluginProbe
School Management System – WPSchoolPress / 2.2.43
School Management System – WPSchoolPress v2.2.43
2.2.48 2.2.47 2.2.46 2.2.45 2.2.44 2.2.43 2.2.42 2.2.41 2.2.40 2.2.39 2.2.38 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 All 103 releases
wpschoolpress / pages / wpsp-marks.php

wpsp-marks.php in School Management System – WPSchoolPress 2.2.43, at pages/wpsp-marks.php

487 lines 23.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined( 'ABSPATH' ) )exit('No Such File');
3 wpsp_header();
4 if( is_user_logged_in() ) {
5 global $current_user, $wpdb;
6 $current_user_role=$current_user->roles[0];
7 if( $current_user_role=='administrator' || $current_user_role=='teacher' ) {
8 wpsp_topbar();
9 wpsp_sidebar();
10 wpsp_body_start();
11 $settings_data = [];
12 $class_id = $subject_id = $exam_id=0;
13 $proversion = wpsp_check_pro_version();
14 $proclass = !$proversion['status'] && isset( $proversion['class'] )? $proversion['class'] : '';
15 $protitle = !$proversion['status'] && isset( $proversion['message'] )? $proversion['message'] : '';
16 $prodisable = !$proversion['status'] ? 'disabled="disabled"' : '';
17 if( isset( $_POST['MarkAction'] ) ){
18 $class_id = (isset($_POST['ClassID'])) ? intval($_POST['ClassID']) : '';
19 $subject_id = (isset($_POST['SubjectID'])? intval($_POST['SubjectID']) : '');
20 $exam_id = (isset($_POST['ExamID'])? intval($_POST['ExamID']) : '');
21 }
22 $ctname = $wpdb->prefix.'wpsp_class';
23 $sbname = $wpdb->prefix.'wpsp_subject';
24 $classQuery = "select `cid`,`c_name` from `$ctname`";
25 $clt = $wpdb->get_results( $classQuery );
26 $msg = 'Please Add Class Before Adding Marks';
27 if( $current_user_role=='teacher' ) {
28 $cuserId = intval($current_user->ID);
29 $classQuery = $wpdb->prepare("SELECT DISTINCT c.cid,c.c_name FROM $ctname c INNER JOIN $sbname s ON s.class_id= c.cid WHERE s.sub_teach_id = %d",$cuserId);
30 $clt = $wpdb->get_results( $classQuery );
31 $msg = 'Please ask Principal to assign class and subject';
32 }
33
34 $wpsp_settings_table = $wpdb->prefix."wpsp_settings";
35 $wpsp_settings_edit = $wpdb->get_results("SELECT * FROM $wpsp_settings_table" );
36 foreach( $wpsp_settings_edit as $sdat ) {
37 $settings_data[$sdat->option_name] = $sdat->option_value;
38 }
39 ?>
40 <div class="wpsp-card">
41 <div class="wpsp-card-head">
42 <h3 class="wpsp-card-title"><?php echo esc_html(apply_filters( 'wpsp_student_marks_heading_item',"Students Marks"),"wpschoolpress"); ?></h3>
43 </div>
44 <div class="wpsp-card-body">
45 <?php
46 $item = apply_filters( 'wpsp_student_marks_title_item',esc_html("Class Name","wpschoolpress"));
47 if( empty( $clt ) ) {
48 echo '<div class="wpsp-text-red col-lg-2">'.esc_html($msg).'</div>';
49 } else { ?>
50 <form class="wpsp-form-horizontal" id="MarkForm" action="" method="post" enctype="multipart/form-data">
51 <?php wp_nonce_field( 'MarksRegister', 'wps_marks_nonce', '', true ); ?>
52 <div class="wpsp-row">
53 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
54 <div class="wpsp-form-group">
55 <label class="wpsp-label"><?php esc_html_e("Class","wpschoolpress"); ?></label>
56 <select name="ClassID" id="ClassID" class="wpsp-form-control" required>
57 <option value=""><?php esc_html_e( 'Select Class', 'wpschoolpress' ); ?> </option>
58 <?php foreach( $clt as $cnm ) { ?>
59 <option value="<?php echo esc_attr(intval($cnm->cid));?>" <?php if($cnm->cid==$class_id) echo esc_html("selected","wpschoolpress");?>><?php echo esc_html($cnm->c_name);?></option>
60 <?php } ?>
61 </select>
62 </div>
63 </div>
64 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
65 <div class="wpsp-form-group">
66 <label class="wpsp-label">
67 <?php esc_html_e("Exam","wpschoolpress");?></label>
68 <select name="ExamID" class="wpsp-form-control" id="ExamID" required>
69 <?php
70 if( $exam_id > 0 ) {
71 $examtable = $wpdb->prefix.'wpsp_exam';
72 $examlist = $wpdb->get_results($wpdb->prepare("SELECT eid,e_name FROM $examtable WHERE classid = %d",$class_id));
73 foreach( $examlist as $exam ) { ?>
74 <option value="<?php echo esc_attr(intval($exam->eid));?>" <?php if($exam->eid==$exam_id) echo esc_html("selected","wpschoolpress");?>><?php echo esc_html($exam->e_name);?></option>
75 <?php }
76 } else { ?>
77 <option value=""><?php esc_html_e( 'Select Exam', 'wpschoolpress' ); ?> </option>
78 <?php } ?>
79 </select>
80 </div>
81 </div>
82 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12">
83 <div class="wpsp-form-group">
84 <label class="wpsp-label"><?php esc_html_e("Subject","wpschoolpress");?></label>
85 <?php
86 $examtable = $wpdb->prefix.'wpsp_exam';
87 if( $exam_id!= '' ) {
88 $exam_id = esc_sql($exam_id);
89 $subjectID = $wpdb->get_var($wpdb->prepare("SELECT subject_id FROM $examtable WHERE eid = %d",$exam_id));
90 $subjectlist = explode( ",", $subjectID );
91 }
92 ?>
93 <select name="SubjectID" id="SubjectID" class="wpsp-form-control" required>
94 <?php if( $subject_id>0 ) {
95 $sub_tbl = $wpdb->prefix."wpsp_subject";
96 $subInfo = $wpdb->get_results($wpdb->prepare("SELECT sub_name,id FROM $sub_tbl WHERE class_id = %d",$class_id));
97 foreach( $subInfo as $sub_list ) {
98 if( in_array( $sub_list->id, $subjectlist ) ) {
99 echo "<option value='".esc_attr($sub_list->id)."'". selected( $subject_id, $sub_list->id, false ).">".esc_html($sub_list->sub_name)."</option>";
100 }
101 }
102 } else { ?>
103 <option value=""><?php esc_html_e( 'Select Subject', 'wpschoolpress' ); ?></option>
104 <?php } ?>
105 </select>
106 </div>
107 </div>
108 <div class="wpsp-col-lg-3 wpsp-col-md-4 wpsp-col-sm-4 wpsp-col-xs-12 <?php echo esc_attr($proclass);?>" title="" <?php echo esc_html($prodisable); ?>>
109 <div class="wpsp-form-group">
110 <label class="wpsp-label"><?php esc_html_e( 'Attach CSV', 'wpschoolpress'); ?></label>
111 <span <?php if($proversion['status'] != "1") {?> wpsp-tooltip="<?php echo esc_attr($protitle);?>" <?php } ?>>
112 <div class="wpsp-btn wpsp-btn-file" <?php echo esc_html($prodisable); ?>>
113 <span><i class="fa fa-file-text-o"></i> <?php esc_html_e( 'Attach CSV File', 'wpschoolpress' );?></span>
114 <input type="file" name="MarkCSV" class="<?php echo esc_attr($proclass);?> wpsp-form-control" title="" <?php echo esc_html($prodisable); ?>>
115 </div>
116 </span>
117 <span class="text"></span>
118 </div>
119 </div>
120 <div class="clearfix"></div>
121 <div class="wpsp-col-sm-8">
122 <div class="wpsp-form-group">
123 <button type="submit" class="wpsp-btn wpsp-btn-success MarkAction update-btn" name="MarkAction" value="Add Marks"><?php esc_html_e( 'Add/Update', 'wpschoolpress'); ?> </button>
124 <span <?php if($proversion['status'] != "1") {?> wpsp-tooltip="<?php echo esc_attr($protitle);?>" <?php } ?>>
125 <button type="submit" name="MarkAction" class="wpsp-btn wpsp-dark-btn update-btn MarkAction <?php echo esc_attr($proclass);?>" <?php echo esc_html($prodisable); ?> value="ImportCSV"><?php esc_html_e( 'Upload CSV', 'wpschoolpress'); ?></button>
126 </span>
127 <button name="MarkAction" class="wpsp-btn wpsp-btn-primary update-btn" id="viewmarks" value="View Marks"><?php esc_html_e( 'View Marks', 'wpschoolpress'); ?> </button>
128 </div>
129 </div>
130 </div>
131 </form>
132 <?php
133 if(isset($_POST['MarkAction']) && sanitize_text_field($_POST['MarkAction'])=='Add Marks'){
134 $mark_entered = '';
135 //Get Extra Fields
136 $extra_tbl = $wpdb->prefix."wpsp_mark_fields";
137 $extra_fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM $extra_tbl WHERE subject_id = %d",$subject_id));
138 if( wpsp_IsMarkEntered( $class_id,$subject_id,$exam_id ) ) {
139 $wpsp_marks = wpsp_GetMarks($class_id,$subject_id,$exam_id);
140 $mark_entered = 1;
141 $wpsp_exmarks = wpsp_GetExMarks($subject_id,$exam_id);
142 foreach($wpsp_exmarks as $exmark){
143 $extra_marks[$exmark->student_id][$exmark->field_id]=$exmark->mark;
144 }
145 }
146 ?>
147 <div id="mark_entry" class="col-md-12 col-lg-12 col-sm-12">
148 <?php if( $mark_entered ==1 ) { ?>
149 <h3 class="wpsp-card-title"><?php esc_html_e( 'Marks Already Entered update here!', 'wpschoolpress'); ?></h3><br/>
150 <?php } else { ?>
151 <h3 class="wpsp-card-title"><?php esc_html_e( 'Enter Marks', 'wpschoolpress'); ?></h3>
152 <?php } ?>
153 <div class="">
154 <form class="form-horizontal group-border-dashed" id="AddMarkForm" action="" style="border-radius: 0px;" method="post">
155 <?php wp_nonce_field( 'MarksRegister', 'wps_marks_nonce', '', true ); ?>
156 <input class="form-control" type="hidden" value="<?php echo esc_attr($subject_id);?>" name="SubjectID">
157 <input class="form-control" type="hidden" value="<?php echo esc_attr(intval($class_id));?>" name="ClassID">
158 <input class="form-control" type="hidden" value="<?php echo esc_attr(intval($exam_id));?>" name="ExamID">
159 <table class="wpsp-table" cellspacing="0" width="100%" style="width: 100%;">
160 <thead>
161 <tr>
162 <th><?php esc_html_e( 'RollNo.', 'wpschoolpress'); ?></th>
163 <th><?php esc_html_e( 'Name', 'wpschoolpress' ); ?></th>
164 <?php if((!isset($settings_data['markstype'])) || ($settings_data['markstype'] == "Number")) { ?>
165 <th><?php esc_html_e( 'Marks', 'wpschoolpress' );?></th>
166 <?php }else {?>
167 <th><?php esc_html_e( 'Grade', 'wpschoolpress' );?></th>
168 <?php } ?>
169 <th><?php esc_html_e( 'Remarks', 'wpschoolpress');?></th>
170 <?php if(!empty($extra_fields)){
171 foreach($extra_fields as $extf){
172 ?>
173 <th><?php echo esc_html($extf->field_text);?></th>
174 <?php } } ?>
175 </tr>
176 </thead>
177 <tbody>
178 <?php
179 if($mark_entered==1){
180 $stable = $wpdb->prefix."wpsp_student";
181 $sno = 1;
182 $stl = [];
183 $studentlists = $wpdb->get_results("select class_id, sid from $stable");
184 echo "<br />";
185 foreach ($studentlists as $stu) {
186 if(is_numeric($stu->class_id) ){
187 if($stu->class_id == $class_id){
188 $stl[] = $stu->sid;
189 }
190 }else{
191 $class_id_array = unserialize( $stu->class_id );
192 if(is_array($class_id_array)){
193 if(in_array($class_id, $class_id_array)){
194 $stl[] = $stu->sid;
195 }
196 }
197 }
198 }
199 if (empty($stl)) {
200 echo "<tr><td>".esc_html( 'No Students to retrive', 'wpschoolpress')."</td></tr>";
201 }else {
202 foreach ($stl as $id ) {
203 $getslist = $wpdb->get_results($wpdb->prepare("SELECT * FROM $stable WHERE sid = %d order by CAST('s_rollno' as SIGNED)",$id));
204 foreach ($getslist as $student ) {
205 $usid = intval($student->wp_usr_id);
206 $stroll = $student->s_rollno;
207 $stfullname = $student->s_fname.' '.$student->s_mname.' '.$student->s_lname;
208 $marktable = $wpdb->prefix."wpsp_mark";
209 $getmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $marktable WHERE class_id = %d AND student_id = %d AND subject_id = %d AND exam_id = %d",$class_id,$usid,$subject_id,$exam_id));
210 $getmarkid = isset( $getmark->mid ) ? $getmark->mid : '';
211 if( empty($getmark) ) {
212 $mark_data = array( 'subject_id'=>$subject_id,'class_id'=>$class_id,'student_id'=>$usid,'exam_id'=>$exam_id );
213 $m_ins = $wpdb->insert($marktable,$mark_data);
214 if( $wpdb->insert_id )
215 $getmarkid = $wpdb->insert_id;
216 }
217 ?>
218 <tr>
219 <td class="number"><?php echo esc_html($stroll);?></td>
220 <td class="number"><?php echo esc_html($stfullname);?></td>
221 <td class="sch_mark">
222 <?php if((!isset($settings_data['markstype'])) || ( $settings_data['markstype'] == "Number")){
223 $classvar = "class='numbers wpsp-form-control'";
224 }else{
225 $classvar = "class='textboxvalue wpsp-form-control'";
226 }
227 ?>
228 <input type="text" <?php echo wp_kses_post($classvar);?> id="v_marks" value="<?php echo ((isset($getmark->mark)? esc_attr($getmark->mark) : '')); ?>" name="marks[<?php echo esc_attr($getmarkid);?>][]">
229 </td>
230 <td class="sch_remarks">
231 <input type="text" class="textcls wpsp-form-control" value="<?php echo esc_attr($getmark->remarks); ?>" name="remarks[<?php echo esc_attr($getmarkid);?>][]">
232 </td>
233 <?php if(!empty($extra_fields)){
234 foreach($extra_fields as $extf){
235 ?>
236 <td><input type="text" class="numbers wpsp-form-control" id="v_exmark" min="0" name="exmarks[<?php echo esc_attr($usid);?>][<?php echo esc_html($extf->field_id);?>]" value="<?php echo ((isset($extra_marks[$usid][$extf->field_id]) ? esc_attr($extra_marks[$usid][$extf->field_id]) : ''));?>"></td>
237 <?php } } ?>
238 </tr>
239 <?php
240 $sno++;
241 }
242 }
243 echo "<input type='hidden' name='update' value='true'>";
244 }
245 }else{
246 $stable = $wpdb->prefix."wpsp_student";
247 $sno = 1;
248 $stl = [];
249 $studentlists = $wpdb->get_results("select class_id, sid from $stable");
250 echo "<br />";
251 foreach ($studentlists as $stu) {
252 if(is_numeric($stu->class_id) ){
253 if($stu->class_id == $class_id){
254 $stl[] = $stu->sid;
255 }
256 }else{
257 $class_id_array = unserialize( $stu->class_id );
258 if(is_array($class_id_array)){
259 if(in_array($class_id, $class_id_array)){
260 $stl[] = $stu->sid;
261 }
262 }
263 }
264 }
265 if (empty($stl)) {
266 echo "<tr><td>".esc_html( 'No Students to retrive3', 'wpschoolpress')."</td></tr>";
267 }else {
268 foreach ($stl as $id ) {
269 $id = esc_sql($id);
270 $getslist = $wpdb->get_results($wpdb->prepare("SELECT * FROM $stable WHERE sid = %d order by CAST('s_rollno' as SIGNED)",$id));
271 foreach( $getslist as $slist ) {
272 ?>
273 <tr>
274 <td class="number"><?php echo esc_html($slist->s_rollno);?></td>
275 <td class="number"><?php echo esc_html($slist->s_fname.' '.$slist->s_mname.' '.$slist->s_lname);?></td>
276 <td class="sch_mark">
277 <?php if((!isset($settings_data['markstype'])) || ( $settings_data['markstype'] == "Number")){
278 $classvar = "class='numbers markbox wpsp-form-control'";
279 }else {
280 $classvar = "class='textboxvalue markbox wpsp-form-control'";
281 }
282 ?>
283 <input type="text" <?php echo wp_kses_post($classvar);?> min="0" value="" name="marks[<?php echo esc_attr($slist->wp_usr_id);?>][]">
284 </td>
285 <td class="sch_remarks">
286 <input type="text" class="textcls wpsp-form-control" value="" name="remarks[<?php echo esc_attr($slist->wp_usr_id);?>][]">
287 </td>
288 <?php if(!empty($extra_fields)){
289 foreach($extra_fields as $extf){
290 ?>
291 <td><input type="text" class="wpsp-form-control" id="v_exmark1" min="0" name="exmarks[<?php echo esc_attr($slist->wp_usr_id);?>][<?php echo esc_html($extf->field_id);?>]"></td>
292 </td>
293 <?php }
294 } ?>
295 </tr>
296 <?php
297 $sno++;
298 }
299 }
300 }
301 if(empty($stl) && $mark_entered=='0'){
302 echo "<tr><td>".esc_html( 'No Students to retrive', 'wpschoolpress')."</td></tr>";
303 }else { }
304 } ?>
305 </tbody>
306 </table>
307 <div class="wpsp-row">
308 <div class="wpsp-col-md-12">
309 <input type="submit" class="wpsp-btn wpsp-btn-success" id="AddMark_Submit" name="AddMark_Submit" value="Save Marks">
310 </div>
311 </div>
312 </form>
313 </div>
314 </div>
315 <?php
316 }else if(isset($_POST['MarkAction']) && sanitize_text_field($_POST['MarkAction'])=='View Marks'){
317 include_once( WPSP_PLUGIN_PATH .'/includes/wpsp-viewMark.php');
318 }else{
319 do_action( 'wpsp_marks_actions' );
320 }
321 } ?>
322 </div>
323 </div>
324 <?php
325 wpsp_body_end();
326 wpsp_footer();
327
328 /* ============================================================
329 PARENT ROLE
330 ============================================================ */
331 } else if( $current_user_role == 'parent' ) {
332 wpsp_topbar();
333 wpsp_sidebar();
334 wpsp_body_start();
335
336 $parent_id = intval( $current_user->ID );
337 $student_table = $wpdb->prefix . "wpsp_student";
338 $class_table = $wpdb->prefix . "wpsp_class";
339 $exam_table_name = $wpdb->prefix . 'wpsp_exam';
340
341 /*
342 * Read URL params: sid = student wp_usr_id (base64), cid = class id (base64)
343 * These are set by the sidebar links for each child+course.
344 */
345 /*
346 * The sidebar passes sid = student plugin row `sid` (base64),
347 * and cid = class id (base64).
348 */
349 $url_sid = isset( $_GET['sid'] ) ? intval( base64_decode( sanitize_text_field( $_GET['sid'] ) ) ) : 0;
350 $url_class_id = isset( $_GET['cid'] ) ? intval( base64_decode( sanitize_text_field( $_GET['cid'] ) ) ) : 0;
351
352 /*
353 * SINGLE VIEW: a specific student + class was clicked in the sidebar.
354 */
355 if ( $url_sid > 0 && $url_class_id > 0 ) :
356
357 /*
358 * Match on `sid` (plugin student row ID) and verify parent ownership.
359 * Also fetch wp_usr_id — that is what the marks table stores.
360 */
361 $student_row = $wpdb->get_row( $wpdb->prepare(
362 "SELECT sid, wp_usr_id, CONCAT_WS(' ', s_fname, s_mname, s_lname) AS full_name
363 FROM $student_table
364 WHERE sid = %d AND parent_wp_usr_id = %d",
365 $url_sid,
366 $parent_id
367 ) );
368
369 /* wp_usr_id is what the AJAX marks handler expects */
370 $url_student_id = $student_row ? intval( $student_row->wp_usr_id ) : 0;
371
372 $class_row = $wpdb->get_row( $wpdb->prepare(
373 "SELECT c_name FROM $class_table WHERE cid = %d",
374 $url_class_id
375 ) );
376
377 $exams = $wpdb->get_results( $wpdb->prepare(
378 "SELECT eid, e_name FROM $exam_table_name WHERE classid = %d",
379 $url_class_id
380 ) );
381
382 $result_div_id = 'marks-result-' . $url_student_id . '-' . $url_class_id;
383 ?>
384
385 <div class="wpsp-card">
386 <div class="wpsp-card-head">
387 <h3 class="wpsp-card-title">
388 <?php echo esc_html( apply_filters( 'wpsp_student_marks_heading_item', 'Students Marks' ), 'wpschoolpress' ); ?>
389 </h3>
390 </div>
391 <div class="wpsp-card-body">
392
393 <?php if ( ! $student_row || ! $url_student_id ) : ?>
394 <p class="wpsp-text-red"><?php esc_html_e( 'Access denied.', 'wpschoolpress' ); ?></p>
395
396 <?php elseif ( empty( $exams ) ) : ?>
397 <p class="wpsp-text-red"><?php esc_html_e( 'No exams found for this class.', 'wpschoolpress' ); ?></p>
398
399 <?php else : ?>
400 <div class="wpsp-form-group" style="margin-bottom: 10px;">
401 <label><strong><?php esc_html_e( 'Select Exam:', 'wpschoolpress' ); ?></strong></label>
402 <select class="wpsp-form-control wpsp-exam-dropdown"
403 style="max-width: 300px;"
404 data-student="<?php echo esc_attr( $url_student_id ); ?>"
405 data-class="<?php echo esc_attr( $url_class_id ); ?>"
406 data-nonce="<?php echo esc_attr( wp_create_nonce( 'wpsp_marks_nonce' ) ); ?>">
407 <option value="">-- <?php esc_html_e( 'Select Exam', 'wpschoolpress' ); ?> --</option>
408 <?php foreach ( $exams as $exam ) : ?>
409 <option value="<?php echo esc_attr( $exam->eid ); ?>">
410 <?php echo esc_html( $exam->e_name ); ?>
411 </option>
412 <?php endforeach; ?>
413 </select>
414 </div>
415
416 <div class="wpsp-marks-result" id="<?php echo esc_attr( $result_div_id ); ?>"></div>
417 <?php endif; ?>
418
419 </div>
420 </div>
421
422 <?php
423 /*
424 * FALLBACK: no specific student/class in URL — this shouldn't normally
425 * happen with a proper sidebar, but keep a safe fallback just in case.
426 */
427 else :
428
429 $students = $wpdb->get_results( $wpdb->prepare(
430 "SELECT st.wp_usr_id, st.class_id, st.sid,
431 CONCAT_WS(' ', st.s_fname, st.s_mname, st.s_lname) AS full_name,
432 cl.c_name
433 FROM $student_table st
434 LEFT JOIN $class_table cl ON cl.cid = st.class_id
435 WHERE st.parent_wp_usr_id = %d",
436 $parent_id
437 ) );
438 ?>
439 <div class="wpsp-card">
440 <div class="wpsp-card-head">
441 <h3 class="wpsp-card-title">
442 <?php echo esc_html( apply_filters( 'wpsp_student_marks_heading_item', 'Students Marks' ), 'wpschoolpress' ); ?>
443 </h3>
444 </div>
445 <div class="wpsp-card-body">
446 <p><?php esc_html_e( 'Please select a student and course from the sidebar to view marks.', 'wpschoolpress' ); ?></p>
447 </div>
448 </div>
449
450 <?php endif; ?>
451
452 <?php
453 wpsp_body_end();
454 wpsp_footer();
455
456 /* ============================================================
457 STUDENT ROLE
458 ============================================================ */
459 } else if( $current_user_role == 'student' ) {
460 wpsp_topbar();
461 wpsp_sidebar();
462 wpsp_body_start();
463
464 $student_id = intval( $current_user->ID );
465 $ciid = sanitize_text_field( stripslashes( $_GET['cid'] ) );
466 $class_id = intval( base64_decode( $ciid ) );
467 ?>
468 <div class="wpsp-card">
469 <div class="wpsp-card-head">
470 <h3 class="wpsp-card-title"><?php esc_html_e( 'Your Marks', 'wpschoolpress' ); ?></h3>
471 </div>
472 <div class="wpsp-card-body">
473 <div class="gap-top-bottom">
474 <?php wpsp_MarkReport( $student_id, $class_id ); ?>
475 </div>
476 </div>
477 </div>
478 <?php
479 wpsp_body_end();
480 wpsp_footer();
481 }
482
483 } else {
484 // Include Login Section
485 include_once( WPSP_PLUGIN_PATH . '/includes/wpsp-login.php' );
486 }
487 ?>