<?php

defined('ABSPATH') || die('Access Denied');

// css
wp_enqueue_style('wde_layout_' . $this->_layout);
wp_enqueue_style('wde_' . WDFInput::get_controller() . '_' . $this->_layout);

// js
wp_enqueue_script('wde_view');
wp_enqueue_script('wde_layout_' . $this->_layout);

$row = $this->row;
if (!$row) {
  ?>
  <div class="form-field form-required">
    <label for="rate"><?php _e('Rate', 'wde'); ?></label>
    <input type="text" name="rate" id="rate" style="width: 100px;" value="" />
    <span>%</span>
    <p class="description"></p>
  </div>
  <?php
}
else {
  $row = get_option("wde_taxes_" . $row);
  ?>
  <tr class="form-field form-required">
    <th scope="row" valign="top"><label for="rate"><?php _e('Rate', 'wde'); ?></label></th>
    <td>
      <input type="text" name="rate" id="rate" aria-required="true" style="width: 100px;" value="<?php echo $row['rate']; ?>" />
      <span>%</span>
      <p class="description"></p>
    </td>
  </tr>
  <?php
}