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

$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("0", "INACTIVE");
$status->add_option("1", "SEND BACK TO TECHNICIAN");
$status->add_option("2", "IN REVIEW");
$status->add_option("3", "SENT FOR QUOTATION");
$status->add_option("4", "WAITING PO");
$status->add_option("5", "WAITING PARTS");
$status->add_option("6", "DECLINED");
$status->add_option("7", "SEND FOR ACTION");
$status->add_option("8", "SEND FOR INVOICING");
$status->add_option("9", "INVOICED");

$account_manager_id = new select();
$account_manager_id->name("user_to_do");
$account_manager_id->id("user_to_do");
$account_manager_id->class("inputs");
$account_manager_id->add_option("", "TECHNICIAN");
$account_manager_id->fill_from_db("users", "record_id", "username", "user_type = 'TECHNICIANS'");
$account_manager_id->onchange("search_jobcard()");

?>

<div class="search_form">
    <h2>SEARCH JOB CARD TECHNICAL TO REPORT ON</h2>
    <?php
    $jc_number->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_tech");
$ajax->return_columns(['jc_number','company_name']);
$ajax->redirect("job_card_tech_home.php");
?>