<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/user/"><i class="fas fa-arrow-left status-icon blue"></i> <?=__('Back')?></a>
            <a href="/list/key/" id="btn-create" class="ui-button cancel" title="<?=__('Manage SSH keys');?>"><i class="fas fa-key status-icon orange"></i><?=__('Manage SSH keys')?></a>
          </div>
          <div class="l-unit-toolbar__buttonstrip float-right">
            <a href="#" class="ui-button" title="<?=__('Save')?>" 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/user/'";
            } else {
                $back = "location.href='".$back."'";
            }
        ?>
        <form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>">
            <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
            <input type="hidden" name="save" value="save" />

            <table class='data'>
                <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">
                            <tr>
                                <td class="step-top">
                                    <span class="page-title"><?=__('Editing User')?></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 __('Username');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" size="20" class="vst-input" name="v_user" value="<?=htmlentities(trim($v_username, "'"))?>" disabled>
                                    <input type="hidden" name="v_username" value="<?=htmlentities(trim($v_username, "'"))?>">
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('Password');?> / <a href="javascript:randomString();" class="generate"><?php print __('generate');?></a>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" size="20" class="vst-input password" name="v_password" value="<?=htmlentities(trim($v_password, "'"))?>"><br />
                                    <meter max="4" id="meter"></meter>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text">
                                    <?php print __('Your password must have at least');?>
                                    <ul>
                                        <li><?php print __('8 characters long');?></li>
                                        <li><?php print __('1 uppercase & 1 lowercase character');?></li>
                                        <li><?php print __('1 number');?></li>
                                    </ul>
                                </td>
                            </tr>                            
                            <tr>
                                <td>
                                    <label><input type="checkbox" class="vst-checkbox password-option" name="v_twofa" <?php if(!empty($v_twofa)) echo "checked=yes" ?>> <?php print __('Enable 2FA');?></label>
                                    <?php if (!empty($v_twofa)) { ?>
                                    <p><?php echo __('2FA Reset Code:').' '.$v_twofa; ?></br></p>
                                    <p><?php echo __('Please scan the code below in your 2FA application:'); ?></p>
                                    <div><img class="qr-code" src="<?php echo $v_qrcode; ?>"></div>
                                    <?php } ?>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('Contact');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" size="20" class="vst-input" name="v_name" value="<?=htmlentities(trim($v_name, "'"))?>">
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('Email');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" size="20" class="vst-input" name="v_email" value="<?=htmlentities(trim($v_email, "'"))?>">
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('Package');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="vst-list" name="v_package">
                                        <?php
                                            foreach ($packages as $key => $value) {
                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
                                                $skey = "'".$key."'";
                                                if (( $key == $v_package ) || ( $skey == $v_package)){
                                                    echo 'selected' ;
                                                }
                                                echo ">".htmlentities($key)."</option>\n";
                                            }
                                        ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('Language');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="vst-list" name="v_language">
                                        <?php
                                            foreach ($languages as $key => $value) {
                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$value."\"";
                                                $svalue = "'".$value."'";
                                                if (( $value == $v_language ) || ( $svalue == $v_language)){
                                                    echo 'selected' ;
                                                }
                                                if (( $value == detect_user_language() ) && (empty($v_language))){
                                                    echo 'selected' ;
                                                }
                                                echo ">".htmlentities($value)."</option>\n";
                                            }
                                        ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('SSH Access');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="vst-list" name="v_shell">
                                        <?php
                                            foreach ($shells as $key => $value) {
                                                echo "\t\t\t\t<option value=\"".htmlentities($value)."\"";
                                                $svalue = "'".$value."'";
                                                if (( $value == $v_shell ) || ($svalue == $v_shell )){
                                                    echo 'selected' ;
                                                }
                                                echo ">".htmlentities($value)."</option>\n";
                                            }
                                        ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                 <td class="vst-text input-label">
                                     <?php print __('PHP CLI Version');?>
                                 </td>
                             </tr>
                             <tr>
                                 <td>
                                     <select class="vst-list" name="v_phpcli">
                                         <?php
                                             foreach ($php_versions as $key => $value) {
                                                 $php = explode('-',$value);
                                                 echo "\t\t\t\t<option value=\"".$value."\"";
                                                 $svalue = "'".$value."'";
                                                 if ((!empty($v_phpcli)) && ( $value == $v_phpcli ) || ($svalue == $v_phpcli)){
                                                     echo ' selected' ;
                                                 }
                                                 if ((empty($v_phpcli)) && ($value == DEFAULT_PHP_VERSION)){
                                                     echo ' selected' ;
                                                 }
                                                 echo ">".htmlentities($value)."</option>\n";
                                             }
                                         ?>
                                     </select>
                                 </td>
                             </tr>                            
                        <?php if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {?>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('Default 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>
                            <?php } ?>
                        </table>
                        <table class="data-col2"></table>
                    </td>
                </tr>
            </table>
        </form>
    </div>