:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/crm/**
:: Editing File: ticket_list.php
<?php // ✅ Set breadcrumb variables $page_title = "Support Tickets"; 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"> <div class="col-sm-10"> <div class="card-header pb-0 card-no-border"> <h2>Ticket Details</h2> </div> </div> <div class="col-sm-2"> <div class="card-header pb-0 card-no-border" style="float:right"> <a href="ticket_add.php" class="btn btn-primary btn-sm"> <i class="fa fa-plus"></i> Add Ticket </a> </div> </div> <div class="card-body"> <div class="dt-ext table-responsive"> <table class="display" id="export-button"> <thead> <tr> <th>#</th> <th>User ID</th> <th>Subject</th> <th>Status</th> <th>Created At</th> <th>Action</th> </tr> </thead> <tbody> <?php $sr_no = 1; $sql = "SELECT * FROM tickets ORDER BY created_at DESC"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { // Status badge if ($row['status'] == 'open') { $status = "<span class='badge bg-warning'>Open</span>"; } elseif ($row['status'] == 'in_progress') { $status = "<span class='badge bg-info'>In Progress</span>"; } else { $status = "<span class='badge bg-success'>Closed</span>"; } echo "<tr>"; echo "<td class='text-center'>{$sr_no}</td>"; echo "<td>{$row['user_id']}</td>"; echo "<td>{$row['subject']}</td>"; echo "<td>{$status}</td>"; echo "<td>{$row['created_at']}</td>"; echo "<td class='text-center'>"; echo "<a href='ticket_edit.php?id=" . intval($row['id']) . "' class='btn btn-info btn-sm' title='View'> <i class='fa fa-pencil'></i> </a> "; echo "<a href='ticket_delete.php?id=" . intval($row['id']) . "' class='btn btn-danger btn-sm' onclick=\"return confirm('Are you sure you want to delete this ticket?');\"> <i class='fa fa-trash'></i> </a>"; echo "</td>"; echo "</tr>"; $sr_no++; } } else { echo "<tr> <td colspan='6' class='text-center text-muted'> No tickets found </td> </tr>"; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div> <?php include "footer.php"; ?>