HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/ilysium.komma.pro/wwwroot/lib/form/types/field_type_select.class.php
<?php
/**
 * field_type_text.class.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 13/12/13
 */

class Field_Type_Select extends Form_Field
{
    private $options;

    public function __construct()
    {
        parent::__construct();

        $this->options = array(
            'Priv&eacute; Sauna 2 uur',
            'Priv&eacute; Sauna 3 uur',
            'Priv&eacute; Sauna 4 uur',
            'Priv&eacute; Sauna - All In',
            'Sauna &amp; Kuren - Stoomstempels &amp; Kruiden',
            'Sauna &amp; Kuren - Houtkrullen &amp; Bronwater',
            'Sauna &amp; Kuren - Stoom &amp; Rasul',
            'Sauna &amp; Kuren - Geitenmelk &amp; Baln&eacute;o',
            'Sauna &amp; Kuren - Bamboe &amp; Massage',
            'Sauna &amp; Kuren - Aroma &amp; Massage',
            'Me-Time - Puur balans',
            'Me-Time - Puur op adem komen',
            'Me-Time - Puur spa',
            'Me-Time - Puur welzijn',
            'Skin care - Ontgifting en huidverfijning',
            'Skin care - Fijne lijntjes en rimpels',
            'Skin care - Eau Thermale Spa&trade;',
            'Skin care - Na dermo-esthetiek',
            'Skin care - Collageen Hyaluron',
            'Skin care - Micro Dermabrasie',
            'Skin care - Oogbehandeling',
            'Skin care - Specifiek voor de man',
        );

    }

    /*
     * Create output
     * @return string 
     */
    public function generate()
    {
        // Pre select value
        if(defined('URL_SUB'))
        {
            $sub = str_replace('res','',URL_SUB);
            $this->value = $sub;
        }

        $output = '';
        $output .= '<div class="input_holder">
                        <label for="' . $this->name . '">' . $this->label . '</label>
                        <select name="' . $this->name . '" id="' . $this->name . '" class="custom">
                            <option value="empty">Maak uw keuze, of vul onderstaand tekstveld in</option>
                            ' . $this->getOptions() . '
                        </select>
                    </div>';

        $output .= '<div class="comment" id="formCommentSkinCare">Woensdag t/m zaterdag<br />van 9.00 uur tot 18.00 uur<br /><br /></div>';
        $output .= '<div class="comment" id="formCommentMeTime">Maandag  t/m zaterdag<br />van 9.00 uur tot 18.00 uur<br /><br /></div>';
        // Set custom select
        //$_SESSION['js_output'] .= '<script type="text/javascript">$(\'#' . $this->name .'\').customSelect();</script>';

        return $output;
    }

    private function getOptions()
    {
        $output = '';

        foreach($this->options as $key => $value)
        {
            $output .= '<option value="' . $key . '"';
            if($key == $this->value) $output .= ' selected';
            $output .= '>' . ucfirst($value) . '</option>';
        }
        return $output;
    }

    public function prepareForDb($value)
    {
        if($value == 'empty') $value = NULL;
        return $value;
    }
}