<?php
// function formatDateTime($datetime)
// {
//     if (!empty($datetime)) {
//         return date('Y-m-d H:i:s', strtotime($datetime));
//     } else {
//         return '';
//     }
// }

// function redirectWithMessage($location, $message, $type = 'error')
// {
//     $_SESSION['message'] = $message;
//     $_SESSION['message_type'] = $type;
//     header("Location: $location");
//     exit();
// }
function formatCurrency($amount) {
    // Format the amount as currency (e.g., $1,000.00)
    return '$' . number_format($amount, 2);
}
function formatDate($date) {
    return date('j F Y', strtotime($date));
}


ob_start();
function formatDateTime($datetime)
{
    if (!empty($datetime)) {
        return date('Y-m-d H:i:s', strtotime($datetime));
    } else {
        return '';
    }
}

function redirectWithMessage($location, $message, $type = 'error')
{
    $_SESSION['message'] = $message;
    $_SESSION['message_type'] = $type;
    @header("Location: $location");
    exit();
}

ob_flush();


