<?php
if (!defined('ABSPATH'))
  exit;
/**
 * Provide a admin area view for the plugin
 *
 * This file is used to markup the admin-facing aspects of the plugin.
 *
 * @link       https://www.eurostocks.com
 * @since      1.0.0
 *
 * @package    Eurostocks
 * @subpackage Eurostocks/admin/partials
 */

// check if function exists
$accepted_languages = array('nl', 'de', 'en', 'fr', 'es');


$lang_data      = eurostocks_get_language_details();
$languages      = $lang_data['languages'];
$language_codes = $lang_data['language_codes'];
$default_lang   = $lang_data['default_lang'];
$current_lang   = $lang_data['current_lang'];
$diflang        = $lang_data['diflang'];
$show_lang      = $lang_data['show_lang'];

$accepted_langs = array();
// check if languages are all accepted
if ($language_codes && count($language_codes) > 0) {
  $all_accepted_langs = true;
  foreach ($language_codes as $lang) {
    if (!in_array($lang, $accepted_languages)) {
      $all_accepted_langs = false;
    } else {
      // create accepted array
      $accepted_langs[] = $lang;
    }
  }
} else {
  $all_accepted_langs = false;
}

if ($language_codes && count($language_codes) > 1) {
  $show_lang = true;
} else {
  $show_lang = false;
}

// remove default language from accepted languages array
if (in_array($default_lang, $accepted_langs)) {
  // remove default lang from accepted langs
  $key = array_search($default_lang, $accepted_langs);
  if (false !== $key) {
    unset($accepted_langs[$key]);
  }
}

?>
<script>
  var EUROSTOCKS_TRANSLATIONS = {
    "ROBOTS_CORRECT": "<?php esc_html_e("The robots.txt is set correctly, good job! This reduces the chance of unnecessary costs. However, there is no guarantee that bots will not scrape these pages. Bad actors will ignore the robot.txt file. That is why it is important to also have the IP filter enabled. Do you need help setting it up correctly? Please contact EuroStocks.", "eurostocks"); ?>",
    "ROBOTS_INCORRECT": "<?php esc_html_e("Currently the robots.txt is not set up correctly. We recommend excluding all crawlers from the results pages and detail pages by default. This way you avoid unnecessary costs. However, there is no guarantee that bots will not scrape these pages. Bad actors will ignore the robot.txt file. That is why it is important to also have the IP filter enabled. Do you need help setting it up correctly? Please contact EuroStocks.", "eurostocks"); ?>",
    "ROBOTS_ERROR": "<?php esc_html_e("Something went wrong, we couldn't check the robots.txt file.", "eurostocks"); ?>",
    "API_CORRECT": "<?php esc_html_e("The data is correct, all filter values ​​have been retrieved.", "eurostocks"); ?>",
    "API_INCORRECT": "<?php esc_html_e("Something went wrong, check if the data is correct.", "eurostocks"); ?>",
  };
