<div class="form-group m-form__group row">
    <label class="col-lg-3 col-form-label">
        Communication Settings:
    </label>
    <div class="col-lg-1" style="top: 9px;">
        <input type="checkbox" class="form-control m-input communication_setting" <?php if(!empty($comm_settings)): ?> checked <?php endif; ?> value="<?php if(!empty($comm_settings)): ?> 1 <?php else: ?> 0 <?php endif; ?>" name="communication_setting"/>
    </div>
    <div class="col-lg-12 comm-panel" style="display:none;">
        <label class="col-lg-4 col-form-label">
            Select Communication Options:
        </label>
        <select id="communication-multiple" name="communication[]" multiple="multiple">
            <optgroup label="Email" class="group-1">
                <?php $__currentLoopData = \App\communicationService::$com_category; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="1-<?php echo $key; ?>" <?php if(!empty($comm_settings) && isset($comm_settings[0]) && in_array($key, explode(',',$comm_settings[0]['type_ids']))): ?> selected = 'selected' <?php endif; ?>><?php echo $value; ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </optgroup>
            <optgroup label="SMS" class="group-2">
                <?php $__currentLoopData = \App\communicationService::$com_category; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="2-<?php echo $key; ?>" <?php if(!empty($comm_settings) && isset($comm_settings[1]) && in_array($key, explode(',',$comm_settings[1]['type_ids']))): ?> selected = 'selected' <?php endif; ?>><?php echo $value; ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </optgroup>
            <optgroup label="Whatsapp" class="group-3">
                <?php $__currentLoopData = \App\communicationService::$com_category; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if($value != 'Overdue'): ?>
                    <option value="3-<?php echo $key; ?>" <?php if(!empty($comm_settings) && isset($comm_settings[2]) && in_array($key, explode(',',$comm_settings[2]['type_ids']))): ?> selected = 'selected' <?php endif; ?>><?php echo $value; ?></option>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </optgroup>
        </select>
    </div>
</div>
