UI: Zeige Anzeigenamen statt Login-Namen und ToDo-Listen Redesign
All checks were successful
Docker Build & Push / build-and-push (push) Successful in 38s
All checks were successful
Docker Build & Push / build-and-push (push) Successful in 38s
This commit is contained in:
@@ -108,7 +108,7 @@ $sql = "SELECT
|
||||
a.image_url, a.product_designation, a.consumable,
|
||||
COALESCE(c.name, c_bp.name, 'Sonstiges') AS category_name,
|
||||
m.name AS manufacturer_name,
|
||||
u.username AS carrier_name,
|
||||
COALESCE(u.display_name, u.username) AS carrier_name,
|
||||
u.id AS carrier_id
|
||||
FROM packing_list_items AS pli
|
||||
LEFT JOIN articles AS a ON pli.article_id = a.id
|
||||
|
||||
@@ -44,7 +44,7 @@ $is_template_val = $is_template_view ? 1 : 0;
|
||||
|
||||
$sql = "SELECT
|
||||
pl.id, pl.name, pl.description, pl.user_id, pl.household_id, pl.is_template,
|
||||
u.username as creator_name,
|
||||
COALESCE(u.display_name, u.username) as creator_name,
|
||||
COUNT(DISTINCT COALESCE(pli.carrier_user_id, 'sonstiges')) AS carrier_count,
|
||||
SUM(pli.quantity * a.weight_grams) AS total_weight
|
||||
FROM packing_lists pl
|
||||
@@ -52,7 +52,7 @@ $sql = "SELECT
|
||||
LEFT JOIN packing_list_items pli ON pl.id = pli.packing_list_id
|
||||
LEFT JOIN articles a ON pli.article_id = a.id
|
||||
WHERE (pl.user_id = ? OR pl.household_id = ?) AND pl.is_template = ?
|
||||
GROUP BY pl.id, pl.name, pl.description, pl.user_id, u.username, pl.household_id, pl.is_template
|
||||
GROUP BY pl.id, pl.name, pl.description, pl.user_id, COALESCE(u.display_name, u.username), pl.household_id, pl.is_template
|
||||
ORDER BY pl.name ASC";
|
||||
|
||||
$stmt = $conn->prepare($sql);
|
||||
|
||||
@@ -35,7 +35,7 @@ if ($packing_list) {
|
||||
$packing_list_id = $packing_list['id'];
|
||||
|
||||
// SQL-Abfrage holt alle relevanten Daten
|
||||
$sql = "SELECT pli.id, pli.quantity, pli.parent_packing_list_item_id, a.name AS article_name, a.weight_grams, a.image_url, a.product_designation, a.consumable, a.product_url, c.name AS category_name, m.name AS manufacturer_name, u.username AS carrier_name FROM packing_list_items AS pli JOIN articles AS a ON pli.article_id = a.id LEFT JOIN categories AS c ON a.category_id = c.id LEFT JOIN manufacturers AS m ON a.manufacturer_id = m.id LEFT JOIN users AS u ON pli.carrier_user_id = u.id WHERE pli.packing_list_id = ?";
|
||||
$sql = "SELECT pli.id, pli.quantity, pli.parent_packing_list_item_id, a.name AS article_name, a.weight_grams, a.image_url, a.product_designation, a.consumable, a.product_url, c.name AS category_name, m.name AS manufacturer_name, COALESCE(u.display_name, u.username) AS carrier_name FROM packing_list_items AS pli JOIN articles AS a ON pli.article_id = a.id LEFT JOIN categories AS c ON a.category_id = c.id LEFT JOIN manufacturers AS m ON a.manufacturer_id = m.id LEFT JOIN users AS u ON pli.carrier_user_id = u.id WHERE pli.packing_list_id = ?";
|
||||
$stmt_items = $conn->prepare($sql);
|
||||
$stmt_items->bind_param("i", $packing_list_id);
|
||||
$stmt_items->execute();
|
||||
|
||||
@@ -94,11 +94,11 @@ $active_list_id = isset($_GET['list_id']) ? intval($_GET['list_id']) : (!empty($
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<?php foreach ($todo_lists as $list): ?>
|
||||
<a href="?list_id=<?php echo $list['id']; ?>" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center <?php echo $active_list_id == $list['id'] ? 'active' : ''; ?>">
|
||||
<a href="?list_id=<?php echo $list['id']; ?>" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center <?php echo $active_list_id == $list['id'] ? 'list-group-item-secondary fw-bold border-start border-4 border-dark' : ''; ?>">
|
||||
<?php echo htmlspecialchars($list['name']); ?>
|
||||
<form method="post" style="display:inline;" onsubmit="return confirm('Liste wirklich löschen?');">
|
||||
<input type="hidden" name="list_id" value="<?php echo $list['id']; ?>">
|
||||
<button type="submit" name="delete_list" class="btn btn-sm btn-link text-<?php echo $active_list_id == $list['id'] ? 'white' : 'danger'; ?> p-0"><i class="fas fa-trash"></i></button>
|
||||
<button type="submit" name="delete_list" class="btn btn-sm btn-link text-danger p-0"><i class="fas fa-trash"></i></button>
|
||||
</form>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
@@ -110,7 +110,7 @@ $active_list_id = isset($_GET['list_id']) ? intval($_GET['list_id']) : (!empty($
|
||||
<form method="post">
|
||||
<div class="input-group">
|
||||
<input type="text" name="list_name" class="form-control" placeholder="Neue Liste erstellen..." required>
|
||||
<button type="submit" name="create_list" class="btn btn-primary"><i class="fas fa-plus"></i></button>
|
||||
<button type="submit" name="create_list" class="btn btn-dark"><i class="fas fa-plus"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -180,4 +180,7 @@ $active_list_id = isset($_GET['list_id']) ? intval($_GET['list_id']) : (!empty($
|
||||
<?php
|
||||
require_once 'footer.php';
|
||||
if (isset($conn) && $conn instanceof mysqli) $conn->close();
|
||||
?>se();
|
||||
?>e();
|
||||
?>nn->close();
|
||||
?>
|
||||
Reference in New Issue
Block a user