<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<input type="hidden" id="connectToServer" value="<?php echo esc_html(wp_create_nonce('connect_to_server')); ?>">

<div class="transferito__three-columns">
    <div class="transferito__column transferito__navigation-column">
        <?php
            $data['sidebarNavigation'] = [
                'destinationURL'        => 'completed',
                'connectToServer'       => 'active',
                'emptyItem1'            => 'disabled',
                'emptyItem2'            => 'disabled',
                'emptyItem3'            => 'disabled'
            ];
            include getTransferitoViewPath('parts/migration/navigation');
        ?>

    </div>
    <div id="connectToServerScreen" class="transferito__column transferito__main-column">
        <div class="transferito-text__h1">Connect to Destination Server</div>
        <div class="transferito__content-container">

            <div class="transferito-connect-to-server">

                <div class="transferito-connect-to-server__verification">

                    <div id="destinationServerCheckStart" class="transferito-connect-to-server__verification-instructions">
                        <div class="transferito-connect-to-server__main-container transferito-connect-to-server__main-container--border">
                            <div class="transferito-connect-to-server__text-container">
                                <div class="transferito-connect-to-server__title transferito-text__p1--bold">
                                    1. Download the verification file
                                </div>
                                <div class="transferito-connect-to-server__text transferito-text__small">
                                    The verification file allows us to connect to your destination server
                                </div>
                            </div>
                            <div class="transferito-connect-to-server__button-container">
                                <button id="downloadConnectionFile" class="transferito-button transferito-button__primary transferito-button--small transferito__download-verification-file">DOWNLOAD FILE</button>
                            </div>
                        </div>

                        <div class="transferito-connect-to-server__main-container">
                            <div class="transferito-connect-to-server__text-container">
                                <div class="transferito-connect-to-server__title transferito-text__p1--bold">
                                    2. Upload the verification file
                                </div>
                                <div class="transferito-connect-to-server__text transferito-text__small">
                                    To the root directory for <span class="transferito-connect-to-server__text--bold-underlined"><?php echo esc_html($data['url']); ?></span>
                                </div>
                            </div>
                            <div class="transferito-connect-to-server__button-container">
                                <button
                                    id="helpUploadVerificationFile"
                                    data-transferito-modal="helpConnectingToYourFTPServer"
                                    class="transferito-button transferito-button__primary--blue transferito-button--small transferito__get-upload-help transferito-open-modal">HELP UPLOADING?</button>
                            </div>
                        </div>
                    </div>

                    <div id="destinationServerConnectionCheckInProgress" class="transferito-connect-to-server__verification-checking transferito__hide-element">
                        <?php
                            $data = [
                                'removeOneColumnClasses'    => true,
                                'mainMessage'               => 'We\'ll wait for you to upload verification file',
                                'secondaryMessage'          => 'You\'ll be able to proceed when your file has been uploaded',
                            ];
                            include getTransferitoViewPath('parts/loading');
                        ?>
                    </div>

                    <div id="destinationServerCheckCompletion" class="transferito-connect-to-server__verification-complete transferito__hide-element">
                        <div class="transferito-navigation__item-icon ">
                            <div class="transferito-icon transferito-icon--completed"></div>
                        </div>
                        <div class="transferito-directory-selection__check-text">We have successfully connected to your Destination Server</div>
                    </div>

                    <div id="destinationServerCheckFailure" class="transferito-connect-to-server__verification-complete transferito__hide-element">
                        <div class="transferito-migration-progress__step-icon">
                            <div class="transferito-icon transferito-icon--exclamation-mark"></div>
                        </div>
                        <div class="transferito-directory-selection__check-text transferito-connect-to-server__text--no-added-padding">We have failed to process your Download Request - Please try again shortly</div>
                    </div>
                </div>


                <div class="transferito-migration-method__action-buttons">
                    <button id="routeToDestinationURL" data-screen-route="destinationURL" class="transferito-button transferito-button__secondary transferito-button--small transferito__screen-routing">BACK</button>
                    <button id="proceedAfterDestinationServerConnection" class="transferito-button transferito-button__primary transferito-button--small transferito__proceed-to_database-details" disabled>CONTINUE</button>
                </div>

            </div>

        </div>
    </div>

    <div id="ConnectToServerProTip" class="transferito__column transferito__pro-tip-column">
        <?php
            $data = [
                'secondaryText'  => [
                    'text' => 'To use connect to your server, you will need the following',
                    'items' => [
                        'Access to your site\'s root directory',
                    ]
                ],
                'textBox' => [
                    "content" => "Need help with connecting to your Destination Server?",
                    "link" => [
                        "anchorText" => "Click here, to watch a video on how to connect to your Destination Server",
                        "modalName" => "helpConnectingToYourFTPServer"
                    ]
                ]
            ];
            include getTransferitoViewPath('parts/migration/pro-tip');
        ?>
    </div>
</div>


<div id="helpConnectingToYourFTPServer" class="transferito__hide-element">
    <?php
        $data = [
            'name'              => 'Connect to Your Destination Server',
            'title'             => 'Connect to Your Destination Server',
            'mainContent'       => 'This video tutorial will give you an overview on how to connect to Your Destination Server.',
            'videoID'           => 'DXU8hIln3Sw',
        ];
        include getTransferitoViewPath('parts/information');
    ?>
</div>


