HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/slfopp7cb1df/public_html/sitepacket.com/system/app/Views/custom_fields/input_checkboxes.php
<?php
$uid = "_" . uniqid(rand());

$options = $field_info->options;
$options_array = explode(",", $options);

$saved_values = isset($field_info->value) ? array_map('trim', explode(",", $field_info->value)) : [];

if ($options && count($options_array)) {
    foreach ($options_array as $value) {
        $value = trim($value);
        $isChecked = in_array($value, $saved_values);

        echo form_checkbox(array(
            "id" => $value . $uid,
            "name" => "custom_field_" . $field_info->id,
            "class" => "form-check-input validate-hidden",
            "data-rule-required" => $field_info->required ? "true" : "false",
            "data-msg-required" => app_lang("field_required"),
            "data-prepare_checkboxes_data" => "1",
        ), $value, $isChecked);

        echo '
        <label for="' . $value . $uid . '" class="mr15">' . $value . '</label>
        ';
    }
}