<script language="JavaScript">
<!--
var me = '<?php echo $_SERVER['SCRIPT_NAME']; ?>';
function popupDatabase(id) {
window.open(me + '?op=edit&use_js=1&database_id='+id, 'ewin', 'dependent=yes,width=350,height=300,scrollbars=1');
}
// -->
</script>
<table border="0" width="100%">
<tr>
<td valign="top">
<b> <?php echo translate("Database list"); ?></b> - <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=edit&database_id=0" onClick="popupDatabase(0); return false;"><?php echo translate("Add new database"); ?></a>
<hr size="1">
<table class="bordertable" align="center">
<tr>
<th class="<?php echo $headers['name']['class']; ?>"><a href="<?php echo $headers['name']['url']; ?>"><?php echo translate("Name"); ?></a></th>
<th class="<?php echo $headers['sortorder']['class']; ?>"><a href="<?php echo $headers['sortorder']['url']; ?>"><?php echo translate("Sort Order"); ?></a></th>
<th> </th>
</tr>
<?php for ($i = 0, $count = count($databases); $i < $count; $i++) { ?>
<tr>
<td><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=edit&database_id=<?php echo $databases[$i]['database_id']; ?>" onClick="popupDatabase(<?php echo $databases[$i]['database_id']; ?>); return false;"><?php echo stripslashes($databases[$i]['database_name']); ?></a></td>
<td align="center"><?php echo $databases[$i]['sort_order']; ?></td>
<td align="center">
<?php if (!$databases[$i]['bug_count']) { ?>
<a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=del&database_id=<?php echo $databases[$i]['database_id']; ?>" onClick="return confirm('<?php echo translate("Are you sure you want to delete this item?"); ?>')"><?php echo translate("Delete"); ?></a>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
<?php include('pagination.html'); ?>
</td>
</tr>
</table>