<?php

use WpBookingPro\Factory;
use WpBookingPro\Language\Text;
use WpBookingPro\Utilities\Utility;
use WpBookingProAdmin\app\helpers\CustomizeHelper;

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

$doc = Factory::getDocument();
$list_table_view = CustomizeHelper::getListTableView();

$id_by_name = "element_field_". $name;
?>
    <div id="<?php echo (esc_attr($id_by_name)) ?>" class="field-tableview">
        <select class="table-view" name="<?php echo(esc_attr($name)); ?>" <?php echo ($disabled?" disabled ":"") ?> >
            <option value=""><?php esc_attr_e('Select table','wpbookingpro') ?></option>
			<?php foreach ($list_table_view as $table) { ?>
                <?php
                    $table = str_replace('woobooking_','',$table);
                ?>
                <option <?php echo ($value == $table ? ' selected ' : '') ?>
                        value="<?php echo (esc_attr($table)) ?>"><?php echo (ucfirst(str_replace('_',' ',$table))) ?></option>
			<?php } ?>
        </select>
    </div>
<?php
$doc->addScriptApplySelector('.field-tableview','field_tableview',array(
    "input_name"=>  $name,
),'admin/app/layouts/WooBooking/form/field/tableview/tableview.jquery.js');
