<?php 

function mock_for_mastersheet_cb() {
	$all_class = get_select_options_from_post(['type' => 'class'], 'class_name');
	$option = get_option('external_examinations');
    $option = trim_array($option);
	$ext_exam = [];
	  if(_count($option)) : foreach ($option as $key => $ext_exam_name) :
	    $ext_exam[$ext_exam_name] = $ext_exam_name;
	  endforeach; endif;
	$all_terms = get_select_options_from_post_q(['type' => 'academic_term'], 'term_name');
	?>
	<div class="col-md-4">
		<div class="card card-primary">
			<div class="card-header">
				<h5 class="card-title">Add Mock Results to list</h5>
			</div>
			<div class="card-body">
				<form method="post" id="mock_for_mastersheet_form" action="contents/plugins/external_examination/ajax.php" data-clearform="true" data-callback="refreshMockForMastersheet" data-callbackid=".mock_for_mastersheet_table">
					<?php 
						select(['label' => 'Term/Session', 'id' => 'term', 'data-form' => 'search-form', 'required' => 'required'], $all_terms);
						select(['label' => 'Class', 'id' => 'class', 'data-form' => 'search-form', 'required' => 'required'], $all_class);
						select(['label' => 'Select External Exam', 'id' => 'ext_exam', 'data-form' => 'search-form', 'required' => 'required'], $ext_exam);
						alert(); submit_btn("mock_for_mastersheet", "Submit"); 
					?>
				</form>
			</div>
		</div>
	</div>
	<div class="col-md-8">
		<div class="card card-primary">
			<div class="card-header">
				<h5 class="card-title">Mock Results Used For Mastersheet Instead of Termly Result</h5>
			</div>
			<div class="card-body">
				<table id="bootstrap-data-table-export" class="table mock_for_mastersheet_table">
					<thead>
						<tr>
							<th>SN</th>
							<th>Term</th>
							<th>Class</th>
							<th>Exam</th>
							<th>Action</th>
						</tr>
					</thead>
					<tbody></tbody>
				</table>
			</div>
		</div>
	</div>
	<?php
	global $post_meta;
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	add_page_javascript('contents/plugins/external_examination/js/js-functions.js');
	add_page_javascript('app/assets/js/page-scripts/js-functions.js');
}