{assign var="page_title" value="Bewerbungen bearbeiten"}
{assign var="page_title_long" value="Mitglieder Bereich &raquo; Bewerbungen bearbeiten"}
{assign var="page_title_site" value="Bewerbungen bearbeiten"}

<b>Wartende Bewerbungen:</b>
<table>
	<tr style="background-color: {$style.bg_1}">
    	<th>Name</th>
        <th>eMail-Adresse</th>
        <th>ICQ</th>
        <th>Bereich</th>
        <th>Datum</th>
        <th>Letzte Änderung</th>
        <th>Aktion</th>
    </tr>
{foreach from=$new_applications item=app}
	<tr>
    	<td>{$app.name}</td>
        <td>{$app.email}</td>
        <td>{if isset( $app.icq ) }{$app.icq}{else}{$app.icq2}{/if}</td>
        <td>{$user->groups[$app.group]}</td>
        <td>{$app.date|date_format:"%d.%m.%y"}</td>
        <td>{$app.lastchange|date_format:"%d.%m.%y"}</td>
        <td>
            <a href="applications_admin.php?edit={$app.applicationID}&amp;{$SID}">bearbeiten</a>
        </td>
    </tr>
{/foreach}
</table>

<hr size="1" width="100%" noshade="noshade" style="color:{$style.bg_b}"></hr>
<form method="post" action="applications_admin.php">
    <input type="hidden" name="sid" value="{$SID_SHORT}" />
    <b>Bewerbungs-Suche: </b>
    <table>
        <tr>
            <td align="right" bgcolor="{$style.bg_a}"><b>Benutzername enthält</b></td>
            <td bgcolor="{$style.bg_a}"><input type="text" name="name" size="30" maxlength="25" class="input_form" /></td>
        </tr>
        <tr>
            <td align="right" bgcolor="{$style.bg_b}"><b>eMail-Adresse enthält</b></td>
            <td bgcolor="{$style.bg_b}"><input type="text" name="email" size="30" maxlength="150" class="input_form" /></td>
        </tr>
        <tr>
            <td align="right" bgcolor="{$style.bg_a}"><b>ICQ-Nummer enthält</b></td>
            <td bgcolor="{$style.bg_a}"><input type="text" name="icq" size="30" maxlength="12" class="input_form" /></td>
        </tr>
        <tr>
            <td align="right" bgcolor="{$style.bg_a}"><b>Bewerbungs-Status</b></td>
            <td bgcolor="{$style.bg_a}">
                <select name="state" class="list_form">
                	<option value="waiting">Wartend</option>
                	<option value="staffler">Staffler (angenommen)</option>
                    <option value="rejected">Abgelehnt</option>
                    <option value="self-rejected">Zurückgezogen</option>
                    <option value="leaved">Staff verlassen</option>
                </select>
            </td>
        </tr>
    </table>
    <br />
    <input type="submit" value="Bewerbungen suchen" name="search_form" class="button_form" />
</form>
<p>%-Zeichen verwenden! Au% findet z.B. Aurax, August, etc!</p>

{if isset( $result_applications )}
<b>Suchergebnisse:</b><br />
<table>
	<tr style="background-color: {$style.bg_1}">
    	<th>Name</th>
        <th>eMail-Adresse</th>
        <th>ICQ</th>
        <th>Bereich</th>
        <th>Datum</th>
        <th>Letzte Änderung</th>
        <th>Aktion</th>
    </tr>
{foreach from=$result_applications item=app}
	<tr>
    	<td>{$app.name}</td>
        <td>{$app.email}</td>
        <td>{if isset( $app.icq ) }{$app.icq}{else}{$app.icq2}{/if}</td>
        <td>{$user->groups[$app.group]}</td>
        <td>{$app.date|date_format:"%d.%m.%y"}</td>
        <td>{$app.lastchange|date_format:"%d.%m.%y"}</td>
        <td>
            <a href="applications_admin.php?edit={$app.applicationID}&amp;{$SID}">bearbeiten</a>
        </td>
    </tr>
{/foreach}
</table>
{/if}