<?php include "../../root.class.php";
$html = new html();
$html->add_styles_page();

?>

<div class="form_down">
    <h1>ADD USER</h1>
    <label>USER ID</label>
    <?php echo $html->input_html_from_db("users", "record_id", "record_id = {$_GET['record_id']}", "record_id", 'record_id', 'record_id'); ?>
    <label>USERNAME</label>
    <?php echo $html->input_html_from_db("users", "username", "record_id = {$_GET['record_id']}", "USERNAME", 'username', 'username'); ?>
    <label>EMAIL</label>
    <?php echo $html->input_html_from_db("users", "email", "record_id = {$_GET['record_id']}", "EMAIL", 'email', 'email'); ?>
    <label>PASSWORD</label>
    <?php echo $html->input_html("", "", "user_password", "user_password");
    echo "<label>ACCESS LEVEL</label>";
    echo $html->select_html_from_db('user_types', 'name', 'name', '', 'user_type', 'user_type');
    echo "<label>STATUS</label>";
    echo $html->select_from_db_add_current_selected_column('users', 'user_type', "record_id = {$_GET['record_id']}", 'user_type');
    ?>
   <select name="status" id="status" class="inputs">
        <option value="0">INACTIVE</option>
        <option value="1">ACTIVE</option>
    </select>
    <?php
    echo $html->select_from_db_add_current_selected_column('users', 'status', "record_id = {$_GET['record_id']}", 'status');

    echo $html->submit_btn("submit", 'SAVE', 'edit_user()');
    ?>

</div>

<?php
$html->html_form_ajax("edit_user", "UPDATE", "users", '', false);
?>