<?php 

function edit_event_cb() {
	global $post_meta;
    if(!isset($_GET['id']))
        return_method();
    $post = new post;
    $event_meta = $post->get_post_meta($_GET['id']);
	?>
<form method="post" action="contents/plugins/eedu_portal/ajax.php" id="form">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header">
                <strong class="card-title">Edit Event</strong>
            </div>
            <div class="card-body">
                <?php 
                input(['label' => '', 'id' => 'id', 'type' => 'hidden', 'value' => $event_meta['id']]);
                textarea(['label' => 'Event Title', 'id' => 'event_title', 'required' => 'required', 'value' => $event_meta['event']]);
                input(['label' => 'Start', 'id' => 'start', 'type' => 'date', 'required' => 'required', 'value' => date('Y-m-d', $event_meta['start'])]); 
                input(['label' => 'Start Time', 'id' => 'starttime', 'type' => 'time', 'value' => date('h:i', $event_meta['start'])]); 
                input(['label' => 'End', 'id' => 'end', 'type' => 'date', 'value' => date('Y-m-d', $event_meta['end'])]); 
                input(['label' => 'End Time', 'id' => 'endtime', 'type' => 'time', 'value' => date('h:i', $event_meta['end'])]); 
                alert(); submit_btn('update_school_event', 'Update Event');
                ?>
            </div>
        </div>
    </div>
</form>

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