<h1>Referral System</h1>
<form action="/admin/modules/referral" method="post">
    <table>
        <tr>
            <td>Enable</td>
            <td>
                {if $Config.Enable}
                    <input name="Enable" id="Enable" type="checkbox" checked/>
                {else}
                    <input name="Enable" id="Enable" type="checkbox"/>
                {/if}
            </td>
        </tr>
        <tr>
            <td>Count Step(Max:5)</td>
            <td><input name="CountStep" id="CountStep" value="{$Config.CountStep}" type="text"/></td>
        </tr>
        <tr><td colspan="2">Step 1</td></tr>
        <tr>
            <td>Need Reset</td>
            <td><input type="text" name="NeedReset_1" value="{$Config.Steps[1].NeedReset}"></td>
        </tr>
        {foreach $Valutes item=$val key=$i}
            {if $val.Name != ''}
                <tr>
                    <td>
                        Valute {$i}({$val.Name})
                    </td>
                    <td>
                        <input name="step_1_val_reward_{$i}" value="{$Config.Steps[1].Valutes[$i]}" type="text">
                    </td>
                </tr>
            {/if}
        {/foreach}
        <tr><td colspan="2">Step 2</td></tr>
        <tr>
            <td>Need Reset</td>
            <td><input type="text" name="NeedReset_2" value="{$Config.Steps[2].NeedReset}"></td>
        </tr>
        {foreach $Valutes item=$val key=$i}
            {if $val.Name != ''}
                <tr>
                    <td>
                        Valute {$i}({$val.Name})
                    </td>
                    <td>
                        <input name="step_2_val_reward_{$i}" value="{$Config.Steps[2].Valutes[$i]}" type="text">
                    </td>
                </tr>
            {/if}
        {/foreach}
        <tr><td colspan="2">Step 3</td></tr>
        <tr>
            <td>Need Reset</td>
            <td><input type="text" name="NeedReset_3" value="{$Config.Steps[3].NeedReset}"></td>
        </tr>
        {foreach $Valutes item=$val key=$i}
            {if $val.Name != ''}
                <tr>
                    <td>
                        Valute {$i}({$val.Name})
                    </td>
                    <td>
                        <input name="step_3_val_reward_{$i}" value="{$Config.Steps[3].Valutes[$i]}" type="text">
                    </td>
                </tr>
            {/if}
        {/foreach}
        <tr><td colspan="2">Step 4</td></tr>
        <tr>
            <td>Need Reset</td>
            <td><input type="text" name="NeedReset_4" value="{$Config.Steps[4].NeedReset}"></td>
        </tr>
        {foreach $Valutes item=$val key=$i}
            {if $val.Name != ''}
                <tr>
                    <td>
                        Valute {$i}({$val.Name})
                    </td>
                    <td>
                        <input name="step_4_val_reward_{$i}" value="{$Config.Steps[4].Valutes[$i]}" type="text">
                    </td>
                </tr>
            {/if}
        {/foreach}

        <tr><td colspan="2">Step 5</td></tr>
        <tr>
            <td>Need Reset</td>
            <td><input type="text" name="NeedReset_5" value="{$Config.Steps[5].NeedReset}"></td>
        </tr>
        {foreach $Valutes item=$val key=$i}
            {if $val.Name != ''}
                <tr>
                    <td>
                        Valute {$i}({$val.Name})
                    </td>
                    <td>
                        <input name="step_5_val_reward_{$i}" value="{$Config.Steps[5].Valutes[$i]}" type="text">
                    </td>
                </tr>
            {/if}
        {/foreach}
        <tr>
            <td colspan="2">
                <button class="def_adm_btn" name="referralsystem_btn">Save</button>
            </td>
        </tr>
    </table>
</form>