<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_miniorange_importexportusers
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
JHtml::_('jquery.framework');
JHtml::_('stylesheet', JUri::base() . 'components/com_miniorange_importexportusers/assets/css/miniorange_importexportusers.css');
JHtml::_('stylesheet', JUri::base() . 'components/com_miniorange_importexportusers/assets/css/bootstrap-select-min.css');
JHtml::_('stylesheet', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');
JHtml::_('stylesheet', JUri::base() . 'components/com_miniorange_importexportusers/assets/css/miniorange_boot.css');
JHtml::_('script', JUri::base() . 'components/com_miniorange_importexportusers/assets/JS/bootstrap.js');
JHtml::_('script', JUri::base() . 'components/com_miniorange_importexportusers/assets/JS/utility.js');
JHtml::_('script', 'https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js');

if (MoImportExportUtility::is_curl_installed() == 0){ ?>
    <p style="color:red;">(Warning: <a href="http://php.net/manual/en/curl.installation.php" target="_blank">PHP CURL extension</a> is not installed or disabled) Please go to Troubleshooting for steps to enable curl.</p>
    <?php
}

$impexp_settings_tab = 'exportsettings';
$active_tab = JFactory::getApplication()->input->get->getArray();

if (isset($active_tab['tab-panel']) && !empty($active_tab['tab-panel'])) {
    $impexp_settings_tab = $active_tab['tab-panel'];
}
?>

<div class="form-horizontal">
    <div class="nav-tab-wrapper mo_idp_nav-tab-wrapper">

        <a id="overview_id"
           class="mo_nav-tab <?php echo $impexp_settings_tab == 'overview' ? 'mo_nav_tab_active' : ''; ?>" href="#overview"
           onclick="add_css_tab('#overview_id');"
           data-toggle="tab">Overview
        </a>

        <a id="export_users"
           class="mo_nav-tab <?php echo $impexp_settings_tab == 'exportsettings' ? 'mo_nav_tab_active' : ''; ?>" href="#export_configuration"
           onclick="add_css_tab('#export_users');"
           data-toggle="tab">Export
        </a>

        <a id="import_users"
           class="mo_nav-tab <?php echo $impexp_settings_tab == 'importsettings' ? 'mo_nav_tab_active' : ''; ?>" href="#import_configuration"
           onclick="add_css_tab('#import_users');"
           data-toggle="tab">Import
        </a>

        <a id="cron_job"
           class="mo_nav-tab <?php echo $impexp_settings_tab == 'cronimport' ? 'mo_nav_tab_active' : ''; ?>" href="#cron_import"
           onclick="add_css_tab('#cron_job');"
           data-toggle="tab">Cron Import
        </a>

        <a id="upgrade_page"
           class="mo_nav-tab <?php echo $impexp_settings_tab == 'license_page' ? 'mo_nav_tab_active' : ''; ?>" href="#licensing_page"
           onclick="add_css_tab('#upgrade_page');"
           data-toggle="tab" style="background-color: orange !important;">Upgrade
        </a>

        <a id="account_tab"
           class="mo_nav-tab <?php echo $impexp_settings_tab == 'account' ? 'mo_nav_tab_active' : ''; ?>" href="#account_setup"
           onclick="add_css_tab('#account_tab');"
           data-toggle="tab">Account Setup
        </a>
    </div>
</div>

<div class="tab-content" id="myTabContent">
    <div id="account_setup" class="tab-pane <?php if ($impexp_settings_tab == 'account') echo 'active'; ?>">

        <?php
        $customer_details = MoImportExportUtility::getCustomerDetails();
        $status = $customer_details['status'];
        $login_status = $customer_details['login_status'];
        $registration_status = $customer_details['registration_status'];
        if ($login_status)
        {
            ?>
            <div class="mo_sync_table_layout_1">
                <div class="mo_sync_table_layout mo_sync_users_container">
                    <?php import_export_users_login_page(); ?>
                </div>
                <div class="mo_sync_table_layout_support_1">
                    <?php support_form(); ?>
                </div>
            </div>
            <?php
        }
        else if ($registration_status == 'MO_OTP_DELIVERED_SUCCESS' || $registration_status == 'MO_OTP_VALIDATION_FAILURE' || $registration_status == 'MO_OTP_DELIVERED_FAILURE')
        {?>
            <div class="mo_sync_table_layout_1">
            <div class="mo_sync_table_layout mo_sync_users_container">
                <?php mo_otp_show_otp_verification(); ?>
            </div>
            <div class="mo_sync_table_layout_support_1">
                <?php support_form(); ?>
            </div>
            </div><?php
        }
        else if (!MoImportExportUtility::is_customer_registered())
        {?>
            <div class="mo_sync_table_layout_1">
            <div class="mo_sync_table_layout mo_sync_users_container">
                <?php mo_usync_local_registration_page(); ?>
            </div>
            <div class="mo_sync_table_layout_support_1">
                <?php support_form(); ?>
            </div>
            </div><?php
        }
        else
        {
            ?>
            <div class="mo_sync_table_layout_1">
                <div class="mo_sync_table_layout mo_sync_users_container">
                    <?php mo_account_page(); ?>
                </div>
                <div class="mo_sync_table_layout_support_1">
                    <?php support_form(); ?>
                </div>
            </div>
            <?php
        }
        ?>
    </div>


    <div id="overview" class="tab-pane <?php if ($impexp_settings_tab == 'overview') echo 'active'; ?>">
        <div class="row-fluid">
            <div class="mo_sync_table_layout_1">
                <div class="mo_sync_table_layout mo_sync_users_container">
                    <?php plugin_overview(); ?>
                </div>
                <div class="mo_sync_table_layout_support_1">
                    <?php support_form(); ?>
                </div>
            </div>
        </div>
    </div>

    <div id="export_configuration" class="tab-pane <?php if ($impexp_settings_tab == 'exportsettings') echo 'active'; ?>">
        <div class="row-fluid">
            <div class="mo_sync_table_layout_1">
                <div class="mo_sync_table_layout mo_sync_users_container">
                    <?php export_configuration(); ?>
                </div>
                <div class="mo_sync_table_layout_support_1">
                    <?php support_form(); ?>
                </div>
            </div>
        </div>
    </div>

    <div id="import_configuration" class="tab-pane <?php if ($impexp_settings_tab == 'importsettings') echo 'active'; ?>">
        <div class="row-fluid">
            <div class="mo_sync_table_layout_1">
                <div class="mo_sync_table_layout mo_sync_users_container">
                    <?php import_configuration(); ?>
                </div>
                <div class="mo_sync_table_layout_support_1">
                    <?php support_form(); ?>
                </div>
            </div>
        </div>
    </div>

    <div id="cron_import" class="tab-pane <?php if ($impexp_settings_tab == 'cronimport') echo 'active'; ?>">
        <div class="row-fluid">
            <div class="mo_sync_table_layout_1">
                <div class="mo_sync_table_layout mo_sync_users_container">
                    <?php cron_import(); ?>
                </div>
                <div class="mo_sync_table_layout_support_1">
                    <?php support_form(); ?>
                </div>
            </div>
        </div>
    </div>

    <div id="licensing_page" class="tab-pane <?php if ($impexp_settings_tab == 'license_page') echo 'active'; ?>">
        <div class="mo_usync_table_layout_1">
            <table style="width:100%;">
                <tr>
                    <td style="width:65%;vertical-align:top;" class="configurationForm">
                        <?php license_page(); ?>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>

<?php

function mo_usync_local_registration_page()
{

    $result = MoImportExportUtility::getCustomerDetails();
    $current_user = JFactory::getUser();
    $admin_email = $result['email'];
    $admin_phone = $result['admin_phone'];

    ?>

    <!--Register with miniOrange-->
    <div class="mo_boot_row  mo_boot_mr-1" id="panel1">
        <div class="mo_boot_col-sm-12">
            <form name="f" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.registerCustomer'); ?>">
                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-5  mo_boot_mt-1">
                        <input type="hidden" name="option1" value="mo_usync_local_register_customer" />
                        <h2>Register with miniOrange</h2>
                    </div>
                    <div class="mo_boot_col-7  mo_boot_mt-1">
                        <input type="button" value="Already registered with miniOrange?" class="mo_boot_btn mo_boot_btn-users_sync" style="float:right" onclick="mo_login_page();"/>
                    </div>
                </div>
                <hr/>
                <div class="mo_boot_row">
                    <div class="mo_boot_col-sm-12">
                        <p style="color: #fa2727">
                            If you face any issues during registraion then you can
                            <a href="https://www.miniorange.com/businessfreetrial" target="_blank"><strong>click here</strong></a>
                            to quick register your account with miniOrange and use the same credentials to login into the plugin.
                        </p>
                    </div>
                </div><br>
                <div id="spregister" class="mo_usync_settings_table">
                    <div class="mo_boot_row" id="spemail">
                        <div class="mo_boot_col-sm-3">
                            <strong>Email<em style="color:#FF0000">*</em>:</strong>
                        </div>
                        <div class="mo_boot_col-sm-8">
                            <?php

                            if ($admin_email == '')
                            {
                                $admin_email = $current_user->email;
                            }
                            ?>
                            <input class="mo_usync_table_textbox mo_boot_form-control" type="email" name="email" style="border: 1px solid #868383 !important;" placeholder="person@example.com" required value="<?php echo $admin_email; ?>" />
                        </div>
                    </div><br>
                    <div class="mo_boot_row" id="sprg_phone">
                        <div class="mo_boot_col-sm-3">
                            <strong>Phone number:</strong>
                        </div>
                        <div class="mo_boot_col-sm-8">
                            <input class="mo_usync_table_textbox mo_boot_form-control" type="tel" id="phone" style="border: 1px solid #868383 !important;" pattern="[\+]\d{11,14}|[\+]\d{1,4}([\s]{0,1})(\d{0}|\d{9,10})" name="phone" title="Phone with country code eg. +1xxxxxxxxxx"  placeholder="Phone with country code eg. +1xxxxxxxxxx" value="<?php echo $admin_phone; ?>" />
                            <p><em><strong>NOTE:</strong>We will call only if you call for support</em></p>
                        </div>
                    </div>
                    <div class="mo_boot_row" id="sprg_passwd">
                        <div class="mo_boot_col-sm-3">
                            <strong>Password<em style="color:#FF0000">*</em>:</strong>
                        </div>
                        <div class="mo_boot_col-sm-8">
                            <input class="mo_usync_table_textbox mo_boot_form-control"  required  type="password" style="border: 1px solid #868383 !important;" name="password" placeholder="Choose your password (Min. length 6)" />
                        </div>
                    </div><br>
                    <div class="mo_boot_row" id="rg_repasswd">
                        <div class="mo_boot_col-sm-3">
                            <strong>Confirm Password<em style="color:#FF0000">*</em>:</strong>
                        </div>
                        <div class="mo_boot_col-sm-8">
                            <input class="mo_usync_table_textbox mo_boot_form-control"  required type="password" style="border: 1px solid #868383 !important;" name="confirmPassword" placeholder="Confirm your password" />
                        </div>
                    </div>
                    <div class="mo_boot_row">
                        <div class="mo_boot_col-sm-12 mo_boot_text-center"><br>
                            <input type="submit" value="Register" class="mo_boot_btn mo_boot_btn-users_sync" />
                        </div>
                    </div>
                </div>
            </form>
            <form name="f" id="customer_login_form" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.customerLoginForm'); ?> ">
            </form>
        </div>
    </div>
    <?php
}

function import_export_users_login_page()
{
    ?>
    <div class="mo_boot_row  mo_boot_mr-1 mo_boot_p-3">
        <div class="mo_boot_col-sm-12">
            <form name="f" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.verifyCustomer'); ?>">
                <div class="mo_boot_row mo_boot_mt-2">
                    <div class="mo_boot_col-sm-12">
                        <input type="hidden" name="option1" value="mo_usync_local_verify_customer" />
                        <h3>Login with miniOrange</h3><hr>
                        <p>
                            Please enter your miniOrange account credentials. If you forgot your password then enter your email and click
                            on <strong>Forgot your password</strong> button. If you are not registered with miniOrange then click on <strong>Back to Registration</strong> button.
                        </p>
                    </div>
                </div>
                <div id="panel1" style="align:center!important;">
                    <div class="mo_boot_row mo_boot_mt-2">
                        <div class="mo_boot_col-sm-2 mo_boot_offset-sm-1">
                            <strong>Email:<em style="color:#FF0000">*</em> </strong>
                        </div>
                        <div class="mo_boot_col-sm-6">
                            <input class="mo_usync_table_textbox mo_boot_form-control" type="email" name="email" style="border: 1px solid #868383 !important;" required placeholder="person@example.com" value="" />
                        </div>
                    </div>
                    <div class="mo_boot_row mo_boot_mt-2">
                        <div class="mo_boot_col-sm-2 mo_boot_offset-sm-1">
                            <strong>Password:<em style="color:#FF0000">*</em> </strong>
                        </div>
                        <div class="mo_boot_col-sm-6">
                            <input class="mo_usync_table_textbox mo_boot_form-control" required type="password" name="password" style="border: 1px solid #868383 !important;" placeholder="Enter your miniOrange password" />
                        </div>
                    </div>
                    <div class="mo_boot_row mo_boot_mt-2">
                        <div class="mo_boot_col-sm-12 mo_boot_text-center">
                            <input type="submit" class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1" value="Login"/>
                            <input type="button" value="Back to Registration" onclick="moCancelForm();" class="mo_boot_btn mo_boot_btn-danger mo_boot_mt-1" />
                            <a href="https://login.xecurify.com/moas/idp/resetpassword" target="_blank"  class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1">Forgot your password?</a>
                        </div>
                    </div>
                </div>
            </form>
            <form id="cancel_form" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.cancelform'); ?>">
                <input type="hidden" name="option1" value="mo_usync_local_cancel" />
            </form>
        </div>
    </div>

    <form method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.cancelform'); ?>"></form>
    <?php
}

/* Show otp verification page*/
function mo_otp_show_otp_verification()
{ ?>

    <div id="panel2" class="mo_boot_p-4">
        <form name="f" method="post" id="otp_form" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.validateOtp'); ?>">
            <div class="mo_boot_row">
                <div class="mo_boot_col-sm-12">
                    <input type="hidden" name="option1" value="mo_usync_local_validate_otp" />
                    <h3>Verify Your Email</h3>
                    <hr>
                </div>
            </div>
            <div class="mo_boot_row">
                <div class="mo_boot_col-sm-2">
                    <strong>Enter OTP:<span style="color:#FF0000">*</span></strong>
                </div>
                <div class="mo_boot_col-sm-6">
                    <input class="mo_boot_form-control" autofocus="true" type="text" name="otp_token" required placeholder="Enter OTP"/>
                </div>
                <div class="mo_boot_col-sm-4">
                    <a style="cursor:pointer;" class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1" onclick="document.getElementById('resend_otp_form').submit();">Resend OTP over Email</a>
                </div>
            </div>
            <div class="mo_boot_row">
                <div class="mo_boot_col-sm-12 mo_boot_text-center"><br>
                    <input type="submit" value="Validate OTP" class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1"/>
                    <input type="button" value="Back" class="mo_boot_btn mo_boot_btn-danger" onclick="moCancelForm();"/>
                </div>
            </div>
        </form>

        <form id="cancel_form" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.cancelform'); ?>">
            <input type="hidden" name="option1" value="mo_usync_local_cancel" />
        </form>

        <form name="f" id="resend_otp_form" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.resendOtp'); ?>">
            <input type="hidden" name="option1" value="mo_usync_local_resend_otp"/>
        </form><hr>

        <div class="mo_boot_row">
            <div class="mo_boot_col-sm-12">
                <h3>I did not recieve any email with OTP. What should I do?</h3>
            </div>
        </div>
        <form id="phone_verification" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.phoneVerification'); ?>">
            <div class="mo_boot_row">
                <div class="mo_boot_col-sm-12">
                    <input type="hidden" name="option1" value="mo_usync_local_phone_verification" />
                    <p>
                        If you can't see the email from miniOrange in your mails, please check your <strong>SPAM Folder</strong>. If you don't see an email even in SPAM folder, verify your identity with our alternate method.<br><br>
                        <strong>Enter your valid phone number here and verify your identity using one time passcode sent to your phone.</strong>
                    </p>
                </div>
            </div>
            <div class="mo_boot_row">
                <div class="mo_boot_col-sm-6">
                    <input class="mo_boot_form-control" required="true" pattern="[\+]\d{1,3}\d{10}" autofocus="true" type="text"
                           name="phone_number" id="phone" placeholder="Enter Phone Number with country code eg. +1xxxxxxxxx" title="Enter phone number without any space or dashes with country code. (Please include country code ex:+91xxxxxxxxxx)"/>
                </div>
                <div class="mo_boot_col-sm-3">
                    <input type="submit" value="Send OTP on Phone" class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1"/>
                </div>
            </div>
        </form>
    </div>


    <script>
        jQuery('#back_btn').click(function () {
            jQuery('#mo_otp_cancel_form').submit();
        });
        jQuery('a[href=#mo_otp_resend_otp_email]').click(function () {
            jQuery('#resend_otp_form').submit();
        });
    </script>
    <?php
}

function mo_account_page()
{
    $result = MoImportExportUtility::getCustomerDetails();
    $email = $result['email'];
    $customerKey = $result['customer_key'];
    $joomlaVersion=MoImportExportUtility::getJoomlaCmsVersion();
    $phpVersion = phpversion();
    $pluginVersion = MoImportExportUtility::GetPluginVersion();

    ?>

    
    <div class="mo_boot_row  mo_boot_mr-1 mo_boot_p-3">
        <div class="mo_boot_col-sm-12">
            <div class="mo_boot_row">
                <h2>Your Profile</h2>
            </div><hr>
             <div class="mo_usync_welcome_message">
                <h4>Thank You for registering with miniOrange</h4>
            </div>
            <table class="table table-striped table-hover table-bordered mo_boot_mt-2">
                <tr>
                    <td><strong>Username/Email</strong></td>
                    <td><?php echo $email; ?></td>
                </tr>
                <tr>
                    <td><strong>Customer ID</strong></td>
				    <td><?php echo $customerKey; ?></td>
                </tr>
                <tr>
                    <td><strong>Joomla Version<</strong></td>
				    <td><?php echo $joomlaVersion; ?></td>
                </tr>
                <tr>
                    <td><strong>Plugin version</strong></td>
                    <td><?php echo $pluginVersion ?></td>
                </tr>
                <tr>
                    <td><strong>PHP version</strong></td>
                    <td><?php echo $phpVersion ?></td>
                </tr>
            </table>
        </div>
        <div class="mo_boot_col-sm-12 mo_boot_text-center" id="sp_proxy_setup">
            <form class="mo_boot_d-inline-block" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.ResetAccount'); ?>" name="reset_useraccount" method="post">
                <input type="button"  value="Remove Account" onclick='submit();' class="mo_boot_btn mo_boot_btn-danger"  /> <br/>
            </form>
        </div>
    </div>
    <?php
}

function plugin_overview()
{
    ?>

    <div id="sp_support_usync" class="">
        <div class="mo_boot_row mo_boot_p-3">
            <div class="mo_boot_col-sm-12">
                <div class="mo_boot_row">
                    <h2>Plugin Overview</h2><hr>
                </div><hr>
            </div>
            <form name="f" method="post" action="index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.pluginoverview" style="width: 100%;"><br>
                <div class="mo_boot_row mo_boot_p-2">
                    <div class="mo_boot_col-12">
                        <p>
                            Joomla Import Export Users plugin allows to move your users from one Joomla site to another Joomla site.
                            This plugin exports and downloads user details in the form of a CSV file. We can also import the users and their details using a CSV file as input.
                        </p>
                        <p style="color:blue;">
                            Your Joomla users can be imported and exported from Joomla 3.x to Joomla 4.x and Joomla 5.x and vice versa. Additionally, you can import users from any other websites or CMS into your Joomla website.
                        </p>
                        <p>
                            Currently you are on the free version and this plugin is only for POC purposes. You can only export the users in the .CSV format using this plugin.
                            If you want to import these users you will require license version of the plugin.
                        </p>
                        <p>Our license is instance based.
                            A Joomla instance refers to a single installation of a Joomla site. It refers to each individual website where the Plugin is active.
                            In the case of multisite/subsite Joomla setup, each site with a separate database will be counted as a single instance.
                            We provide deep discount on 2nd instance onwards.
                        </p><hr>

                        <details>
                            <summary class="mo_users_summary">How does this plugin (Extension) works?</summary>
                            <p>The Import-Export Joomla Users Plugin takes CSV file as input. You must create a CSV file and upload it. This is to match each field of CSV file to the field of particular user fields, otherwise, Admin needs to input manually. For example, the username field gets mapped to the Username. For the plugin to work correctly, you must map the headers of all the columns correctly and you must ensure that all of the fields you enter are in the correct format.
                                You can create the CSV from scratch or you can export the users to get the format of the CSV. You can use a spreadsheet program, such as Microsoft Excel, OpenOffice, Libre Office, or Google Spreadsheets for creating and modifying the CSV file. Save this file in UTF-8 encoding with extension .CSV. After entering all details about users in a spreadsheet, you can bulk import users to Joomla. With this plugin, you can also export and download user details as a CSV file.
                            </p>
                        </details><br>

                        <h2>DOCUMENTATION:</h2>
                        <p>
                            Click <a href="https://plugins.miniorange.com/joomla-import-export-users" target="_blank">here</a> to follow the step by step setup guide to configure the plugin.
                        </p>
                    </div>

                </div>
            </form>
        </div>
    </div>
    <?php

}

function export_configuration()
{
    $result = MoImportExportUtility::getCustomerDetails();
    $disabled = 'disabled';
    $enable_export_users = isset($result['enable_export_users']) ? $result['$nable_export_users'] : '';
    $groups = MoImportExportUtility::loadGroups();
    ?>

    <div id="sp_support_usync" class="">
        <div class="mo_boot_row mo_boot_p-3">
            <div class="mo_boot_col-sm-12">
                <div class="mo_boot_row">
                    <h2>Export Users <sup><a href="https://plugins.miniorange.com/joomla-import-export-users#step2" target="_blank" style="font-size:20px;color:black"><div class="fa fa-question-circle-o mo_tooltip"><span class="mo_tooltiptext" >You can refer the guide for setup.</span></div></a></sup></h2><hr>
                </div><hr>
            </div>
            <form name="f" method="post" action="index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.exportUsers" style="width: 100%;"><br>
           
                <div class="mo_boot_col-12">
                    <div class="mo_boot_row">
                        <div class="mo_boot_col-9"> 
                            1) Click on the button to Export groups/roles in the CSV format.
                        </div>
                        <div class="mo_boot_col-3"> 
                        <input type="submit" name="export_groups" value="Export Groups" style="margin-bottom:1%;margin-left: 1%;" class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1"/>
                        </div>
                    </div>
                </div>
                <div class="mo_boot_col-12 mo_boot_mt-3">
                    <div class="mo_boot_row">
                        <div class="mo_boot_col-9"> 
                           2) Click on the button to Export Users in the CSV format
                            <input type="hidden" name="export_user_profile" value="false">
                        </div>
                        <div class="mo_boot_col-3"> 
                            <input type="submit" name="export_users" value="Export Users" style="margin-bottom:1%;margin-left: 1%;" class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1"/>
                        </div>
                    </div>
                </div>
                <div class="mo_boot_col-12 mo_boot_mt-3">
                    <div class="mo_boot_row">
                        <div class="mo_boot_col-9"> 
                           3) Click on the button to Export Users with User Profile information in the CSV format.
                            <input type="hidden" name="export_user_profile" value="true">
                        </div>
                        <div class="mo_boot_col-3"> 
                            <input type="submit" name="export_users_profile" value="Export Users with Profile" style="margin-bottom:1%;margin-left: 1%;" class="mo_boot_btn mo_boot_btn-users_sync mo_boot_mt-1" disabled />
                        </div>
                    </div>
                </div>
                <div class="mo_boot_row mo_boot_p-2">
                    <div class="mo_boot_col-12">
                        <details>
                            <summary class="mo_users_summary">Role based Export
                                <sup><?php echo $disabled == 'disabled' ? '<a href=' . JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page') . '><strong style="color: red">&nbsp;&nbsp;[Premium features]</strong></a>' : ''; ?></sup>
                            </summary>
                            <br><input type="checkbox" disabled/>&emsp;Enable Role based Export<br><br>
                            <strong>Note:</strong> If you want to allow only specific role/group of users to export in CSV format, then enable the below checkbox and select appropriate Role.<br><?php
                            foreach ($groups as $key => $value) {
                                if ($value['title'] != 'Public' && $value['title'] != 'Guest') {
                                    echo '<br><input type="checkbox" name="role_based_tfa_' . str_replace(' ', '_', $value['title']) . '"' . $disabled . '  />&emsp;' . $value['title'];
                                }
                            } ?><br><br>
                        </details>

                        <details>
                            <summary class="mo_users_summary">Column based Export
                                <sup><?php echo $disabled == 'disabled' ? '<a href=' . JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page') . '><strong style="color: red">&nbsp;&nbsp;[Premium features]</strong></a>' : ''; ?></sup>
                            </summary><br>
                            <input type="checkbox" disabled/>&emsp;Enable Column based Export<br><br>
                            <textarea name="" style="margin-top:10px;width:100%;font-size:14px;border: 1px solid;" rows="5" placeholder="Enter semicolon(;) separated column names" disabled></textarea>
                            <strong>Note:</strong>You can use this field to set which columns must be exported and in which order.
                            If you leave it empty, all columns will be exported.
                            Use a list of fields separated by semicolon(;), <strong>for example: name;username;email</strong><br>
                        </details>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <?php
}

