<div class="form_wrapper">
    <form method="post">
        <div class="buttons">
            <a href="/admin/delete_camp/{$camp->get_camp_id()}" class="addbutton delete-big">Tábor törlése</a>
        </div>
        <input type="hidden" name="action" value="camp_update">
        <input type="hidden" name="camp_id" value="{$camp->get_camp_id()}">

        <div>
            <label class="desc" for="camp_name">Tábor neve / típusa:</label>
            <div><input type="text" name="camp_name" id="camp_name" value="{$camp->get_camp_name()}" required></div>
        </div>
        <div>
            <label class="desc" for="camp_city">Helyszín:</label>
            <div><input type="text" name="camp_city" id="camp_city" value="{$camp->get_camp_city()}" required></div>
        </div>
        <div>
            <label class="desc" for="camp_from">Tábor kezdete:</label>
            <div><input type="text" name="camp_from" id="camp_from" value="{$camp->get_camp_from()}" class="datepicker" required></div>
        </div>
        <div>
            <label class="desc" for="camp_to">Tábor vége:</label>
            <div><input type="text" name="camp_to" id="camp_to" value="{$camp->get_camp_to()}" class="datepicker" required></div>
        </div>
        <div>
            <label class="desc" for="camp_leader">Táborvezető:</label>
            <div><input type="text" name="camp_leader" id="camp_leader" value="{$camp->get_camp_leader()}"></div>
        </div>
        <div>
            <label class="desc" for="camp_helpers">Segítők:</label>
            <div><input type="text" name="camp_helpers" id="camp_helpers" value="{$camp->get_camp_helpers()}"></div>
        </div>
        <div>
            <label class="desc" for="camp_is_open">Lehet jelentkezni:</label>
            <div><input type="checkbox" name="camp_is_open" id="camp_is_open" value="1" {if 1==$camp->get_camp_is_open()}checked{/if}></div>
        </div>
        <div>
            <label class="desc" for="camp_camp_type_ct_id">Típus:</label>
            <div>
                <select name="camp_camp_type_ct_id" id="camp_camp_type_ct_id">
                    {foreach $camp_type_array as $camp_type}
                        <option value="{$camp_type->get_ct_id()}" {if $camp->get_camp_camp_type_ct_id() == $camp_type->get_ct_id()}selected{/if}>
                            {$camp_type->get_ct_name()}
                        </option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div>
            <label class="desc" for="camp_count">Létszám:</label>
            <div><input type="number" min="1" name="camp_count" id="camp_count" value="{$camp->get_camp_count()}"></div>
        </div>
        <div>
            <label class="desc" for="camp_price">Ár:</label>
            <div><input type="number" min="0" name="camp_price" id="camp_price" value="{$camp->get_camp_price()}"></div>
        </div>
        <div>
            <label class="desc" id="title2" for="camp_info">Tábor információk:</label>
            <div><textarea rows="7" name="camp_info" id="camp_info">{$camp->get_camp_info()}</textarea></div>
        </div>
        <div>
            <div>
                <input class="button black" type="submit" value="Mentés">
            </div>
        </div>

    </form>
</div>
<br><br>

