'That purchase order no longer exists.'])); } if (!poMayApprove($po)) { exit(json_encode(['error' => $po['po_status'] !== 'pending' ? poNumber($po) . " isn't waiting for approval." : "You can't approve this one - it needs someone else with full Purchasing access."])); } $approve = intval($_GET['approve'] ?? 1) === 1; $own = intval($po['po_created_by']) === intval($session_user_id ?? 0); ob_start(); ?>