roles[0]; if($current_user_role=='administrator' || $current_user_role=='teacher') { wpsp_topbar(); wpsp_sidebar(); wpsp_body_start(); $filename = WPSP_PLUGIN_PATH .'includes/wpsp-studentList.php'; if( isset( $_GET['tab'] ) && $_GET['tab'] == 'addstudent' ) { if($current_user_role=='administrator'){ $label = __( 'Add New Student', 'wpschoolpress'); $filename = WPSP_PLUGIN_PATH .'includes/wpsp-studentForm.php'; } } else if( isset($_GET['id']) && is_numeric($_GET['id']) ) { if($current_user_role=='administrator' || $current_user_role=='teacher') { $label = __( 'Update Student', 'wpschoolpress'); $filename = WPSP_PLUGIN_PATH .'includes/wpsp-studentProfile.php'; } } else if( isset( $_POST['ClassID'] ) && empty( $_POST['ClassID'] ) ) { $label = esc_html('List Of Unassigned Students','wpschoolpress'); } else if( isset( $_POST['ClassID'] ) && $_POST['ClassID']=='all' ) { $label = esc_html('List Of All Students','wpschoolpress'); } else if( isset( $_POST['ClassID'] ) && !empty( $_POST['ClassID'] ) ){ $class_table = $wpdb->prefix."wpsp_class"; $sel_class = $wpdb->prepare( "SELECT * FROM $class_table WHERE cid LIKE %d;",'%' . $wpdb->esc_like( $_POST['ClassID'] ) . '%' ); $label = 'List of class ' .esc_html($sel_class). ' Students'; } else { $label = esc_html('List Of All Students','wpschoolpress'); } include_once ( $filename ); if(isset($_GET['tab'])){ if($_GET['tab'] != 'addstudent' ) { do_action('wpsp_student_import_html'); } } wpsp_body_end(); wpsp_footer(); }else if($current_user_role=='parent') { /* Parents can View their children's class students */ wpsp_topbar(); wpsp_sidebar(); wpsp_body_start(); global $wpdb; $parent_id = intval($current_user->ID); $student_table = $wpdb->prefix."wpsp_student"; $class_table = $wpdb->prefix."wpsp_class"; $users_table = $wpdb->prefix."users"; // $students = $wpdb->get_results("select st.wp_usr_id, st.class_id, st.s_fname AS full_name,cl.c_name from $student_table st LEFT JOIN $class_table cl ON cl.cid=st.class_id where st.parent_wp_usr_id='".esc_sql($parent_id)."'"); $students = $wpdb->get_results($wpdb->prepare("SELECT st.wp_usr_id, st.class_id, st.s_fname AS full_name,cl.c_name FROM $student_table st LEFT JOIN $class_table cl ON cl.cid=st.class_id WHERE st.parent_wp_usr_id = %d",$parent_id)); $child=array(); foreach($students as $childinfo){ $child[]=array('student_id'=>$childinfo->wp_usr_id,'name'=>$childinfo->full_name,'class_id'=>$childinfo->class_id,'class_name'=>$childinfo->c_name); } if( count( $child ) > 0 ) { ?>
| s_rollno); ?> | |
| s_gender); ?> | |
| s_dob)); ?> | |
| s_doj)); ?> | |
| s_paddress); ?> | |
| s_pcountry); ?> | |
| s_pzipcode); ?> | |
| user_email); ?> | |
| s_phone); ?> | |
| s_bloodgrp); ?> |
| # | ||||
|---|---|---|---|---|
| s_rollno);?> | full_name);?> | p_full_name);?> | peraddress);?> |