Backup #1725

ID1725
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/semantic-explorer/relationen/new.php
Version4
Typ modified
Größe2.9 KB
Hash3dac642541873b0dee8b339161b031968220cddd924d805e8027277133622ad6
Datum2025-12-27 12:34:49
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Write-Operation
Datei existiert Ja

Dateiinhalt

<?php ob_start(); ?>

<nav class="breadcrumb">
    <a href="/">Campus KI</a> &raquo;
    <a href="/semantic-explorer">Semantic Explorer</a> &raquo;
    <a href="/semantic-explorer/relationen">Relationen</a> &raquo; Neu
</nav>

<h1>Neue Relation</h1>

<form id="relation-form" class="form" style="max-width: 600px;">
    <div class="form-group">
        <label for="source_entity_id">Quell-Entität *</label>
        <select id="source_entity_id" name="source_entity_id" class="form-select" required>
            <option value="">-- Bitte waehlen --</option>
            <?php foreach ($entities as $e): ?>
            <option value="<?= $e['id'] ?>"><?= htmlspecialchars($e['name']) ?> (<?= $e['type'] ?>)</option>
            <?php endforeach; ?>
        </select>
    </div>

    <div class="form-group">
        <label for="relation_type">Beziehungstyp *</label>
        <select id="relation_type" name="relation_type" class="form-select" required>
            <?php foreach ($relationTypes as $t): ?>
            <option value="<?= htmlspecialchars($t) ?>"><?= htmlspecialchars($t) ?></option>
            <?php endforeach; ?>
        </select>
    </div>

    <div class="form-group">
        <label for="target_entity_id">Ziel-Entität *</label>
        <select id="target_entity_id" name="target_entity_id" class="form-select" required>
            <option value="">-- Bitte waehlen --</option>
            <?php foreach ($entities as $e): ?>
            <option value="<?= $e['id'] ?>"><?= htmlspecialchars($e['name']) ?> (<?= $e['type'] ?>)</option>
            <?php endforeach; ?>
        </select>
    </div>

    <div class="form-group">
        <label for="strength">Staerke (0.0 - 1.0)</label>
        <input type="number" id="strength" name="strength" class="form-input"
               min="0" max="1" step="0.1" value="1.0">
    </div>

    <div class="form-actions">
        <button type="submit" class="btn btn--primary">Relation erstellen</button>
        <a href="/semantic-explorer/relationen" class="btn">Abbrechen</a>
    </div>
</form>
<div id="form-message" class="form-message"></div>

<script>
document.getElementById('relation-form').addEventListener('submit', async (e) => {
    e.preventDefault();
    const form = e.target;
    const formData = new FormData(form);
    const data = Object.fromEntries(formData.entries());

    const response = await fetch('/semantic-explorer/relationen', {
        method: 'POST',
        headers: {'Content-Type': 'application/json'},
        body: JSON.stringify(data)
    });
    const result = await response.json();

    if (result.success) {
        window.location.href = '/semantic-explorer/relationen';
    } else {
        document.getElementById('form-message').innerHTML =
            '<span class="form-message--error">Fehler: ' + result.error + '</span>';
    }
});
</script>

<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1725 4 modified 2.9 KB 2025-12-27 12:34
1637 3 modified 2.9 KB 2025-12-27 09:45
1636 2 modified 2.9 KB 2025-12-27 09:45
1635 1 modified 2.8 KB 2025-12-27 09:45

← Zurück zur Übersicht