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

$name = new input();
$name->class("inputs");
$name->type("text");
$name->placeholder("NAME");
$name->name("name");
$name->id("name");
$name->onkeyup("search_tests()");

$test_description = new input();
$test_description->class("inputs");
$test_description->type("text");
$test_description->placeholder("DESCRIPTION");
$test_description->name("test_description");
$test_description->id("test_description");
$test_description->onkeyup("search_tests()");

$passmark = new input();
$passmark->class("inputs");
$passmark->type("text");
$passmark->placeholder("PASSMARK");
$passmark->name("passmark");
$passmark->id("passmark");
$passmark->onkeyup("search_tests()");

?>

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

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

    <?php
    $ajax = new js_ajax();
    $ajax->run_on_load();
    $ajax->function_name("search_test");
    $ajax->select("tests");
    $ajax->return_columns(['name', 'test_description', 'passmark']);
    $ajax->redirect("edit_test.php");
    ?>