<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>
          </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" name="v_add_user" 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">
                            <tr>
                                <td class="step-top">
                                    <span class="page-title"><?=__('Adding 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_username" value="<?=htmlentities(trim($v_username, "'"))?>" tabindex="1" >
                                </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, "'"))?>" tabindex="2" /><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 class="vst-text ">
                                    <?php print __('Contact');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text" size="20" class="vst-input" name="v_name" value="<?=htmlentities(trim($v_name, "'"))?>" tabindex="3" >
                                </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" id='v_email' value="<?=htmlentities(trim($v_email, "'"))?>" tabindex="5" >
                                </td>
                            </tr>
                             <tr>
                                <td class="vst-text input-label">
                                    <label><input type="checkbox" size="20" class="vst-checkbox" name="v_email_notice" id='v_email_notify' value="" tabindex="5" /> <?php print __('Send welcome email');?></label>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label" name="v_package">
                                    <?php print __('Package');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <select class="vst-list" name="v_package" tabindex="6" >
                                        <?php
                                            foreach ($data as $key => $value) {
                                                echo "\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
                                                if ((!empty($v_package)) && ( $key == $_POST['v_package'])){
                                                    echo 'selected' ;
                                                } else {
                                                    if ( $key == 'default'){
                                                        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" tabindex="7" >
                                        <?php
                                            foreach ($languages as $key => $value) {
                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($value)."\"";
                                                $svalue = "'".$value."'";
                                                if (( $value == $_SESSION['LANGUAGE'] ) && (empty($v_language))){
                                                    echo ' selected' ;
                                                }
                                                if (isset($v_language)){
                                                    if (( $value == $v_language ) || ( $svalue == $v_language)){
                                                        echo ' selected' ;
                                                    }
                                                }
                                                echo ">".htmlentities($value)."</option>\n";
                                            }
                                        ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="vst-text input-label">
                                    <?php print __('Send login credentials to email address');?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="text"  class="vst-input" name="v_notify" id="v_notify" value="<?=htmlentities(trim($v_notify, "'"))?>" tabindex="8" >
                                </td>
                            </tr>
                        </table>
                    <table class="data-col2"></table>
                    </td>
                </tr>
            </table>
        </form>
    </div>
