<div class="l-center edit">
        <div class="l-sort clearfix">
          <div class="l-unit-toolbar__buttonstrip">
            <a class="ui-button cancel" id="btn-back" href="/list/dns/"><i class="fas fa-arrow-left status-icon blue"></i> <?=_('Back')?></a>
          </div>
          <div class="l-unit-toolbar__buttonstrip float-right">
            <a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i> <?=_('Save')?></a>
          </div>
        </div>
      </div>

    <div class="l-separator"></div>

    <div class="l-center animated fadeIn">
        <?php
          $back = $_SESSION['back'];
          if (empty($back)) {
            $back = "location.href='/list/dns/'";
          } else {
            $back = "location.href='".$back."'";
          }
        ?>
        <form id="vstobjects" name="v_add_dns" method="post">
            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
            <input type="hidden" name="ok" value="Add" />

            <table class="data mode-add">
                <tr class="data-add">
                    <td class="data-dotted">
                        <table class="data-col1">
                            <tr><td></td></tr>
                        </table>
                    </td>
                    <td class="data-dotted">
                        <table class="data-col2" width="600px">
                            <tr>
                                <td class="step-top">
                                    <span class="page-title"><?=_('Adding DNS Domain')?></span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <?php
                                        if (!empty($_SESSION['error_msg'])) {
                                            echo "<span class=\"vst-error\"> <i class=\"fas fa-exclamation-circle status-icon red\"></i> ".htmlentities($_SESSION['error_msg'])."</span>";
                                        } else {
                                            if (!empty($_SESSION['ok_msg'])) {
                                                echo "<span class=\"vst-ok\"> <i class=\"fas fa-check-circle status-icon green\"></i> ".$_SESSION['ok_msg']."</span>";
                                            }
                                        }
                                    ?>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text step-top">
                                    <?php print _('Domain');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print _('IP address');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="vst-list" tabindex="-1" onchange="this.nextElementSibling.value=this.value">
                                        <option value="">clear</option>
                                        <?php
                                            foreach ($v_ips as $ip => $value) {
                                                $display_ip = empty($value['NAT']) ? $ip : "{$value['NAT']}";
                                                echo "<option value='{$display_ip}'>" . htmlentities($display_ip) . "</option>\n";
                                            }
                                        ?>
                                    </select>
                                    <input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <a href="javascript:elementHideShow('advtable');" class="vst-advanced"><?php print _('Advanced options');?>&nbsp;<i class="fas fa-arrow-circle-right"></i></a>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text">
                                  <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="advtable">
                                        <tr>
                                            <td class="vst-text input-label">
                                                <?php print _('Expiration Date');?> <span class="optional">(<?=_('YYYY-MM-DD');?>)</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input type="text" size="20" class="vst-input" name="v_exp" value="<?=htmlentities(trim($v_exp, "'"))?>">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="vst-text input-label">
                                                TTL
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input type="text" size="20" class="vst-input" name="v_ttl" value="<?=htmlentities(trim($v_ttl, "'"))?>">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="vst-text input-label">
                                                <?php print _('Name servers');?>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input type="text" size="20" class="vst-input" name="v_ns1" value="<?=htmlentities(trim($v_ns1, "'"))?>">
                                                <span class="remove-ns additional-control delete"><?=_('delete')?></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <input type="text" size="20" class="vst-input" name="v_ns2" value="<?=htmlentities(trim($v_ns2, "'"))?>">
                                                <span class="remove-ns additional-control delete"><?=_('delete')?></span>
                                            </td>
                                        </tr>
                                <?  if($v_ns3)
                                  echo '<tr>
                                        <td>
                                            <input type="text" size="20" class="vst-input" name="v_ns3" value="'.htmlentities(trim($v_ns3, "'")).'">
                                            <span class="remove-ns additional-control delete">'._('delete').'</span>
                                        </td>
                                    </tr>';

                                    if($v_ns4)
                                    echo '<tr>
                                        <td>
                                            <input type="text" size="20" class="vst-input" name="v_ns4" value="'.htmlentities(trim($v_ns4, "'")).'">
                                            <span class="remove-ns additional-control delete">'._('delete').'</span>
                                        </td>
                                    </tr>';

                                    if($v_ns5)
                                    echo '<tr>
                                        <td>
                                            <input type="text" size="20" class="vst-input" name="v_ns5" value="'.htmlentities(trim($v_ns5, "'")).'">
                                            <span class="remove-ns additional-control delete">'._('delete').'</span>
                                        </td>
                                    </tr>';

                                    if($v_ns6)
                                    echo '<tr>
                                        <td>
                                            <input type="text" size="20" class="vst-input" name="v_ns6" value="'.htmlentities(trim($v_ns6, "'")).'">
                                            <span class="remove-ns additional-control delete">'._('delete').'</span>
                                        </td>
                                    </tr>';

                                    if($v_ns7)
                                    echo '<tr>
                                        <td>
                                            <input type="text" size="20" class="vst-input" name="v_ns7" value="'.htmlentities(trim($v_ns7, "'")).'">
                                            <span class="remove-ns additional-control delete">'._('delete').'</span>
                                        </td>
                                    </tr>';

                                    if($v_ns8)
                                    echo '<tr>
                                        <td>
                                            <input type="text" size="20" class="vst-input" name="v_ns8" value="'.htmlentities(trim($v_ns8, "'")).'">
                                            <span class="remove-ns additional-control delete">'._('delete').'</span>
                                        </td>
                                    </tr>';
                                ?>
                                <tr class="add-ns" <? if($v_ns8) echo 'style="display:none;"'; ?> >
                                    <td class="step-top-small">
                                      <span class="add-ns-button additional-control add"><?=_('Add one more Name Server')?></span>
                                    </td>
                                </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <table class="data-col2"></table>
                    </td>
                </tr>
            </table>
        </form>
    </div>