{include_php file="shared_handle:joinCompetition"}

<h1 class="underline">Join a Competition</h1>
<br />
Fill out the following form to be submitted to the competition organizer, please use a valid email address in order to receive confirmation instructions.<br />

<form name="joinCompetitionForm" method="post" style="margin:0px;">
<input type="hidden" name="pg" value="competition/join" />
<input type="hidden" name="join_attempt" value="true" />
<input type="hidden" name="no_expire" value="true" />

<table><tr><td align="right" nowrap>
{if $competition}
<div class="chunk300" style="text-align:left;">
<h2 class="withBG">Selected Competition</h2>
<b>ID</b>: {$competition.id}<br />
<b>Title</b>: {$competition.title}<br />
<b>Type</b>: {$competition.type|niceText}, {$competition.style}<br />
<b>Owner</b>: {$competition.firstName} {$competition.lastName} ({$competition.username})<br />
<b>Term</b>: {$competition.startDate|date_format2:"M j, Y"} to {$competition.endDate|date_format2:"M j, Y"}<br /><br />
	<div class="underline" style="margin-bottom:4px;">&nbsp;</div>
		<input type="checkbox" name="confirmOK" value="true" /> <b>This is the correct competition</b>
		&nbsp; &nbsp;<a href="javascript:document.joinCompetitionForm.submit();" class="button">Go</a>
	</div>
</div>
{/if}

<div class="chunk300">
<h2 class="withBG">Join Form</h2>
<label for="compID">Competition ID#</label>
<input id="compID" class="textInput" name="cid" value="{$smarty.post.cid}"> &nbsp;<br />
<label for="name">Your Name</label>
<input id="name" class="textInput" name="applicantName" value="{if $user->isLoggedIn() and not $smarty.request.applicantName}{$user->firstName} {$user->lastName}{else}{$smarty.request.applicantName}{/if}"> &nbsp;<br />
<label for="email">Email</label>
<input id="email" class="textInput" name="applicantEmail" value="{$smarty.request.applicantEmail|default:$user->email}"> &nbsp;<br />
<label for="comment">Comment</label>
<input id="comment" class="textInput" name="comment" value="{$smarty.request.comment}" maxlength="255"> &nbsp;
<div class="underline" style="margin-bottom:4px;">&nbsp;</div>
<a href="javascript:document.joinCompetitionForm.submit();" class="button">Submit</a>
</div>
</td></tr></table>

</form>

