feat: bootstrap JOBcard CRM foundation

This commit is contained in:
Marco0300
2026-09-01 18:54:47 +02:00
commit 480494c5ed
31 changed files with 1300 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
/**
* Return whether a client name already occurs in a list, ignoring case and outer whitespace.
* Existing entries may be strings or rows containing a `name` field.
*/
function client_name_is_duplicate(string $name, array $existingClients): bool
{
$candidate = strtolower(trim($name));
foreach ($existingClients as $existing) {
$existingName = is_array($existing) ? ($existing['name'] ?? '') : $existing;
if (is_string($existingName) && strtolower(trim($existingName)) === $candidate) {
return true;
}
}
return false;
}