<?php
include "../../root.class.php";
$html = new html();
$html->add_styles_page();

// $html->check_user_type("ADMIN");
// 
$category = new input();
$category->name("name");
$category->id("name");
$category->type("text");
$category->placeholder("Category Name");
$category->class("search_inputs");
$category->onkeyup("category_search()");

?>

<div class="search_form">
    <?php
    $category->add();

    $ajax = new js_ajax();
    $ajax->function_name("category_search");
    $ajax->select("stock_categories");
    $ajax->return_columns(['name']);
    $ajax->run_on_load();
    $ajax->redirect("edit_stock_category.php");
    ?>

</div>

<?php echo $html->html_form_ajax("search_stock_categories", "SELECT", "stock_categories", '', false, ['name'], "edit_stock_category.php"); ?>