File manager - Edit - /home/webapp69.cm.in.th/u69319090028/Shop/views/account/my_reviews.php
Back
<div class="cargoo-card"> <div class="cargoo-card-header d-flex justify-content-between align-items-center"> <div> <h5 class="mb-1 fw-bold"><i class="bi bi-star-fill text-warning me-2"></i>รีวิวของฉัน</h5> <p class="text-muted small mb-0">จัดการความคิดเห็นและให้คะแนนสินค้าที่คุณสั่งซื้อสำเร็จ</p> </div> </div> <!-- Nav Tabs: Pending Reviews vs Submitted Reviews --> <div class="px-3 pt-3 border-bottom bg-light"> <ul class="nav nav-pills small gap-2 pb-3" id="reviewTabs" role="tablist"> <li class="nav-item" role="presentation"> <button class="nav-link active fw-semibold position-relative" id="pending-tab" data-bs-toggle="pill" data-bs-target="#pending-content" type="button" role="tab"> <i class="bi bi-clock-history me-1"></i> สินค้าที่รอรีวิว <?php if (!empty($pendingItems)): ?> <span class="badge bg-danger rounded-pill ms-1"><?= count($pendingItems) ?></span> <?php endif; ?> </button> </li> <li class="nav-item" role="presentation"> <button class="nav-link fw-semibold position-relative" id="submitted-tab" data-bs-toggle="pill" data-bs-target="#submitted-content" type="button" role="tab"> <i class="bi bi-check-circle-fill me-1"></i> รีวิวแล้ว (<?= count($myReviews) ?>) </button> </li> </ul> </div> <div class="cargoo-card-body p-4"> <div class="tab-content" id="reviewTabsContent"> <!-- 1. Pending Review Items Tab --> <div class="tab-pane fade show active" id="pending-content" role="tabpanel" tabindex="0"> <?php if (empty($pendingItems)): ?> <div class="text-center py-5"> <i class="bi bi-check2-circle text-muted" style="font-size: 3.5rem;"></i> <h6 class="mt-3 fw-bold text-dark">ไม่มีสินค้าที่รอการรีวิว</h6> <p class="text-muted small mb-3">คุณได้รีวิวสินค้าในคำสั่งซื้อที่สำเร็จครบถ้วนแล้ว</p> <a href="<?= url('/search') ?>" class="btn btn-cargoo-primary btn-sm px-4"> <i class="bi bi-bag me-1"></i> <?= __('continue_shopping') ?> </a> </div> <?php else: ?> <div class="d-flex flex-column gap-3"> <?php foreach ($pendingItems as $item): ?> <div class="p-3 border rounded-3 bg-white d-flex flex-column flex-sm-row justify-content-between align-items-sm-center gap-3"> <div class="d-flex align-items-center gap-3"> <div class="rounded-2 overflow-hidden border bg-light d-flex align-items-center justify-content-center flex-shrink-0" style="width: 64px; height: 64px;"> <?php if (!empty($item['product_image'])): ?> <img src="<?= asset('/' . ltrim($item['product_image'], '/')) ?>" alt="<?= e($item['product_name']) ?>" class="w-100 h-100 object-fit-contain"> <?php else: ?> <i class="bi bi-box-seam text-secondary fs-3"></i> <?php endif; ?> </div> <div> <span class="badge bg-primary-subtle text-primary border border-primary-subtle small px-2 py-0 mb-1"> <i class="bi bi-shop me-1"></i><?= e($item['store_name']) ?> </span> <h6 class="fw-semibold text-dark mb-1 small text-truncate" style="max-width: 380px;"> <?= e($item['product_name']) ?> </h6> <?php if (!empty($item['variation_summary'])): ?> <small class="text-muted d-block">ตัวเลือก: <?= e($item['variation_summary']) ?></small> <?php endif; ?> <small class="text-muted">คำสั่งซื้อ: <code>#<?= e($item['order_no']) ?></code></small> </div> </div> <div class="text-sm-end"> <a href="<?= url('/reviews/create/' . (int)$item['order_item_id']) ?>" class="btn btn-cargoo-primary btn-sm px-4 py-2 fw-bold"> <i class="bi bi-star me-1"></i> เขียนรีวิว </a> </div> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> <!-- 2. Submitted Reviews Tab --> <div class="tab-pane fade" id="submitted-content" role="tabpanel" tabindex="0"> <?php if (empty($myReviews)): ?> <div class="text-center py-5"> <i class="bi bi-star text-muted" style="font-size: 3.5rem;"></i> <h6 class="mt-3 fw-bold text-dark">ยังไม่มีประวัติการรีวิว</h6> <p class="text-muted small">เมื่อคุณสั่งซื้อสินค้าและได้รับของเรียบร้อยแล้ว สามารถมารีวิวได้ที่นี่</p> </div> <?php else: ?> <div class="d-flex flex-column gap-3"> <?php foreach ($myReviews as $rev): ?> <div class="p-4 border rounded-3 bg-white"> <!-- Header: Product Info & Actions --> <div class="d-flex flex-column flex-sm-row justify-content-between align-items-sm-start pb-3 mb-3 border-bottom gap-2"> <div class="d-flex align-items-center gap-3"> <div class="rounded-2 overflow-hidden border bg-light d-flex align-items-center justify-content-center flex-shrink-0" style="width: 50px; height: 50px;"> <?php if (!empty($rev['product_main_image'])): ?> <img src="<?= asset('/' . ltrim($rev['product_main_image'], '/')) ?>" alt="<?= e($rev['product_name']) ?>" class="w-100 h-100 object-fit-contain"> <?php else: ?> <i class="bi bi-box-seam text-secondary"></i> <?php endif; ?> </div> <div> <h6 class="fw-bold text-dark mb-0 small"><?= e($rev['product_name']) ?></h6> <small class="text-muted">ร้าน: <?= e($rev['store_name']) ?> • คำสั่งซื้อ <code>#<?= e($rev['order_no']) ?></code></small> </div> </div> <div class="d-flex gap-2"> <a href="<?= url('/reviews/' . (int)$rev['id'] . '/edit') ?>" class="btn btn-outline-primary btn-sm px-3"> <i class="bi bi-pencil me-1"></i> แก้ไข </a> <form action="<?= url('/reviews/' . (int)$rev['id'] . '/delete') ?>" method="POST" onsubmit="return confirm('คุณแน่ใจหรือไม่ว่าต้องการลบรีวิวนี้?');" class="d-inline"> <?= Security::csrfField() ?> <button type="submit" class="btn btn-outline-danger btn-sm px-2" title="ลบรีวิว"> <i class="bi bi-trash"></i> </button> </form> </div> </div> <!-- Rating & Date --> <div class="d-flex align-items-center justify-content-between mb-2"> <div class="d-flex align-items-center gap-1"> <?php for ($i = 1; $i <= 5; $i++): ?> <i class="bi <?= $i <= (int)$rev['rating'] ? 'bi-star-fill text-warning' : 'bi-star text-secondary' ?>"></i> <?php endfor; ?> <span class="ms-2 small fw-bold text-dark"><?= (int)$rev['rating'] ?>.0</span> <?php if (!empty($rev['is_anonymous'])): ?> <span class="badge bg-light text-muted border ms-2 small" style="font-size: 0.7rem;"> <i class="bi bi-incognito me-1"></i>รีวิวแบบไม่ระบุชื่อ </span> <?php endif; ?> </div> <small class="text-muted"><?= date('d/m/Y H:i', strtotime($rev['created_at'])) ?></small> </div> <!-- Review Content --> <?php if (!empty($rev['review_text'])): ?> <p class="text-secondary small mb-3" style="white-space: pre-line;"><?= e($rev['review_text']) ?></p> <?php endif; ?> <!-- Review Attached Images --> <?php if (!empty($rev['images'])): ?> <div class="d-flex flex-wrap gap-2 pt-2"> <?php foreach ($rev['images'] as $img): ?> <div class="rounded-2 overflow-hidden border bg-light" style="width: 64px; height: 64px;"> <a href="<?= asset('/' . ltrim($img['image_path'], '/')) ?>" target="_blank"> <img src="<?= asset('/' . ltrim($img['image_path'], '/')) ?>" class="w-100 h-100 object-fit-cover"> </a> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> </div> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings