🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:messages.php
<?php require APPROOT . '/views/layouts/admin_header.php'; ?> <h4 class="font-outfit fw-bold text-navy mb-4">Contact Inbox</h4> <div class="row g-4"> <!-- Inbox List --> <div class="<?php echo $data['selected_message'] ? 'col-lg-6' : 'col-12'; ?>"> <div class="card border-0 shadow-sm rounded-4"> <div class="card-header bg-white border-bottom py-3"> <h5 class="mb-0 font-outfit fw-bold text-navy">Messages</h5> </div> <div class="card-body p-0"> <div class="table-responsive"> <table class="table table-hover align-middle mb-0"> <thead class="table-light"> <tr> <th class="ps-4">Sender</th> <th>Subject</th> <th>Received</th> <th class="text-end pe-4">Actions</th> </tr> </thead> <tbody> <?php if(empty($data['messages'])): ?> <tr> <td colspan="4" class="text-center py-5 text-muted"> <i class="fas fa-inbox fs-2 mb-3 d-block text-secondary"></i> Your inbox is empty. </td> </tr> <?php else: ?> <?php foreach($data['messages'] as $msg): ?> <tr class="<?php echo ($data['selected_message'] && $data['selected_message']->id == $msg->id) ? 'table-active' : ''; ?>"> <td class="ps-4"> <span class="fw-bold text-navy d-block"><?php echo htmlspecialchars($msg->name); ?></span> <small class="text-muted"><?php echo htmlspecialchars($msg->email); ?></small> </td> <td class="text-navy font-inter fw-medium" style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> <?php echo htmlspecialchars($msg->subject); ?> </td> <td><small class="text-muted"><?php echo date('M d, Y H:i', strtotime($msg->created_at)); ?></small></td> <td class="text-end pe-4"> <a href="<?php echo URLROOT; ?>/admin/messages/view/<?php echo $msg->id; ?>" class="btn btn-sm btn-outline-navy me-1 rounded-pill px-3"> <i class="fas fa-envelope-open me-1"></i> Read </a> <a href="<?php echo URLROOT; ?>/admin/messages/delete/<?php echo $msg->id; ?>" class="btn btn-sm btn-outline-danger rounded-pill px-3" onclick="return confirm('Are you sure you want to delete this message?');"> <i class="fas fa-trash me-1"></i> </a> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> </div> <!-- Pagination --> <?php if(isset($data['total_pages']) && $data['total_pages'] > 1): ?> <div class="card-footer bg-white border-top py-3 d-flex justify-content-between align-items-center" style="border-bottom-left-radius: 12px; border-bottom-right-radius: 12px;"> <div class="text-muted small"> Showing page <strong><?php echo $data['current_page']; ?></strong> of <strong><?php echo $data['total_pages']; ?></strong> </div> <nav aria-label="Page navigation"> <ul class="pagination pagination-sm mb-0"> <li class="page-item <?php echo ($data['current_page'] <= 1) ? 'disabled' : ''; ?>"> <a class="page-link border-light text-navy rounded-circle me-1" href="?page=<?php echo $data['current_page'] - 1; ?>" aria-label="Previous"> <span aria-hidden="true">«</span> </a> </li> <?php for($i = 1; $i <= $data['total_pages']; $i++): ?> <li class="page-item <?php echo ($data['current_page'] == $i) ? 'active' : ''; ?>"> <a class="page-link border-light rounded-circle me-1 <?php echo ($data['current_page'] == $i) ? 'bg-navy border-navy text-white' : 'text-navy'; ?>" href="?page=<?php echo $i; ?>"><?php echo $i; ?></a> </li> <?php endfor; ?> <li class="page-item <?php echo ($data['current_page'] >= $data['total_pages']) ? 'disabled' : ''; ?>"> <a class="page-link border-light text-navy rounded-circle" href="?page=<?php echo $data['current_page'] + 1; ?>" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li> </ul> </nav> </div> <?php endif; ?> </div> </div> <!-- Message Detail Pane --> <?php if($data['selected_message']): ?> <?php $msg = $data['selected_message']; ?> <div class="col-lg-6"> <div class="card border-0 shadow-sm rounded-4 bg-white sticky-lg-top" style="top: 100px; z-index: 10;"> <div class="card-header bg-white border-bottom py-3 d-flex justify-content-between align-items-center"> <h5 class="mb-0 font-outfit fw-bold text-navy">Message Details</h5> <a href="<?php echo URLROOT; ?>/admin/messages" class="btn-close"></a> </div> <div class="card-body p-4"> <div class="mb-4 pb-3 border-bottom"> <div class="d-flex justify-content-between align-items-start mb-2"> <div> <h5 class="fw-bold text-navy mb-0"><?php echo htmlspecialchars($msg->name); ?></h5> <a href="mailto:<?php echo htmlspecialchars($msg->email); ?>" class="text-gold text-decoration-none small"><?php echo htmlspecialchars($msg->email); ?></a> </div> <span class="badge bg-light text-navy border rounded-pill"><?php echo date('M d, Y H:i', strtotime($msg->created_at)); ?></span> </div> <div class="mt-3"> <strong class="text-muted d-block small">Subject:</strong> <span class="text-navy fw-semibold"><?php echo htmlspecialchars($msg->subject); ?></span> </div> </div> <div class="mb-4"> <strong class="text-muted d-block small mb-2">Message:</strong> <p class="text-navy font-inter bg-light p-3 rounded-3" style="white-space: pre-wrap; line-height: 1.6; font-size: 0.95rem;"><?php echo htmlspecialchars($msg->message); ?></p> </div> <div class="d-flex justify-content-end gap-2"> <a href="mailto:<?php echo htmlspecialchars($msg->email); ?>?subject=Re: <?php echo rawurlencode($msg->subject); ?>" class="btn btn-gold rounded-pill px-4"> <i class="fas fa-reply me-1"></i> Reply </a> <a href="<?php echo URLROOT; ?>/admin/messages/delete/<?php echo $msg->id; ?>" class="btn btn-outline-danger rounded-pill px-4" onclick="return confirm('Are you sure you want to delete this message?');"> <i class="fas fa-trash me-1"></i> Delete </a> </div> </div> </div> </div> <?php endif; ?> </div> <?php require APPROOT . '/views/layouts/admin_footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder