<?php

use WpBookingPro\Factory;
use WpBookingPro\Language\Text;
use WpBookingPro\Utilities\Utility;
defined('_WPBOOKINGPRO_EXEC') or die;
extract($displayData);

$doc = Factory::getDocument();
$list_open_source_user = get_users();
$id_by_name = "element_field_". $name;
?>
    <div id="<?php echo (esc_attr($id_by_name)) ?>" class="field-wordpress_user">
        <select class="open-source-user" name="<?php echo (esc_attr($name)); ?>">
            <option value=""><?php esc_html_e('None','wpbookingpro') ?></option>
			<?php foreach ($list_open_source_user as $user) { ?>
                <option <?php echo ($value == $user->get('ID') ? ' selected ' : '') ?>
                        value="<?php echo (esc_attr($user->get('ID'))) ?>"><?php echo (esc_html($user->get('user_login'))) ?></option>
			<?php } ?>
        </select>
    </div>
<?php
$doc->addScriptApplySelector('.field-wordpress_user','field_wordpress_user',array(
    "input_name"=>  $name,
),'admin/app/layouts/WooBooking/form/field/wordpressuser/wordpressuser.jquery.js');
