<?php if (isset($this->noDomainsModule)) { ?>

    <div class="alert alert-danger">
        <?php echo $this->user->lang('Sorry, you must have the domains module installed to use this tool.'); ?>
    </div>

<?php } else { ?>

<script src="../plugins/import/domains_registrar/PluginDomainsregistrar.js?version=<?php echo $this->gVersion; ?>"></script>

<?php if (isset($this->registrarDropdown)) { ?>

<div id="domains_results"></div>

<span class="grid-meta" id="domains-grid-metadata"></span>

<div id="gridheader" class="blue-box p-3 mb-3">

<div class="row g-3 align-items-center">

    <!-- Select Registrar Label -->
    <div class="col-auto text-end fw-semibold">
        <?php echo $this->user->lang("Select Registrar"); ?>:
    </div>

    <!-- Registrar Dropdown -->
    <div class="col-md-3">
        <select name="selectRegistrar"
                id="domains-grid-filterbyregistrar"
                class="form-select select2">
            <option value="--">----</option>
            <?php foreach ($this->registrars as $registrar) { ?>
                <option value="<?php echo $registrar; ?>">
                    <?php echo $registrar; ?>
                </option>
            <?php } ?>
        </select>
    </div>

    <!-- Limit Selector -->
    <div class="col-md-1">
        <select id="domains-grid-filter"
                class="form-select change-grid-showrecords select2">
            <option value="5">5</option>
            <option value="10">10</option>
            <option value="25">25</option>
            <option value="50">50</option>
            <option value="150">150</option>
            <option value="300">300</option>
        </select>
    </div>

</div>

</div>

 <div class="dt-wrapper pull-top">
    <div class="table-responsive">
        <table id="table-list" class="display" style="width:100%">
            <thead>
                <tr>
                    <th style="text-align: center">
                        <input type="checkbox" id="checkAll">
                    </th>
                    <th class="width4 "><?php echo $this->user->lang('Domain'); ?></th>
                    <th class="width4 "><?php echo $this->user->lang('Expiry Date'); ?></th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
</div>


<div id="domains-footer" class="mt-3">
    <button class="cm-btns orange" id="importDomainButton">
        <span><?php echo $this->user->lang("Import"); ?></span>
    </button>
</div>

<?php } ?>

<?php if (isset($this->noRegistrars)) { ?>
    <br>
    <div class="alert alert-danger">
        <?php echo $this->unescape($this->noRegistrarsText); ?>
    </div>
<?php } ?>

<?php if (isset($this->hasRegistrars)) { ?>
    <div class="table-summary mt-4 mb-3">
        <?php echo $this->user->lang('Select a registrar from the drop-down field above to fetch a list of the domains you have registered that are not already part of ClientExec. <b>It takes approximately 5 seconds PER 100 Domains to retrieve the information from the registrar and a further 5 seconds PER DOMAIN to import.</b> '); ?>
        <br><br>
        <?php echo $this->user->lang('Once a domain is imported, you can edit from within ClientExec its contact info, name servers, initiate a domain transfer, etc.'); ?>
        <br>
        <?php echo $this->user->lang('Note that when a domain is imported, if the registrant doesn\'t have an account in ClientExec then a new account will be created, except if the registrant\'s personal information is marked as private.'); ?>
        <?php echo $this->user->lang('If you have configured a TLD with a registrar that is not listed it is most likely due to the plugin not supporting import functionality.'); ?>
    </div>
<?php } ?>

<?php } ?>
