<?php

use TourOperatorPro\Language\Text;
use TourOperatorPro\Utilities\Utility;

defined('_TOUROPERATOR_EXEC') or die;
extract($displayData);



$doc = Factory::getDocument();
TourOperatorProHtmlBackend::load_jquery_library('select2');
$doc->addLessStyleSheet('admin/nb_apps/nb_woobooking/layouts/WooBooking/form/field/assets/less/tags.less');

$db = Factory::getDBO();
$query = $db->getQuery(true);
$query->select('name')
    ->from(WoobookingTable::getWBTable('tag'));
$tags = $db->setQuery($query)->loadColumn();
$id_by_name = "element_field_". $name;
?>
    <div id="<?php esc_attr_e($id_by_name) ?>" class="field-tags">
        <select multiple name="<?php esc_attr_e($name); ?>" class="list-tag">
        </select>
    </div>
<?php
$doc->addScriptApplySelector('.field-tags', 'field_tags', array(
    "tags" => $tags,
    "tags_selected" => $value,
), 'admin/nb_apps/nb_woobooking/layouts/WooBooking/form/field/tags/jquery.tags.js');
