<?php
// /templates/footer.php
?>
        </div> </div> </div> 
        
<div class="modal fade" id="notificationModal" tabindex="-1" aria-labelledby="notificationModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content border-0 shadow">
            <div class="modal-header text-white" id="notificationModalHeader">
                <h5 class="modal-title" id="notificationModalLabel">Thông báo</h5>
                <button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body text-center py-4">
                <i class="fas fa-3x mb-3" id="notificationModalIcon"></i>
                <p class="h5" id="notificationModalMessage"></p>
            </div>
            <div class="modal-footer border-0">
                <button type="button" class="btn btn-primary" data-dismiss="modal">Đã hiểu</button>
            </div>
        </div>
    </div>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.21/js/dataTables.bootstrap4.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="/quanlybanhang/assets/js/main.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="/quanlybanhang/assets/js/messaging_script.js?v=1.2"></script>


<script>
// HÀM HIỂN THỊ FORM THÔNG BÁO CHUNG
function showNotification(message, type = 'info') {
    const header = $('#notificationModalHeader');
    const icon = $('#notificationModalIcon');
    const messageP = $('#notificationModalMessage');

    // Reset các class màu cũ
    header.removeClass('bg-success bg-danger bg-warning bg-primary');
    icon.removeClass('fa-check-circle fa-times-circle fa-exclamation-triangle fa-info-circle text-success text-danger text-warning text-primary');

    switch (type) {
        case 'success':
            header.addClass('bg-success');
            icon.addClass('fa-check-circle text-success');
            break;
        case 'error':
            header.addClass('bg-danger');
            icon.addClass('fa-times-circle text-danger');
            break;
        case 'warning':
            header.addClass('bg-warning');
            icon.addClass('fa-exclamation-triangle text-warning');
            break;
        default: // 'info'
            header.addClass('bg-primary');
            icon.addClass('fa-info-circle text-primary');
            break;
    }

    messageP.text(message);
    $('#notificationModal').modal('show');
}
</script>

</body>
</html>
<?php
if (isset($conn)) {
    $conn->close();
}
?>