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

// HTML FORM ELEMENTS
$username = new input();
$username->class("inputs");
$username->type("text");
$username->placeholder("username");
$username->name("username");
$username->id("username");
$username->onkeyup("search_user()");

$user_type = new select();
$user_type->class("inputs");
$user_type->name("access_type");
$user_type->id("access_type");
$user_type->add_option("", "access_type");
$user_type->onchange("search_user()");
$user_type->add_option("", "ALL");
$user_type->add_option("ALL", "MANAGMENT");
$user_type->add_option("OPERATOR", "FUEL OPERATOR");
$company_id = new input();
$company_id->class("inputs");
$company_id->type("hidden");
$company_id->placeholder("company id");
$company_id->name("company_id");
$company_id->required();
$company_id->id("company_id");
$company_id->value($_SESSION['company_id']);


$user_type_label = new label();
$user_type_label->for("user_type");
$user_type_label->value("User Type");



$submit_btn = new button();
$submit_btn->value("SEARCH");
$submit_btn->onclick("search_user()");



?>


<div class="row">
    <input type="submit" value="ADD" class="submit_btn" onclick="window.location.href='add_user.php'">
    <div class="form_down">
        <?php $username->add(); ?>
        <?php $user_type->add(); ?>
        <?php $company_id->add(); ?>
    </div>
</div>



<?php
$ajax = new js_ajax();
$ajax->run_on_load();
$ajax->function_name("search_user");
// $ajax->submit_btn_id("submit");
$ajax->select("users");
$ajax->return_columns(['username']);
$ajax->redirect("edit_user.php");
?>