<?php

include "../../root.class.php";
$db = new db_safeguard();
$call = new call_functions();

// chech in Job Cards
$res = $db->query("job_cards", "SELECT * FROM job_cards WHERE jc_number = '{$_GET['jc_number']}'");
if ($res->num_rows >= 1) {
    $data = $res->fetch_assoc();
    echo $data['project_name'] . " : " . $call->get_username($data['account_manager_id']);
}


// chech in Job Cards Tech
$res = $db->query("job_cards_tech", "SELECT * FROM job_cards_tech WHERE jc_number = '{$_GET['jc_number']}'");
if ($res->num_rows >= 1) {
    $data = $res->fetch_assoc();
    echo $data['company_name'] . " : " . $call->get_username($data['user_id']);
}

// chech in Job Card Account
$res = $db->query("job_card_accounts", "SELECT * FROM job_card_accounts WHERE `name` = '{$_GET['jc_number']}'");
if ($res->num_rows >= 1) {
    $data = $res->fetch_assoc();
    echo $data['description'] . " : " . $call->get_username($data['account_manager_id']);
}
