<?php /* Smarty version 2.6.22, created on 2016-11-22 21:01:08
         compiled from /data/vhosts/orders.eurojaponautosupply.com/httpdocs/ultimate_support_chat/modules/users/views/edit.html */ ?>
<div class="usc_app_page_wrap" style="min-height:500px">
<h1>Edit Operator</h1>

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

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

            <div class="form-group">
                <label>Display name</label><span id="username_ajax_return"></span>
                <input type="text" class="form-control" id="username" name="username" value="<?php echo $_POST['username']; ?>
"
                       placeholder="Enter display name" required onblur="checkUsername()">
            </div>

            <div class="form-group">
                <label>First name</label>

                <input type="text" class="form-control" name="firstname" value="<?php echo $_POST['firstname']; ?>
"
                       placeholder="Enter first name">
            </div>

            <div class="form-group">
                <label>Last name</label>
                <input type="text" class="form-control" name="lastname" value="<?php echo $_POST['lastname']; ?>
"
                       placeholder="Enter last name">
            </div>

            <div class="form-group">
                <label>Email address</label><span id="email_ajax_return"></span>
                <input type="email" class="form-control" id="email" value="<?php echo $_POST['email']; ?>
" name="email"
                       placeholder="Enter email" required onblur="checkEmail()">
            </div>

            <div class="form-group">
                <label>Password</label>
                <input type="password" class="form-control" name="password" value=""
                       placeholder="Password">
            </div>

			<?php if ($_SESSION['user']['permissions'] == 1): ?>
			
            	<div class="checkbox">
                	<label>
                    	<input type="checkbox" name="role" value="admin" <?php if ($_POST['permissions'] == 1): ?>checked<?php endif; ?>> Admin
                    	<p class="help-block">Can manage operators, departments, settings and widget customization</p>
                	</label>
            	</div>
			
			<?php endif; ?>


        </div>
        <!-- /.box-body -->

        <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">
        <label>Operator avatar</label><br/>

        <?php if ($_POST['avatar'] == ''): ?>
             <span id="operator_avatar"><img id="op_avatar" src="<?php echo $this->_tpl_vars['data_server']; ?>
config/themes/img/avatars/default.png"></span>
        <?php else: ?>
             <span id="operator_avatar"><img id="op_avatar" src="<?php echo $this->_tpl_vars['data_server']; ?>
<?php echo $_POST['avatar']; ?>
"></span>
        <?php endif; ?>

    </div>


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

            <input type="file" name="file" id="file" onchange="uploadFile();"/>
            <input type="hidden" name="user_id" id="user_id" value="<?php echo $_GET['user_id']; ?>
"/>
            <input type="hidden" name="avatar" id="selected_avatar" value="<?php echo $_POST['avatar']; ?>
">

            <p class="help-block">JPG or PNG (Max: 90px by 90px)</p>

            <button type="button" value="Upload 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>

<?php if ($_SESSION['user']['user_id'] == $_GET['user_id']): ?>
	<?php echo '<script>var editingLoggedOperator = true; </script>'; ?>

<?php else: ?>
	<?php echo '<script>var editingLoggedOperator = false; </script>'; ?>

<?php endif; ?>

<script src="<?php echo $this->_tpl_vars['data_server']; ?>
js/users_edit.min.js" type="text/javascript"></script>