<?php

use TourOperatorPro\Factory;
use TourOperatorPro\Mvc\Model\Model as ModelAlias;
use TourOperatorPro\Utilities\Utility;
use TourOperatorPro\Html\TourOperatorProHtmlWooPanel as TourOperatorProHtmlWooPanelAlias;
use TourOperatorPro\Language\Text;
defined('_TOUROPERATOR_EXEC') or die;
extract($displayData);

TourOperatorProHtmlWooPanelAlias::load_jquery_library('select2');
TourOperatorProHtmlWooPanelAlias::load_jquery_library('auto_numeric');


$doc = Factory::getDocument();
$orderstatusModel= ModelAlias::getInstance('orderstatuss');
$list=$orderstatusModel->getList();
$id_by_name = $id_by_name = "element_field_" . str_replace(array('[', ']'), '_', $name);
?>
    <div id="<?php esc_attr_e($id_by_name) ?>" class="field-orderstatus">
        <div class="wrapper-orderstatus">
            <select class="orderstatus" name="<?php esc_attr_e($name); ?>">
                <?php foreach ($list as $item){ ?>
                    <option <?php echo ($item->id===$value?' selected ':'') ?> value="<?php esc_attr_e($item->id); ?>"><?php esc_html_e($item->name); ?></option>
                <?php } ?>
            </select>
        </div>
    </div>
<?php
$doc->addLessStyleSheet('admin_woopanel/app/layouts/WooBooking/form/field/orderstatus/orderstatus.less');
$doc->addScriptApplySelector("#$id_by_name",'field_orderstatus',array(
    "input_name"=>  $name,
),'admin_woopanel/app/layouts/WooBooking/form/field/orderstatus/jquery.orderstatus.js');
