opensmtpdadmin/templates/list-domain.tpl

48 lines
2.1 KiB
Smarty

<div id="overview">
<?php if ($ROLE == ADMIN_ROLE) { ?>
<form name="list_domain" method="get">
<select name="username" onChange="this.form.submit()";>
<?php
if (count($list_admins) > 0) {
foreach ($list_admins as $row) {
echo '<option value="' . $row['username'] . '"';
if (isset($username) && $username == $row['username']) echo ' selected';
echo ">" . $row['username'] . "</option>";
}
}
?>
</select>
<input class="button" type="submit" name="go" value="<?php echo $LANG['List_button']; ?>" />
<?php } ?>
<form name="search" method="post" action="search.php">
Search: <input type="textbox" name="search" size="25">
</form>
</div>
<?php
if (count($list_domains) > 0) {
echo "<table id=\"admin_table\">";
echo "<tr class=\"header\">";
echo "<td>" . $LANG['List_domain_domain'] . "</td>";
echo "<td>" . $LANG['List_domain_description'] . "</td>";
echo "<td>" . $LANG['List_domain_aliases'] . "</td>";
echo "<td>" . $LANG['List_domain_mailboxes'] . "</td>";
echo "<td>" . $LANG['List_modified'] . "</td>";
if ($ROLE == ADMIN_ROLE) echo "<td colspan=\"2\">&nbsp;</td>";
echo "</tr>";
foreach ($list_domains as $row) {
if ($row['aliases'] == 0) $row['aliases'] = $LANG['List_domain_unlimited'];
if ($row['mailboxes'] == 0) $row['mailboxes'] = $LANG['List_domain_unlimited'];
echo "<tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">";
echo "<td><a href=\"list-virtual.php?domain=" . $row['domain'] . "\">" . $row['domain'] . "</a></td>";
echo "<td>" . $row['description'] . "</td>";
echo "<td>" . $row['alias_count'] . " / " . $row['aliases'] . "</td>";
echo "<td>" . $row['mailbox_count'] . " / " . $row['mailboxes'] . "</td>";
echo "<td>" . $row['modified'] . "</td>";
if ($ROLE == ADMIN_ROLE) echo "<td><a href=\"domain.php?action=edit&domain=" . $row['domain'] . "\">" . $LANG['edit'] . "</a></td>";
if ($ROLE == ADMIN_ROLE) echo "<td><a href=\"delete.php?table=domain&domain=" . $row['domain'] . "\" onclick=\"return confirm ('" . $LANG['confirm_domain'] . $LANG['List_domain_domain'] . ": " . $row['domain'] . "')\">" . $LANG['del'] . "</a></td>";
echo " </tr>";
}
echo "</table>";
}