<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_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()}" 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()}" 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="shuttles">Labda típus:</label>
			<table>
				{foreach $shuttle_array as $shuttle}
				<tr>
					<td><input type="checkbox" name="shuttles[]" value="{$shuttle->get_cst_id()}" class="coach_type" {if in_array($shuttle->get_cst_id(), $shuttles)}checked{/if}></td>
					<td class="coach">{$shuttle->get_cst_name()}</td>
				</tr>
				{/foreach}
			</table>
		</div>
		<div>
			<label class="desc" for="shuttles">Bejárás típusa:</label>
				<table>
				{foreach $accomodation_array as $accomodation}
				<tr>
					<td><input type="checkbox" name="accomodations[]" value="{$accomodation->get_cat_id()}" class="coach_type" {if in_array($accomodation->get_cat_id(), $accomodations)}checked{/if}></td>
					<td class="coach">{$accomodation->get_cat_name()}</td>
				</tr>
				{/foreach}
				</table>
		</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>
					<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a>	
				</td>
				<td>
					{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}	
				</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"]}.{/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">
					<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a>
				</td>
				<td>
					{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}	
				</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>
		</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">
					<a href="/admin/apply/{$apply->get_capp_id()}" class="bold">{$apply->get_capp_id()}</a>
				</td>
				<td>
					{$apply->get_capp_camp_kid_ck_id()->get_ck_name()}	
				</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>
			</tr>
		{/foreach}
		{/if}
	</table>
</div>
