Backup #1673

ID1673
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/content/edit.php
Version1
Typ modified
Größe3.3 KB
Hash5c4c515b58b80ed7ba4463f559e01846df2f8f9737b4af00f247808e6c677639
Datum2025-12-27 11:44:22
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="/content">Content Studio</a> &raquo; <a href="/content/<?= $order['id'] ?>">Auftrag #<?= $order['id'] ?></a> &raquo; Bearbeiten
</nav>

<h1>Auftrag bearbeiten</h1>

<form id="order-form" class="form" style="max-width: 600px;">
    <div class="form-group">
        <label for="title">Titel *</label>
        <input type="text" id="title" name="title" class="form-input" required
               value="<?= htmlspecialchars($order['title']) ?>">
    </div>
    <div class="form-group">
        <label for="briefing">Briefing *</label>
        <textarea id="briefing" name="briefing" class="form-textarea" rows="6" required><?= htmlspecialchars($order['briefing']) ?></textarea>
    </div>
    <div class="form-group">
        <label for="author_profile_id">Autorenprofil</label>
        <select id="author_profile_id" name="author_profile_id" class="form-select">
            <option value="">-- Kein Profil --</option>
            <?php foreach ($profiles ?? [] as $profile): ?>
            <option value="<?= $profile['id'] ?>" <?= ($order['author_profile_id'] ?? '') == $profile['id'] ? 'selected' : '' ?>><?= htmlspecialchars($profile['name']) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="form-group">
        <label for="contract_id">Contract</label>
        <select id="contract_id" name="contract_id" class="form-select">
            <option value="">-- Kein Contract --</option>
            <?php foreach ($contracts ?? [] as $contract): ?>
            <option value="<?= $contract['id'] ?>" <?= ($order['contract_id'] ?? '') == $contract['id'] ? 'selected' : '' ?>><?= htmlspecialchars($contract['name']) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="form-group">
        <label for="structure_id">Struktur</label>
        <select id="structure_id" name="structure_id" class="form-select">
            <option value="">-- Keine Struktur --</option>
            <?php foreach ($structures ?? [] as $structure): ?>
            <option value="<?= $structure['id'] ?>" <?= ($order['structure_id'] ?? '') == $structure['id'] ? 'selected' : '' ?>><?= htmlspecialchars($structure['name']) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="form-actions">
        <button type="submit" class="btn btn--primary">Speichern</button>
        <a href="/content/<?= $order['id'] ?>" class="btn">Abbrechen</a>
    </div>
</form>
<div id="form-message" class="form-message"></div>

<script>
document.getElementById('order-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('/api/v1/content/<?= $order['id'] ?>', {
        method: 'PUT',
        headers: {'Content-Type': 'application/json'},
        body: JSON.stringify(data)
    });
    const result = await response.json();

    if (result.success) {
        window.location.href = '/content/<?= $order['id'] ?>';
    } 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
2186 11 modified 19.9 KB 2025-12-30 22:51
2184 10 modified 16.5 KB 2025-12-30 22:43
2183 9 modified 15.3 KB 2025-12-30 22:42
2182 8 modified 13.6 KB 2025-12-30 22:41
2178 7 modified 13.3 KB 2025-12-30 22:37
2177 6 modified 12.2 KB 2025-12-30 22:37
2176 5 modified 11.1 KB 2025-12-30 22:36
2172 4 modified 3.0 KB 2025-12-30 22:33
1679 3 modified 3.0 KB 2025-12-27 11:49
1678 2 modified 3.0 KB 2025-12-27 11:49
1673 1 modified 3.3 KB 2025-12-27 11:44

← Zurück zur Übersicht