{*
 **********************************************************
 * Developed by: Team Theme Metro
 * Website: http://www.thememetro.com
 **********************************************************
*}

<div class="card">
    <div class="card-body">
        <div class="alert alert-block alert-info text-center">
            {lang key='upgradecurrentconfig'}: <strong>{$groupname} - {$productname}</strong>{if $domain} ({$domain}){/if}
        </div>

        <table class="table table-striped">
            <thead>
            <tr>
                <th width="60%">{lang key='orderdesc'}</th>
                <th width="40%" class="text-center">{lang key='orderprice'}</th>
            </tr>
            </thead>
            <tbody>
            {foreach $upgrades as $upgrade}
                {if $type eq "package"}
                    <tr>
                        <td><input type="hidden" name="pid" value="{$upgrade.newproductid}" /><input type="hidden" name="billingcycle" value="{$upgrade.newproductbillingcycle}" />{$upgrade.oldproductname} => {$upgrade.newproductname}</td>
                        <td class="text-center">{$upgrade.price}</td>
                    </tr>
                {elseif $type eq "configoptions"}
                    <tr>
                        <td>{$upgrade.configname}: {$upgrade.originalvalue} => {$upgrade.newvalue}</td>
                        <td class="text-center">{$upgrade.price}</td>
                    </tr>
                {/if}
            {/foreach}
            <tr class="masspay-total">
                <td class="text-right">{lang key='ordersubtotal'}:</td>
                <td class="text-center">{$subtotal}</td>
            </tr>
            {if $taxrate}
                <tr class="masspay-total">
                    <td class="text-right">{$taxname} @ {$taxrate}%:</td>
                    <td class="text-center">{$tax}</td>
                </tr>
            {/if}
            {if $taxrate2}
                <tr class="masspay-total">
                    <td class="text-right">{$taxname2} @ {$taxrate2}%:</td>
                    <td class="text-center">{$tax2}</td>
                </tr>
            {/if}
            <tr class="masspay-total">
                <td class="text-right">{lang key='ordertotalduetoday'}:</td>
                <td class="text-center">{$total}</td>
            </tr>
            </tbody>
        </table>

        {if $type eq "package" && $curbillingcycle ne "free"}
            {include file="$template/includes/alert.tpl" type="warning" msg="{lang key='upgradeproductlogic'} ({$upgrade.daysuntilrenewal} {lang key='days'})" textcenter=true}
        {/if}
        {if $type eq "configoptions"}
            {include file="$template/includes/alert.tpl" type="warning" msg="{lang key='upgradeoptionlogic' productname=$productname }" textcenter=true}
        {/if}
        <div class="row">
            <div class="col-sm-6">

                <form method="post" action="{$smarty.server.PHP_SELF}">
                    <input type="hidden" name="step" value="3" />
                    <input type="hidden" name="type" value="{$type}" />
                    <input type="hidden" name="id" value="{$id}" />
                    {if $type eq "package"}
                        <input type="hidden" name="pid" value="{$upgrades.0.newproductid}" />
                        <input type="hidden" name="billingcycle" value="{$upgrades.0.newproductbillingcycle}" />
                    {/if}
                    {foreach $configoptions as $cid => $value}
                        <input type="hidden" name="configoption[{$cid}]" value="{$value}" />
                    {/foreach}

                    <h5>{lang key='orderpaymentmethod'}</h5>
                    <div class="form-group">
                        <select name="paymentmethod" id="inputPaymentMethod" class="form-control custom-select">
                            {if $allowgatewayselection}
                                <option value="none">{lang key='paymentmethoddefault'}</option>
                            {/if}
                            {foreach $gateways as $gateway}
                                <option value="{$gateway.sysname}"{if $gateway.sysname eq $selectedgateway} selected="selected"{/if}>{$gateway.name}</option>
                            {/foreach}
                        </select>
                    </div>

            </div>
        </div>

        <div class="form-actions text-center">
            <button type="submit" class="btn btn-primary" id="btnOrderContinue">
                {lang key='continue'} <i class="fas fa-arrow-right"></i>
            </button>
        </div>

        </form>

    </div>
</div>
