<!-- BEFORE YOU CONTINUE BLOCK -->
<div class="alert ce-alert ce-alert-error">
    <div class="inside">
        <span class="fw-bold"><?php echo $this->user->lang('BEFORE YOU CONTINUE'); ?></span>
    </div>

    <div class="inside mt-3">
        <div>
            <?php echo $this->user->lang(
                'Before proceeding please generate a backup of both your WHMCS database and Clientexec database giving you the ability to revert back in the event of an issue.'
            ); ?>
        </div>

        <div class="mt-2">
            <?php echo $this->user->lang('It is also recommended to set your default currency before running the importer.'); ?>
            <a href="../admin/index.php?fuse=admin&controller=settings&view=currencies&settings=billing">
                <?php echo $this->user->lang('Set your default currency here.'); ?>
            </a>
        </div>

        <div class="mt-2">
            <?php echo $this->user->lang('The WHMCS importer has been tested with WHMCS 8.x though may be compatible with other versions.'); ?>
        </div>

        <div class="mt-2">
            <?php echo $this->user->lang('If you experience any issues while migrating to Clientexec feel free to send an email to support@clientexec.com for assistance.'); ?>
        </div>
    </div>
</div>


<!-- COLLECTIONS STATUS BLOCK -->
<div class="alert ce-alert ce-alert-error mt-4">
    <div class="inside">
        <span class="fw-bold"><?php echo $this->user->lang('"Collections" status in WHMCS'); ?></span>
    </div>

    <div class="inside mt-2">
        <span>
            <?php echo $this->user->lang(
                'Please note that any package with "Collections" status in WHMCS will be set as "Active" status in Clientexec, and any invoice with "Collections" status in WHMCS will be set as "Unpaid" status in Clientexec, so change the status of those items in WHMCS if required before importing.'
            ); ?>
        </span>
    </div>
</div>


<!-- PAYPAL SUBSCRIPTIONS BLOCK -->
<div class="alert ce-alert ce-alert-error mt-4">
    <div class="inside">
        <span class="fw-bold"><?php echo $this->user->lang('Paypal Subscriptions'); ?></span>
    </div>

    <div class="inside mt-2">
        <span><?php echo $this->user->lang(
            'Please only add this redirect when you are ready to fully migrate to Clientexec. This redirect will prevent WHMCS from receiving PayPal callbacks.'
        ); ?></span>
    </div>

    <div class="inside mt-2">
        <span><?php echo $this->user->lang('At the beginning of the .htaccess file, add the following:'); ?></span>
    </div>

    <!-- Inner alert -->
    <div class="alert ce-alert mt-3">
        <div class="inside">
            <span class="fw-bold">Redirect 301 /modules/gateways/callback/paypal.php /plugins/gateways/paypal/callbackRedirect.php</span>
        </div>
    </div>

    <div class="inside mt-2">
        <span><?php echo $this->user->lang(
            'This redirect may need to be adjusted depending on your path to paypal.php in your WHMCS and your Clientexec installation directory.'
        ); ?></span>
    </div>
</div>


<!-- CONFIGURATION FILE NOTICE -->
<div class="alert ce-alert mt-4">
    <div class="inside">
        <span class="fw-bold">
            <?php echo $this->user->lang(
                'The following values can be obtained from the configuration.php file located on your WHMCS root directory.'
            ); ?>
        </span>
    </div>
</div>


<!-- WHMCS DB CONFIG FORM -->
<div class="mt-3">
    <input type="hidden" name="importer_name" id="importer_name" value="whmcs" />

    <!-- Database Host -->
    <div class="row mb-3 whmcs-import-form">
        <label class="col-sm-3 col-form-label"
               data-bs-toggle="tooltip"
               title="Enter the database host of your WHMCS installation, or leave this field empty to use localhost">
            Database Host:
        </label>
        <div class="col-sm-4">
            <input type="text" name="db_host" id="db_host" class="form-control" value="" />
        </div>
    </div>

    <!-- Database Name -->
    <div class="row mb-3 whmcs-import-form">
        <label class="col-sm-3 col-form-label"
               data-bs-toggle="tooltip"
               title="Enter the database name of your WHMCS installation">
            Database Name:
        </label>
        <div class="col-sm-4">
            <input type="text" name="db_name" id="db_name" class="form-control" value="" />
        </div>
    </div>

    <!-- Database Username -->
    <div class="row mb-3 whmcs-import-form">
        <label class="col-sm-3 col-form-label"
               data-bs-toggle="tooltip"
               title="Enter the database username of your WHMCS installation">
            Database Username:
        </label>
        <div class="col-sm-4">
            <input type="text" name="db_username" id="db_username" class="form-control" value="" />
        </div>
    </div>

    <!-- Database Password -->
    <div class="row mb-3 whmcs-import-form">
        <label class="col-sm-3 col-form-label"
               data-bs-toggle="tooltip"
               title="Enter the database password of your WHMCS installation">
            Database Password:
        </label>
        <div class="col-sm-4">
            <input type="password" name="db_password" id="db_password" class="form-control" value="" />
        </div>
    </div>

    <!-- Database Port -->
    <div class="row mb-3 whmcs-import-form">
        <label class="col-sm-3 col-form-label"
               data-bs-toggle="tooltip"
               title="Enter the database port of your WHMCS installation, or leave this field empty if not required">
            Database Port:
        </label>
        <div class="col-sm-4">
            <input type="text" name="db_port" id="db_port" class="form-control" value="" />
        </div>
    </div>

    <!-- CC Encryption Hash -->
    <div class="row mb-3 whmcs-import-form">
        <label class="col-sm-3 col-form-label"
               data-bs-toggle="tooltip"
               title="Enter the credit card encryption hash of your WHMCS installation">
            CC Encryption Hash:
        </label>
        <div class="col-sm-4">
            <input type="password" name="cc_encryption_hash" id="cc_encryption_hash" class="form-control" value="" />
        </div>
    </div>

</div>

<button class="rich-button mt-3" id="importButton">
    <span><?php echo $this->user->lang("Import"); ?></span>
</button>

<br><br>

<!-- ERROR MESSAGE -->
<?php if (isset($this->error)) { ?>
<div class="alert ce-alert alert-warning mt-3">
    <?php echo $this->errormessage; ?>
</div>
<?php } ?>

<br>

<!-- IMPORT RESULTS -->
<?php if (isset($this->results)) { ?>
<div class="alert ce-alert">
    <span class="fw-bold"><?php echo $this->user->lang('Import Results'); ?>:</span>
    <ul>
        <li><?php echo $this->numDepartments; ?> <?php echo $this->user->lang("departments added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numAdmins; ?> <?php echo $this->user->lang("admin accounts added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numAccounts; ?> <?php echo $this->user->lang("client accounts added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numServers; ?> <?php echo $this->user->lang("servers added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numPackagesGroups; ?> <?php echo $this->user->lang("product groups added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numPackages; ?> <?php echo $this->user->lang("products added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numPackagesAddons; ?> <?php echo $this->user->lang("product addons added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numCoupons; ?> <?php echo $this->user->lang("coupons added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numDomains; ?> <?php echo $this->user->lang("client domains added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numHosting; ?> <?php echo $this->user->lang("client packages added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numHostingAddons; ?> <?php echo $this->user->lang("client package addons added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numInvoices; ?> <?php echo $this->user->lang("invoices added from %s.", "WHMCS"); ?></li>
        <li><?php echo $this->numTickets; ?> <?php echo $this->user->lang("tickets added from %s.", "WHMCS"); ?></li>
    </ul>
</div>
<?php } ?>
