<?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>

<div id="gridheader">
    <div class="row g-3 align-items-center">
        <div class="col-auto text-end fw-semibold">
            <?php echo $this->user->lang("Select Registrar"); ?>:
        </div>

        <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>
    </div>
</div>
<div class="cm-holder dt-info">
    <div class="head padding-bottom">
        <div class="dt-header">

            <!-- LEFT SIDE -->
            <div class="dt-header-left">

                <div class="dt-filters">
                </div>

            </div>

            <!-- RIGHT SIDE -->
            <div class="dt-header-right">
                <div class="filter-group dt-length"></div>
            </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>


<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 } ?>
