$CFG->site_root = realpath(dirname(__FILE__)); $headerStr = "<div class='header-wrapper' style=''>\n <div style='position:absolute; left:10px; top:10px'><a href='javascript:window.location.assign(\"{$CFG->wwwroot}{$CFG->basedir}index.php?logout\");' >Log Out</a></div>"; if ($CFG->wwwroot == "https://srm-itd01/") { $headerStr .= "DEV: {$CFG->sysname} " . ($CFG->istrainingsite ? ' (TRAINING)' : '') . " </span><br/>"; } else { $headerStr .= "PROD: {$CFG->sysname} " . ($CFG->istrainingsite ? ' (TRAINING)' : '') . "</span><br/>"; } $headerStr .= " <span id='user_feedback' style='width: 80%'>"; $headerStr .= $loggedinuserdata->name . "</span></div>"; // list users here // generate the student table and action buttons $from = isset($_REQUEST['from']) ? $_REQUEST['from'] : 0; $increment = 10; $searchstr = isset($_REQUEST['searchstr']) ? $_REQUEST['searchstr'] : null; $enumlib = new EnumLib(); $userdata = simplexml_load_string($enumlib->getStudents($increment, $from, $searchstr)); $listTableStr = "<table><tr><th>{$stringlib->get_string('participant_num')}</th><th>{$stringlib->get_string('participant_fname')}</th><th>{$stringlib->get_string('participant_lname')}</th><th>{$stringlib->get_string('participant_photo')}</th><th>Delete</th></tr>"; foreach ($userdata->student as $student) { $listTableStr .= "<tr><td><a href='#' onclick='edit_student({$student->id});'>{$student->studentnum}</a></td><td>{$student->fname}</td><td>{$student->lname}</td><td><img src='{$CFG->serviceURL}?action=showstudentimage&studentid={$student->id}&getbig=false&token={$token}'></td>"; $listTableStr .= "<td><input type='image' src='{$CFG->wwwroot}{$CFG->basedir}/icons/gtk-cancel.png' BORDER='0' style='vertical-align: text-bottom;' onclick='delete_student({$student->id}); return false;'/></td></tr>"; } $listTableStr .= "</table>"; $buttonStr = '<div id="nav_div" style="float: left">'; $buttonStr .= '<button id="first" style="float: left" ' . ($from == 0 ? 'disabled="disabled"' : '') . ' onclick="goFirst()">First</button>'; $buttonStr .= '<button id="prev" onclick="goPrev()" style="float: left" ' . ($from == 0 ? 'disabled="disabled"' : '') . '>Prev ' . $increment . '</button>'; $buttonStr .= '<button id="next" onclick="goNext()" style="float: left" ' . ($from + $increment > $userdata->count ? 'disabled="disabled"' : '') . '>Next ' . $increment . '</button>'; $buttonStr .= '<button id="last" style="float: left" ' . ($from + $increment > $userdata->count ? 'disabled="disabled"' : '') . ' onclick="goLast()">Last</button><br/></div>'; $buttonStr .= "<div>{$stringlib->get_string('participants_count')}:{$userdata->count}</div>"; // $menuStr = '<div style="display:table; width:100%"><div style="display:table-row; width:100%">'; $menuStr = ""; //$displayAdminStr = false;
$returnStr = $authlib->new_student($_REQUEST['student_fname'], $_REQUEST['student_lname'], $_REQUEST['student_num'], $_REQUEST['student_email'], $_REQUEST['student_cohort'], isset($_FILES['file']) ? $_FILES['file'] : null); break; case 'updatestudent': include 'lib/MediaLib.php'; $returnStr = $authlib->update_student($_REQUEST['studentID'], $_REQUEST['student_fname'], $_REQUEST['student_lname'], $_REQUEST['student_num'], $_REQUEST['student_email'], isset($_FILES['file']) ? $_FILES['file'] : null); break; case 'deletestudent': $returnStr = $authlib->delete_student($_REQUEST['id']); break; case 'uploadstudentbycsv': $returnStr = $authlib->upload_csv($_FILES['file']); break; case 'liststudents': include 'lib/EnumLib.php'; $enumLib = new EnumLib(); $returnStr = $enumLib->getStudents(); break; case 'liststudentsbysearchstr': include 'lib/EnumLib.php'; $enumLib = new EnumLib(); $returnStr = $enumLib->findStudents(isset($_REQUEST['searchstr']) ? $_REQUEST['searchstr'] : ''); break; case 'liststudentsbysearchstrforform': include 'lib/EnumLib.php'; $enumLib = new EnumLib(); $returnStr = $enumLib->findStudentsForForm($_REQUEST['formid'], isset($_REQUEST['searchstr']) ? $_REQUEST['searchstr'] : '', isset($_REQUEST['site']) ? $_REQUEST['site'] : -1); break; case 'listunusedstudentsforformAsExcel': include 'lib/EnumLib.php'; $reportsLib = new ReportsLib(); $phpexcelObj = $reportsLib->findUnusedStudentsForFormAsExcel($_REQUEST['formid']);