<html dir="{$_CONF['info_row']['content_dir']}" xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$_CONF['info_row']['content_language']}" lang="{$_CONF['info_row']['content_language']}">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset={$_CONF['info_row']['charset']}" />

	<meta name="generator" content="PowerBB" />

	<link rel="stylesheet" href="{$style_path}" type="text/css" />


	<title>{$lang['manage_attachments']} -
{if {$_CONF['info_row']['allowed_powered']} == 1}
{$lang['powered']}
{/if}</title>
<script type="text/javascript" src="includes/js/jquery.js"></script>

</head>

<body>
<script type='text/javascript'>

function AddMoreAttach(x)
{
	x += 1;

	var up_max = {$_CONF['group_info']['upload_attach_num']};

	if (x <= up_max)
	{
		$(".more_attach_tr").hide();
		$("#add_attach_table").append('<tr align="center"><td class="row1 rows_space"><fieldset><legend>{$lang['review_file']}</legend><span class="r-right"><input name="files[]" type="file" id="attach' + x + '" size="50" /></span><span class="l-left"></span></fieldset></td></tr>');
		$("#add_attach_table").append('<tr align="center" class="more_attach_tr"><td class="row1 rows_space" colspan="2"><input type="button" name="more_attach" class="more_attach_class" value="{$lang['more_attach_file']}" /></td></tr>');

		$("#files" + x).focus();
		$(".more_attach_class").click(function() { AddMoreAttach(x) });

		if (x == up_max)
		{
			$(".more_attach_tr").hide();
		}
   }
}

function Ready()
{

	$("#attach_table").hide();
	$(".more_attach_class").click(function() { AddMoreAttach(1) });

}
$(document).ready(Ready);
</script>

<form name="topic" method="post" enctype="multipart/form-data" action="index.php?page=attachments&amp;edit_start=1&amp;&amp;subject_id={$SubjectInfo['id']}">

<table border="0" cellspacing="1" width="100%" class="border" align="center" id="add_attach_table">
	<tr align="center">
		<td class="tcat" colspan="2">
		{$lang['attachments']}
		</td>
	</tr>
	<tr align="center">
		<td class="row1 rows_space" colspan="2">
						<br />
			{$lang['ex_list']}
{Des::while}{ExList}
{$ExList['Ex']}
	{/Des::while}
		</td>
	</tr>
<tr align="center">
		<td class="row1 rows_space" colspan="2">
			<strong>{$lang['upload_attachments_nm']}
			 {$_CONF['group_info']['upload_attach_num']}</strong>
		</td>
	</tr>
    <div id="attach_table">
	<tr align="center">
		<td class="row1 rows_space">
		     <fieldset>
<legend>{$lang['review_file']}</legend>
<span class="r-right">
<input name="files[]" type="file" value="" size="50" />
</span>
<span class="l-left">
</span>
</fieldset>
</td>
	</tr>
</div>
<tr align="center" class="more_attach_tr">
		<td class="row1 rows_space" colspan="2">
			<input type="button" name="more_attach" class="more_attach_class" value="{$lang['more_attach_file']}" />
		</td>
	</tr>
 </table>


<table border="0" cellspacing="1" width="100%" cellpadding="0" style="border-collapse: collapse">
<tr align="center">
		<td class="row1 rows_space" colspan="2">
	 <input name="insert" type="submit" value="{$lang['upload']}" />
		</td>
	</tr>
			{Des::while}{SubjectAttachList}

			<tr align="center">
				<td class="row2" width="50%">
					<a target="_blank" href="index.php?page=download&amp;attach=1&amp;id={$SubjectAttachList['id']}">
				{$SubjectAttachList['filename']}</a>
				</td>
				<td class="row2" width="50%">
				<a href="index.php?page=attachments&amp;delete_attach_subject=1&amp;id={$SubjectAttachList['id']}&amp;subject_id={$SubjectAttachList['subject_id']}">
               {$lang['remove']}</a>
               </td>
			</tr>
	{/Des::while}
		</table>
 </form>
</body>

</html>