<?php

$content = api_query('https://' . $server . '/manager/ispmgr?func=domain.sublist&elid=' . urlencode($_GET['elid']) . '&out=xml&authinfo=' . urlencode($_SESSION['username']) . ':' . urlencode($_SESSION['password']));
$parse_xml = simplexml_load_string($content);
echo '<div class="menu"><img src="images/t-new.png" alt="." /><a href="?func=domain.sublist.edit&amp;plid=' . urlencode($_GET['elid']) . '">Создать новую запись домена ' . htmlentities($_GET['elid'], ENT_QUOTES, 'UTF-8') . '</a>' . "\n";
echo '</div>' . "\n";
foreach($parse_xml->elem as $var) {
    echo '<div class="post"><b>Имя:</b> ' . htmlentities((string)$var->name, ENT_QUOTES, 'UTF-8') . '<br />' . "\n";
    echo '<b>Тип:</b> ' . htmlentities((string)$var->type, ENT_QUOTES, 'UTF-8') . '<br />' . "\n";
    echo '<b>Адрес:</b> ' . htmlentities((string)$var->addr, ENT_QUOTES, 'UTF-8') . '<br />' . "\n";
    echo '&raquo; <a href="?func=domain.sublist.edit&amp;elid=' . urlencode((string)$var->key) . '&amp;plid=' . urlencode($_GET['elid']) . '">Изменить</a><br />' . "\n";
    echo '&raquo; <a href="?func=domain.sublist.delete&amp;elid=' . urlencode((string)$var->key) . '&amp;plid=' . urlencode($_GET['elid']) . '">Удалить</a>' . "\n";
    echo '</div>' . "\n";
}
echo '<div class="menu"><img src="images/t-back.png" alt="." /><a href="?func=domain">Доменные имена</a><br />' . "\n";
echo '<img src="images/sb-menu.png" alt="." /><a href="?func=menu">Вернуться в меню</a>' . "\n</div>";

?>