<?php 

function all_academic_session_cb() {
	$current_year = date('Y', time());
	$next_year = $current_year + 1;
	$session_name = $current_year.'/'.$next_year;
	$session = Session::getInstance();
	$post = new post;
	global $post_meta;
	add_page_javascript('contents/plugins/eedu_portal/js/refresh-list-functions.js');
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	?>
	<div class="row">
		<?php if (current_user_can("new_academic_session")): ?>
		<div class="col-md-4">
			<div class="card">
                <div class="card-header">
                    <strong class="card-title">New Academic Session</strong>
                </div>
                <div class="card-body">
                    <form action="contents/plugins/eedu_portal/ajax.php" data-callbackid="#bootstrap-data-table" data-callback="refreshAcSessionList" id="add_academic_session" method="post">
                    	<?php 
                    		input(['label' => 'Academic Session Name', 'id' => 'session_name', 'required' => 'required', 'value' => $session_name]);
                    		input(['label' => 'Opening Date', 'id' => 'posted_on', 'type' => 'date', 'required' => 'required']);
                    		submit_btn("new_academic_session");
                    	 ?>
                    </form>
                </div>
            </div>
		</div>
		<?php endif ?>
		<div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <strong class="card-title">All Academic Sessions</strong>
                </div>
                <div class="card-body">
          <table id="bootstrap-data-table" data-refresh="refreshAcSessionList" class="table table-striped table-bordered list-table">
            <thead>
              <tr>
                <th>SN</th>
                <th>Session ID</th>
				<th>Academic Session</th>
				<th>Status</th>
				<th></th>
              </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
                </div>
            </div>
        </div>
    </div>
	<?php

}