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

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

$tons = new input();
$tons->class("inputs");
$tons->type("text");
$tons->placeholder("TONS");
$tons->name("tons");
$tons->id("tons");
$tons->onchange("search_silos()");

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

?>
<div class="column">
    <div class="banner">
        <div class="row">
            <?php echo $html->selectable_block("add_silo.php", "ADD"); ?>

            <div class="search_form">
                <div class="row">

                    <div class="row">
                        <?php $name->add(); ?>
                        <?php $tons->add(); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <?php
    $ajax = new js_ajax();
    $ajax->run_on_load();
    $ajax->function_name("search_silos");
    $ajax->select("silos");
    $ajax->return_columns(['name', 'tons']);
    $ajax->redirect("edit_silo.php");
    ?>