<?php 

function add_class_cb() {
	global $post_meta;
	?>
	<div class="row">
		<div class="col-md-6">
			<div class="card card-primary">
				<div class="card-header">
					<h3 class="card-title">Add Class</h3>
				</div>
				<div class="card-body">
					<form method="post" action="contents/plugins/eedu_portal/ajax.php" id="add_class_form" data-callback="refreshCategoryMapping" data-callbackid="#category-mapping-div">
						<?php  
							input(['label' => 'Class Name', 'id' => 'class_name', 'required' => 'required']);
							input(['label' => 'Order', 'id' => 'order', 'required' => 'required', 'class' => 'form-control numbers-only', 'hint' => 'This is the order for promotion. To be serialized in ascending order. Each class bear a unique order.']);
							submit_btn('add_class', 'Add Class');
						?>
					</form>
				</div>
			</div>
		</div>
		<div class="col-md-6">
			<div class="card card-primary">
				<div class="card-header">
					<h3 class="card-title">Add Category</h3>
				</div>
				<div class="card-body">
					<form method="post" action="contents/plugins/eedu_portal/ajax.php" id="add_category_form" data-callback="refreshCategoryMapping" data-callbackid="#category-mapping-div">
						<?php  
							input(['label' => 'Category Name', 'id' => 'category_name', 'required' => 'required']);
							input(['label' => 'Order', 'id' => 'order', 'required' => 'required', 'class' => 'form-control numbers-only', 'hint' => 'This is the order for promotion. To be serialized in ascending order. Each class bear a unique order.']);
							submit_btn('add_category', 'Add Category');
						?>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="card card-primary">
				<div class="card-header">
					<h3 class="card-title">Assign Categories to Classes</h3>
				</div>
				<div class="card-body">
					<form id="category_mapping_form" method="post" action="contents/plugins/eedu_portal/ajax.php">
						<div id="category-mapping-div"></div>
						<?php submit_btn('category_mapping', 'Save Mapping'); ?>
					</form>
				</div>
			</div>
		</div>
	</div>

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