require_once __DIR__ . "/classes/Jueces.php"; try { $result = null; $am = new AuthManager("juezFunctions"); $operation = http_request("Operation", "s", null); $federation = http_request("Federation", "i", -1); // -1 defaults to all federations $idjuez = http_request("ID", "i", 0); $jueces = new Jueces("juezFunctions", $federation); if ($operation === null) { throw new Exception("Call to juezFunctions without 'Operation' requested"); } switch ($operation) { case "insert": $am->access(PERMS_OPERATOR); $result = $jueces->insert(); break; case "update": $am->access(PERMS_OPERATOR); $result = $jueces->update($idjuez); break; case "delete": $am->access(PERMS_OPERATOR); $result = $jueces->delete($idjuez); break; case "selectbyid": $result = $jueces->selectByID($idjuez); break; case "select": $result = $jueces->select(); break;