<script language="JavaScript">
<!--
	var me = '{$SCRIPT_NAME}';
	{literal}

	function popupDatabase(id) {
		window.open(me + '?op=edit&use_js=1&database_id='+id, 'ewin', 'dependent=yes,width=350,height=300,scrollbars=1');
	}
	{/literal}
// -->
</script>
<table border="0" width="100%">
	<tr>
		<td valign="top">
			<b>&nbsp;{$STRING.databaselist'}</b> - <a href="{$SCRIPT_NAME}?op=edit&database_id=0" onClick="popupDatabase(0); return false;">{$STRING.addnew} {$STRING.database}</a>
			<hr size="1">
			<table border="0" cellpadding="2" cellspacing="1" width="100%">
				<tr>
					<th class="{$headers.name.class}"><a href="{$headers.name.url}">{$STRING.name}</a></th>
					<th class="{$headers.sortorder.class}"><a href="{$headers.sortorder.url}">{$STRING.sortorder}</a></th>
					<th>Delete</th>
				</tr>
				{section name=database loop=$databases}
				<tr{if $smarty.section.database.iteration is even} class="alt"{/if}>
					<td><a href="{$SCRIPT_NAME}?op=edit&database_id={$databases[database].database_id}" onClick="popupDatabase({$databases[database].database_id}); return false;">{$databases[database].database_name|stripslashes}</a></td>
					<td align="center">{$databases[database].sort_order}</td>
					<td align="center">
						{if not $databases[database].bug_count}
							<a href="{$SCRIPT_NAME}?op=del&database_id={$databases[database].database_id}" onClick="return confirm('{$STRING.suredeletedb}')">{$STRING.delete}</a>
						{/if}
					</td>
				</tr>
				{/section}
				<tr>
					<td colspan="3" align="center">
						<br>
  					{$first} - {$last} of {$total}
						<br>
						{if $pages ne "1"}[ {$pages} ]{/if}
  					<br>
					</td>
				</tr>
			</table>
			<br>
		</td>
	</tr>
</table>
