<?php

namespace DropshippingExportFreeVendor;

use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\Loader\Plugin\PluginLinksLoaderAction;
/**
 * @var string $title
 * @var bool $edit
 * @var Export $export
 * @var string $export_manager_url
 * @var string $products_url
 * @var WPDesk\View\Renderer\Renderer $renderer
 */
$renderer->output_render('Header', ['title' => $title]);
$is_pl_lang = PluginLinksLoaderAction::is_pl_lang();
?>
<hr>
	<table class="form-table export-status-table bg-white">
		<tbody>
		<tr valign="top">
			<td class="forminp txt-center">
				<h2><?php 
echo \esc_html(\__('Please wait, export in progress', 'dropshipping-export-free'));
?></h2>
			</td>
		</tr>
		<tr valign="top">
			<td class="forminp txt-center">
				<p><?php 
echo \esc_html(\__('If you close your browser, the cron scheduler will complete the export process (it will take longer).', 'dropshipping-export-free'));
?></p>
			</td>
		</tr>
		<tr valign="top">
			<td>
				<table class="form-table status-table">
					<tbody>
					<tr>
						<td class="width-40 txt-left"><p><?php 
echo \esc_html(\__('Time elapsed', 'dropshipping-export-free'));
?>: <span id="timer">00:00:00</span></p></td>
						<td class="width-20 txt-center"><span id="export-progress"><?php 
echo \esc_html($export->get_formated_progress());
?></span></td>
						<td class="width-40 txt-right"><p>
								<?php 
echo \esc_html(\__('Exported', 'dropshipping-export-free'));
?>: <span id="export-created"><?php 
echo \esc_html($export->get_created());
?></span> |
								<?php 
echo \esc_html(\__('of', 'dropshipping-export-free'));
?> <span id="export-total"><?php 
echo \esc_html($export->get_products_count());
?></span></p></td>
					</tr>
					<tr>
						<td class="txt-left" colspan="3">
							<ul id="export-player" class="start">
								<li id="start-export"><a href="#"><?php 
echo \esc_html(\__('Start export', 'dropshipping-export-free'));
?></a></li>
								<li id="stop-export"><a href="#"><?php 
echo \esc_html(\__('Stop export', 'dropshipping-export-free'));
?> </a></li>
							</ul>
						</td>
					</tr>
					<tr>
						<td class="txt-left" colspan="3">
							<p>
							<?php 
$faq_url = $is_pl_lang ? 'https://wpdesk.link/export-docs-process-pl' : 'https://wpdesk.link/export-docs-process';
echo \wp_kses_post(\sprintf(\__('Have you encountered any problems with the export, or do you want to know more? <a href="%s" target="_blank">Visit FAQ →</a>.', 'dropshipping-export-free'), $faq_url));
?>
							</p>
						</td>
					</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<tr valign="top">
			<td class="forminp">
				<fieldset id="log-container">
					<legend><?php 
echo \esc_html(\__('Export log', 'dropshipping-export-free'));
?>:</legend>
					<div class="log-wrapper">
						<textarea class="width-100" id="log-viewer" rows="20" readonly></textarea>
					</div>
				</fieldset>
			</td>
		</tr>
		</tbody>
	</table>
<div id="navigation-wrapper" class="hidden">
	<hr>
	<table class="form-table">
		<tbody>
		<tr valign="top">
			<td class="forminp txt-center">
					<a href="<?php 
echo \esc_url($export_manager_url);
?>" class="button button-hero button-primary" name="button button-hero"><?php 
echo \esc_html(\__('Go to the export manager', 'dropshipping-export-free'));
?></a>
					<a href="<?php 
echo \esc_url($products_url);
?>" class="button button-hero button-primary" name="button button-hero"><?php 
echo \esc_html(\__('Go to your Products', 'dropshipping-export-free'));
?></a>
					<a href="<?php 
echo \esc_url($file_url);
?>" class="button button-hero button-primary green" name="button button-hero"><?php 
echo \esc_html(\__('Go to your File', 'dropshipping-export-free'));
?></a>
					<?php 
if (!empty($zip_file_url)) {
    ?>
						<a href="<?php 
    echo \esc_url($zip_file_url);
    ?>" class="button button-hero button-primary green" name="button button-hero"><?php 
    echo \esc_html(\__('Download ZIP File', 'dropshipping-export-free'));
    ?></a>
					<?php 
}
?>
			</td>
		</tr>
		</tbody>
	</table>
</div>
<?php 
$renderer->output_render('Footer');
