public function getPurchaseOrders($supplierid) { if ($this->validateAdmin()) { echo json_encode(PurchaseOrder::GetSupplierOrders($supplierid)); } else { echo 0; } }