function import_configuration()
{
    $result = MoImportExportUtility::getCustomerDetails();
    $disabled = 'disabled';
    $groups = MoImportExportUtility::loadGroups();
    ?>
    <div id="sp_support_usync" class="">
        <div class="mo_boot_row mo_boot_p-3">
            <div class="mo_boot_col-sm-12">
                <div class="mo_boot_row">
                    <h2>Import Users / Groups <sup><a href="https://plugins.miniorange.com/joomla-import-export-users#step3" target="_blank" style="font-size:20px;color:black"><div class="fa fa-question-circle-o mo_tooltip"><span class="mo_tooltiptext" >You can refer the guide for setup.</span></div></a></sup></h2>
                    <sup> <a href=<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page'); ?>> <h5 style="color: red">&nbsp;&nbsp;[Premium features]</h5></a></sup>
                </div><hr>
            </div>

            <h3 style="color: #d9534f;">Step 1: Import Groups/Roles</h3>
            <p><b>Note:</b> If you have any custom groups other than Joomla's default groups, first export those groups from <b>Export</b> tab by clicking on <b>Export Groups/Roles</b> button then Import those Groups/Roles here. After that you can import the users in the step 2.</p>
            <div class="mo_boot_col-12 mo_boot_mt-1">
                <div class="mo_boot_row mo_boot_mt-2">
                    <div id="mo_sync_upload_container" class="mo_sync_upload_container mo_tooltip" >
                        <input type="file" style="height: 46px !important;" <?php echo $disabled; ?> class="mo_sync_upload_file_btn mo_sync_btn mo_sync_btn_primary mo_sync_btn_radius mo_sync_plupload_browse_button" name="csv_import_file_groups" />
                        <input type="submit"  style="height: 46px !important;"  <?php echo $disabled; ?> class=" mo_boot_btn mo_boot_btn-users_sync" name="fetch_groups_details" method="post" value="Import Groups"/>
                        <span class="mo_tooltiptext" >This is feature is avaiable in our premium plugin.</span>
                    </div> 
                </div>
            </div>
            <div class="mo_boot_mt-5">
                <h3 style="color: #d9534f;">Step 2: Import Users</h3>
                <p><b>Note:</b> If you have any custom groups other than Joomla's default groups, first export those groups from <b>Export tab</b> by clicking on <b>Export Groups/Roles</b> button then Import those Groups/Roles above. After that you can import the users with or without user profile information using following options.</p>
            </div>
            <div class="mo_boot_col-sm-12 mo_boot_mt-1">
                <strong> A) Import Users Without User Profile Information </strong>
                <div class="mo_boot_row mo_boot_mt-2">
                    <div id="mo_sync_upload_container" class="mo_sync_upload_container mo_tooltip" >
                        <input type="file" style="height: 46px !important;" <?php echo $disabled; ?> class="mo_sync_btn mo_sync_btn_primary mo_sync_btn_radius mo_sync_plupload_browse_button" name="csv_import_file"/>
                        <input type="hidden" name="import_user_profile" value="false">
                        <input type="submit" style="height: 46px !important;"  <?php echo $disabled; ?> class="mo_boot_btn mo_boot_btn-users_sync" name="fetch_file_details" method="post" value="Import Users"/>
                        <span class="mo_tooltiptext" >This is feature is avaiable in our premium plugin.</span>
                    </div>
                </div>
            </div>

            <div class="mo_boot_col-sm-12 mo_boot_mt-2">
                <strong>B) Import Users With User Profile Information</strong>
                <div class="mo_boot_row mo_boot_mt-2">
                    <div id="mo_sync_upload_container" class="mo_sync_upload_container mo_tooltip" >
                        <input type="file" style="height: 46px !important;" <?php echo $disabled; ?> class=" mo_sync_btn mo_sync_btn_primary mo_sync_btn_radius mo_sync_plupload_browse_button" name="csv_import_file" />
                        <input type="hidden" name="import_user_profile" value="true">
                        <input type="submit"  style="height: 46px !important;"  <?php echo $disabled; ?> class=" mo_boot_btn mo_boot_btn-users_sync" name="fetch_user_profile_file_details" method="post" value="Import Users with Profile"/>
                        <span class="mo_tooltiptext" >This is feature is avaiable in our premium plugin.</span>
                    </div>
                </div>
            </div>



            <div class="mo_boot_row mo_boot_mt-3" style="width: 100%">
                <div class="mo_boot_col-lg-12 mo_boot_mt-1">
                    <details>
                        <summary class="mo_users_summary">Role based Import
                            <sup><a href=' <?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page'); ?>'><strong style="color: red">&nbsp;&nbsp;[Premium features]</strong></a></sup>
                        </summary><br>
                        <input type="checkbox" disabled/>&emsp;Enable Role based Import<br><br>
                        <strong>Note:</strong> If you want to allow only specific role/group of users to import in to Joomla, then enable the below checkbox and select appropriate Role.<br><?php
                        foreach ($groups as $key => $value) {
                            if ($value['title'] != 'Public' && $value['title'] != 'Guest') {
                                echo '<br><input type="checkbox" name="role_based_tfa_' . str_replace(' ', '_', $value['title']) . '"' . $disabled . '  />&emsp;' . $value['title'];
                            }
                        } ?><br><br>
                    </details>

                    <details>
                        <summary class="mo_users_summary">Column based Import
                            <sup><a href='<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page'); ?>'><strong style="color: red">&nbsp;&nbsp;[Premium features]</strong></a></sup>
                        </summary><br>
                        <input type="checkbox" disabled/>&emsp;Enable Column based Import<br><br>
                        <textarea name="" style="margin-top:10px;width:100%;font-size:14px;border: 1px solid;" rows="5" placeholder="Enter semicolon(;) separated column names" disabled></textarea>
                        <strong>Note:</strong>You can use this field to set which columns must be imported and in which order.
                        If you leave it empty, all columns will be imported.
                        Use a list of fields separated by semicolon(;), <strong>for example: name;username;email</strong><br>
                    </details>

                    <details>
                        <summary class="mo_users_summary">UPDATE USERS
                            <sup><a href=<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page') ?>><strong style="color: red">&nbsp;&nbsp;[Premium features]</strong></a></sup>
                        </summary><br>
                        <input type="checkbox" disabled/>&emsp;Enable Update Users<br><br>
                        <input type="checkbox" disabled/>&emsp;Delete users that are not present in the CSV?<br><br>
                        <div class="mo_boot_row mo_boot_mt-3">
                            <div class="mo_boot_col-sm-4">
                                <strong>Update roles for existing users?</strong>
                            </div>
                            <div class="mo_boot_col-sm-8">
                                <select class="mo_boot_form-control" style="border: 1px solid #868383 !important;">
                                    <option value="dont_update_email">No</option>
                                    <option value="update_and_override_roles">Yes, update and override existing roles</option>
                                    <option value="add_new_keep_old_roles">Yes, add new roles and dont update existing ones</option>
                                </select>
                            </div>
                        </div><br>
                    </details><br><br>

                    <div class="mo_boot_col-sm-12">
                        <div class="mo_boot_row">
                            <h3>Send Email</h3><sup><a href=<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page'); ?>><h4 style="color: red">&nbsp;&nbsp;[Premium features]</h4></a></sup><hr>
                        </div>
                        <input type="checkbox" name="send_email_after_create" value="1" disabled >&emsp;Do you wish to send a mail from this plugin with credentials and other data?<br>
                        <input type="checkbox" name="send_email_after_update" value="1" disabled>&emsp;Do you wish to send a mail to users that are being updated? (not only to the one which are being created)
                    </div><br>

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

