make this design is so super report anaylstics and use best practise and make it working well (<?php
session_start();
require_once 'db_connect.php'; // Ensure this file connects to your database

// Check if the admin is logged in
if (!isset($_SESSION['admin_id'])) {
    header("Location: admin_login.php");
    exit();
}

// Initialize filter variables with default values
$start_date = $_GET['start_date'] ?? date('Y-m-d', strtotime('-30 days'));
$end_date = $_GET['end_date'] ?? date('Y-m-d');
$gender_filter = $_GET['gender_filter'] ?? '';
$age_group_filter = $_GET['age_group_filter'] ?? '';
$status_filter = $_GET['status_filter'] ?? '';
$service_filter = $_GET['service_filter'] ?? '';

// Build base WHERE conditions
$where_conditions = "WHERE p.registration_date BETWEEN :start_date AND :end_date";
$params = [
    ':start_date' => $start_date,
    ':end_date' => $end_date
];

// Apply filters to WHERE conditions
if ($gender_filter) {
    $where_conditions .= " AND p.gender = :gender";
    $params[':gender'] = $gender_filter;
}

if ($age_group_filter) {
    switch ($age_group_filter) {
        case 'under_18':
            $where_conditions .= " AND p.age < 18";
            break;
        case '18_30':
            $where_conditions .= " AND p.age BETWEEN 18 AND 30";
            break;
        case '31_50':
            $where_conditions .= " AND p.age BETWEEN 31 AND 50";
            break;
        case '51_70':
            $where_conditions .= " AND p.age BETWEEN 51 AND 70";
            break;
        case 'over_70':
            $where_conditions .= " AND p.age > 70";
            break;
    }
}

if ($status_filter) {
    $where_conditions .= " AND p.status = :status";
    $params[':status'] = $status_filter;
}

// Fetch total number of patients
$stmt = $pdo->prepare("SELECT COUNT(*) FROM patients p $where_conditions");
$stmt->execute($params);
$total_patients = $stmt->fetchColumn();

// Fetch gender distribution
$stmt = $pdo->prepare("SELECT p.gender, COUNT(*) as count FROM patients p $where_conditions GROUP BY p.gender");
$stmt->execute($params);
$gender_distribution = $stmt->fetchAll();

// Fetch age distribution
$stmt = $pdo->prepare("SELECT p.age FROM patients p $where_conditions");
$stmt->execute($params);
$ages = $stmt->fetchAll(PDO::FETCH_COLUMN);

// Fetch status distribution
$stmt = $pdo->prepare("SELECT p.status, COUNT(*) as count FROM patients p $where_conditions GROUP BY p.status");
$stmt->execute($params);
$status_distribution = $stmt->fetchAll();

// Fetch services rendered distribution
if ($gender_filter || $age_group_filter || $status_filter) {
    // If patient filters are applied, join with patients table and apply the same $where_conditions
    $service_query = "
        SELECT s.service_name, COUNT(*) as count
        FROM invoice_services isv
        INNER JOIN invoices i ON isv.invoice_id = i.id
        INNER JOIN services s ON isv.service_id = s.service_id
        INNER JOIN patients p ON i.patient_id = p.id
        $where_conditions
        GROUP BY s.service_name
    ";

    $services_params = $params;
} else {
    // No patient filters applied
    $service_query = "
        SELECT s.service_name, COUNT(*) as count
        FROM invoice_services isv
        INNER JOIN invoices i ON isv.invoice_id = i.id
        INNER JOIN services s ON isv.service_id = s.service_id
        WHERE i.invoice_date BETWEEN :start_date AND :end_date
        GROUP BY s.service_name
    ";

    $services_params = [
        ':start_date' => $start_date,
        ':end_date' => $end_date
    ];
}

$stmt = $pdo->prepare($service_query);
$stmt->execute($services_params);
$services_distribution = $stmt->fetchAll();

// Fetch invoice amounts over time
$stmt = $pdo->prepare("
    SELECT DATE(i.invoice_date) as date, SUM(i.total_amount) as total_amount
    FROM invoices i
    INNER JOIN patients p ON i.patient_id = p.id
    $where_conditions
    GROUP BY DATE(i.invoice_date)
    ORDER BY date
");
$stmt->execute($params);
$invoice_trend = $stmt->fetchAll();

// Fetch patient registration trend
$stmt = $pdo->prepare("
    SELECT DATE(p.registration_date) as date, COUNT(*) as count
    FROM patients p
    $where_conditions
    GROUP BY DATE(p.registration_date)
    ORDER BY date
");
$stmt->execute($params);
$registration_trend = $stmt->fetchAll();
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Meta tags for responsive design and character encoding -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Page title -->
    <title>Admin Report Dashboard</title>
    <!-- Bootstrap 4.5 CSS for responsive layout and components -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <!-- Date Range Picker CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css">
    <!-- Chart.js Library -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <!-- Custom CSS for the design -->
    <style>
        /* Custom CSS for clean design */
        body {
            background-color: #f8f9fa;
            font-family: 'Roboto', Arial, sans-serif;
        }
        /* Header styling */
        .dashboard-header {
            background-color: #4F3F02; /* Brown */
            color: #fff;
            padding: 20px;
            text-align: center;
            border-radius: 10px;
            margin-bottom: 30px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        }
        /* Card styling */
        .card {
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            margin-bottom: 20px;
            background-color: #ffffff;
        }
        .card-header {
            background-color: #D1C287; /* Light golden */
            color: #4F3F02; /* Brown */
            font-weight: bold;
            border-bottom: none;
            padding: 15px;
        }
        /* Button styling */
        .btn-primary {
            background-color: #4F3F02; /* Brown */
            border-color: #4F3F02;
            color: #fff;
            font-weight: bold;
            border-radius: 50px;
        }
        .btn-primary:hover {
            background-color: #D1C287; /* Light golden */
            border-color: #D1C287;
            color: #4F3F02; /* Brown */
        }
        .btn-secondary {
            background-color: #D1C287; /* Light golden */
            border-color: #D1C287;
            color: #4F3F02; /* Brown */
            font-weight: bold;
            border-radius: 50px;
        }
        .btn-secondary:hover {
            background-color: #4F3F02; /* Brown */
            color: #fff;
        }
        /* Form control styling */
        .form-control, .form-select {
            border-radius: 8px;
        }
        /* DateRangePicker styling */
        .daterangepicker td.active, .daterangepicker td.active:hover {
            background-color: #4F3F02;
        }
        /* Print button styling */
        #printReport {
            background-color: #28a745; /* Green */
            border-color: #28a745;
            color: #fff;
            font-weight: bold;
            border-radius: 50px;
        }
        #printReport:hover {
            background-color: #218838; /* Dark green */
            border-color: #1e7e34;
            color: #fff;
        }
        /* Adjust chart sizes */
        canvas {
            max-height: 400px;
        }
    </style>
</head>
<body>
    <!-- Main Container -->
    <div class="container-fluid">
        <!-- Header -->
        <div class="dashboard-header">
            <h1>Admin Report Dashboard</h1>
            <p>Comprehensive Patient Data Analysis</p>
        </div>

        <!-- Filters and Print Button -->
        <div class="row mb-4">
            <div class="col-md-12">
                <!-- Filter Card -->
                <div class="card">
                    <div class="card-header">Filters</div>
                    <div class="card-body">
                        <form id="filterForm" method="GET" class="row">
                            <!-- Date Range Picker -->
                            <div class="col-md-3 mb-3">
                                <label for="daterange">Date Range:</label>
                                <input type="text" id="daterange" name="daterange" class="form-control" value="<?= htmlspecialchars($start_date) ?> - <?= htmlspecialchars($end_date) ?>">
                                <input type="hidden" id="start_date" name="start_date" value="<?= htmlspecialchars($start_date) ?>">
                                <input type="hidden" id="end_date" name="end_date" value="<?= htmlspecialchars($end_date) ?>">
                            </div>
                            <!-- Gender Filter -->
                            <div class="col-md-3 mb-3">
                                <label for="gender_filter">Gender:</label>
                                <select id="gender_filter" name="gender_filter" class="form-select">
                                    <option value="">All</option>
                                    <option value="Male" <?= $gender_filter == 'Male' ? 'selected' : '' ?>>Male</option>
                                    <option value="Female" <?= $gender_filter == 'Female' ? 'selected' : '' ?>>Female</option>
                                    <option value="Other" <?= $gender_filter == 'Other' ? 'selected' : '' ?>>Other</option>
                                </select>
                            </div>
                            <!-- Age Group Filter -->
                            <div class="col-md-3 mb-3">
                                <label for="age_group_filter">Age Group:</label>
                                <select id="age_group_filter" name="age_group_filter" class="form-select">
                                    <option value="">All</option>
                                    <option value="under_18" <?= $age_group_filter == 'under_18' ? 'selected' : '' ?>>Under 18</option>
                                    <option value="18_30" <?= $age_group_filter == '18_30' ? 'selected' : '' ?>>18-30</option>
                                    <option value="31_50" <?= $age_group_filter == '31_50' ? 'selected' : '' ?>>31-50</option>
                                    <option value="51_70" <?= $age_group_filter == '51_70' ? 'selected' : '' ?>>51-70</option>
                                    <option value="over_70" <?= $age_group_filter == 'over_70' ? 'selected' : '' ?>>Over 70</option>
                                </select>
                            </div>
                            <!-- Status Filter -->
                            <div class="col-md-3 mb-3">
                                <label for="status_filter">Status:</label>
                                <select id="status_filter" name="status_filter" class="form-select">
                                    <option value="">All</option>
                                    <?php
                                    $status_options_display = ['Initial Consultation', 'Diagnostic Phase', 'Treatment in Progress', 'Improving', 'Monitoring', 'Maintenance Phase', 'Awaiting Test Results', 'Follow-up Needed', 'Paused', 'Completed Program', 'Relapsed', 'Discontinued', 'Inactive'];
                                    foreach ($status_options_display as $option) {
                                        echo "<option value=\"".htmlspecialchars($option)."\"" . ($status_filter == $option ? ' selected' : '') . ">".htmlspecialchars($option)."</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                            <!-- Service Filter -->
                            <div class="col-md-3 mb-3">
                                <label for="service_filter">Service:</label>
                                <select id="service_filter" name="service_filter" class="form-select">
                                    <option value="">All</option>
                                    <?php
                                    // Fetch all services from the database
                                    $stmt = $pdo->query("SELECT DISTINCT service_name FROM services ORDER BY service_name");
                                    $services = $stmt->fetchAll(PDO::FETCH_COLUMN);
                                    foreach ($services as $service) {
                                        echo "<option value=\"".htmlspecialchars($service)."\"" . ($service_filter == $service ? ' selected' : '') . ">".htmlspecialchars($service)."</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                            <!-- Buttons -->
                            <div class="col-md-12 d-flex justify-content-end">
                                <button type="submit" class="btn btn-primary">Apply Filters</button>
                                <button type="button" id="resetFilters" class="btn btn-secondary ml-2">Reset Filters</button>
                                <button type="button" id="printReport" class="btn btn-success ml-2">Print Report</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        <!-- Report Content -->
        <div id="reportContent">
            <!-- Total Patients Card -->
            <div class="row">
                <div class="col-md-12">
                    <div class="card text-center">
                        <div class="card-body">
                            <h5 class="card-title">Total Patients</h5>
                            <h2 class="card-text"><?= htmlspecialchars($total_patients) ?></h2>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Charts Row -->
            <div class="row">
                <!-- Gender Distribution Chart -->
                <div class="col-lg-6 col-md-12">
                    <div class="card h-100">
                        <div class="card-header">Gender Distribution</div>
                        <div class="card-body">
                            <canvas id="genderChart"></canvas>
                        </div>
                    </div>
                </div>
                <!-- Age Distribution Chart -->
                <div class="col-lg-6 col-md-12">
                    <div class="card h-100">
                        <div class="card-header">Age Distribution</div>
                        <div class="card-body">
                            <canvas id="ageChart"></canvas>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Additional Charts Row -->
            <div class="row">
                <!-- Status Distribution Chart -->
                <div class="col-lg-6 col-md-12">
                    <div class="card h-100">
                        <div class="card-header">Patient Status Distribution</div>
                        <div class="card-body">
                            <canvas id="statusChart"></canvas>
                        </div>
                    </div>
                </div>
                <!-- Services Rendered Distribution Chart -->
                <div class="col-lg-6 col-md-12">
                    <div class="card h-100">
                        <div class="card-header">Services Rendered Distribution</div>
                        <div class="card-body">
                            <canvas id="servicesChart"></canvas>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Invoice Amount Trend Chart -->
            <div class="row">
                <div class="col-md-6">
                    <div class="card">
                        <div class="card-header">Invoice Amount Over Time</div>
                        <div class="card-body">
                            <canvas id="invoiceTrendChart"></canvas>
                        </div>
                    </div>
                </div>
                <!-- Patient Registration Trend Chart -->
                <div class="col-md-6">
                    <div class="card">
                        <div class="card-header">Patient Registration Over Time</div>
                        <div class="card-body">
                            <canvas id="registrationTrendChart"></canvas>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- End of Report Content -->

        <!-- Back to Dashboard Button -->
        <a href="admin_dashboard.php" class="btn btn-secondary mt-3 mb-5">Back to Dashboard</a>
    </div>
    <!-- Include jQuery and Bootstrap JS for components -->
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <!-- Moment.js for date manipulation -->
    <script src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
    <!-- Date Range Picker JS -->
    <script src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
    <!-- Custom JS scripts -->
    <script>
        $(document).ready(function() {
            // Initialize Date Range Picker
            $('#daterange').daterangepicker({
                startDate: moment('<?= htmlspecialchars($start_date) ?>'),
                endDate: moment('<?= htmlspecialchars($end_date) ?>'),
                locale: {
                    format: 'YYYY-MM-DD'
                }
            }, function(start, end, label) {
                $('#start_date').val(start.format('YYYY-MM-DD'));
                $('#end_date').val(end.format('YYYY-MM-DD'));
            });

            // Reset filters by reloading the page without any GET parameters
            $('#resetFilters').click(function() {
                window.location.href = 'admin_report.php';
            });

            // Print Report functionality
            $('#printReport').click(function() {
                window.print();
            });

            // Gender Distribution Chart
            var genderCtx = document.getElementById('genderChart').getContext('2d');
            var genderChart = new Chart(genderCtx, {
                type: 'pie',
                data: {
                    labels: <?= json_encode(array_column($gender_distribution, 'gender')) ?>,
                    datasets: [{
                        data: <?= json_encode(array_column($gender_distribution, 'count')) ?>,
                        backgroundColor: ['#4F3F02', '#D1C287', '#FFCE56'] // Colors for Male, Female, Other
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'bottom'
                        }
                    }
                }
            });

            // Age Distribution Chart (Bar)
            var ageCtx = document.getElementById('ageChart').getContext('2d');
            var ages = <?= json_encode($ages) ?>;
            var ageCounts = {};
            ages.forEach(function(age) {
                var ageGroup = Math.floor(age / 10) * 10;
                var label = ageGroup + '-' + (ageGroup + 9);
                if (!ageCounts[label]) {
                    ageCounts[label] = 0;
                }
                ageCounts[label]++;
            });
            var ageLabels = Object.keys(ageCounts);
            var ageData = Object.values(ageCounts);

            var ageChart = new Chart(ageCtx, {
                type: 'bar',
                data: {
                    labels: ageLabels,
                    datasets: [{
                        label: 'Number of Patients',
                        data: ageData,
                        backgroundColor: '#4F3F02'
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: {
                        y: {
                            beginAtZero: true,
                            stepSize: 1
                        }
                    },
                    plugins: {
                        legend: {
                            display: false
                        }
                    }
                }
            });

            // Status Distribution Chart
            var statusCtx = document.getElementById('statusChart').getContext('2d');
            var statusChart = new Chart(statusCtx, {
                type: 'pie',
                data: {
                    labels: <?= json_encode(array_column($status_distribution, 'status')) ?>,
                    datasets: [{
                        data: <?= json_encode(array_column($status_distribution, 'count')) ?>,
                        backgroundColor: [
                            '#FF6384', '#36A2EB', '#FFCE56',
                            '#4BC0C0', '#9966FF', '#FF9F40',
                            '#C9CBCF', '#8D6E63', '#7986CB',
                            '#81C784', '#DCE775', '#FFB74D', '#BA68C8'
                        ] // Extend colors as needed
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'bottom'
                        }
                    }
                }
            });

            // Services Rendered Distribution Chart
            var servicesCtx = document.getElementById('servicesChart').getContext('2d');
            var servicesLabels = <?= json_encode(array_column($services_distribution, 'service_name')) ?>;
            var servicesData = <?= json_encode(array_column($services_distribution, 'count')) ?>;
            var servicesChart = new Chart(servicesCtx, {
                type: 'pie',
                data: {
                    labels: servicesLabels,
                    datasets: [{
                        data: servicesData,
                        backgroundColor: [
                            '#4F3F02', '#D1C287', '#FFCE56',
                            '#4BC0C0', '#9966FF', '#FF9F40',
                            '#C9CBCF', '#8D6E63', '#7986CB',
                            '#81C784'
                        ] // Extend colors as needed
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'bottom'
                        }
                    }
                }
            });

            // Invoice Amount Trend Chart (Line)
            var invoiceTrendCtx = document.getElementById('invoiceTrendChart').getContext('2d');
            var invoiceTrendLabels = <?= json_encode(array_column($invoice_trend, 'date')) ?>;
            var invoiceTrendData = <?= json_encode(array_column($invoice_trend, 'total_amount')) ?>;
            var invoiceTrendChart = new Chart(invoiceTrendCtx, {
                type: 'line',
                data: {
                    labels: invoiceTrendLabels,
                    datasets: [{
                        label: 'Total Invoice Amount ($)',
                        data: invoiceTrendData,
                        backgroundColor: 'rgba(79, 63, 2, 0.2)',
                        borderColor: '#4F3F02',
                        fill: true,
                        tension: 0.2
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: {
                        x: {
                            type: 'time',
                            time: {
                                unit: 'day',
                                displayFormats: {
                                    day: 'YYYY-MM-DD'
                                }
                            },
                            title: {
                                display: true,
                                text: 'Date'
                            }
                        },
                        y: {
                            beginAtZero: true,
                            title: {
                                display: true,
                                text: 'Amount ($)'
                            }
                        }
                    },
                    plugins: {
                        legend: {
                            display: true,
                            position: 'top'
                        }
                    }
                }
            });

            // Patient Registration Trend Chart (Line)
            var registrationTrendCtx = document.getElementById('registrationTrendChart').getContext('2d');
            var registrationTrendLabels = <?= json_encode(array_column($registration_trend, 'date')) ?>;
            var registrationTrendData = <?= json_encode(array_column($registration_trend, 'count')) ?>;
            var registrationTrendChart = new Chart(registrationTrendCtx, {
                type: 'line',
                data: {
                    labels: registrationTrendLabels,
                    datasets: [{
                        label: 'New Registrations',
                        data: registrationTrendData,
                        backgroundColor: 'rgba(209, 194, 135, 0.2)',
                        borderColor: '#D1C287',
                        fill: true,
                        tension: 0.2
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: {
                        x: {
                            type: 'time',
                            time: {
                                unit: 'day',
                                displayFormats: {
                                    day: 'YYYY-MM-DD'
                                }
                            },
                            title: {
                                display: true,
                                text: 'Date'
                            }
                        },
                        y: {
                            beginAtZero: true,
                            title: {
                                display: true,
                                text: 'Number of Registrations'
                            }
                        }
                    },
                    plugins: {
                        legend: {
                            display: true,
                            position: 'top'
                        }
                    }
                }
            });
        });
    </script>
</body>
</html>) and this database structure (1. Database Structure
The database for the admin dashboard and patient management system consists of the following tables:
a. patients
id (INT, AUTO_INCREMENT, PRIMARY KEY): Unique identifier for each patient.
name (VARCHAR): Full name of the patient.
age (INT): Age of the patient.
gender (ENUM('Male', 'Female', 'Other')): Gender of the patient.
phone (VARCHAR): Phone number of the patient.
email (VARCHAR): Email address of the patient.
medical_history (TEXT): Medical history of the patient.
date_of_birth (DATE): Date of birth of the patient.
registration_date (DATE): Date when the patient was registered.
registration_datetime (DATETIME): Date and time when the patient was registered.
status (ENUM): Current status of the patient (e.g., 'Initial Consultation', 'Treatment in Progress', etc.).
b. health_records
id (INT, AUTO_INCREMENT, PRIMARY KEY): Unique identifier for each health record.
patient_id (INT, FOREIGN KEY referencing patients.id): ID of the patient associated with this health record.
blood_pressure (VARCHAR): Blood pressure reading.
weight (DECIMAL): Weight of the patient.
bmi (DECIMAL): Body Mass Index of the patient.
cholesterol (DECIMAL): Cholesterol level of the patient.
prescription (TEXT): Prescriptions given to the patient.
treatment_progress (TEXT): Notes on the treatment progress.
record_date (DATE): Date of the health record.
c. admins
id (INT, AUTO_INCREMENT, PRIMARY KEY): Unique identifier for each admin.
username (VARCHAR): Admin's username.
password (VARCHAR): Hashed password for the admin.
email (VARCHAR): Email address of the admin.
d. patient_logins
id (INT, AUTO_INCREMENT, PRIMARY KEY): Unique identifier for each patient login.
patient_id (INT, FOREIGN KEY referencing patients.id): ID of the patient associated with this login.
username (VARCHAR): Username for patient login.
password (VARCHAR): Hashed password for patient login.
e. invoices
id (INT, AUTO_INCREMENT, PRIMARY KEY): Unique identifier for each invoice.
patient_id (INT NOT NULL, FOREIGN KEY referencing patients.id): ID of the patient associated with this invoice.
service_name (VARCHAR(255) NOT NULL): Name of the service rendered.
service_description (TEXT): Description of the service.
cost (DECIMAL(10, 2) NOT NULL): Cost of the service.
tax_rate (DECIMAL(5, 2) DEFAULT 0): Tax rate applied to the service.
discount (DECIMAL(5, 2) DEFAULT 0): Discount applied to the service.
total_amount (DECIMAL(10, 2) NOT NULL): Total amount due after tax and discount.
invoice_date (DATE DEFAULT CURRENT_DATE): Date of the invoice.
notes (TEXT): Additional notes for the invoice.
Tax decimal(5,2)
f. services
service_id (INT, AUTO_INCREMENT, PRIMARY KEY): Unique identifier for each service.
service_name (VARCHAR(255) NOT NULL): Name of the service.
service_price (DECIMAL(10, 2) NOT NULL): Price of the service.
service_description (TEXT): Description of the service.
created_at (TIMESTAMP DEFAULT CURRENT_TIMESTAMP): Timestamp when the service was created.
updated_at (TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP): Timestamp when the service was last updated.
g. invoice_services
id (INT, AUTO_INCREMENT, PRIMARY KEY): Unique identifier for each entry in the invoice services table.
invoice_id (INT NOT NULL, FOREIGN KEY referencing invoices.id): ID of the associated invoice.
service_id (INT NOT NULL, FOREIGN KEY referencing services.service_id): ID of the associated service.
service_name (VARCHAR(255) NOT NULL): Name of the service rendered.
cost (DECIMAL(10, 2) NOT NULL): Cost of the service rendered.


)