<script data-cfasync="false" type="text/javascript">
    var admin_edit_packagetypes = <?php echo ($this->user->hasPermission('admin_edit_packagetypes')) ? "true" : "false"; ?>;

    productview.currency = {};
    productview.currency.abrv = '<?php echo $this->currency["abrv"]; ?>';
    productview.currency.symbol = '<?php echo $this->currency["symbol"]; ?>';
    productview.currency.decimalssep = "<?php echo $this->currency['decimalssep']; ?>";
    productview.currency.thousandssep = "<?php echo $this->currency['thousandssep']; ?>";
    productview.currency.alignment = "<?php echo $this->currency['alignment']; ?>";
    productview.currency.precision = "<?php echo $this->currency['precision']; ?>";

    // Code for prices in different currencies
    function productPricingFilterBy(el, filter) {
        $(el).closest('.nav-pills').find('.nav-link').removeClass('active');
        $(el).addClass('active');
        productview.domains_pricing_load(filter);
    }
</script>

<?php
    // Code for prices in different currencies
    include_once 'modules/billing/models/CurrencyGateway.php';

    $gateway = new CurrencyGateway($this->user);
    $currencies = $gateway->GetCurrencies();

    if ($currencies['totalcount'] > 1) {
?>
    <ul class="nav nav-pills mb-3">
        <?php foreach ($currencies['currencies'] as $currencyValues) { ?>
            <li class="nav-item">
                <a class="nav-link <?php if ($currencyValues['abrv'] === $this->currency["abrv"]) echo 'active default-language-tab'; ?>"
                   href="javascript:void(0)"
                   onclick="productPricingFilterBy(this,'<?php echo $currencyValues['abrv']; ?>')">
                   <?php echo $currencyValues['name']; ?>
                </a>
            </li>
        <?php } ?>
    </ul>
<?php
    }
?>

<div id="blueGridBox" class="blue-box">
  <div class="row align-items-center mb-3">
    <div class="col">
      <?php if ($this->user->hasPermission('admin_edit_packagetypes')) { ?>
        <button type="button" class="cm-btns orange add-tld" onclick="productview.tlds.showperiodwindow(0);">
          <?php echo $this->user->lang("Add Period");?>
        </button>
      <?php } ?>
    </div>

    <div class="col-md-3 text-end">
      <label for="latefee" class="form-label mb-0">
        <?php echo $this->user->lang("Late Fee");?>
      </label>
      <input type="text" class="form-control d-inline-block ms-2"
             style="width: 70px;"
             value="<?php echo $this->latefee;?>"
             name="latefee" id="latefee">
    </div>

    <div class="col-md-3 text-end">
      <div class="form-check d-inline-block">
        <input class="form-check-input" type="checkbox" id="taxdomainorders" name="taxdomainorders" value="1"
          <?php if ($this->taxdomainorders == 1) echo "checked";?>>
        <label class="form-check-label" for="taxdomainorders">
          <?php echo $this->user->lang("Tax domain orders?");?>
        </label>
      </div>
    </div>
  </div>
</div>

<hr class="my-4">

<div class="dt-wrapper pull-top">
    <div class="table-responsive">
        <table id="pricing-list" class="display" style="width:100%">
            <thead>
                <tr>
                    <th class="text-center"><input type="checkbox" id="checkAll"></th>
                    <th class=""><?php echo $this->user->lang('Billing Period(s)'); ?></th>
                    <th class=""><?php echo $this->user->lang('Price'); ?></th>
                    <th class=""><?php echo $this->user->lang('Transfer'); ?></th>
                    <th class=""><?php echo $this->user->lang('Renew'); ?></th>
                </tr>
            </thead>
        </table>
    </div>
    <div class="table-actions">
        <button class="action-buttons" id="delete-button" disabled="disabled">
            <i class="icon-ic-25"></i><?php echo $this->user->lang('Delete'); ?>
        </button>
    </div>
</div>