</script>
<div class="eurostocks-wrap">
  <h2><?php echo esc_html(get_admin_page_title()); ?></h2>
  <?php 
    require_once('eurostocks-admin-display-options.php'); 
  ?>
  <form method="post" id="eurostocks-settings" name="eurostocks_options" action="options.php">
    <div id="general">
      <?php
      settings_fields($this->plugin_name);
      do_settings_sections($this->plugin_name);
      wp_nonce_field('eurostocks', 'eurostocks_nonce');

      ?>
      <div class="postbox-container">
        <div class="meta-box-holder">
          <div class="euro-postbox">
            <div class="eurostocks-admin-header">
              <h2><?php esc_html_e('EuroStocks API Settings', 'eurostocks'); ?></h2>
            </div>

            <div class="euro-inside">

              <p>
                <?php esc_html_e('Enter your EuroStocks username, password and API key. You will find this information in your ', 'eurostocks'); ?>
                <a target="_blank" rel="nofollow noopener" href="https://docs.eurostocks.com/import-api"><?php esc_html_e('EuroStocks account', 'eurostocks'); ?></a>.
              </p>

              <p>
                <label for="eurostocks-username"><?php esc_html_e('Username', 'eurostocks'); ?></label>
                <input class="regular-text input textinput" type="text" id="eurostocks-username"
                  name="eurostocks[username]" value="<?php echo esc_html($euro_username); ?>" />
              </p>

              <p>
                <label for="eurostocks-password"><?php esc_html_e('Password', 'eurostocks'); ?></label>
                <input class="regular-text input textinput" type="password" id="eurostocks-password"
                  name="eurostocks[password]" value="<?php echo esc_html($euro_password); ?>" />
              </p>

              <p>
                <label for="eurostocks-api-key"><?php esc_html_e('API key', 'eurostocks'); ?></label>
                <input class="regular-text input textinput" type="text" id="eurostocks-api-key"
                  name="eurostocks[api_key]" value="<?php echo esc_html($euro_api_key); ?>" />
              </p>

              <p>
                <label
                  for="eurostocks-verify-euro-keys"><?php esc_html_e('Validate API key / Update makes', 'eurostocks'); ?></label>
                <a id="eurostocks-verify-euro-keys"
                  class="button"><?php esc_html_e('Update makes', 'eurostocks'); ?></a>
                <span id="eurostocks-feedback"></span>
              </p>
             
              <?php submit_button(__('Save settings', 'eurostocks'), 'primary', 'submit_a', TRUE); ?>
            </div>

          </div>
        </div>



        <?php if (get_option('eurostocks_transmissions')) { ?>

          <?php if ($show_lang) { ?>
            <div class="meta-box-holder">
              <div class="euro-postbox">
                <div class="eurostocks-admin-header">
                  <h2><?php esc_html_e('Languages', 'eurostocks'); ?></h2>
                </div>
                <div class="euro-inside">
                  <h3><?php esc_html_e('Active languages', 'eurostocks'); ?></h3>

                  <ul id="eurostocks-languages" style="list-style:disc; padding-left:20px;">
                    <?php

                    foreach ($language_codes as $lang) {
                    ?>
                      <li>
                        <span>
                          <img style="display: inline-block;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  $lang . '.png'; ?>"
                            alt="<?php echo esc_html($lang); ?>" />
                          <?php echo esc_html($lang);
                          if ($lang == $default_lang) {
                            echo ' (' . esc_html__('default', 'eurostocks') . ')';
                          }
                          if (!in_array($lang, $accepted_languages)) {
                            echo ' (' . esc_html__('not supported', 'eurostocks') . ')';
                          }
                          ?></span>
                      </li>
                    <?php
                    }
                    ?>
                  </ul>

                  <p><?php esc_html_e('Languages are managed through external mult-language plugins such as WPML or Polylang.', 'eurostocks'); ?></p>
                  <?php if (!$all_accepted_langs) {
                    echo '<p style="color:red;">' . esc_html__('Not all active languages are supported by the plugin. Please contact EuroStocks for supporting additional languages.', 'eurostocks') . '</p>';
                  } ?>
                </div>
              </div>
            </div>
          <?php } ?>


          <div class="meta-box-holder">
            <div class="euro-postbox">
              <div class="eurostocks-admin-header">
                <h2><?php esc_html_e('Shortcode', 'eurostocks'); ?></h2>
              </div>

              <div class="euro-inside">
                <p>
                  <?php esc_html_e('Place the following shortcode on the website to display the EuroStocks ads.', 'eurostocks'); ?>
                </p>

                <div class="shortcode-result">
                  <h3><?php esc_html_e('Shortcode', 'eurostocks'); ?></h3>
                  <p>
                  <pre><code class="eurostocks-shortcode-code">[eurostocks_search]</code></pre>
                  </p>
                  <p>
                  <pre><code class="eurostocks-shortcode-code">[eurostocks]</code></pre>
                  </p>
                  <label>
                    <h3><?php esc_html_e('Select the filter page', 'eurostocks'); ?></h3> <?php if ($show_lang) { ?>
                      <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                        alt="<?php echo esc_html($lang); ?>" />
                    <?php } ?>
                    <select id="eurostocks-select-filters-page" name="eurostocks[filters_page]">

                      <?php
                      $pages = get_pages();

                      foreach ($pages as $page) {
                        $selected = '';
                        if ($page->ID == $filters_page) {
                          $selected = 'selected';
                        }
                      ?>
                        <option value="<?php echo esc_html($page->ID); ?>" <?php echo esc_html($selected); ?>>
                          <?php echo esc_html($page->post_title); ?> (<?php echo esc_url(get_page_link($page->ID)); ?>)
                        </option>
                      <?php
                      }
                      ?>
                    </select>
                    <br><br>

                    <?php
                    foreach ($accepted_langs as $lang) { ?>
                      <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                        alt="<?php echo esc_html($lang); ?>" />

                      <select id="eurostocks-select-filters-page" name="eurostocks[<?php echo esc_html($lang); ?>][filters_page]">

                        <?php
                        $pages = get_pages();

                        foreach ($pages as $page) {
                          $selected = '';
                          if ($page->ID == $filters_page_e[esc_html($lang)]) {
                            $selected = 'selected';
                          }
                        ?>
                          <option value="<?php echo esc_html($page->ID); ?>" <?php echo esc_html($selected); ?>>
                            <?php echo esc_html($page->post_title); ?> (<?php echo esc_url(get_page_link($page->ID)); ?>)
                          </option>
                        <?php
                        }
                        ?>
                      </select>
                      <br><br>
                    <?php
                    }
                    ?>


                  </label>

                </div>

                <br>
                <a id="check-robots" class="check-robots button"><?php esc_html_e('Check Robots.txt', 'eurostocks'); ?></a>
                <div id="eurostocks-feedback-robots"></div>
                <br>

                <?php 

                $option_name = 'eurostocks_error';
				
                if (get_option($option_name)) {
                  ?>
                  <div>
                    <?php esc_html_e('The shortcode was found on a page that wasn\'t set as the filter page. Please check the settings. Clicking on the robots.txt button will reset this check.', 'eurostocks'); ?>
                  </div>
                  <script>
                    var EXTENDED_TRANSLATIONS = {
                      "ROBOTS_DISCLAIMER": "<?php esc_html_e("The were multiple places with the shortcode detected which weren't selected as the filter page. This check only checks if the selected filter page is in the robots.txt.", "eurostocks"); ?>", 
                    };
                  </script>
                  <?php
                }else{ ?>
                  <script>
                    var EXTENDED_TRANSLATIONS = {
                      "ROBOTS_DISCLAIMER": "",
                    };
                  </script>
                  <?php
                }
                ?>

                <div class="shortcode-result">
                  <h3><?php esc_html_e('Shortcode details pagina', 'eurostocks'); ?></h3>
                  <p>
                  <pre><code class="eurostocks-shortcode-code">[eurostocks_details]</code></pre>
                  </p>
                  <label>
                    <h3><?php esc_html_e('Select the details page template', 'eurostocks'); ?></h3>
                    <?php if ($show_lang) { ?>
                      <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                        alt="<?php echo esc_html($lang); ?>" />
                    <?php } ?>
                    <select id="eurostocks-select-details-page" name="eurostocks[details_page]">

                      <?php
                      $pages = get_pages();

                      foreach ($pages as $page) {
                        $selected = '';
                        if ($page->ID == $details_page) {
                          $selected = 'selected';
                        }

                      ?>
                        <option value="<?php echo esc_html($page->ID); ?>" <?php echo esc_html($selected); ?>>
                          <?php echo esc_html($page->post_title); ?> (<?php echo esc_url(get_page_link($page->ID)); ?>)
                        </option>
                      <?php
                      }
                      ?>
                    </select>

                    <br><br>

                    <?php
                    foreach ($accepted_langs as $lang) { ?>
                      <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                        alt="<?php echo esc_html($lang); ?>" />
                      <select id="eurostocks-select-details-page" name="eurostocks[<?php echo esc_html($lang); ?>][details_page]">

                        <?php
                        $pages = get_pages();

                        foreach ($pages as $page) {
                          $selected = '';
                          if ($page->ID == $details_page_e[esc_html($lang)]) {
                            $selected = 'selected';
                          }


                        ?>
                          <option value="<?php echo esc_html($page->ID); ?>" <?php echo esc_html($selected); ?>>
                            <?php echo esc_html($page->post_title); ?> (<?php echo esc_url(get_page_link($page->ID)); ?>)
                          </option>
                        <?php
                        }
                        ?>
                      </select>
                      <br><br>
                    <?php
                    }
                    ?>
                  </label>

                  <?php submit_button(__('Save settings', 'eurostocks'), 'primary', 'submit_b', TRUE); ?>

                </div>
              </div>
            </div>
          </div>

          <div class="meta-box-holder">
            <div class="euro-postbox">
              <div class="eurostocks-admin-header">
                <h2><?php esc_html_e('Options', 'eurostocks'); ?></h2>
              </div>
              <div class="euro-inside">

                <p>
                  <?php esc_html_e('Here you can determine which options should not be shown, which options should be selected by default and which options should be shown as a favorite on the filter page. Note: A maximum of 10 options can be marked as favorites. When an option is checked as \'Do not show\' it is not possible to mark it as \'Selected\' and/or \'Favorite\'.', 'eurostocks'); ?>
                </p>

                <table id="eurostocks-options-table">
                  <thead>
                    <tr>
                      <th style="text-align:left;"><?php esc_html_e('Option', 'eurostocks'); ?></th>
                      <th><?php esc_html_e('Don\'t show:', 'eurostocks'); ?></th>
                      <th><?php esc_html_e('Selected:', 'eurostocks'); ?></th>
                      <th><?php esc_html_e('Favorite:', 'eurostocks'); ?></th>
                    </tr>
                  </thead>
                  <tbody>
                    <?php
                    $i = 0;
                    foreach ($caroptions as $optie => $value) {
                    ?>
                      <tr id="optie-<?php echo sanitize_text_field($i); ?>">
                        <td><?php echo esc_html__($value, 'eurostocks'); ?></td>
                        <td style="text-align:center">
                          <input type="checkbox" class="euro-hide" id="<?php echo 'hide_' . sanitize_text_field($i); ?>" name="eurostocks[<?php echo 'hide_' . sanitize_text_field($optie); ?>]" value="1" <?php checked((isset($options[sanitize_text_field('hide_' . $optie)]) && $optie != '') ? sanitize_text_field($options['hide_' . sanitize_text_field($optie)]) : 0, 1); ?>>
                        </td>
                        <td style="text-align:center">
                          <input type="checkbox" class="euro-sel" id="<?php echo 'select_' . sanitize_text_field($i); ?>" name="eurostocks[<?php echo 'select_' . sanitize_text_field($optie); ?>]" value="1" <?php checked((isset($options[sanitize_text_field('select_' . $optie)]) && $optie != '') ? sanitize_text_field($options['select_' . sanitize_text_field($optie)]) : 0, 1); ?>>
                        </td>
                        <td style="text-align:center">
                          <input type="checkbox" class="euro-fav" id="<?php echo 'fav_' . sanitize_text_field($i); ?>" name="eurostocks[<?php echo 'fav_' . sanitize_text_field($optie); ?>]" value="1" <?php checked((isset($options[sanitize_text_field('fav_' . $optie)]) && $optie != '') ? sanitize_text_field($options['fav_' . sanitize_text_field($optie)]) : 0, 1); ?>>
                        </td>
                      </tr>
                      
                    <?php 
                    $i++;
                  } ?>
                  </tbody>
                </table>

                <?php submit_button(__('Save settings', 'eurostocks'), 'primary', 'submit_c', TRUE); ?>
              </div>

            </div>
          </div>

          <div class="meta-box-holder">
            <div class="euro-postbox">
              <div class="eurostocks-admin-header">
                <h2><?php esc_html_e('Filters, configuration and display options', 'eurostocks'); ?></h2>
              </div>
              <div class="euro-inside">


                <h3><?php esc_html_e('Is the plugin used within an iframe?', 'eurostocks'); ?> </h3>

                <span for="eurostocks-use-as-iframe">
                  <input id="eurostocks-use-as-iframe" value="1" type="checkbox" name="eurostocks[use_as_iframe]" <?php checked($use_as_iframe, 1); ?>>
                  <?php esc_html_e('The plugin is used within an iframe', 'eurostocks'); ?>
                </span>
                <br><br>

                <h3><?php esc_html_e('Cars display options', 'eurostocks'); ?></h3>
                <span for="eurostocks-griddisplay">
                  <input id="eurostocks-griddisplay" value="1" type="radio" name="eurostocks[griddisplay]" <?php checked($griddisplay, 1); ?>> <?php esc_html_e('Grid view', 'eurostocks'); ?><br>
                  <input id="eurostocks-griddisplay" value="0" type="radio" name="eurostocks[griddisplay]" <?php checked($griddisplay, 0); ?>> <?php esc_html_e('List view', 'eurostocks'); ?>
                </span>

                <br><br>
                <span for="eurostocks-country">
                  <h3><?php esc_html_e('Price display for country:', 'eurostocks'); ?></h3>
                  <label><input id="eurostocks-country" type="radio" name="eurostocks[country]" value="nl" <?php checked($country == 'nl', 1); ?>> NL (19%)</label>
                  <label><input id="eurostocks-country" type="radio" name="eurostocks[country]" value="nl21" <?php checked($country == 'nl21', 1); ?>> NL (21%)</label>
                  <label><input id="eurostocks-country" type="radio" name="eurostocks[country]" value="be" <?php checked($country == 'be', 1); ?>> BE</label>
                </span>

                <br><br>

                <h3><?php esc_html_e('Show only cars with', 'eurostocks'); ?></h3>

                <span for="eurostocks-feature-warranty">
                  <input id="eurostocks-feature-warranty" value="1" type="checkbox" name="eurostocks[feature_warranty]"
                    <?php checked($feature_warranty, 1); ?>>
                  <?php esc_html_e('Only show cars with warranty', 'eurostocks'); ?>
                </span>

                <br>
                <span for="eurostocks-maintenance-history">
                  <input id="eurostocks-maintenance-history" value="1" type="checkbox"
                    name="eurostocks[maintenance_history]" <?php checked($maintenance_history, 1); ?>>
                  <?php esc_html_e('Only show cars with maintenance history', 'eurostocks'); ?>
                </span>

                <br>
                <span for="eurostocks-max-prev-owners">
                  <input id="eurostocks-max-prev-owners" value="1" type="checkbox" name="eurostocks[max_prev_owners]"
                    <?php checked($max_prev_owners, 1); ?>>
                  <?php esc_html_e('Only show cars with max 1 previous owner', 'eurostocks'); ?>
                </span>

                <br>
                <span for="eurostocks-no-damage-history">
                  <input id="eurostocks-no-damage-history" value="1" type="checkbox" name="eurostocks[no_damage_history]"
                    <?php checked($no_damage_history, 1); ?>>
                  <?php esc_html_e('Only show cars without damage history', 'eurostocks'); ?>
                </span>
                <br>

                <p>
                  <label for="eurostocks-dealers"><?php esc_html_e('Only show specific dealers', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-dealers"
                    name="eurostocks[dealers]" placeholder="<?php esc_html_e('Dealer id', 'eurostocks'); ?>" value="<?php echo esc_html($dealers); ?>" />
                </p>

                <p>
                  <label for="eurostocks-max_kmstand"><?php esc_html_e('Max mileage', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" required type="number" min="0" step="1000" max="125000"
                    id="eurostocks-max_kmstand" name="eurostocks[max_kmstand]"
                    value="<?php echo esc_html($max_kmstand); ?>" />
                </p>

                <p>
                  <label for="eurostocks-min_bouwjaar"><?php esc_html_e('Minimal registration year', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" required type="number" id="eurostocks-min_bouwjaar"
                    name="eurostocks[min_bouwjaar]" min="2013" max="2025" value="<?php echo esc_html($min_bouwjaar); ?>" />
                </p>

                <br>

                <h3><?php esc_html_e('Select the details page blocks you want to hide here', 'eurostocks'); ?></h3>

                <label for="eurostocks-show-nav">
                  <input id="eurostocks-show-nav" value="1" type="checkbox" name="eurostocks[show_nav]" <?php checked($show_nav, 1); ?>> <?php esc_html_e('Show navigation', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-hide-experts">
                  <input id="eurostocks-hide-experts" value="1" type="checkbox" name="eurostocks[hide_experts]" <?php checked($hide_experts, 1); ?>> <?php esc_html_e('Hide experts / contact block', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-hide-reviews">
                  <input id="eurostocks-hide-reviews" value="1" type="checkbox" name="eurostocks[hide_reviews]" <?php checked($hide_reviews, 1); ?>> <?php esc_html_e('Hide reviews block', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-hide-kosten-left">
                  <input id="eurostocks-hide-kosten-left" value="1" type="checkbox" name="eurostocks[hide_kosten_left]" <?php checked($hide_kosten_left, 1); ?>> <?php esc_html_e('Hide costs (left)', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-hide-kosten-right">
                  <input id="eurostocks-hide-kosten-right" value="1" type="checkbox" name="eurostocks[hide_kosten_right]" <?php checked($hide_kosten_right, 1); ?>> <?php esc_html_e('Hide costs (right)', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-enable-pdf">
                  <input id="eurostocks-enable-pdf" value="1" type="checkbox" name="eurostocks[enable_pdf]" <?php checked($enable_pdf, 1); ?>> <?php esc_html_e('enable PDF', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-cotwdisplay">
                  <input id="eurostocks-cotwdisplay" value="1" type="checkbox" name="eurostocks[co2_disclaimer_display]" <?php checked($co2_disclaimer_display, 1); ?>> <?php esc_html_e('Display Co2 disclaimer', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-cotwplay">
                  <input id="eurostocks-cotwplay" value="1" type="checkbox" name="eurostocks[co2_fallback_display]" <?php checked($co2_fallback_display, 1); ?>> <?php esc_html_e('Display Co2 fallback', 'eurostocks'); ?>
                </label>

                <br>

                <label for="eurostocks-show-options-sep">
                  <input id="eurostocks-show-options-sep" value="1" type="checkbox" name="eurostocks[show_options_sep]" <?php checked($show_options_sep, 1); ?>> <?php esc_html_e('Show options seperate from car info', 'eurostocks'); ?>
                </label>

                <br>
                <br>

                <h3><?php esc_html_e('Show CTAs', 'eurostocks'); ?></h3>
                <!-- show_cta_cf -->
               
                <span for="eurostocks-show-cta_cf">
                  <input id="eurostocks-show-cta_cf" value="1" type="checkbox" name="eurostocks[show_cta_cf]" <?php checked($show_cta_cf, 1); ?>> <?php esc_html_e('Show CTAs (CF)', 'eurostocks'); ?>
                </span>
                <br>
                <!-- show_cta_tel --> 
                <span for="eurostocks-show-cta_tel">
                  <input id="eurostocks-show-cta_tel" value="1" type="checkbox" name="eurostocks[show_cta_tel]" <?php checked($show_cta_tel, 1); ?>> <?php esc_html_e('Show CTAs (Tel)', 'eurostocks'); ?>
                </span>
                <br>
                <!-- show_cta_app -->
                <span for="eurostocks-show-cta_app">
                  <input id="eurostocks-show-cta_app" value="1" type="checkbox" name="eurostocks[show_cta_app]" <?php checked($show_cta_app, 1); ?>> <?php esc_html_e('Show CTAs (App)', 'eurostocks'); ?>
                </span>
                <br>
                <!-- show_cta_fav -->
                <span for="eurostocks-show-cta_fav">
                  <input id="eurostocks-show-cta_fav" value="1" type="checkbox" name="eurostocks[show_cta_fav]" <?php checked($show_cta_fav, 1); ?>> <?php esc_html_e('Show CTAs (Fav, note: only use this if your website has been prepared for it)', 'eurostocks'); ?>
                </span>
                <br>
                <br>

                <h3><?php esc_html_e('Update CTA order', 'eurostocks'); ?></h3>
                <!-- order_ctas -->
                <ol id="sortable-ctas">
                  <?php
                    foreach ($ordered_ctas as $cta_key) {
                        echo '<li class="eurostocks-draggable" data-key="' . esc_attr($cta_key) . '">' . esc_html($default_cta_order[$cta_key]) . '</li>';
                    }
                    ?>
                </ol>

                <input type="hidden" id="cta_order_input" name="eurostocks[cta_order]" value="<?php echo  esc_attr(implode(',', $ordered_ctas)); ?>">


                <h3><?php esc_html_e('Powered by display', 'eurostocks'); ?> </h3>

                <span for="eurostocks-powered_by">
                  <input id="eurostocks-powered_by" value="0" type="radio" name="eurostocks[show_powered_by]" <?php checked($show_powered_by, 0); ?>> <?php esc_html_e('Hide powered by', 'eurostocks'); ?><br>
                  <input id="eurostocks-powered_by" value="1" type="radio" name="eurostocks[show_powered_by]" <?php checked($show_powered_by, 1); ?>> <?php esc_html_e('Show Powered by EuroStocks (dark logo)', 'eurostocks'); ?><br>
                  <input id="eurostocks-powered_by" value="2" type="radio" name="eurostocks[show_powered_by]" <?php checked($show_powered_by, 2); ?>> <?php esc_html_e('Show Powered by EuroStocks (light logo)', 'eurostocks'); ?>
                </span>
                

                <br>
                <br>

                <h3><?php esc_html_e('Expanded filters', 'eurostocks'); ?> </h3>

                <span for="eurostocks-expand-filters">
                  <input id="eurostocks-expand-filters" value="1" type="checkbox" name="eurostocks[expand_filters]" <?php checked($expand_filters, 1); ?>>
                  <?php esc_html_e('Show expanded filter view by default', 'eurostocks'); ?>
                </span>

                <h3><?php esc_html_e('Select the filters you want to hide here', 'eurostocks'); ?> </h3>

                <span for="eurostocks-hide-power">
                  <input id="eurostocks-hide-power" value="1" type="checkbox" name="eurostocks[hide_power]" <?php checked($hide_power, 1); ?>> <?php esc_html_e('Hide HP filter', 'eurostocks'); ?>
                </span>
                <br><span for="eurostocks-hide-mileage">
                  <input id="eurostocks-hide-mileage" value="1" type="checkbox" name="eurostocks[hide_mileage]" <?php checked($hide_mileage, 1); ?>> <?php esc_html_e('Hide KM filter', 'eurostocks'); ?>
                </span>

                <br>
                <span for="eurostocks-hide-year">
                  <input id="eurostocks-hide-year" value="1" type="checkbox" name="eurostocks[hide_year]" <?php checked($hide_year, 1); ?>> <?php esc_html_e('Hide year filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-fuel">
                  <input id="eurostocks-hide-fuel" value="1" type="checkbox" name="eurostocks[hide_fuel_type]" <?php checked($hide_fuel_type, 1); ?>> <?php esc_html_e('Hide fuel filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-transmission">
                  <input id="eurostocks-hide-transmission" value="1" type="checkbox" name="eurostocks[hide_transmission]"
                    <?php checked($hide_transmission, 1); ?>>
                  <?php esc_html_e('Hide transmission filter', 'eurostocks'); ?>
                </span>

                <br><span for="eurostocks-hide-drive-type">
                  <input id="eurostocks-hide-drive-type" value="1" type="checkbox" name="eurostocks[hide_drive_type]" <?php checked($hide_drive_type, 1); ?>> <?php esc_html_e('Hide drive type filter', 'eurostocks'); ?>
                </span>

                <br><span for="eurostocks-hide-seats">
                  <input id="eurostocks-hide-seats" value="1" type="checkbox" name="eurostocks[hide_seats]" <?php checked($hide_seats, 1); ?>> <?php esc_html_e('Hide seats count filter', 'eurostocks'); ?>
                </span>

                <br>
                <span for="eurostocks-hide-speed">
                  <input id="eurostocks-hide-speed" value="1" type="checkbox" name="eurostocks[hide_speed_control]" <?php checked($hide_speed_control, 1); ?>>
                  <?php esc_html_e('Hide speed controls filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-interior">
                  <input id="eurostocks-hide-interior" value="1" type="checkbox" name="eurostocks[hide_interior_type]"
                    <?php checked($hide_interior_type, 1); ?>>
                  <?php esc_html_e('Hide Interior filter', 'eurostocks'); ?>
                </span>
                <br>
          
                <span for="eurostocks-hide-price">
                  <input id="eurostocks-hide-price" value="1" type="checkbox" name="eurostocks[hide_price]"
                    <?php checked($hide_price, 1); ?>>
                  <?php esc_html_e('Hide Price filter', 'eurostocks'); ?>
                </span>
                <br>

                <span for="eurostocks-hide-parking-filter">
                  <input id="eurostocks-hide-parking-filter" value="1" type="checkbox"
                    name="eurostocks[hide_filter_parking]" <?php checked($hide_filter_parking, 1); ?>>
                  <?php esc_html_e('Hide parking sensor filter', 'eurostocks'); ?>
                </span>
                <br>

                <span for="eurostocks-hide-options-filter">
                  <input id="eurostocks-hide-options-filter" value="1" type="checkbox"
                    name="eurostocks[hide_filter_options]" <?php checked($hide_filter_options, 1); ?>>
                  <?php esc_html_e('Hide options filter', 'eurostocks'); ?>
                </span>
                <br>



                <span for="eurostocks-hide-climatisation">
                  <input id="eurostocks-hide-climatisation" value="1" type="checkbox"
                    name="eurostocks[hide_climatisation]" <?php checked($hide_climatisation, 1); ?>>
                  <?php esc_html_e('Hide climatisation filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-exterior-color">
                  <input id="eurostocks-hide-exterior-color" value="1" type="checkbox"
                    name="eurostocks[hide_exterior_color]" <?php checked($hide_exterior_color, 1); ?>>
                  <?php esc_html_e('Hide color filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-headlight">
                  <input id="eurostocks-hide-headlight" value="1" type="checkbox" name="eurostocks[hide_headlight_type]"
                    <?php checked($hide_headlight_type, 1); ?>>
                  <?php esc_html_e('Hide headlight type filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-door-count">
                  <input id="eurostocks-hide-door-count" value="1" type="checkbox" name="eurostocks[hide_door_count]"
                    <?php checked($hide_door_count, 1); ?>>
                  <?php esc_html_e('Hide number of doors filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-vat">
                  <input id="eurostocks-hide-vat" value="1" type="checkbox" name="eurostocks[hide_vat]" <?php checked($hide_vat, 1); ?>> <?php esc_html_e('Hide VAT filter', 'eurostocks'); ?>
                </span>
                <br>
                <span for="eurostocks-hide-category">
                  <input id="eurostocks-hide-category" value="1" type="checkbox" name="eurostocks[hide_category]" <?php checked($hide_category, 1); ?>> <?php esc_html_e('Hide car category filter', 'eurostocks'); ?>
                </span><br>

              <br>

                <h3><?php esc_html_e('Sort options', 'eurostocks'); ?></h3>

                <span for="eurostocks-hide-sort">
                  <input id="eurostocks-hide-sort" value="1" type="checkbox" name="eurostocks[hide_sort]"
                    <?php checked($hide_sort, 1); ?>>
                  <?php esc_html_e('Hide sort function', 'eurostocks'); ?>
                </span>
                <br>

                <span for="eurostocks-hide-sort-price">
                  <input id="eurostocks-hide-sort-price" value="1" type="checkbox" name="eurostocks[hide_sort_price]"
                    <?php checked($hide_sort_price, 1); ?>>
                  <?php esc_html_e('Hide sort option price', 'eurostocks'); ?>
                </span>
                <br>

                <span for="eurostocks-hide-sort-mileage">
                  <input id="eurostocks-hide-sort-mileage" value="1" type="checkbox" name="eurostocks[hide_sort_mileage]"
                    <?php checked($hide_sort_mileage, 1); ?>>
                  <?php esc_html_e('Hide sort option mileage', 'eurostocks'); ?>
                </span>

                <br>

                <span for="eurostocks-hide-sort-registration">
                  <input id="eurostocks-hide-sort-registration" value="1" type="checkbox"
                    name="eurostocks[hide_sort_registration]" <?php checked($hide_sort_registration, 1); ?>>
                  <?php esc_html_e('Hide sort option registration date', 'eurostocks'); ?>
                </span>
                <br>

                <span for="eurostocks-hide-sort-creation">
                  <input id="eurostocks-hide-sort-creation" value="1" type="checkbox"
                    name="eurostocks[hide_sort_creation]" <?php checked($hide_sort_creation, 1); ?>>
                  <?php esc_html_e('Hide sort option date added', 'eurostocks'); ?>
                </span>


                <br>
                <br>

                <p>
                  <label for="eurostocks-default-sort"><?php esc_html_e('Default sort', 'eurostocks'); ?></label>
                  <select name="eurostocks[default_sort]" class="regular-text input textinput">
                    <option value="priceAsc" <?php selected($default_sort, 'priceAsc'); ?>><?php esc_html_e('Price Low - High', 'eurostocks'); ?></option>
                    <option value="priceDesc" <?php selected($default_sort, 'priceDesc'); ?>><?php esc_html_e('Price High - Low', 'eurostocks'); ?></option>
                    <option value="mileageAsc" <?php selected($default_sort, 'mileageAsc'); ?>><?php esc_html_e('Mileage Low - High', 'eurostocks'); ?></option>
                    <option value="mileageDesc" <?php selected($default_sort, 'mileageDesc'); ?>><?php esc_html_e('Mileage High - Low', 'eurostocks'); ?></option>
                    <option value="registrationAsc" <?php selected($default_sort, 'registrationAsc'); ?>><?php esc_html_e('Registration date Old - New', 'eurostocks'); ?></option>
                    <option value="registrationDesc" <?php selected($default_sort, 'registrationDesc'); ?>><?php esc_html_e('Registration date New - Old', 'eurostocks'); ?></option>
                    <option value="creationAsc" <?php selected($default_sort, 'creationAsc'); ?>><?php esc_html_e('Date added Old - New', 'eurostocks'); ?></option>
                    <option value="creationDesc" <?php selected($default_sort, 'creationDesc'); ?>><?php esc_html_e('Date added New - Old', 'eurostocks'); ?></option>
                  </select>
                </p>
                <br>

                <?php submit_button(__('Save settings', 'eurostocks'), 'primary', 'submit_d', TRUE); ?>

              </div>
            </div>
          </div>


          <?php require_once('eurostocks-admin-display-content.php'); ?>

          <?php require_once('eurostocks-admin-display-experts.php'); ?>

          <?php require_once('eurostocks-admin-display-reviews.php'); ?>
          

          <div class="meta-box-holder">
            <div class="euro-postbox">
              <div class="eurostocks-admin-header">
                <h2><?php esc_html_e('Costs and services', 'eurostocks'); ?></h2>
              </div>

              <div class="euro-inside">

                <h3><?php esc_html_e('Block title', 'eurostocks'); ?></h3>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label
                    for="eurostocks-kosten-en-diensten"><?php esc_html_e('Costs and services title', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten-en-diensten"
                    name="eurostocks[txt_kosten_diensten]" value="<?php echo esc_html($txt_kosten_diensten); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label
                      for="eurostocks-kosten-en-diensten"><?php esc_html_e('Costs and services title', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten-en-diensten"
                      name="eurostocks[<?php echo esc_html($lang); ?>][txt_kosten_diensten]" value="<?php echo esc_html($txt_kosten_diensten_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>


                <br>
                <h3><?php esc_html_e('Content (left side)', 'eurostocks'); ?></h3>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten-one-title"><?php esc_html_e('Title', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten-one-title"
                    name="eurostocks[kosten_one_title]" value="<?php echo esc_html($kosten_one_title); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                    <label for="eurostocks-kosten-one-title"><?php esc_html_e('Title', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten-one-title"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_one_title]" value="<?php echo esc_html($kosten_one_title_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten-one-txt"><?php esc_html_e('Text', 'eurostocks'); ?></label>
                  <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-kosten-one-txt"
                    name="eurostocks[kosten_one_txt]"><?php echo esc_html($kosten_one_txt); ?></textarea>

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                    <label for="eurostocks-kosten-one-txt"><?php esc_html_e('Text', 'eurostocks'); ?></label>
                    <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-kosten-one-txt"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_one_txt]"><?php echo esc_html($kosten_one_txt_e[esc_html($lang)]); ?></textarea>

                    <br><br>
                  <?php
                  }
                  ?>
                </p>

                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten-two-title"><?php esc_html_e('Title', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten-two-title"
                    name="eurostocks[kosten_two_title]" value="<?php echo esc_html($kosten_two_title); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                    <label for="eurostocks-kosten-two-title"><?php esc_html_e('Title', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten-two-title"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_two_title]" value="<?php echo esc_html($kosten_two_title_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten-two-txt"><?php esc_html_e('Text', 'eurostocks'); ?></label>
                  <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-kosten-two-txt"
                    name="eurostocks[kosten_two_txt]"><?php echo esc_html($kosten_two_txt); ?></textarea>

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                    <label for="eurostocks-kosten-two-txt"><?php esc_html_e('Text', 'eurostocks'); ?></label>
                    <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-kosten-two-txt"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_two_txt]"><?php echo esc_html($kosten_two_txt_e[esc_html($lang)]); ?></textarea>

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <br><br>
                <h3><?php esc_html_e('Costs block', 'eurostocks'); ?></h3>

                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten-title"><?php esc_html_e('Title', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten-title"
                    name="eurostocks[kosten_title]" value="<?php echo esc_html($kosten_title); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                    <label for="eurostocks-kosten-title"><?php esc_html_e('Title', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten-title"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_title]" value="<?php echo esc_html($kosten_title_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten_vraagprijs"><?php esc_html_e('Price', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_vraagprijs"
                    name="eurostocks[kosten_vraagprijs]" value="<?php echo esc_html($kosten_vraagprijs); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                    <label for="eurostocks-kosten_vraagprijs"><?php esc_html_e('Price', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_vraagprijs"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_vraagprijs]" value="<?php echo esc_html($kosten_vraagprijs_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label
                    for="eurostocks-kosten_vraagprijs_tax"><?php esc_html_e('Costs asking price VAT', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_vraagprijs_tax"
                    name="eurostocks[kosten_vraagprijs_tax]" value="<?php echo esc_html($kosten_vraagprijs_tax); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label
                      for="eurostocks-kosten_vraagprijs_tax"><?php esc_html_e('Costs asking price VAT', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_vraagprijs_tax"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_vraagprijs_tax]" value="<?php echo esc_html($kosten_vraagprijs_tax_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label
                    for="eurostocks-kosten_vraagprijs_no_tax"><?php esc_html_e('Costs asking price non-VAT', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_vraagprijs_no_tax"
                    name="eurostocks[kosten_vraagprijs_no_tax]"
                    value="<?php echo esc_html($kosten_vraagprijs_no_tax); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label
                      for="eurostocks-kosten_vraagprijs_no_tax"><?php esc_html_e('Costs asking price non-VAT', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_vraagprijs_no_tax"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_vraagprijs_no_tax]" value="<?php echo esc_html($kosten_vraagprijs_no_tax_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>

                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label
                    for="eurostocks-kosten_restbpm"><?php esc_html_e('BPM indication', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_toelating"
                    name="eurostocks[kosten_restbpm]" value="<?php echo esc_html($kosten_restbpm); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label
                      for="eurostocks-kosten_restbpm"><?php esc_html_e('BPM indication', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_restbpm"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_restbpm]" value="<?php echo esc_html($kosten_restbpm_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>


                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label
                    for="eurostocks-kosten_toelating"><?php esc_html_e('Admission and control Country', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_toelating"
                    name="eurostocks[kosten_toelating]" value="<?php echo esc_html($kosten_toelating); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label
                      for="eurostocks-kosten_toelating"><?php esc_html_e('Admission and control Country', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_toelating"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_toelating]" value="<?php echo esc_html($kosten_toelating_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten_transport"><?php esc_html_e('Import', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_transport"
                    name="eurostocks[kosten_transport]" value="<?php echo esc_html($kosten_transport); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label for="eurostocks-kosten_transport"><?php esc_html_e('Import', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_transport"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_transport]" value="<?php echo esc_html($kosten_transport_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>

                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten_transport2"><?php esc_html_e('Transport', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_transport2"
                    name="eurostocks[kosten_transport2]" value="<?php echo esc_html($kosten_transport_two); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label for="eurostocks-kosten_transport2"><?php esc_html_e('Transport', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_transport2"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_transport2]" value="<?php echo esc_html($kosten_transport_two_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>


                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-kosten_totaal"><?php esc_html_e('Total', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-kosten_totaal"
                    name="eurostocks[kosten_totaal]" value="<?php echo esc_html($kosten_totaal); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label for="eurostocks-kosten_totaal"><?php esc_html_e('Total', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-kosten_totaal"
                      name="eurostocks[<?php echo esc_html($lang); ?>][kosten_totaal]" value="<?php echo esc_html($kosten_totaal_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>

              </div>
            </div>
          </div>

          <div class="meta-box-holder">
            <div class="euro-postbox">
              <div class="eurostocks-admin-header">
                <h2><?php esc_html_e('Contact settings', 'eurostocks'); ?></h2>
              </div>
              <div class="euro-inside">
                <h3><?php esc_html_e('Contact info and settings', 'eurostocks'); ?></h3>
                <?php
                $option_name = 'eurostocks_sendmailc';
                ?>

                <p><?php esc_html_e('Contact form submissions:', 'eurostocks'); ?>
                  <?php echo esc_html(get_option($option_name)); ?></p>

                <p>
                  <label for="eurostocks-email"><?php esc_html_e('Email', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-email" name="eurostocks[email]"
                    value="<?php echo esc_html($email); ?>" />
                </p>

                <p>
                  <label for="eurostocks-contact-tel"><?php esc_html_e('Telephone number (Call CTA)', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-contact-tel" name="eurostocks[contact_tel]"
                    value="<?php echo esc_html($contact_tel); ?>" />
                </p>
                <p>
                  <label for="eurostocks-contact-app"><?php esc_html_e('Telephone number (WhatsApp CTA)', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-contact-app" name="eurostocks[contact_app]"
                    value="<?php echo esc_html($contact_app); ?>" />
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-redirect"><?php esc_html_e('Redirect url', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="text" id="eurostocks-redirect"
                    name="eurostocks[redirect]" value="<?php echo esc_html($redirect); ?>" />

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label for="eurostocks-redirect"><?php esc_html_e('Redirect url', 'eurostocks'); ?></label>
                    <input class="regular-text input textinput" type="text" id="eurostocks-redirect"
                      name="eurostocks[<?php echo esc_html($lang); ?>][redirect]" value="<?php echo esc_html($redirect_e[esc_html($lang)]); ?>" />

                    <br><br>
                  <?php
                  }
                  ?>
                </p>

                <p>
                <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label
                    for="eurostocks-contactcar"><?php esc_html_e('Contact e-mail', 'eurostocks'); ?></label>
                  <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contactcar"
                    name="eurostocks[contactcar]"><?php echo esc_html($contactcar); ?></textarea>

                    <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label
                    for="eurostocks-contactcar"><?php esc_html_e('Contact e-mail', 'eurostocks'); ?></label>
                    <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contactcar"
                      name="eurostocks[<?php echo esc_html($lang); ?>][contactcar]"><?php echo esc_html($contactcar_e[esc_html($lang)]); ?></textarea>

                    <br><br>
                  <?php
                  }
                  ?>
                </p>

                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-contactmes"><?php esc_html_e('Contact e-mail footer text', 'eurostocks'); ?></label>
                  <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contactmes"
                    name="eurostocks[contactmes]"><?php echo esc_html($contactmes); ?></textarea>

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label for="eurostocks-contactmes"><?php esc_html_e('Contact e-mail footer text', 'eurostocks'); ?></label>
                    <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contactmes"
                      name="eurostocks[<?php echo esc_html($lang); ?>][contactmes]"><?php echo esc_html($contactmes_e[esc_html($lang)]); ?></textarea>

                    <br><br>
                  <?php
                  }
                  ?>
                </p>

                <span for="eurostocks-hide-car-lease">
                  <input id="eurostocks-hide-car-lease" value="1" type="checkbox" name="eurostocks[hide_carlease]" <?php checked($hide_carlease, 1); ?>> <?php esc_html_e('Hide car lease option', 'eurostocks'); ?>
                </span><br>

                <span for="eurostocks-hide-car-trade">
                  <input id="eurostocks-hide-car-trade" value="1" type="checkbox" name="eurostocks[hide_cartrade]" <?php checked($hide_cartrade, 1); ?>> <?php esc_html_e('Hide car swap option', 'eurostocks'); ?>
                </span><br>

                <?php submit_button(__('Save settings', 'eurostocks'), 'primary', 'submit_e', TRUE); ?>

              </div>
            </div>
          </div>

          <div class="meta-box-holder">
            <div class="euro-postbox">
              <div class="eurostocks-admin-header">
                <h2><?php esc_html_e('PDF settings', 'eurostocks'); ?></h2>
              </div>
              <div class="euro-inside">
                <h3><?php esc_html_e('PDF info', 'eurostocks'); ?></h3>

                <p>
                  <label for="eurostocks-logo"><?php esc_html_e('Logo', 'eurostocks'); ?></label>
                  <?php if ($logo_img = wp_get_attachment_image_url($logo, 'medium')): ?>
                    <a href="#" class="logo-media-upload">
                      <img src="<?php echo esc_url($logo_img) ?>" />
                    </a>

                    <a href="#"
                      class="eurostocks-media-remove"><?php esc_html_e('Delete image', 'eurostocks'); ?></a>
                    <input type="hidden" name="eurostocks[logo]" value="<?php echo esc_html(absint($logo)) ?>">
                  <?php else: ?>
                    <a href="#"
                      class="button review_img-media-upload"><?php esc_html_e('Upload review title img', 'eurostocks'); ?></a>
                    <a href="#" class="eurostocks-media-remove"
                      style="display:none"><?php esc_html_e('Delete logo', 'eurostocks'); ?></a>
                    <input type="hidden" name="eurostocks[logo]" value="">
                  <?php endif; ?>
                </p>


                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-contacttimes"><?php esc_html_e('Opening hours', 'eurostocks'); ?></label>
                  <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contacttimes"
                    name="eurostocks[contacttimes]"><?php echo wp_kses_post($contacttimes, array('a', 'span', 'div', 'br')); ?></textarea>

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label for="eurostocks-contacttimes"><?php esc_html_e('Opening hours', 'eurostocks'); ?></label>
                    <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contacttimes"
                      name="eurostocks[<?php echo esc_html($lang); ?>][contacttimes]"><?php echo wp_kses_post($contacttimes_e[esc_html($lang)], array('a', 'span', 'div', 'br')); ?></textarea>

                    <br><br>
                  <?php
                  }
                  ?>
                </p>
                <p>
                  <?php if ($show_lang) { ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($default_lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                  <?php } ?>
                  <label for="eurostocks-contactaddress"><?php esc_html_e('Contact info', 'eurostocks'); ?></label>
                  <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contactaddress"
                    name="eurostocks[contactaddress]"><?php echo wp_kses_post($contactaddress, array('a', 'span', 'div', 'br')); ?></textarea>

                  <br><br>

                  <?php
                  foreach ($accepted_langs as $lang) {
                  ?>
                    <img style="display: inline;" src="<?php echo esc_url(plugins_url('../assets/', __FILE__)) .  esc_html($lang) . '.png'; ?>"
                      alt="<?php echo esc_html($lang); ?>" />
                      <label for="eurostocks-contactaddress"><?php esc_html_e('Contact info', 'eurostocks'); ?></label>
                    <textarea rows="4" class="regular-text input textinput" type="text" id="eurostocks-contactaddress"
                      name="eurostocks[<?php echo esc_html($lang); ?>][contactaddress]"><?php echo wp_kses_post($contactaddress_e[esc_html($lang)], array('a', 'span', 'div', 'br')); ?></textarea>

                    <br><br>
                  <?php
                  }
                  ?>
                </p>



                <?php submit_button(__('Save settings', 'eurostocks'), 'primary', 'submit_f', TRUE); ?>

              </div>
            </div>
          </div>

          <div class="meta-box-holder">
            <div class="euro-postbox">
              <div class="eurostocks-admin-header">
                <h2><?php esc_html_e('Financial lease', 'eurostocks'); ?></h2>
              </div>

              <div class="euro-inside">


                <p>
                  <label
                    for="eurostocks-enable-fl"><?php esc_html_e('Show financial lease option', 'eurostocks'); ?></label>
                  <input type="checkbox" value="1" <?php checked(1 == $enable_fl); ?> name="eurostocks[enable_fl]"
                    id="eurostocks-enable-fl">
                </p>

                <p>
                  <label
                    for="eurostocks-only-fl"><?php esc_html_e('Show only financial lease option', 'eurostocks'); ?></label>
                  <input type="checkbox" value="1" <?php checked(1 == $only_fl); ?> name="eurostocks[only_fl]"
                    id="eurostocks-only-fl">
                </p>

                <p>
                  <label
                    for="eurostocks-rent-percentage"><?php esc_html_e('Interest percentage (%)', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="number" min="0" step="any" max="100"
                    id="eurostocks-rent-percentage" name="eurostocks[fl_percentage]"
                    value="<?php echo esc_html($fl_percentage); ?>" />
                </p>

                <p>
                  <label for="eurostocks-fl-duration"><?php esc_html_e('Duration (months)', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="number" min="0" step="any" max="60"
                    id="eurostocks-fl-duration" name="eurostocks[fl_duration]"
                    value="<?php echo esc_html($fl_duration); ?>" /> <?php esc_html_e('Months', 'eurostocks'); ?>
                </p>

                <p>
                  <label for="eurostocks-rent-percentage"><?php esc_html_e('Residual debt (%)', 'eurostocks'); ?></label>
                  <input class="regular-text input textinput" type="number" min="0" max="100" step="any"
                    id="eurostocks-restschuld-percentage" name="eurostocks[fl_restschuld]"
                    value="<?php echo esc_html($fl_restschuld); ?>" /> %
                </p>

                <?php submit_button(__('Save settings', 'eurostocks'), 'primary', 'submit_g', TRUE); ?>
              </div>

            </div>
          </div>
        <?php } ?>


      </div>
    </div>
  </form>
</div>