roles[0]; if($current_user_role=='administrator' || $current_user_role=='teacher'){ wpsp_topbar(); wpsp_sidebar(); wpsp_body_start(); if(isset($_GET['tab']) && sanitize_text_field($_GET['tab'])=='addparent'){ if($current_user_role=='administrator'){ include_once( WPSP_PLUGIN_PATH.'/includes/wpsp-parentForm.php'); } } else { include_once( WPSP_PLUGIN_PATH .'/includes/wpsp-parentList.php'); ?>
ID); $label = esc_html('Your Profile','wpschoolpress'); if( $current_user_role=='student' ) { $student_id = intval($current_user->ID); $student_table = $wpdb->prefix."wpsp_student"; // $parent_info = $wpdb->get_row("select parent_wp_usr_id from $student_table where wp_usr_id='".esc_sql($student_id)."'"); $parent_info = $wpdb->get_row($wpdb->prepare("SELECT parent_wp_usr_id FROM $student_table WHERE wp_usr_id = %d",$student_id)); $parent_id = sanitize_text_field($parent_info->parent_wp_usr_id); $label = esc_html('Parent Profile','wpschoolpress'); } if($parent_id > 0){ global $wpdb; $student_table = $wpdb->prefix . "wpsp_student"; $users_table = $wpdb->prefix . "users"; if ($parent_id != ''){ $pid = intval($parent_id); }else{ $pid = ''; } if (!empty($pid)) $where = "where p.parent_wp_usr_id='".esc_sql($pid)."'"; $button = isset($_POST['button']) ? sanitize_text_field($_POST['button']) : ''; $pinfo = $wpdb->get_row("select p.*, CONCAT_WS(' ', p_fname, p_mname, p_lname ) AS full_name ,u.user_email from $student_table p LEFT JOIN $users_table u ON u.ID=p.parent_wp_usr_id $where"); $loc_avatar = get_user_meta($pid, 'simple_local_avatar', true); $img_url = $loc_avatar ? $loc_avatar['full'] : WPSP_PLUGIN_URL . 'img/avatar.png'; if (!empty($pinfo)){ $profile = "| Full Name: ".esc_html($pinfo->p_fname. $pinfo->p_mname. $pinfo->p_lname)." | |
| Email: ".esc_html($pinfo->user_email)." | Gender: ".esc_html($pinfo->p_gender)." |
| Education: ".esc_html($pinfo->p_edu)." | Profession: ".esc_html($pinfo->p_profession)." |
| Blood Group: ".esc_html($pinfo->p_bloodgrp)." | |
Parent profile not linked with this account, Kindly contact to School!
"; } wpsp_body_end(); wpsp_footer(); } } else { include_once( WPSP_PLUGIN_PATH.'/includes/wpsp-login.php'); } ?>