payfrit-api/api/portal/reassign_employees.php
John Mizerek 1f81d98c52 Initial PHP API migration from CFML
Complete port of all 163 API endpoints from Lucee/CFML to PHP 8.3.
Shared helpers in api/helpers.php (DB, auth, request/response, security).
PDO prepared statements throughout. Same JSON response shapes as CFML.
2026-03-14 14:26:59 -07:00

15 lines
420 B
PHP

<?php
require_once __DIR__ . '/../helpers.php';
runAuth();
$targetBusinessID = 44;
queryTimed("UPDATE Employees SET BusinessID = ?", [$targetBusinessID]);
$qCount = queryOne("SELECT COUNT(*) AS cnt FROM Employees WHERE BusinessID = ?", [$targetBusinessID]);
jsonResponse([
'OK' => true,
'MESSAGE' => "All employee records reassigned to BusinessID $targetBusinessID",
'COUNT' => (int) $qCount['cnt'],
]);