<?php include "../../root.class.php";
$html = new html();
$html->add_styles_page();
$html->check_user_type("ADMIN");

?>


<div class="form_down">
    <h1>EDIT EXPENCE</h1>
    <hr>
    <?php
    echo $html->input_html("", $_GET['record_id'], "record_id", "record_id", "inputs", "", "", "text", "hidden");
    echo $html->select_html_from_db("suppliers", "record_id", "name", "", "supplier_id", "supplier_id");
    echo $html->select_from_db_add_current_selected_column('expenses', 'supplier_id', "record_id = {$_GET['record_id']}", 'supplier_id');
    echo $html->select_html_from_db("projects", "record_id", "name", "", "project_id", "project_id");
    echo $html->select_from_db_add_current_selected_column('expenses', 'project_id', "record_id = {$_GET['record_id']}", "project_id");

    echo $html->input_html_from_db('expenses', 'amount', "record_id = {$_GET['record_id']}", "", "amount", "amount");
    echo $html->date_input_html_from_db('expenses', 'date_time', "record_id = {$_GET['record_id']}", "date_time", "date_time");
    echo $html->image_from_db('images', 'expenses', 'images', "record_id = {$_GET['record_id']}");
    echo $html->submit_btn('submit', 'ADD', 'update_expence()');
    ?>

</div>

<?php
$html->html_form_ajax("update_expence", "UPDATE", "expenses", '', false, [], '', ['images']);
?>