<h2>Donate System</h2>


<form action="/admin/modules/donate" method="post">
    <table>
    <tr>
        <td>Enable</td>
        <td>
            <input type="hidden" name="click_enable" value="1">
            {if $Enable}
                <input onchange="form.submit()" name="Enable" id="Enable" type="checkbox" checked/>
            {else}
                <input onchange="form.submit()" name="Enable" id="Enable" type="checkbox"/>
            {/if}
        </td>
    </tr>
    </table>
</form>
<h3>List donate items</h3>
<form action="/admin/modules/donate" method="post">

    <table width="100%" style="text-align: center;">
        <thead>
        <tr style="background: rgba(0,0,0,0.3);">
            <th>Type</th>
            <th>Index</th>
            <th>Level</th>
            <th>Skill</th>
            <th>Luck</th>
            <th>Opt</th>
            <th>Excellent</th>
            <th>Soc 1</th>
            <th>Soc 2</th>
            <th>Soc 3</th>
            <th>Soc 4</th>
            <th>Soc 5</th>
            <th>PvP</th>
            <th>Ancient</th>
            <th>Harmony</th>
            <th>Price</th>
            <th>Update</th>
            <th>Delete</th>
        </tr>
        </thead>
        <tbody>
        {foreach $Config item=item key=i}
            {if $i%2 == 0}
                <tr>
            {else}
                <tr style="background: rgba(0,0,255,0.2);">
            {/if}
                <td>{$item.Type}</td>
                <td>{$item.Index}</td>
                <td>{$item.Level}</td>
                <td>{$item.Skill}</td>
                <td>{$item.Luck}</td>
                <td>{$item.Opt}</td>
                <td>{$item.Excellent}</td>
                <td>{$item.Soc1}</td>
                <td>{$item.Soc2}</td>
                <td>{$item.Soc3}</td>
                <td>{$item.Soc4}</td>
                <td>{$item.Soc5}</td>
                <td>{$item.Pvp}</td>
                <td>{$item.Ancient}</td>
                <td>{$item.Harmony}</td>
                <td>
                {foreach $Valutes item=$val key=$i}
                    {if $val.Name != ''}
                        {$val.Name}: {$item.Price.Valutes[$i]} <br>
                    {/if}
                {/foreach}
                </td>
                <td><button value="{$i}" name="update_item">Update</button></td>
                <td><button value="{$i}" name="delete_item">Delete</button></td>
            </tr>
        {/foreach}
        </tbody>
    </table>
</form>
<h3>Add/Edit Donate</h3>

<div id="donate">
    <form action="/admin/modules/donate" method="post">
        <table style="margin: 0 auto;" width="47%">

            <tr>
                <th>Type</th>
                <td><input type="text" value="{$Update.Type}" placeholder="Type" name="add_don_type"></td>

            </tr>
            <tr>
                <th>Index</th>
                <td><input type="text" value="{$Update.Index}" placeholder="Index" name="add_don_index"></td>
            </tr>
            <tr>
                <th>Level</th>
                <td><input type="text" value="{$Update.Level}" placeholder="Level" name="add_don_level"></td>
            </tr>
            <tr>
                <th>Skill</th>
                <td><input type="text" value="{$Update.Skill}" placeholder="Skill" name="add_don_skill"></td>
            </tr>
            <tr>
                <th>Luck</th>
                <td><input type="text" value="{$Update.Luck}" placeholder="Luck" name="add_don_luck"></td>
            </tr>
            <tr>
                <th>Option</th>
                <td><input type="text" value="{$Update.Opt}" placeholder="Option" name="add_don_opt"></td>
            </tr>
            <tr>
                <th>Excellent</th>
                <td><input type="text" value="{$Update.Excellent}" placeholder="Excellent" name="add_don_exc"></td>
            </tr>
            <tr>
                <th>Socket1</th>
                <td><input type="text" value="{$Update.Soc1}" placeholder="Socket1" name="add_don_soc1"></td>
            </tr>
            <tr>
                <th>Socket2</th>
                <td><input type="text" value="{$Update.Soc2}" placeholder="Socket2" name="add_don_soc2"></td>
            </tr>
            <tr>
                <th>Socket3</th>
                <td><input type="text" value="{$Update.Soc3}" placeholder="Socket3" name="add_don_soc3"></td>
            </tr>
            <tr>
                <th>Socket4</th>
                <td><input type="text" value="{$Update.Soc4}" placeholder="Socket4" name="add_don_soc4"></td>
            </tr>
            <tr>
                <th>Socket5</th>
                <td><input type="text" value="{$Update.Soc5}" placeholder="Socket5" name="add_don_soc5"></td>
            </tr>
            <tr>
                <th>PvP</th>
                <td><input type="text" value="{$Update.Pvp}" placeholder="PvP" name="add_don_pvp"></td>
            </tr>
            <tr>
                <th>Ancient</th>
                <td><input type="text" value="{$Update.Ancient}" placeholder="Ancient" name="add_don_anc"></td>
            </tr>
            <tr>
                <th>Harmony</th>
                <td><input type="text" value="{$Update.Harmony}" placeholder="Harmony" name="add_don_harm"></td>
            </tr>
            <tr>
            <tr><td colspan="2">Price</td></tr>
            {foreach $Valutes item=$val key=$i}
                {if $val.Name != ''}
                    <tr>
                        <th>
                            Valute {$i}({$val.Name})
                        </th>
                        <td>
                            <input name="val_take_{$i}" value="{$Update.Price.Valutes[$i]}" type="text">
                        </td>
                    </tr>
                {/if}
            {/foreach}
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;"><button class="btn btn-primary"   name="add_item" value="{$Update.Key}">ADD Item</button></td>
            </tr>
        </table>
    </form>
</div>
