<?php
$batch_id_list = explode(',', $batch_id_list);
?>
<div class="col-sm-12"><br> <br></div>
<div class="col-sm-12 text-left" id="selected_course_name">
    <?php
    echo 'Course name : ' . $course_info->course_name
    . '<br>Resource person name : ' . $resource_person_info->person_first_name . ' ' . $resource_person_info->person_last_name;
    ?>
</div>
<div class="col-sm-12" id="resource_person_feature_message">
    <?php
    if (!$virtual_classroom_feature_info) {
        echo '<span style=color:red>Please assign feature for this resource person first</span>';
    }
    ?>
</div>
<input type="hidden" name="selected_course_id" id="selected_course_id" value="<?php echo $course_info->course_id; ?>">
<input type="hidden" name="resource_person" id="resource_person" value="<?php echo $course_info->resource_person_id; ?>">
<?php
echo '<div class="col-sm-12"><h4>Course batches:</h4>';
if ($first_column_batch) {
    echo '<div class="col-sm-12">';
    foreach ($first_column_batch as $batch_value) {
        ?>
        <div class="col-sm-4">
            <div class="checkbox checkbox-success">
                <input type="checkbox"
                       onchange="getBatchIDValue(this.value)"
                       id="course_batch_id<?php echo $batch_value->course_batch_id; ?>" 
                       class="styled"
                       name="course_batch_id[]"
                       value="<?php echo $batch_value->course_batch_id; ?>" 
                       <?php
                       if (in_array($batch_value->course_batch_id, $batch_id_list)) {
                           echo 'checked';
                       }
                       ?>>
                <label for="<?php echo $batch_value->course_batch_name; ?>" class="text-justify" ><?php echo $batch_value->course_batch_name; ?></label>
            </div>
        </div>
        <?php
    }
    echo ' </div>';
}

if ($second_column_batch) {
    echo '<div class="col-sm-12">';
    foreach ($second_column_batch as $batch_value) {
        ?>
        <div class="col-sm-4">
            <div class="checkbox checkbox-success">
                <input type="checkbox"
                       onchange="getBatchIDValue(this.value)"
                       id="course_batch_id<?php echo $batch_value->course_batch_id; ?>" 
                       class="styled"
                       name="course_batch_id[]"
                       value="<?php echo $batch_value->course_batch_id; ?>" 
                       <?php
                       if (in_array($batch_value->course_batch_id, $batch_id_list)) {
                           echo 'checked';
                       }
                       ?>>
                <label for="<?php echo $batch_value->course_batch_name; ?>" class="text-justify" ><?php echo $batch_value->course_batch_name; ?></label>
            </div>
        </div>
        <?php
    }
    echo ' </div>';
}

if ($third_column_batch) {
    echo '<div class="col-sm-12">';
    foreach ($third_column_batch as $batch_value) {
        ?>
        <div class="col-sm-4">
            <div class="checkbox checkbox-success">
                <input type="checkbox"
                       onchange="getBatchIDValue(this.value)"
                       id="course_batch_id<?php echo $batch_value->course_batch_id; ?>" 
                       class="styled"
                       name="course_batch_id[]"
                       value="<?php echo $batch_value->course_batch_id; ?>" 
                       <?php
                       if (in_array($batch_value->course_batch_id, $batch_id_list)) {
                           echo 'checked';
                       }
                       ?>>
                <label for="<?php echo $batch_value->course_batch_name; ?>" class="text-justify" ><?php echo $batch_value->course_batch_name; ?></label>
            </div>
        </div>
        <?php
    }
    echo ' </div>';
}
echo '</div">';