:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/kreativecrm/**
:: Editing File: vcard_portfolio_list.php
<?php // =============================== // PAGE TITLE // =============================== $page_title = "VCard Portfolio"; include 'header.php'; include 'breadcrumb.php'; include 'menu.php'; ?> <div class="page-body"> <div class="container-fluid"> <div class="row"> <div class="col-sm-12"> <div class="card"> <div class="row"> <!-- =============================== PAGE HEADING =============================== --> <div class="col-sm-10"> <div class="card-header pb-0 card-no-border"> <h2>VCard Portfolio</h2> </div> </div> <!-- =============================== ADD BUTTON =============================== --> <div class="col-sm-2"> <div class="card-header pb-0 card-no-border text-end"> <a href="vcard_portfolio_add.php" class="btn btn-primary btn-sm"> <i class="fa fa-plus"></i> Add Portfolio </a> </div> </div> <!-- =============================== TABLE =============================== --> <div class="card-body"> <div class="dt-ext table-responsive"> <table class="display" id="export-button"> <thead> <tr> <th>#</th> <th>VCard</th> <th>Image</th> <th>Title</th> <th>Sort Order</th> <th>Status</th> <th>Created At</th> <th>Action</th> </tr> </thead> <tbody> <?php $sr = 1; $sql = " SELECT p.*, v.full_name, v.card_slug FROM vcard_portfolio p LEFT JOIN vcards v ON v.id = p.vcard_id ORDER BY p.sort_order ASC, p.created_at DESC "; $result = mysqli_query($conn, $sql); if ($result && mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { // Status badge $status = ($row['status'] == 1) ? "<span class='badge bg-success'>Active</span>" : "<span class='badge bg-danger'>Inactive</span>"; // Image preview if (!empty($row['image'])) { $img_url = "/kreativecrm/uploads/vcard/{$row['card_slug']}/portfolio/{$row['image']}"; $image = "<img src='{$img_url}' style='height:50px;border-radius:6px;'>"; } else { $image = "<span class='text-muted'>No Image</span>"; } echo "<tr>"; echo "<td>{$sr}</td>"; echo "<td>" . htmlspecialchars($row['full_name'] ?? 'N/A') . "</td>"; echo "<td>{$image}</td>"; echo "<td>" . htmlspecialchars($row['title']) . "</td>"; echo "<td>{$row['sort_order']}</td>"; echo "<td>{$status}</td>"; echo "<td>{$row['created_at']}</td>"; echo "<td class='text-center'> <a href='vcard_portfolio_edit.php?id={$row['id']}' class='btn btn-info btn-sm me-1'> <i class='fa fa-pencil'></i> </a> <a href='vcard_portfolio_delete.php?id={$row['id']}' class='btn btn-danger btn-sm' onclick=\"return confirm('Are you sure you want to delete this portfolio item?');\"> <i class='fa fa-trash'></i> </a> </td>"; echo "</tr>"; $sr++; } } else { echo "<tr> <td colspan='8' class='text-center text-muted'> No portfolio items found </td> </tr>"; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div> <?php include 'footer.php'; ?>