<aside id="custom_html-2" class="widget_text widget widget_custom_html" style="background-color: #EFEFEF;">
<h1 class="maintitle">{PAGE_TITLE}</h1>
<br \>
<!-- IF PRESENT_EDIT -->
<script type="text/javascript">
function form_validate (f)
{
	var error = '';

	if (f.elements["name"].value == '')
	{
		f.elements["name"].focus();
		error='{L_PRESENT_ERROR_NAME}...';
	}
	else if (f.elements["price"].value == '')
	{
		f.elements["price"].focus();
		error='{L_PRESENT_ERROR_PRICE}...';
	}

	if (error)
	{
		alert('{L_ERROR}: '+error);
		return false;
	}
	return true;
}
</script>
<form method="post" onsubmit="return form_validate(this);" enctype="multipart/form-data">
	<table class="pad_6 forumline row1 tCenter" width="100%">
	<tr>
		<th width="180">{L_PRESENT}</th>
		<th colspan="4">{L_PRESENT_NAME}</th>
	</tr>
	<tr>
		<td rowspan="9">
			<div id="present" class="pad_10">
				<div style="color: #c80; font-size:14px;">{NAME}</div>
				<img src="styles/images/presents/{PIC}">
				<div class="rblock">{PRICE}</div>
			</div>
		</td>
		<td colspan="4"><input type="text" name="name" size="50" value="{NAME}" /></td>
	<tr>
	<tr>
		<th>{L_PRESENT_PRICE}</th>
		<th>{L_PRESENT_TYPE}</th>
		<th>{L_PRESENT_ACTIVE}</th>
		<th>{L_DELETE}</th>
	</tr>
	<tr>
		<td><input type="text" name="price" size="15" value="{PRICE}" /></td>
		<td>{SELECT_TYPE}</td>
		<td><input type="checkbox" name="active" value="1" {ACTIVE_CHECKED} /></td>
		<td><input type="checkbox" name="delete" value="1" /></td>
	<tr>
	<tr>
		<th colspan="4">{L_SELECT_IMAGE}</th>
	</tr>
	<tr>
		<td colspan="4" class="nowrap"><input type="file" name="pic" class="hint" /></td>
	<tr>
	<tr>
		<td colspan="4" class="catBottom border bw_TRB med pad_4"><input type="submit" name="submit" value="{L_EDIT}" class="bold" /></td>
	</tr>
</table>
</form>
<!-- ENDIF -->

<!-- IF PRESENT_DONATE -->
<br \>
<form action="{PRESENT_URL}" method="post" name="post">
	<table class="forumline pad_4" width="100%">
	<col class="row1">
	<col class="row2">
	<tr>
		<th width="180">{L_PRESENT}</th>
		<th>{L_PRESENT_DESC}</th>
	</tr>
	<tr>
		<td rowspan="6" class="tCenter pad_10">
			<div id="present" class="pad_10">
				<div style="color: #c80; font-size:14px;">{NAME}</div>
				<img src="styles/images/presents/{PIC}">
				
			</div>
		</td>
	    <td><b>{L_NAME}</b>: {NAME}</td>
	</tr>
	<tr>
		<td><b>{L_PRICE}</b>: {PRICE}</td>
	</tr>
	<tr>
		<td><b>{L_CATEGORY}</b>: {TYPE}</td>
	</tr>
	<tr>
		<td><b>{L_PRESENT_MAKE_ANONYMOUS}</b>:
			<label><input type="radio" name="hide_present" value="1" />{L_YES}</label>&nbsp;&nbsp;
			<label><input type="radio" name="hide_present" value="0" checked="checked" />{L_NO}</label>
		</td>
	</tr>
	<tr>
		<td>
		<p class="input"><b>{L_PRESENT_TO}</b>: <input class="post" type="text" size="16" maxlength="25" name="username" value="{USERNAME}" /> <input type="button" value="{L_FIND_USERNAME}" onclick="window.open('search.php?mode=searchuser&input_name=username', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400'); return false;" /></p>
        </td>
	</tr>
	<tr>
		<td><b>{L_PRESENT_WISH}</b>:
		<input type="button" onclick="window.open('posting.php?mode=smilies', '_phpbbsmilies', 'height=540, resizable=yes, scrollbars=yes ,width=620, left=360, top=60'); return false;" value="{L_SMILIES}" />
		<br />
		<textarea cols="100%" class="mrg_4" name="message" id="message">{MESSAGE}</textarea>
		</td>
	</tr>
	<tr>
		<td colspan="2" class="catBottom"><input type="submit" name="submit" value="{L_GIVE}" class="bold" /></td>
	</tr>