<h1 class="apply" id="applies">Függőben lévő jelentkezések</h1>
<div class="outer">
    <table class="apply_table">
        <tr>
            <th>#</th>
            <th>Jelentkező</th>
            <th>Jelentkezés ideje</th>
            <th>Elfogadás</th>
            <th>Elutasítás</th>
            <th>E-mail</th>
        </tr>
        {if !count($pending_apply_array)}
        <tr>
            <td colspan="6" class="no_data">Nincs függőben lévő jelentkezés</td>
        </tr>
        {else}
        {foreach $pending_apply_array as $apply}
            <tr>
                <td>
                    {$apply->get_capp_id()}
                </td>
                <td>
                    <a href="/admin/apply/{$apply->get_capp_id()}" class="bold">
                        {$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
                    </a>
                </td>
                <td>
                    {$apply->get_capp_date()|substr:0:16}
                </td>
                <td>
                    <a href="/admin/accept_apply/{$apply->get_capp_id()}"><img src="/_image/tick.png"></a>
                </td>
                <td>
                    <a href="/admin/deny_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a>
                </td>
                <td>
                    <a href='mailto:{$apply->get_responsible_contact()->get_cc_email()}?subject=Tollaslabda tábor {$camp->get_camp_from()|substr:0:4}. {$months[$camp->get_camp_from()|date_format:"%m"]} {$camp->get_camp_from()|date_format:"%e"}{if $camp->get_camp_from()|date_format:"%m" != $camp->get_camp_to()|date_format:"%m"}. - {$months[$camp->get_camp_to()|date_format:"%m"]} {else} - {/if}{$camp->get_camp_to()|date_format:"%e"}.
&body=Kedves {$apply->get_responsible_contact()->get_cc_name()}!'>{$apply->get_responsible_contact()->get_cc_email()}</a>
                </td>
            </tr>
        {/foreach}
        {/if}
    </table>
</div>

{if count($deleted_apply_array)}
<h1 class="apply">Törölt jelentkezések</h1>
<div class="outer">
    <table class="apply_table">
        <tr>
            <th>#</th>
            <th>Jelentkező</th>
            <th>Törlés ideje</th>
            <th>Eltávolítás a listából</th>
        </tr>
        {foreach $deleted_apply_array as $apply}
            <tr>
                <td class="bold">
                    {$apply->get_capp_id()}
                </td>
                <td>
                    <a href="/admin/apply/{$apply->get_capp_id()}" class="bold">
                        {$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
                    </a>
                </td>
                <td>
                    {$apply->get_capp_accept_date()|substr:0:16}
                </td>
                <td>
                    <a href="/admin/remove_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a>
                </td>
            </tr>
        {/foreach}
    </table>
</div>
{/if}

<h1 class="apply">Visszaigazolt jelentkezések ({count($camp->get_camp_applies())} fő)</h1>
<div class="outer">
    <table class="apply_table">
        <tr>
            <th>#</th>
            <th>Jelentkező</th>
            <th>Jelentkezés ideje</th>
            <th>Státusz</th>
            <th>Visszaigazolva</th>
            <th>Módosítás</th>
            <th>Befizetés</th>
            <th>Befizetett összeg</th>
        </tr>
        {if !count($apply_array)}
        <tr>
            <td colspan="6" class="no_data">Nincs még visszaigazolt jelentkezés</td>
        </tr>
        {else}
        {foreach $apply_array as $apply}
            <tr>
                <td class="bold">
                    {$apply->get_capp_id()}
                </td>
                <td>
                    <a href="/admin/apply/{$apply->get_capp_id()}" class="bold">
                        {$apply->get_capp_camp_kid_ck_id()->get_ck_name()}
                    </a>
                </td>
                <td>
                    {$apply->get_capp_date()|substr:0:16}
                </td>
                <td style="color: {if $apply->get_capp_status() == 'Elfogadva'}green{else}red{/if}; font-weight: bold;">
                    {$apply->get_capp_status()}
                </td>
                <td>
                    {$apply->get_capp_accept_date()|substr:0:16}
                </td>
                <td>
                    {if $apply->get_capp_status() == 'Elutasítva'}
                        <a href="/admin/accept_apply/{$apply->get_capp_id()}"><img src="/_image/tick.png"></a>
                    {else}
                        <a href="/admin/deny_apply/{$apply->get_capp_id()}"><img src="/_image/delete.png"></a>
                    {/if}
                </td>
                <td>
                    {if $camp->get_camp_price() == null or $apply->get_capp_money() == $camp->get_camp_price()}
                        <img src="/_image/tick.png">
                    {elseif $camp->get_camp_price() > 0 and $apply->get_capp_money() == 0}
                        <img src="/_image/delete.png">
                    {else}
                        <img src="/_image/dollar.png">
                    {/if}
                </td>
                <td>
                    <a href="/admin/camp_fee/{$apply->get_capp_id()}" class="bold">
                        {$apply->get_capp_money()} Ft
                    </a>
                </td>
            </tr>
        {/foreach}
        {/if}
    </table>
</div>
