<?php
include "../../classes/autoload.php";

$invoice_res = $db->query("invoices", "SELECT * FROM invoices WHERE invoice_number = {$_GET['invoice_number']}");
if ($invoice_res->num_rows > 0) {
    $invoice = $invoice_res->fetch_assoc();
    echo $invoice['record_id'];
} else {
    echo 0;
}
?>