opensmtpdadmin/templates/list-virtual.tpl

96 lines
4.7 KiB
Smarty

<?php if (count($list_domains) > 0) { ?>
<div id="overview">
<form name="select_domain" method="get">
<select name="domain" onChange="this.form.submit()";>
<?php
if (count($list_domains) > 0) {
foreach ($list_domains as $row) {
echo '<option value="' . $row['domain'] . '"';
if ($list_domains[$domain_key]['domain'] == $row['domain']) echo ' selected';
echo ">" . $row['domain'] . "</option>";
}
}
?>
</select>
<input type="hidden" name="offset" value="0">
<input class="button" type="submit" name="go" value="<?php echo $LANG['List_button']; ?>" />
</form>
<?php
if ($list_domains[$domain_key]['aliases'] == 0) $list_domains[$domain_key]['aliases'] = $LANG['List_domain_unlimited'];
if ($list_domains[$domain_key]['mailboxes'] == 0) $list_domains[$domain_key]['mailboxes'] = $LANG['List_domain_unlimited'];
echo '<h4>' . $LANG['List_virtual_welcome'] . $domain . '</h4>';
echo '<p>' . $LANG['List_domain_aliases'] . ": " . $list_domains[$domain_key]['alias_count'] . " / " . $list_domains[$domain_key]['aliases'] . '</p>';
echo '<p>' . $LANG['List_domain_mailboxes'] . ": " . $list_domains[$domain_key]['mailbox_count'] . " / " . $list_domains[$domain_key]['mailboxes'] . '</p>';
?>
<form name="search" method="post" action="search.php">
<input type="textbox" name="search" size="25">
</form>
</div>
<?php
if ($list_domains[$domain_key]['alias_count'] > $limit || $list_domains[$domain_key]['mailbox_count'] > $limit) {
echo "<div id=\"nav_bar\">";
if ($offset >= $limit) {
echo "<a href=\"list-virtual.php?domain=" . $_GET['domain'] . "&offset=" . ($offset - $limit) . "\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $LANG['List_left_arrow'] . "\"></a>";
}
if (($list_domains[$domain_key]['alias_count'] > $limit) || ($list_domains[$domain_key]['mailbox_count'] > $limit)) {
echo "<a href=\"list-virtual.php?domain=" . $list_domains[$domain_key]['domain'] . "&offset=0\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $LANG['List_up_arrow'] . "\"></a>";
}
if ((($offset + $limit) < $list_domains[$domain_key]['alias_count']) || (($offset + $limit) < $list_domains[$domain_key]['mailbox_count'])) {
echo "<a href=\"list-virtual.php?domain=" . $list_domains[$domain_key]['domain'] . "&offset=" . ($offset + $limit) . "\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $LANG['List_right_arrow'] . "\"></a>";
}
echo "</div>";
}
if (count($list_alias) > 0) {
echo "<table id=\"alias_table\">";
echo "<tr>";
echo "<td colspan=\"5\"><h3>" . $LANG['List_virtual_alias_title'] . "</h3></td>";
echo "</tr>";
echo "<tr class=\"header\">";
echo "<td>" . $LANG['List_virtual_alias_address'] . "</td>";
echo "<td>" . $LANG['List_virtual_alias_goto'] . "</td>";
echo "<td>" . $LANG['List_modified'] . "</td>";
echo "<td colspan=\"2\">&nbsp;</td>";
echo "</tr>";
foreach ($list_alias as $row) {
echo "<tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">";
echo "<td>" . $row['address'] . "</td>";
echo "<td>" . preg_replace("/,/", "<br>", $row['goto']) . "</td>";
echo "<td>" . $row['modified'] . "</td>";
echo "<td><a href=\"edit-alias.php?address=" . $row['address'] . "&domain=" . $list_domains[$domain_key]['domain'] . "\">" . $LANG['edit'] . "</a></td>";
echo "<td><a href=\"delete.php?table=alias&delete=" . $row['address'] . "&domain=" . $list_domains[$domain_key]['domain'] . "\"onclick=\"return confirm ('" . $LANG['confirm'] . $LANG['List_domain_aliases'] . ": ". $row['address'] . "')\">" . $LANG['del'] . "</a></td>";
echo "</tr>";
}
echo "</table>";
}
if (count($list_mailbox) > 0) {
echo "<table id=\"mailbox_table\">";
echo "<tr>";
echo "<td colspan=\"7\"><h3>" . $LANG['List_virtual_mailbox_title'] . "</h3></td>";
echo "</tr>";
echo "<tr class=\"header\">";
echo "<td>" . $LANG['List_virtual_mailbox_username'] . "</td>";
echo "<td>" . $LANG['List_virtual_mailbox_name'] . "</td>";
echo "<td>" . $LANG['List_modified'] . "</td>";
echo "<td colspan=\"2\">&nbsp;</td>";
echo "</tr>";
foreach ($list_mailbox as $row) {
echo "<tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['modified'] . "</td>";
echo "<td><a href=\"edit-mailbox.php?username=" . $row['username'] . "&domain=" . $list_domains[$domain_key]['domain'] . "\">" . $LANG['edit'] . "</a></td>";
echo "<td><a href=\"delete.php?table=mailbox&delete=" . $row['username'] . "&domain=" . $list_domains[$domain_key]['domain'] . "\"onclick=\"return confirm ('" . $LANG['confirm'] . $LANG['List_domain_mailboxes'] . ": ". $row['username'] . "')\">" . $LANG['del'] . "</a></td>";
echo "</tr>";
}
echo "</table>";
}
?>
<?php } ?>