<?php 

function edit_class_cb() {
	global $post_meta;
	$post = new post;
	if(!isset($_GET['id']))
		return_method();
	$class_meta = $post->get_post_meta($_GET['id']);
	?>
	<div class="col-md-6">
		<div class="card card-primary">
			<div class="card-header">
				<h3>Edit Class</h3>
			</div>
			<div class="card-body">
				<form method="post" action="contents/plugins/eedu_portal/ajax.php" id="edit_class_form">
					<?php 
						input(['label' => '', 'id' => 'id', 'type' => 'hidden', 'value' => $class_meta['id']]);
						input(['label' => 'Class Name', 'id' => 'class_name', 'value' => $class_meta['class_name'], 'required' => 'required']);
						input(['label' => 'Order', 'id' => 'order', 'required' => 'required', 'class' => 'form-control numbers-only', 'value' => $class_meta['order'], 'hint' => 'This is the order for promotion. To be serialized in ascending order. Each class bear a unique order.']);
						submit_btn('edit_class', 'Update');
					?>
				</form>
			</div>
		</div>
	</div>

	<?php
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	add_page_javascript('app/assets/js/page-scripts/koweb.js');
}