<?php require_once 'includes/bootstrap.php'; require_once 'includes/product-card.php'; include 'includes/header.php'; $id=isset($_GET['id'])?(int)$_GET['id']:0; $b=mysqli_query($conn,"SELECT * FROM brands WHERE id=$id LIMIT 1"); $br=$b?mysqli_fetch_assoc($b):null; $rs=mysqli_query($conn,"SELECT p.*,b.name brand_name FROM products p LEFT JOIN brands b ON p.brand_id=b.id WHERE p.status=1 AND p.brand_id=$id ORDER BY p.id DESC LIMIT 60"); ?><main class="container section"><div class="title-row"><h2><?php echo $br?e($br['name']):'Brand'; ?></h2><a class="see-all" href="brands.php?lang=<?php echo e($lang); ?>"><?php echo e(t('brands')); ?></a></div><div class="product-row"><?php if($rs): while($p=mysqli_fetch_assoc($rs)): render_product_card($conn,$p,$lang); endwhile; endif; ?></div></main><?php include 'includes/footer.php'; ?>
