Add PayPal integration and band image upload features

- Implemented complete PayPal payment integration with checkout flow
- Added payments table to database for transaction tracking
- Created image upload functionality for band profiles
- Added gallery management in band profiles
- Updated booking flow to support PayPal payments
- Added payment status display in user profiles
- Included comprehensive documentation for new features

New files:
- upload-handler.php: REST API for image uploads
- paypal-checkout.php: PayPal checkout page
- paypal-process.php: Payment processing backend
- PAYPAL_UPLOAD_FEATURES.md: Complete documentation
- storage/uploads/bands/: Upload directory

Modified files:
- database.sql: Added payments table
- profil.php: Added gallery and payment tracking
- anfrage.php: Integrated PayPal payment option
This commit is contained in:
Claude
2025-12-02 21:11:04 +00:00
parent 798a2785e7
commit 615866d215
7 changed files with 714 additions and 3 deletions
+18 -1
View File
@@ -15,6 +15,8 @@ $user = currentUser();
$message = '';
$error = '';
$requestId = null;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$data = [
'band_id' => $bandId,
@@ -30,6 +32,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$error = 'Bitte Datum und Ort ausfüllen.';
} else {
createRequest($data);
$requestId = (int) db()->lastInsertId();
$message = 'Anfrage gespeichert und an die Band gemeldet.';
sendEmail('info@' . preg_replace('/\s+/', '', strtolower($band['name'])) . '.ch', 'Neue Anfrage', 'Neue Anfrage für ' . $band['name']);
}
@@ -52,8 +55,21 @@ $settings = settings();
<p>PayPal Zahlungsabwicklung ist <?= $settings['paypal_enabled'] === '1' ? 'aktiviert' : 'optional' ?>, Service Fee: <?= htmlspecialchars($settings['service_fee']) ?>%.</p>
</header>
<main>
<?php if ($message): ?><div class="alert alert-success"><?= htmlspecialchars($message) ?></div><?php endif; ?>
<?php if ($message): ?>
<div class="alert alert-success">
<?= htmlspecialchars($message) ?>
<?php if ($requestId && $settings['paypal_enabled'] === '1'): ?>
<div style="margin-top: 1rem;">
<a href="paypal-checkout.php?request_id=<?= $requestId ?>" class="btn-primary" style="display: inline-block; padding: 0.75rem 1.5rem; text-decoration: none;">
Jetzt mit PayPal bezahlen
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($error): ?><div class="alert alert-error"><?= htmlspecialchars($error) ?></div><?php endif; ?>
<?php if (!$message): ?>
<form method="post">
<label>Event-Datum
<input type="date" class="form-control" name="event_date" required>
@@ -72,6 +88,7 @@ $settings = settings();
</label>
<button class="btn-primary">Anfrage senden</button>
</form>
<?php endif; ?>
</main>
</body>
</html>