<?php
require_once 'config.php';
require_once 'includes/Database.php';

$db = new Database();

echo "=== PACKAGE TYPES IN DATABASE ===\n\n";
$packageTypes = $db->fetchAll("
    SELECT DISTINCT package_type, COUNT(*) as count 
    FROM training_completion 
    WHERE package_type IS NOT NULL AND package_type != '' 
    GROUP BY package_type 
    ORDER BY count DESC
");

foreach ($packageTypes as $type) {
    echo $type['package_type'] . " (" . $type['count'] . " records)\n";
}

echo "\n\n=== SALES TYPES IN DATABASE ===\n\n";
$salesTypes = $db->fetchAll("
    SELECT DISTINCT sales_type, COUNT(*) as count 
    FROM training_completion 
    WHERE sales_type IS NOT NULL AND sales_type != '' 
    GROUP BY sales_type 
    ORDER BY count DESC
");

foreach ($salesTypes as $type) {
    echo $type['sales_type'] . " (" . $type['count'] . " records)\n";
}
?>
