<?php 

function cp_add_lesson_cb() {
	$session = Session::getInstance();
    $ref = cp_get_material_ref($session->id);
	?>
	<div class="card" id="add-lesson-container">
        <div class="card-header">
            <span class="badge badge-warning pull"><?php echo get_class_name($_GET['class']) ?></span></br><span class="badge badge-success"><?php echo get_course_name($_GET['course']) ?></span>
        </div>
        <div class="card-body">
            <?php 
                do_action("drag_n_drop_uploader", [
                    "ref" => $ref,
                    "accepts" => "application/pdf, image/*",
                    "id" => "cp_upload_material"
                ]);
             ?>
        
            <form id="add-lesson-form" method="post" action="contents/plugins/classroom_plus/ajax.php" data-clearform=1 data-callback="refreshPage">
                <input type="hidden" name="class" id="class" value="<?php echo $_GET['class']; ?>">
                <input type="hidden" name="course" id="course" value="<?php echo $_GET['course']; ?>">
                <input type="hidden" name="term" id="term" value="<?php echo $_GET['term']; ?>">
                <div class="row">
                    <div class="col-md-6">
                        <?php input(['label' => 'Week', 'id' => 'week', 'type' => 'number', 'required' => 'required', 'value' => 1]); ?>
                    </div>
                    <div class="col-md-6">
                        <?php input(['label' => 'Period', 'id' => 'period']); ?>
                    </div>
                </div>
                <input type="hidden" name="ref" value="<?php echo $ref; ?>" id="ref">
            <?php 
                input(['label' => 'Topic', 'id' => 'topic', 'required' => 'required']);
                textarea(['label' => 'Objectives', 'id' => 'objectives', 'required' => 'required'], true);
                submit_btn('create_course_outline');
             ?>
            </form>
                
        </div>
    </div>
	<?php
}