Esempio n. 1
0
            $result = $jornadas->selectByID($jornadaid);
            break;
        case "enumerate":
            $result = $jornadas->searchByPrueba($allowClosed, $hideUnassigned);
            break;
        case "rounds":
            $result = $jornadas->roundsByJornada($jornadaid);
            break;
        case "enumerateMangasByJornada":
            $result = Jornadas::enumerateMangasByJornada($jornadaid);
            break;
        case "enumerateRondasByJornada":
            $result = Jornadas::enumerateRondasByJornada($jornadaid);
            break;
        case "access":
            $result = $jornadas->checkAccess($am, $jornadaid, $perms);
            break;
        default:
            throw new Exception("jornadaFunctions:: invalid operation: {$operation} provided");
    }
    if ($result === null) {
        throw new Exception($jornadas->errormsg);
    }
    if ($result === "") {
        echo json_encode(array('success' => true, 'insert_id' => 0, 'affected_rows' => 0));
    } else {
        echo json_encode($result);
    }
} catch (Exception $e) {
    do_log($e->getMessage());
    echo json_encode(array('errorMsg' => $e->getMessage()));