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


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

$jc_number = new input();
$jc_number->name("jc_number");
$jc_number->id("jc_number");
$jc_number->class("inputs");
$jc_number->placeholder("JOB CARD NUMBER");
$jc_number->type("text");
$jc_number->onkeyup("search_jobcard()");

$status = new select();
$status->name("status");
$status->id("status");
$status->class("inputs");
$status->onchange("search_jobcard()");
$status->add_option("", "STATUS");
$status->add_option("1", "Active");
$status->add_option("0", "Inactive");

$account_manager_id = new select();
$account_manager_id->name("account_manager_id");
$account_manager_id->id("account_manager_id");
$account_manager_id->class("inputs");
$account_manager_id->add_option("", "ACCOUNT MANAGER");
$account_manager_id->fill_from_db("users", "record_id", "username");
$account_manager_id->onchange("search_jobcard()");

?>

<div class="search_form">
    <h2>SEARCH JOB CARD</h2>
    <?php
    $jc_number->add();
    $project_name->add();
    $status->add();
    $account_manager_id->add();
    ?>
</div>

<?php
$ajax = new js_ajax();
$ajax->run_on_load();
$ajax->function_name("search_jobcard");
// $ajax->submit_btn_id("submit");
$ajax->select("job_cards");
$ajax->return_columns(['jc_number','project_name']);
$ajax->redirect("edit_jobcard.php");
?>