Kimi chinh sua

This commit is contained in:
2026-04-24 08:58:53 +00:00
parent 91ff4a5e4d
commit 86216ef872
43 changed files with 2868 additions and 597 deletions

28
analyze_khachhang.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
$inputFileName = 'khachhang.xlsx';
try {
$spreadsheet = IOFactory::load($inputFileName);
$worksheet = $spreadsheet->getActiveSheet();
$rows = $worksheet->toArray();
echo "--- HEADER COLUMNS ---\n";
if (isset($rows[0])) {
foreach ($rows[0] as $index => $header) {
echo "Col " . $index . ": " . ($header ?? "NULL") . "\n";
}
}
echo "\n--- SAMPLE DATA (Rows 2-5) ---\n";
for ($i = 1; $i <= 4; $i++) {
if (isset($rows[$i])) {
echo "Row " . ($i + 1) . ": " . implode(" | ", array_map(fn($v) => $v ?? "NULL", $rows[$i])) . "\n";
}
}
} catch (Exception $e) {
echo 'Error loading file: ' . $e->getMessage();
}