feat: P4 backend kvalita - SELECT * fix, overdue konsolidace, Validator
- SELECT * nahrazen explicitnimi sloupci ve 22 PHP souborech (69+ vyskytu) - users-handlers.php: password_hash explicitne vyloucen z dotazu - Overdue detekce presunuta do invoices.php routeru (1x pred dispatch misto 3x v handlerech) - Validator.php: validacni helper s pravidly required, string, int, email, in, numeric - PaginationHelper: PHPStan typy opraveny Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,10 @@ function handleGetAdmin(PDO $pdo): void
|
||||
$endDate = date('Y-m-t', strtotime($startDate));
|
||||
|
||||
$sql = "
|
||||
SELECT a.*, CONCAT(u.first_name, ' ', u.last_name) as user_name
|
||||
SELECT a.id, a.user_id, a.shift_date, a.arrival_time, a.arrival_address,
|
||||
a.break_start, a.break_end, a.departure_time, a.departure_address,
|
||||
a.notes, a.project_id, a.leave_type, a.leave_hours, a.created_at,
|
||||
CONCAT(u.first_name, ' ', u.last_name) as user_name
|
||||
FROM attendance a
|
||||
JOIN users u ON a.user_id = u.id
|
||||
WHERE a.shift_date BETWEEN ? AND ?
|
||||
@@ -112,7 +115,11 @@ function handleGetWorkFund(PDO $pdo): void
|
||||
$startDate = sprintf('%04d-01-01', $year);
|
||||
$endDate = sprintf('%04d-%02d-%02d', $year, $maxMonth, cal_days_in_month(CAL_GREGORIAN, $maxMonth, $year));
|
||||
|
||||
$stmt = $pdo->prepare('SELECT * FROM attendance WHERE shift_date BETWEEN ? AND ? ORDER BY shift_date');
|
||||
$stmt = $pdo->prepare(
|
||||
'SELECT id, user_id, shift_date, arrival_time, break_start, break_end,
|
||||
departure_time, notes, project_id, leave_type, leave_hours
|
||||
FROM attendance WHERE shift_date BETWEEN ? AND ? ORDER BY shift_date'
|
||||
);
|
||||
$stmt->execute([$startDate, $endDate]);
|
||||
$allRecords = $stmt->fetchAll();
|
||||
|
||||
@@ -206,7 +213,13 @@ function handleGetWorkFund(PDO $pdo): void
|
||||
function handleGetLocation(PDO $pdo, int $recordId): void
|
||||
{
|
||||
$stmt = $pdo->prepare("
|
||||
SELECT a.*, CONCAT(u.first_name, ' ', u.last_name) as user_name
|
||||
SELECT a.id, a.user_id, a.shift_date, a.arrival_time,
|
||||
a.arrival_lat, a.arrival_lng, a.arrival_accuracy, a.arrival_address,
|
||||
a.break_start, a.break_end, a.departure_time,
|
||||
a.departure_lat, a.departure_lng, a.departure_accuracy,
|
||||
a.departure_address, a.notes, a.project_id,
|
||||
a.leave_type, a.leave_hours, a.created_at,
|
||||
CONCAT(u.first_name, ' ', u.last_name) as user_name
|
||||
FROM attendance a
|
||||
JOIN users u ON a.user_id = u.id
|
||||
WHERE a.id = ?
|
||||
@@ -467,7 +480,11 @@ function handleUpdateBalance(PDO $pdo): void
|
||||
|
||||
function handleUpdateAttendance(PDO $pdo, int $recordId): void
|
||||
{
|
||||
$stmt = $pdo->prepare('SELECT * FROM attendance WHERE id = ?');
|
||||
$stmt = $pdo->prepare(
|
||||
'SELECT id, user_id, shift_date, arrival_time, break_start, break_end,
|
||||
departure_time, notes, project_id, leave_type, leave_hours
|
||||
FROM attendance WHERE id = ?'
|
||||
);
|
||||
$stmt->execute([$recordId]);
|
||||
$record = $stmt->fetch();
|
||||
|
||||
@@ -593,7 +610,10 @@ function handleUpdateAttendance(PDO $pdo, int $recordId): void
|
||||
|
||||
function handleDeleteAttendance(PDO $pdo, int $recordId): void
|
||||
{
|
||||
$stmt = $pdo->prepare('SELECT * FROM attendance WHERE id = ?');
|
||||
$stmt = $pdo->prepare(
|
||||
'SELECT id, user_id, shift_date, leave_type, leave_hours
|
||||
FROM attendance WHERE id = ?'
|
||||
);
|
||||
$stmt->execute([$recordId]);
|
||||
$record = $stmt->fetch();
|
||||
|
||||
@@ -920,7 +940,10 @@ function handleGetPrint(PDO $pdo): void
|
||||
$users = $stmt->fetchAll();
|
||||
|
||||
$sql = "
|
||||
SELECT a.*, CONCAT(u.first_name, ' ', u.last_name) as user_name
|
||||
SELECT a.id, a.user_id, a.shift_date, a.arrival_time, a.arrival_address,
|
||||
a.break_start, a.break_end, a.departure_time, a.departure_address,
|
||||
a.notes, a.project_id, a.leave_type, a.leave_hours, a.created_at,
|
||||
CONCAT(u.first_name, ' ', u.last_name) as user_name
|
||||
FROM attendance a
|
||||
JOIN users u ON a.user_id = u.id
|
||||
WHERE a.shift_date BETWEEN ? AND ?
|
||||
|
||||
Reference in New Issue
Block a user