<?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->required();
$name->id("name");
$name->value_from_db("variety", "name", "record_id = $_GET[record_id] ");
// HTML FORM ELEMENTS

$record_id = new input();
$record_id->class("inputs");
$record_id->type("hidden");
$record_id->name("record_id");
$record_id->required();
$record_id->id("record_id");
$record_id->value($_GET['record_id']);

$submit_btn = new button();
$submit_btn->value("UPDATE");
$submit_btn->onclick("edit_variety()");

?>

<div class="form_down">
    <h1>EDIT VARIETY</h1>
    <?php
    $name->add();
    $record_id->add();
    $submit_btn->add();
    ?>
</div>

<?php
// $html->html_form_ajax("add_user", "INSERT", "users", '', false);
$ajax = new js_ajax();
$ajax->function_name("edit_variety");
$ajax->submit_btn_id("submit");
$ajax->update("variety");
$ajax->on_success("VARIETY SUCCESSFULLY UPDATED");

?>