function cron_import()
{
    $disabled = 'disabled';
    ?>
    <div class="mo_boot_row mo_boot_mr-1  mo_boot_p-3 mo_boot_px-2" id="tabhead">
        <div class="mo_boot_col-sm-12">
            <form action="" method="post" name="" enctype="multipart/form-data">
                <div class="mo_boot_col-sm-12">
                    <div class="mo_boot_row">
                        <h2>Execute an import of users periodically <sup><a href="https://plugins.miniorange.com/joomla-import-export-users#step4" target="_blank" style="font-size:20px;color:black"><div class="fa fa-question-circle-o mo_tooltip"><span class="mo_tooltiptext" >You can refer the guide for setup.</span></div></a></sup></h2>
                        <sup><?php echo $disabled == 'disabled' ? '<a href=' . JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=license_page') . '><h4 style="color: red">&nbsp;&nbsp;[Premium features]</h4></a>' : ''; ?></sup>
                    </div><hr>
                </div>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-sm-5">
                        <strong>Activate periodically import?</strong>
                    </div>
                    <div class="mo_boot_col-sm-7">
                        <input type="checkbox" disabled>
                    </div>
                </div>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-sm-5">
                        <strong>Path of file that to be imported</strong>
                    </div>
                    <div class="mo_boot_col-sm-7">
                        <input class="mo_boot_form-control" type="url" disabled placeholder="Path of file that are going to be imported	" name="" style="border: 1px solid #868383 !important;"/>
                    </div>
                </div>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-sm-5">
                        <strong>Period</strong>
                    </div>
                    <div class="mo_boot_col-sm-7">
                        <select class="mo_boot_form-control" style="border: 1px solid #868383 !important;">
                            <option value="hourly">hourly</option>
                            <option value="daily">daily</option>
                            <option value="weekly">weekly</option>
                            <option value="monthly">monthly</option>
                        </select>
                        <strong>Note: </strong>How often the event should reoccur?
                    </div>
                </div>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-sm-5">
                        <strong>Send mail when using periodically import?</strong>
                    </div>
                    <div class="mo_boot_col-sm-7">
                        <input type="checkbox" disabled>
                    </div>
                </div>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-sm-5">
                        <strong>Send mail also to users that are being updated?</strong>
                    </div>
                    <div class="mo_boot_col-sm-7">
                        <input type="checkbox" disabled>
                    </div>
                </div><br>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-lg-12 mo_boot_mt-1">
                        <h2>Users not present in CSV file</h2><hr>
                    </div>
                </div>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-sm-5">
                        <strong>Delete users that are not present in the CSV?</strong>
                    </div>
                    <div class="mo_boot_col-sm-7">
                        <input type="checkbox" disabled>
                    </div>
                </div>

                <div class="mo_boot_row mo_boot_mt-3">
                    <div class="mo_boot_col-sm-5">
                        <strong>Change role of users that are not present in the CSV?</strong>
                    </div>
                    <div class="mo_boot_col-sm-7">
                        <input type="checkbox" disabled>&emsp;<strong>Note: </strong>After import users which is not present in the CSV and can be changed to a different role.
                    </div>
                </div>

                <div class="mo_boot_row mo_boot_mt-5">
                    <div class="mo_boot_col-sm-12 mo_boot_text-center">
                        <input type="submit" class="mo_boot_btn mo_boot_btn-users_sync" value="Save Cron Options" disabled/>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <?php
}

