<?php

include "../../root.class.php";

$db = new db_safeguard();

$res = $db->query("orders", "SELECT * FROM orders WHERE po_number = '{$_GET['po_number']}' AND `status` = 1");
if ($res->num_rows > 0) {
    echo "CLOSED";
} else {
    $res = $db->query("orders", "SELECT * FROM orders WHERE po_number = '{$_GET['po_number']}'");
    if ($res->num_rows == 0) {
        echo "NO THERE";
    } else {
        echo "OPEN";
    }
}