<?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->value_from_db("equipment_list", "name", "record_id = {$_GET['record_id']}");
$name->id("name");

$record_id = new input();
$record_id->type("hidden");
$record_id->name("record_id");
$record_id->id("record_id");
$record_id->value($_GET['record_id']);


$name_btn = new button();
$name_btn->value("UPDATE");
$name_btn->onclick("add_equipment()");

?>

<div class="form_down">
    <h1>EDIT EQUIPMENT</h1>
    <?php
    $name->add();
    $record_id->add();
    $name_btn->add();
    ?>
</div>

<?php
// $html->html_form_ajax("add_user", "INSERT", "users", '', false);
$ajax = new js_ajax();
$ajax->function_name("add_equipment");
$ajax->submit_btn_id("submit");
$ajax->update("equipment_list");
$ajax->on_success("SUCCESSFULLY UPDATED EQUIPMENT");

?>