function license_page()
{
    $useremail = MoImportExportUtility::getCustomerDetails();
    $user_email = isset($useremail['email']) ? $useremail['email'] : "";
    if (isset($useremail)) $user_email = $useremail['email'];
    else $user_email = "xyz";

    ?>

    <div id="myModal" class="TC_modal">
        <div class="TC_modal-content" style="width: 40%!important;">
            <span class="TC_modal_close" onclick="hidemodal()" >&times;</span><br><br>
            <div class=" mo_boot_text-center">
                <p>
                    You Need to Login / Register in <strong>My Account</strong> tab to Upgrade your License
                </p><br><br>
                <a href="<?php echo JURI::base()?>index.php?option=com_miniorange_importexportusers&view=accountsetup&tab-panel=account" class="mo_boot_btn mo_boot_btn-primary">LOGIN / REGISTER</a>
            </div>
        </div>
    </div>

    <div class="mo_boot_row mo_boot_ml-4 mo_boot_mr-4 mo_boot_mb-4">
        <div class="tab-content">
            <div class="mo_boot_col-sm-12" style="border:2px solid blue;background:white;box-sizing:border-box;">
                <div id="licensing_plans">
                    <div class="tab-pane active" style="background-color:#ecf2f2;" id="license_content">
                        <div class="cd-pricing-container cd-has-margins"><br>
                            <ul class="cd-pricing-list cd-bounce-invert" >
                                <li class="cd-black" >
                                    <ul class="cd-pricing-wrapper">
                                        <li id="singlesite_tab" data-type="singlesite" class="mosslp is-visible cd-singlesite" style="width: 100%">
                                            <header class="cd-pricing-header">
                                                <h2 style="margin-bottom: 10px" >Free<br/></h2><span class="mo_usync_plan_description"><strong>(EXPORT USERS)</strong></span>
                                            </header>
                                            <br><br>
                                            <div style="text-align:center" >
                                                <span id="plus_total_price" style="font-weight: bolder;font-size: xx-large;color:black">$0*</span><br><span class="mo_usync_note"></span> <br/>
                                            </div>
                                            <footer class="cd-pricing-footer" ><br>
                                                <?php
                                                echo '<a target="" class="cd-select" style="font-size: 85.5%; cursor: pointer;width:100%;border:none;height:70px;background-color: #0c1866 !important;"><h4 style="color: white;">ACTIVE PLAN</h4></a>';
                                                ?>
                                            </footer><br>
                                            <div class="cd-pricing-body">
                                                <ul class="cd-pricing-features">
                                                    <li class="mo_pricing_list">&#9989;&emsp;Unlimited users export</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Role Based Export</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Column Based Export</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Unlimited users Import</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Role Based Import</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Column Based Import</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Update Users while Importing with CSV</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Update Roles for existing users</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Send a mail with credentials and other data after new user created</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Send a mail to users that are being updated</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Cron/Periodical Import</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Send mail when using periodically import</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Send mail also to users that are being periodically updated</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Delete users that are not present in the CSV</li>
                                                    <li class="mo_pricing_list">&#10060;&emsp;Change role of users that are not present in the CSV</li>
                                                </ul>
                                            </div>
                                        </li>
                                    </ul>
                                </li>
                                <li class="cd-black" >
                                    <ul class="cd-pricing-wrapper">
                                        <li id="singlesite_tab" data-type="singlesite" class="mosslp is-visible" style="height=600px; width: 100%; left: 30%; ">

                                            <header class="cd-pricing-header">
                                                <h2 style="margin-bottom: 10px">Premium<br/></h2><span class="mo_usync_plan_description"><strong>(IMPORT / EXPORT USERS)</strong></span>
                                            </header> 
                                            
                                            <div class="mo_boot_col-12">
                                                <div class="mo_idp_plans">
                                                    <div class="mo_boot_row mo_boot_text-center">
                                                        <div class="mo_boot_col-6" style="color:#0a2051;font-size:22px">
                                                            <strong>Half Yearly</strong>
                                                        </div>
                                                        <div class="mo_boot_col-6" style="color:#0a2051;font-size:22px">
                                                            <strong>Yearly</strong>
                                                        </div>
                                                    </div>
                                                </div><br>
                                            </div>
                                            <div class="mo_boot_mt-2 mo_idp_price_slab_100" id="mo_idp_price_slab1_100">
                                                <div class="mo_boot_row mo_boot_text-center">
                                                    <div class="mo_boot_col-6">
                                                        <span class="price-value">
                                                            <span id="plus_total_price" style="font-weight: bolder;font-size: xx-large;color:black">$99*</span><br>
                                                        </span>
                                                    </div>
                                                    <div class="mo_boot_col-6">
                                                        <span class="price-value">
                                                            <span id="plus_total_price" style="font-weight: bolder;font-size: xx-large;color:black">$149*</span><br>
                                                        </span>
                                                    </div>
                                                </div><br>
                                            </div>
                                            <footer class="cd-pricing-footer mo_boot_mt-2">
                                                <?php
                                                if (!MoImportExportUtility::is_customer_registered())
                                                {
                                                    echo '<button class="cd-select" style="font-size: 85.5%; cursor: pointer;width:100%;border:none;height:70px" onclick="showmodal()"><h4 style="color:white">UPGRADE NOW</h4></button>';
                                                }
                                                else
                                                {
                                                    $redirect1= "https://login.xecurify.com/moas/login?username=" . $user_email . "&redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=joomla_import_export_premium_plan";
                                                    echo '<a target="_blank" class="cd-select" style="font-size: 85.5%; cursor: pointer;width:100%;border:none;height:70px;padding:17px;"  href="'.$redirect1.'" ><h4 style="color:white">UPGRADE NOW</h4></a>';
                                                }
                                                ?>

                                            </footer><br>
                                            <div class="cd-pricing-body">
                                                <ul class="cd-pricing-features">
                                                    <li class="mo_pricing_list">&#9989;&emsp;Unlimited users export</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Role Based Export</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Column Based Export</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Unlimited users Import</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Role Based Import</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Column Based Import</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Update Users while Importing with CSV</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Update Roles for existing users</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Send a mail with credentials and other data after new user created</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Send a mail to users that are being updated</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Cron/Periodical Import</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Send mail when using periodically import</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Send mail also to users that are being periodically updated</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Delete users that are not present in the CSV</li>
                                                    <li class="mo_pricing_list">&#9989;&emsp;Change role of users that are not present in the CSV</li>
                                                </ul>
                                            </div>
                                        </li>
                                    </ul>
                                </li>
                            </ul> 
                        </div> 
                    </div><br>
                </div>
            </div>

            <!--We will uncomment this code once we will create the plan for this-->
            <div style="border:2px solid blue;background:white;box-sizing:border-box; padding-top: 10px;margin-top:20px;" id="upgrade-steps">
                <div  style="padding-top: 1px;">
                    <h2 style="text-align:center">HOW TO UPGRADE TO PREMIUM</h2>
                </div> <hr>
                <section   id="section-steps" >
                    <div class="mo_boot_col-sm-12 mo_boot_row ">
                        <div class=" mo_boot_col-sm-6 works-step">
                            <div><strong>1</strong></div>
                            <p>
                                Click on <strong><em>Upgrade Now</em></strong> button for required license version and you will be redirected to <span stye="margin-left:10px"></span> miniOrange login console.
                            </p>
                        </div>
                        <div class="mo_boot_col-sm-6 works-step">
                            <div><strong>4</strong></div>
                            <p>
                                You can download the license version plugin from the <strong><em>View License > Releases and Downloads</em></strong> section on the miniOrange console.
                            </p>
                        </div>
                    </div>
                    <div class="mo_boot_col-sm-12 mo_boot_row ">
                        <div class=" mo_boot_col-sm-6 works-step">
                            <div><strong>2</strong></div>
                            <p>
                                Enter your miniOrange account credentials. Once you have successfuly logged in, you will be redirected towards the payment page.
                            </p>
                        </div>
                        <div class="mo_boot_col-sm-6 works-step">
                            <div><strong>5</strong></div>
                            <p>
                                From the JOOMLA admin dashboard, uninstall the plugin currently installed.
                            </p>
                        </div>
                    </div>

                    <div class="mo_boot_col-sm-12 mo_boot_row ">
                        <div class="mo_boot_col-sm-6 works-step">
                            <div><strong>3</strong></div>
                            <p>
                                Enter your card details and proceed for payment. On successful payment completion, the license version plugin will be available to download.
                            </p>
                        </div>
                        <div class=" mo_boot_col-sm-6 works-step">
                            <div><strong>6</strong></div>
                            <p>
                                Now install the downloaded license version plugin and enable it.
                                After enabling the license version plugin, login using the account which you have used for the purchase of license version plugin.<br> <br>
                            </p>
                        </div>
                    </div>
                </section>
            </div>

            <div style="border:2px solid blue;background:white;box-sizing:border-box; padding-top: 10px;margin-top:20px;" >
                <h2 style="text-align:center">LICENSING POLICY</h2><hr>
                <div style="margin-left: 33px;">
                    <h4>* This is the price for 1 instance.</h4>
                    <br>
                    <p>We will setup a Conference Call / Gotomeeting and do end to end configuration of the plugin. We provide services to do the configuration on your behalf.</p>
                    <p>If you have any doubts regarding the licensing plans, you can email us at <a href="mailto:joomlasupport@xecurify.com">joomlasupport@xecurify.com</a>.</p>
                    <h3>Return Policy -</h3>
                    <p>If the licensed plugin you purchased is not working as advertised and you’ve attempted to resolve any feature issues with our support team, which couldn't get resolved,
                        we will refund the whole amount. If the request for issue resolution is made within 10 days of the purchase, the issue will be resolved within the period stated by the team.
                        <br><br><strong>Note that this policy does not cover the following cases:</strong>
                    <li>1. Change in mind or change in requirements after purchase.</li>
                    <li>2. Infrastructure issues do not allow the functionality to work.</li>
                    </p><br>
                </div>
            </div>
            <div  id="payment-method"  style="border:2px solid blue;background:white;box-sizing:border-box; padding-top: 10px;margin-top:20px;" >
                <h2 style="text-align:center">ACCEPTED PAYMENT METHODS</h2><hr>
                <section style="height: 350px;" >
                    <br>
                    <div class="mo_boot_col-sm-12 mo_boot_row">

                        <div class="mo_boot_col-sm-6">
                            <div class="plan-box">
                                <div style="background-color:white; border-radius:10px; ">
                                    <em style="font-size:30px;" class="fa fa-cc-amex" aria-hidden="true"></em>
                                    <em style="font-size:30px;" class="fa fa-cc-visa" aria-hidden="true"></em>
                                    <em style="font-size:30px;" class="fa fa-cc-mastercard" aria-hidden="true"></em>
                                </div>
                                <div >
                                    If the payment is made through Credit Card/International Debit Card, the license will be created automatically once the payment is completed.
                                </div>
                            </div>
                        </div>
                      
                        <div class="mo_boot_col-sm-6">
                            <div class="plan-box">
                                <div style="background-color:white; border-radius:10px; ">
                                    <img class="payment-images card-image" src="" alt="">
                                    <em style="font-size:30px;" class="fa fa-university" aria-hidden="true"><span style="font-size: 20px;font-weight:500;">&nbsp;&nbsp;Bank Transfer</span></em>

                                </div>
                                <div>
                                    If you want to use bank transfer for the payment then contact us at <strong><em><span>info@xecurify.com</span></em></strong>  so that we can provide you the bank details.
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="row">
                        <p style="margin-top:20px;font-size:16px;text-align:center">
                            <span style="font-weight:500;"> Note :</span> Once you have paid through Net Banking, please inform us so that we can confirm and update your license.
                        </p>
                    </div>
                </section>
            </div>
        </div>
    </div>
    <?php
}

