Files
webprogrammierung/content/profile.php
T

94 lines
4.2 KiB
PHP

<!--
Content: Profil
Inhalt: Das eigene Profil, wenn man angemeldet ist. Dort hat man die Möglichkeit seine Angaben zu ändern.
-->
<?php
include_once 'php/controller/profileArticles-controller.php';
?>
<main class="form-page">
<div class="flexbox">
<!-- Linke Spalte: Profildaten -->
<div class="container">
<form>
<label class="input-label">Vorname</label>
<input type="text" name="Vorname" class="login-input" required
placeholder="Vorname"
value="<?php //DB-Daten ?>">
<label class="input-label">Nachname</label>
<input type="text" name="Nachname" class="login-input" required
placeholder="Nachname"
value="<?php //DB-Daten ?>">
<label class="input-label">Email-Adresse</label>
<input type="email" name="Email" class="login-input" required
placeholder="mustermann@web.de"
value="<?php //DB-Daten ?>">
<label class="input-label">Passwort</label>
<input type="password" name="Passwort" class="login-input"
required placeholder="Passwort">
<button type="submit" class="login-button">
Speichern
</button>
<button type="button" class="login-button delete-account-button">
Account löschen
</button>
</form>
</div>
<!-- Rechte Spalte: Eigene Beiträge -->
<div class="container">
<h2 class="section-title">Meine Beiträge</h2>
<div class="articles-list">
<!-- Beispiel-Eintrag 1 (Wird später per PHP wiederholt) -->
<div class="article-item">
<div class="article-meta">
<span class="article-date"><?php if (isset($creationDate)) { echo htmlspecialchars($creationDate); } ?></span>
<span class="article-category"><?php if (isset($category)) { echo htmlspecialchars($category); } ?></span>
</div>
<h3 class="article-title"><?php if (isset($title)) { echo htmlspecialchars($title); } ?></h3>
<?php if (isset($tags) && !empty($tags)): ?>
<div class="article-view-bottom-section">
<div class="article-view-tags-label">Tags:</div>
<div class="article-view-tags-list">
<?php
// Falls $tags ein String ist (z.B. "Web, CSS"), in ein Array umwandeln
$tagArray = is_array($tags) ? $tags : explode(',', $tags);
foreach ($tagArray as $tag):
$trimmedTag = trim($tag);
if (!empty($trimmedTag)):
?>
<span class="article-view-tag-item"><?php echo htmlspecialchars($trimmedTag); ?></span>
<?php
endif;
endforeach;
?>
</div>
</div>
<?php endif; ?>
<a href="" <!-- TODO --> class="edit-link-button">Bearbeiten</a>
</div>
<!-- Beispiel-Eintrag 2 -->
<div class="article-item">
<div class="article-meta">
<span class="article-date">15.04.2026</span>
<span class="article-category">Lifestyle</span>
</div>
<h3 class="article-title">Produktiv im Homeoffice</h3>
<div class="article-tags">
<span class="tag">Tipps</span>
<span class="tag">Arbeit</span>
</div>
<a href="edit-article.php?id=2" class="edit-link-button">Bearbeiten</a>
</div>
</div>
</div>
</div>
</main>