$department_id = $_SESSION['department_id']; $faculty_id = $_SESSION['faculty_id']; $campus_id = $_SESSION['campus_id']; $adm_yr = $_SESSION['adm_yr']; $query .= " AND `courses`.`school_course_code` = '{$pursuing_course}' AND `courses`.`department_id` = '{$department_id}'\n\tAND `courses`.`faculty_id` = '{$faculty_id}' AND `courses`.`campus_id` = '{$campus_id}' AND `courses`.`student_adm_yr`= '{$adm_yr}'"; } if ($result = mysqli_query($conn, $query)) { while ($lec_info = mysqli_fetch_assoc($result)) { $lec_name = $lec_info['lec_name']; $lec_email = $lec_info['lec_email']; $lec_phone = $lec_info['lec_phone']; $lec_avator = $lec_info['lec_avator_uri']; $lec_qualification = $lec_info['lec_qualification']; $course_name = $lec_info['course_name']; if ($_POST['client'] == 'desktop') { showLec($lec_name, $lec_email, $course_name, $lec_phone, $lec_avator, $lec_qualification); } else { echo json_encode(array_map("utf8_encode", $lec_info)) . ","; } } } function showLec($lec_name, $lec_email, $course_name, $lec_phone, $lec_avator, $lec_qualification) { echo '<table> <tr> <td > <div> <img alt="lec_avator" src="' . $lec_avator . '" style="width:120px; height:150px; border:1px solid #ccc;border-radius:5px; padding:3px;"> </div> </td><td> <div style="margin:0px 10px 10px 10px; ">
<?php $lec_id = $_POST['lec_id']; require 'db_auth.php'; $query = "SELECT * FROM lecturer,courses where `lecturer`.`lec_id` =`courses`.`lec_id` "; if ($result = mysqli_query($conn, $query)) { while ($lec_info = mysqli_fetch_assoc($result)) { $lec_id = $lec_info['lec_id']; $lec_name = $lec_info['lec_name']; $course_name = $lec_info['course_name']; showLec($lec_id, $lec_name, $course_name); } } function showLecInfo($lec_name, $lec_email, $lec_phone, $lec_qualifications) { echo '<div><img alt="lec_avator" src="uploads/images/avators/lec/victor.jpg" style="width:120px; height:150px; border:1px solid #ccc;border-radius:5px; padding:3px;"> <p style="float:right;"><label>Name : ' . $lec_name . '</label><br /> <label>Email : ' . $lec_email . '</label><br /> <label>Phonenumber : ' . $lec_phone . '</label></p></div> <br /><label>Qualifications<br />' . $lec_qualifications . '</label>'; }