<?php 
 
function result_checker_cb() {
	$term = (isset($_POST['term'])) ? $_POST['term'] : get_option('current_academic_term');
  	$all_terms = get_select_options_from_post_q(['type' => 'academic_term'], 'term_name');
	?>
	<style type="text/css">
		.collapse.in {
		    display: block !important;
		    visibility: visible !important;
		}
	</style>
	<form id="result-checker-form" method="post" data-callback="_get_student_result" data-submittingmsg="Fetching Result From Server" action="contents/plugins/eedu_portal/ajax.php">
			<div class="row">
				<?php do_action("eedu_portal_term_filter", ['ele-class' => "col-md-12"]); ?>
				<div class="col-md-12">
					<?php 
						do_action("search_users", [
							"settings" => ["label" => "Search Your Name", "multiple" => "not:multiple", "required" => "required", "name" => "user_id"], 
							"query_settings" => ["role" => "student", "status" => "active"]
						]);
					?>
				</div>
				<!-- <div class="col-md-12">
					<?php // input(['label' => 'Your Student ID', 'id' => 'confirm_student_id', 'hint' => 'Leave student ID empty if you are not sure', 'placeholder' => get_option('sch_abbr').'/STUDENT/XXX']); ?>
				</div> -->
			</div>
			<div id="display-name-verification"></div>
			<div class="row">
				<div class="col-md-6">
					<?php checkbox(['label' => 'Mock Exam?', 'id' => 'mock', 'value' => 'mock', 'data-target' => '.toToggle', 'data-toggle' => 'collapse']); ?>
				</div>
				<?php do_action("extexam_mock_exam_broadsheet_filter", [
					'ele-class' => 'col-md-6 toToggle collapse',
					'label' => 'Select Exam'
				]); ?>
			</div>
			<?php
			input(['label' => 'Result Pin', 'placeholder' => 'Enter your 15 digits result pin', 'id' => 'pin', 'required' => 'required', 'class' => 'form-control numbers-only']);
			// alert();
			submit_btn('process_result_checker', 'Get Result');
		 ?>
	</form>
	<?php
	global $post_meta;
	add_page_javascript('contents/plugins/eedu_portal/js/result-checker.js');
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	add_page_javascript('app/assets/js/page-scripts/koweb.js');
}