<?php
if (isset($first_column_selected_group)) {
    if ($first_column_selected_group) {
        echo '<div class="col-sm-12">';
        foreach ($first_column_selected_group as $group_value) {
            ?>
            <div class="col-sm-4">
                <div class="checkbox checkbox-success">
                    <input type="checkbox"
                           onclick="getIDValue(this.value)"
                           id="id<?php echo $group_value->group_id; ?>" 
                           class="styled"
                           name="id[]"
                           value="<?php echo $group_value->group_id; ?>" checked >
                    <label for="<?php echo $group_value->group_name; ?>" class="text-justify" ><?php echo $group_value->group_name; ?></label>
                </div>
                <div class="col-sm-12" style="color: red" id="checkbox_error<?php echo $group_value->group_id; ?>"></div>
            </div>
            <?php
        }
        echo ' </div>';
    }
}
if (isset($second_column_selected_group)) {
    if ($second_column_selected_group) {
        echo '<div class="col-sm-12">';
        foreach ($second_column_selected_group as $group_value) {
            ?>
            <div class="col-sm-4">
                <div class="checkbox checkbox-success">
                    <input type="checkbox"
                           onclick="getIDValue(this.value)"
                           id="id<?php echo $group_value->group_id; ?>" 
                           class="styled"
                           name="id[]"
                           value="<?php echo $group_value->group_id; ?>" checked>
                    <label for="<?php echo $group_value->group_name; ?>" class="text-justify" ><?php echo $group_value->group_name; ?></label>
                </div>
                <div class="col-sm-12" style="color: red" id="checkbox_error<?php echo $group_value->group_id; ?>"></div>
            </div>
            <?php
        }
        echo ' </div>';
    }
}

if (isset($first_column_group)) {
    if ($first_column_group) {
        echo '<div class="col-sm-12">';
        foreach ($first_column_group as $group_value) {
            ?>
            <div class="col-sm-4">
                <div class="checkbox checkbox-success">
                    <input type="checkbox"
                           onclick="getIDValue(this.value)"
                           id="id<?php echo $group_value->group_id; ?>" 
                           class="styled"
                           name="id[]"
                           value="<?php echo $group_value->group_id; ?>" >
                    <label for="<?php echo $group_value->group_name; ?>" class="text-justify" ><?php echo $group_value->group_name; ?></label>
                </div>
                <div class="col-sm-12" style="color: red" id="checkbox_error<?php echo $group_value->group_id; ?>"></div>
            </div>
            <?php
        }
        echo ' </div>';
    }
}

if (isset($second_column_group)) {
    if ($second_column_group) {
        echo '<div class="col-sm-12">';
        foreach ($second_column_group as $group_value) {
            ?>
            <div class="col-sm-4">
                <div class="checkbox checkbox-success">
                    <input type="checkbox"
                           onclick="getIDValue(this.value)"
                           id="id<?php echo $group_value->group_id; ?>" 
                           class="styled"
                           name="id[]"
                           value="<?php echo $group_value->group_id; ?>" >
                    <label for="<?php echo $group_value->group_name; ?>" class="text-justify" ><?php echo $group_value->group_name; ?></label>
                </div>
                <div class="col-sm-12" style="color: red" id="checkbox_error<?php echo $group_value->group_id; ?>"></div>
            </div>
            <?php
        }
        echo ' </div>';
    }
}

if (isset($third_column_group)) {
    if ($third_column_group) {
        echo '<div class="col-sm-12">';
        foreach ($third_column_group as $group_value) {
            ?>
            <div class="col-sm-4">
                <div class="checkbox checkbox-success">
                    <input type="checkbox"
                           onclick="getIDValue(this.value)"
                           id="id<?php echo $group_value->group_id; ?>" 
                           class="styled"
                           name="id[]"
                           value="<?php echo $group_value->group_id; ?>" >
                    <label for="<?php echo $group_value->group_name; ?>" class="text-justify" ><?php echo $group_value->group_name; ?></label>
                </div>
                <div class="col-sm-12" style="color: red" id="checkbox_error<?php echo $group_value->group_id; ?>"></div>
            </div>
            <?php
        }
        echo ' </div>';
    }
}
?>

<div id="moregroupword3" class="col-sm-12" style="display:block;">
    <a href="javascript:;" onclick="moreSelectedGroup('<?php echo $counter; ?>', '<?php echo $access_level ?>')" > More</a>
</div>
<input type="hidden" name="url_name" id="url_name" value="<?php echo base_url() . 'user/more-group-selection' ?>">
<input type="hidden" name="group_count" id="group_count" value="">


