<div class="usc_app_page_wrap" style="min-height:600px">

<h1>Add new operator</h1>

<form role="form" method="post" enctype="multipart/form-data" >

    <input class="name_nulled" type="text" name="username"/>
    <input class="name_nulled"  type="password" name="password"/>

    <div class="col-lg-6">
        <div class="box-body">
            <div class="form-group">
                <label>Display name</label><span id="username_ajax_return"></span>
				{if isset($error.username)}<span class="rm_ajax_username error_handling">{$error.username}</span>{/if}
                <input type="text" class="form-control" id="username" name="username" value="{$smarty.post.username}" placeholder="Enter display name" onblur="checkUsername()"  required />
            </div>
			
            <div class="form-group">
                <label>First name</label>{if isset($error.firstname)}<span class="error_handling ml20">{$error.firstname}</span>{/if}

                <input type="text" class="form-control" id="firstname" name="firstname" value="{$smarty.post.firstname}" placeholder="Enter first name" required />
            </div>

            <div class="form-group">
                <label>Last name</label>{if isset($error.lastname)}<span class="error_handling ml20">{$error.lastname}</span>{/if}
                <input type="text" class="form-control" id="lastname" name="lastname" value="{$smarty.post.lastname}" placeholder="Enter last name" required />
            </div>


            <div class="form-group">
                <label>Email address</label><span id="email_ajax_return"></span>
				{if isset($error.email)}<span class="rm_ajax_email error_handling">{$error.email}</span>{/if}
                <input type="email" class="form-control" id="email" name="email" value="{$smarty.post.email}" placeholder="Enter email" onblur="checkEmail()" required />
            </div>


            <div class="form-group">
                <label>Password</label>{if isset($error.password)}<span class="error_handling ml20">{$error.password}</span>{/if}
                <input type="password" class="form-control" id="password" name="password" value="{$smarty.post.password}" placeholder="Enter password" required />
            </div>

            <div class="checkbox">
                <label>
                    <input type="checkbox" id="make_admin" name="role" value="admin" {if $smarty.post.role=='admin'}checked{/if}> Admin
                    <p class="help-block">Can manage operators, departments, settings and widget customization</p>
                </label>
            </div>
        </div>

        <div class="box-footer">
            <button type="submit" name="submit" value="true" class="btn btn-primary">Save</button>
        </div>
    </div>


<div class="col-lg-6">

    <div class="form-group">
        {if $smarty.post.avatar == ''}
        <span id="operator_avatar"><img src="{$data_server}config/themes/img/avatars/default.png"></span>
        {else}
        <span id="operator_avatar"><img src="{$data_server}{$smarty.post.avatar}"></span>
        {/if}

    </div>


    <div class="form-group">
        <label>Upload avatar</label>


            <input type="file" name="file" id="file" onchange="uploadFile();">
            <input type="hidden" name="selected_avatar" id="selected_avatar" value="">
            <p class="help-block">JPG or PNG (Max: 90px by 90px)</p>

            <button type="button" value="Remove_File" class="btn btn-primary" onclick="remove_avatar();">Remove</button>
            <br/><br/>

            <p id="error_handling"></p>

            <progress id="progressBar" value="0" max="100"></progress>
            <p id="loaded_n_total"></p>

            <p id="status"></p>


    </div>

</div>
</form>

</div>
<script src="{$data_server}js/users_add.min.js" type="text/javascript"></script>