function support_form()
{
    $current_user = JFactory::getUser();
    $result       = MoImportExportUtility::getCustomerDetails();
    $admin_email  = isset($result['email']) ? $result['email'] : '';
    $admin_phone  = isset($result['admin_phone']) ? $result['admin_phone'] : '';
    if($admin_email == '')
        $admin_email = $current_user->email;
    ?>
    <div id="sp_support_usync" class="">
        <div class="mo_boot_row mo_boot_p-3">
            <div class="mo_boot_col-sm-12">
                <div class="mo_boot_row">
                    <h3>Feature Request (24*7 Support)</h3>
                </div><hr>
            </div>
            <div class="mo_boot_col-sm-12">
                <form  name="f" method="post" action="<?php echo JRoute::_('index.php?option=com_miniorange_importexportusers&view=accountsetup&task=accountsetup.contactUs');?>">
                    <div class="mo_boot_col-sm-12">
                        <div class="mo_boot_row">
                            <div class="mo_boot_col-sm-2">
                                <img src="<?php echo JURI::base();?>/components/com_miniorange_importexportusers/assets/images/phone.svg" width="40" height="40"  alt="Phone Image">
                            </div>
                            <div class="mo_boot_col-sm-10">
                                <p><strong>&emsp;Need any help? Just give us a call at <span style="color:red">+1 978 658 9387</span></strong></p><br>
                            </div>
                            <p>We can help you with configuring your Identity Provider. Just send us a query and we will get back to you soon.</p>
                        </div>
                    </div>
                    <div class="mo_boot_row mo_boot_text-center">
                        <div class="mo_boot_col-sm-12">
                            <input style="border: 1px solid #868383 !important;" type="email" class="mo_usync_table_textbox mo_boot_form-control" name="query_email" value="<?php echo $admin_email; ?>" placeholder="Enter your email" required />
                        </div>
                        <div class="mo_boot_col-sm-12"><br>
                            <textarea  name="query_support" class="mo_boot_form-text-control" style="border-radius:4px;resize: vertical;width:100%; border: 1px solid #868383 !important;" cols="52" rows="5" required placeholder="Write your query here"></textarea>
                        </div>
                    </div>
                    <div class="mo_boot_row mo_boot_text-center">
                        <div class="mo_boot_col-sm-12">
                            <input type="hidden" name="option1" value="mo_usync_login_send_query"/><br>
                            <input type="submit" name="send_query" value="Submit Query" class="mo_boot_btn mo_boot_btn-users_sync" style="margin-top:5px"/>
                        </div>
                    </div><hr>
                    <div class="mo_boot_row">
                        <div class="mo_boot_col-sm-12">
                            <p><br>If you want custom features in the plugin, just drop an email to <a style="word-wrap:break-word!important;" href="mailto:joomlasupport@xecurify.com"> joomlasupport@xecurify.com</a> </p>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <?php
}

?>
