{*
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{extends file='module:agilemultisellerpro/views/templates/front/layouts/selleraccount.tpl'}

{block name='page_content'}

	{if $sellerinfo->getIdSellerinfo()}
		<h3>{l s='Your account summary' d='Modules.Agilemultisellerpro.Summary'}</h3>
		<form action="{$link->getModuleLink('agilemultiseller', 'sellersummary', [], true)|escape:'htmlall':'UTF-8'}"
			method="post" class="form-horizontal std" id="frmConvertingPayment">
			<div class="form-group row">
				<label for="seller_status"
					class="control-label col-xs-7 col-sm-6 col-md-3 col-lg-2 col-xl-2">
					<span>{l s='Seller Account Status' d='Modules.Agilemultisellerpro.Summary'}</span>
				</label>
				<div class="col-xs-4 col-sm-6 col-md-7 col-lg-7 col-xl-7">
					<span id="seller_status">{if $isSeller}<i class="material-icons btn-outline-success" aria-hidden="true">done</i>&nbsp;&nbsp;{l s='Active' d='Modules.Agilemultisellerpro.Summary'}{else}<i class="material-icons btn-outline-danger" aria-hidden="true">close</i>&nbsp;{l s='Inactive' d='Modules.Agilemultisellerpro.Summary'}{/if}</span>
				</div>
			</div>
			<div class="form-group row">
				<label for="products_stat"
					class="control-label col-xs-7 col-sm-6 col-md-3 col-lg-2 col-xl-2">
					<span>{l s='Products Listed' d='Modules.Agilemultisellerpro.Summary'}</span>
				</label>
				<div class="col-xs-4 col-sm-6 col-md-7 col-lg-7 col-xl-7">
					<span id="products_stat">{$num_products|escape:'htmlall':'UTF-8'}</span>
				</div>
			</div>
			<div class="form-group row">
				<label for="orders_stat"
					class="control-label col-xs-7 col-sm-6 col-md-3 col-lg-2 col-xl-2">
					<span>{l s='Orders Received' d='Modules.Agilemultisellerpro.Summary'}</span>
				</label>
				<div class="col-xs-4 col-sm-6 col-md-7 col-lg-7 col-xl-7">
					<span id="orders_stat">{$num_orders|escape:'htmlall':'UTF-8'}</span>
				</div>
			</div>
			<div class="form-group row">
				<label for="sales_stat"
					class="control-label col-xs-7 col-sm-6 col-md-3 col-lg-2 col-xl-2">
					<span>{l s='Total Amount Sold' d='Modules.Agilemultisellerpro.Summary'}</span>
				</label>
				<div class="col-xs-4 col-sm-6 col-md-7 col-lg-7 col-xl-7">
					{foreach from=$totals_sold item=total}
						<span id="sales_stat">{Tools::displayPrice($total.amount, $total.currency)|escape:'htmlall':'UTF-8'}</span>
						<span class="sales-stat-currency">&nbsp;{l s='Sale received in ' d='Modules.Agilemultisellerpro.Summary'}{$total.currency->name|escape:'htmlall':'UTF-8'}</span><br/>
					{/foreach}
				</div>
			</div>

		</form>
	{else}
		<form action="{$link->getModuleLink('agilemultisellerpro', 'sellersummary', [], true)|escape:'htmlall':'UTF-8'}"
			method="post" class="form-horizontal std text-xs-center" id="frmSellerSummary">
			<p>
				{l s='You do not yet have a seller account.' d='Modules.Agilemultisellerpro.Summary'}
				{l s='Once you register for a seller account, you will be able to list your products in this store upon approval.' d='Modules.Agilemultisellerpro.Summary'}
			</p>
			<br />
			<p>
				{l s='Do you want create a seller account now so that you can list your products for sale?' d='Modules.Agilemultisellerpro.Summary'}
			</p>

			{if isset($id_cms_seller_terms) AND $id_cms_seller_terms >0}
				<div class="checkbox">
					<input type="checkbox" name="iagree" required
						id="iagree">&nbsp;{l s='Yes, I have read and I agree on the Seller Terms & conditions, Please create a seller account for me' d='Modules.Agilemultisellerpro.Summary'}
				</div>
				<br />
				<p class="clearfix">
					<span class="agile-term">
						<a href="{$link_terms|escape:'htmlall':'UTF-8'}" id="seller_terms" name="seller_terms"
							class="iframe">{l s='Seller Terms & conditions(read)' d='Modules.Agilemultisellerpro.Summary'}</a>
					</span>
				</p>
			{/if}

			<div class="text-xs-center">
				<button type="submit" class="btn btn-primary" name="submitSellerAccount" value="1">
					{l s='Yes, Sign me up' d='Modules.Agilemultisellerpro.Summary'}
				</button>
			</div>

			{* <center>
				<input type="hidden" name="submitSellerAccount" id="submitSellerAccount" value="1">
				<input type="button" class="btn btn-primary" onclick="check_terms({$id_cms_seller_terms|intval})"
					name="submitSellerAccount" value="{l s='Yes, Sign me up' d='Modules.Agilemultisellerpro.Summary'}" />
			</center> *}
			<br><br>
		</form>
	{/if}

{/block}


{block name='javascript_bottom'}
	{$smarty.block.parent}

	<script type="text/javascript">
		var membership_module_integrated = {$membership_module_integrated|intval};
		var msg = "{l s='You must agree on Seller Terms & Conditions' d='Modules.Agilemultisellerpro.Summary'}";
		var mymembership_url = "{$link->getModuleLink('agilemembership', 'mymembership', [content_only=>1], true)|escape:'htmlall':'UTF-8'}";
	</script>

{/block}
