<div class="mb-4 pb-3 border-bottom">

    <h5 class="fw-semibold mb-3">
        <?php echo $this->user->lang('Before You Continue'); ?>
    </h5>

    <ul class="mb-0 small">
        <li>
            <?php echo $this->user->lang(
                'Generate a backup of both your WHMCS and Clientexec databases before proceeding.'
            ); ?>
        </li>
        <li>
            <?php echo $this->user->lang('Set your default currency before running the importer.'); ?>
            <a href="../admin/index.php?fuse=admin&controller=settings&view=currencies&settings=billing"
               class="ms-1">
                <?php echo $this->user->lang('Configure currency'); ?>
            </a>
        </li>
        <li>
            <?php echo $this->user->lang(
                'Tested with WHMCS 8.x; other versions may be compatible.'
            ); ?>
        </li>
        <li>
            <?php echo $this->user->lang(
                'For assistance contact support@clientexec.com.'
            ); ?>
        </li>
    </ul>

</div>

<div class="mb-4 pb-3 border-bottom">

    <h6 class="fw-semibold mb-2">
        <?php echo $this->user->lang('"Collections" Status Handling'); ?>
    </h6>

    <p class="mb-0 small text-muted">
        <?php echo $this->user->lang(
            'Packages marked "Collections" in WHMCS import as "Active". Invoices marked "Collections" import as "Unpaid". Adjust these statuses before importing if required.'
        ); ?>
    </p>

</div>

<div class="mb-4 pb-3 border-bottom">

    <h6 class="fw-semibold mb-2">
        <?php echo $this->user->lang('PayPal Subscriptions'); ?>
    </h6>

    <p class="small text-muted mb-2">
        <?php echo $this->user->lang(
            'Apply this redirect only when fully migrating to Clientexec.'
        ); ?>
    </p>

    <pre class="bg-light border p-2 small mb-2">
Redirect 301 /modules/gateways/callback/paypal.php /plugins/gateways/paypal/callbackRedirect.php
    </pre>

    <p class="small text-muted mb-0">
        <?php echo $this->user->lang(
            'Adjust paths based on your installation directories.'
        ); ?>
    </p>

</div>

<div class="mb-4">

    <h5 class="fw-semibold mb-3">
        <?php echo $this->user->lang('WHMCS Database Configuration'); ?>
    </h5>

    <input type="hidden" name="importer_name" id="importer_name" value="whmcs" />

    <div class="row g-3">

        <div class="col-md-6">
            <label class="form-label small">
                <?php echo $this->user->lang('Database Host'); ?>
            </label>
            <input type="text" name="db_host" class="form-control form-control-sm">
        </div>

        <div class="col-md-6">
            <label class="form-label small">
                <?php echo $this->user->lang('Database Name'); ?>
            </label>
            <input type="text" name="db_name" class="form-control form-control-sm">
        </div>

        <div class="col-md-6">
            <label class="form-label small">
                <?php echo $this->user->lang('Database Username'); ?>
            </label>
            <input type="text" name="db_username" class="form-control form-control-sm">
        </div>

        <div class="col-md-6">
            <label class="form-label small">
                <?php echo $this->user->lang('Database Password'); ?>
            </label>
            <input type="password" name="db_password" class="form-control form-control-sm">
        </div>

        <div class="col-md-6">
            <label class="form-label small">
                <?php echo $this->user->lang('Database Port'); ?>
            </label>
            <input type="text" name="db_port" class="form-control form-control-sm">
        </div>

        <div class="col-md-6">
            <label class="form-label small">
                <?php echo $this->user->lang('CC Encryption Hash'); ?>
            </label>
            <input type="password" name="cc_encryption_hash" class="form-control form-control-sm">
        </div>

    </div>

</div>


<button class="cm-btns orange mt-2" id="importButton">
    <span><?php echo $this->user->lang("Import"); ?></span>
</button>


<?php if (isset($this->error)) { ?>
<div class="mt-3 text-danger small">
    <?php echo $this->errormessage; ?>
</div>
<?php } ?>


<?php if (isset($this->results)) { ?>
<div class="mt-4 pt-3 border-top">

    <h6 class="fw-semibold mb-2">
        <?php echo $this->user->lang('Import Results'); ?>
    </h6>

    <ul class="mb-0 small">
        <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 } ?>