</table>
</form>
<!-- ENDIF -->

<!-- IF PRESENT_LIST -->
<form action="{PRESENT_URL}" id="type" method="post">{SELECT_TYPE}</form>
<!-- IF IS_AM -->
<script type="text/javascript">
function form_validate (f)
{
	var error = '';

	if (f.elements["name"].value == '')
	{
		f.elements["name"].focus();
		error='{L_PRESENT_ERROR_NAME}...';
	}
	else if (f.elements["price"].value == '')
	{
		f.elements["price"].focus();
		error='{L_PRESENT_ERROR_PRICE}...';
	}
    else if (f.elements["pic"].value == '')
	{
		f.elements["pic"].focus();
		error='{L_PRESENT_ERROR_PIC}';
	}

	if (error)
	{
		alert('{L_ERROR}: '+error);
		return false;
	}
	return true;
}
</script>
<!-- ENDIF -->

<table class="forumline">
<tr>
	<th>{L_BAY_PRESENT}</th>
</tr>
<tr>
	<td class="row1">
		<table class="tCenter borderless" width="100%">
			<!-- BEGIN presentrow -->
			<tr>
				<!-- BEGIN presentcol -->
				<td class="row1 pad_10" width="25%">
				<div id="present" class="pad_10">
					<div style="color: #c80; font-size:14px;"><!-- IF IS_AM --><a href="presents.php?present=edit&pre={presentrow.presentcol.ID}"><img src="styles/images/presents/edit.png"></a><!-- ENDIF --> {presentrow.presentcol.NAME}</div>
					<img src="styles/images/presents/{presentrow.presentcol.PIC}">
				<div class="lblock"><a href="presents.php?present=donate&pre={presentrow.presentcol.ID}<!-- IF USER_PRESENT -->&u={USER_PRESENT}<!-- ENDIF -->"><b>{L_GIVE}</b></a></div>
				<div class="rblock">{presentrow.presentcol.PRICE}</div>
				</div>
				</td>
			    <!-- END presentcol -->
		        <!-- BEGIN not -->
				<td class="row1" align="center" width="25%">&nbsp;</td>
				<!-- END not -->
			</tr>
		    <!-- END presentrow -->
		    <!-- BEGIN not_present -->
			<tr>
				<td colspan="3" class="row1 tCenter pad_8">{L_NONE}</td>
			</tr>
		    <!-- END not_present -->
		</table>
    </td>
</tr>

<!-- IF IS_ADMIN -->
<tr>
	<th class="thHead gen clickable bold" onclick="toggle_block('add_present'); return false;">{L_ADD_PRESENT}</th>
</tr>
<tr id="add_present" style="display: none;">
	<td class="tCenter row2">
		<form method="post" onsubmit="return form_validate(this);" enctype="multipart/form-data">
			<table class="forumline pad_6" width="100%">
			<tr>
				<th>{L_PRESENT_NAME}</th>
				<th>{L_PRESENT_PRICE}</th>
				<th>{L_PRESENT_TYPE}</th>
				<th>{L_PRESENT_ACTIVE}</th>
				<th>{L_SELECT_IMAGE}</th>
			</tr>
			<tr>
				<td><input type="text" name="name" size="45" /></td>
				<td><input type="text" name="price" size="15" /></td>
				<td>{SELECT_TYPE_PRESENT}</td>
				<td><input type="checkbox" name="active" value="1" checked="checked" /></td>
			    <td class="nowrap"><input type="file" name="pic" class="hint" /></td>
			</tr>
			<tr>
				<td colspan="5" class="catBottom border bw_TRBL med pad_4"><input type="submit" name="submit" value="{L_ADD}" class="bold" /></td>
			</tr>
			</table>
		</form>
    </td>
</tr>
<!-- ENDIF -->
</table>
<!-- ENDIF -->
<div class="cat_categories2" style="border-radius: 0px 0px 15px 15px;">
		<p style="float: left">{PAGE_NUMBER}</p>
		<p style="float: right">{PAGINATION}</p>
		<div class="clear"></div>
</aside>
