██████╗ ████████╗██████╗ ██████╗ ███████╗ █████╗ ██████╗ ███████╗██████╗
██╔══██╗╚══██╔══╝██╔══██╗ ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔══██╗
██║ ██║ ██║ ██████╔╝ ██████╔╝█████╗ ███████║██║ ██║█████╗ ██████╔╝
██║ ██║ ██║ ██╔══██╗ ██╔══██╗██╔══╝ ██╔══██║██║ ██║██╔══╝ ██╔══██╗
██████╔╝ ██║ ██║ ██║ ██║ ██║███████╗██║ ██║██████╔╝███████╗██║ ██║
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
Author: James Patrick A. Bago
A comprehensive PHP web application designed to read, parse, and display Daily Time Record (DTR) data from Excel files. This system provides an intuitive interface for managing and analyzing staff attendance records with advanced filtering and statistical capabilities.
- Excel File Upload: Seamlessly upload and import Excel files (.xls/.xlsx format)
- Automatic Date Span Detection: Intelligently extracts date range from the 3rd sheet of the Excel file
- Smart Data Parsing: Automatically recognizes and extracts TIME-IN (morning) and TIME-OUT (afternoon/overtime) entries per day
- Staff List View: Browse all staff members displayed as interactive, clickable cards
- Staff Search: Real-time search functionality to quickly find specific staff members
- Record Count Display: Each staff card shows the total number of attendance records
- Detailed Attendance Overview: Click any staff member to view their complete attendance history
- Comprehensive Statistics Dashboard: View key metrics including:
- Total days recorded
- Complete attendance days (with both TIME-IN and TIME-OUT)
- Days with TIME-IN only
- Days with TIME-OUT only
- Incomplete attendance days
- Date Filtering: Filter attendance records by specific dates
- Search Functionality: Search attendance records by date or day name
- Modern Responsive Design: Beautiful, mobile-friendly interface that works on all devices
- Pagination Support: Efficient pagination for large datasets
- Real-time Status Updates: Visual feedback during file upload and processing
- Error Handling: Comprehensive error messages and validation
- Session-based Storage: Data persists across page navigation
- Clear Data Function: Easy removal of current data to upload new files
- File Validation: Automatic validation of uploaded file types and formats
- PHP 7.4 or higher
- Composer (for dependency management)
- XAMPP or any PHP web server with Apache
- PHP Extensions:
- zip (for Excel file processing)
- xml (for spreadsheet parsing)
-
Install Dependencies using Composer:
# If you have Composer installed globally: composer install # If using XAMPP PHP directly: D:\Programming\Xampp\php\php.exe composer.phar install --ignore-platform-req=ext-zip
-
Enable Required PHP Extensions:
- Open
D:\Programming\Xampp\php\php.ini - Find the line
;extension=zipand remove the semicolon to make itextension=zip - Ensure
extension=xmlis also enabled - Restart Apache in XAMPP Control Panel for changes to take effect
- Open
-
Verify Setup (Optional):
php check_setup.php
-
Start Your Web Server:
- If using XAMPP, place the project in the
htdocsfolder - Start Apache from XAMPP Control Panel
- If using XAMPP, place the project in the
-
Access the Application:
http://localhost/DTR Reader/
Note: If you encounter errors about missing extensions, ensure you restart Apache after enabling extensions in php.ini.
The application reads the 3rd sheet of the Excel file to automatically identify the date range of the attendance report. It extracts dates from row 13 onwards in column A and also parses date ranges from the 2nd sheet's attendance statistic table.
Starting from the 4th sheet onwards, the application processes each staff member's attendance sheet and extracts:
- Staff names (from sheet titles)
- Dates (from column A)
- TIME-IN entries (first morning entry per day)
- TIME-OUT entries (last afternoon/overtime entry per day)
- Each staff member's attendance is parsed into structured records
- Records are sorted chronologically
- Statistics are calculated automatically for each staff member
- Data is stored in session for quick access across pages
The web interface provides:
- Overview statistics (total staff, total records, date range)
- Interactive staff grid with search functionality
- Individual staff attendance pages with detailed statistics
- Filterable and searchable attendance tables
- Pagination for efficient data browsing
DTR Reader/
├── index.php # Main web interface and dashboard
├── staff.php # Individual staff attendance detail page
├── upload.php # File upload handler
├── clear.php # Session data clearing handler
├── check_setup.php # Setup verification script
├── src/
│ └── DTRReader.php # Core class for reading and parsing Excel files
├── assets/
│ ├── knewcode.svg # KNewCode IT Solutions logo
│ └── logo.png # Application logo
├── uploads/ # Directory for uploaded Excel files
├── vendor/ # Composer dependencies
├── composer.json # PHP dependencies configuration
└── README.md # This file
- Open the application in your browser:
http://localhost/DTR Reader/ - Click "Choose File" and select your attendance Excel file (.xls or .xlsx)
- Click "Upload & Process" to import the data
- Wait for the processing to complete (you'll see a success message)
- After upload, you'll see a grid of all staff members
- Each card displays:
- Staff name (with avatar initial)
- Number of attendance records
- Use the search box to filter staff by name
- Navigate through pages if there are many staff members
- Click on any staff member's card
- View their complete attendance overview with:
- Statistics cards showing key metrics
- Complete attendance table with all records
- Search functionality to find specific dates
- Date filter to narrow down by specific date
- Use pagination to navigate through large attendance records
- Click the "Clear" button in the upload section
- Confirm the action to remove current data
- Upload a new file to start fresh
The application expects Excel files with the following structure:
- Sheet 1: (Not used)
- Sheet 2: Contains attendance statistic table with date range
- Sheet 3: Contains date information (row 13+ in column A)
- Sheet 4+: Individual staff attendance sheets
- TIME-IN Detection: Identifies the first time entry in the morning (typically before 12:00 PM)
- TIME-OUT Detection: Identifies the last time entry in the afternoon/evening (typically after 12:00 PM)
- Overtime Handling: Overtime entries are treated as TIME-OUT entries
- Date Format: Supports various date formats found in Excel cells
- Uploaded file path is stored in session
- Extracted data (records, staff names, date span) is cached in session
- Session data persists until explicitly cleared or session expires
- The application automatically detects TIME-IN and TIME-OUT columns based on time patterns
- Overtime entries are automatically treated as TIME-OUT
- Only one TIME-IN (morning) and one TIME-OUT (afternoon/overtime) are recognized per day per staff member
- The system handles missing entries gracefully (displays "-" for missing times)
- All dates are displayed in a user-friendly format (e.g., "Jan 15, 2025")
- The interface is fully responsive and works on desktop, tablet, and mobile devices
- Chrome (recommended)
- Firefox
- Edge
- Safari
- Opera
For issues, questions, or feature requests, please contact the development team.
Copyright: Copyright © 2025 KNewCode IT Solutions. All rights reserved.