Files
HRM-System/scratch/check_ana_punches.php

35 lines
1.2 KiB
PHP

<?php
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
use Illuminate\Support\Facades\DB;
$employeeId = 6; // MA. ANDRHEA IVHON SANCHEZ / Ana Regina Mariano (Bio ID 2008)
echo "=== Attendance Records for Employee ID: $employeeId ===\n";
$records = DB::table('attendance_records')
->where('employee_id', $employeeId)
->whereBetween('date', ['2026-05-01', '2026-05-10'])
->orderBy('date', 'asc')
->get();
echo json_encode($records, JSON_PRETTY_PRINT) . "\n";
echo "=== Biometric Attendances for Employee ID: $employeeId ===\n";
// Let's find her biometric_emp_id
$emp = DB::table('employees')->where('user_id', $employeeId)->first();
$bioEmpId = $emp ? $emp->biometric_emp_id : null;
echo "Biometric Emp ID: " . ($bioEmpId ?? 'NULL') . "\n";
if ($bioEmpId) {
$bioRecords = DB::table('biometric_attendances')
->where('biometric_emp_id', $bioEmpId)
->whereBetween('punch_time', ['2026-05-01 00:00:00', '2026-05-10 23:59:59'])
->orderBy('punch_time', 'asc')
->get();
echo json_encode($bioRecords, JSON_PRETTY_PRINT) . "\n";
}