Employee Attendance System
This is a desktop and mobile-based system for managing employee attendance. It uses selfies with date, time, and location to record time-in and time-out. The system includes a mobile app for employees (built with B4A), a desktop admin panel (built with B4J), a RESTful API (using PHP-CRUD-API), and a MySQL database.
Features
Employee Mobile App (B4A)
- Login with employee credentials.
- Time-in/time-out (once per day) with selfie, date, time, and location.
- View profile and attendance history (by date range).
- Logout.
Admin Panel (B4J)
- Login with admin credentials.
- Manage departments, shifts, locations, and employees (employee creation).
- Create and manage employee accounts.
- Generate date-wise attendance reports.
- Logout.
Backend API
- Handles data operations (CRUD) for the mobile app and admin panel.
- Built with PHP-CRUD-API.
Database
- MySQL database to store departments, shifts, locations, employees, accounts, and attendance records (including selfies, date, time, and location).
Technologies
Technology | Version/Requirements |
---|---|
PHP-CRUD-API | v2, requires PHP 7.2+ with PDO drivers enabled |
MySQL | 5.7+ / MariaDB 10.0+ for spatial features |
B4A | 13.10 |
B4J | 10.20 |
Web Server | Apache (via XAMPP or similar) |
Installation
1. Set Up the Database
- Install XAMPP and start Apache and MySQL.
- Access PHPMyAdmin (http://localhost/phpmyadmin).
- Create a new database named b4xattendance.
- Import the b4xattendance.sql file (located in the API and DB folder) to set up the database structure and data.
2. Set Up the API
- Copy the api.php file (located in the API and DB folder) to the XAMPP htdocs directory (e.g., htdocs/api/).
- Open api.php in a text editor.
- Locate the configuration line (approximately line 12777) and update it with your MySQL server details:
-
api.php, line 12777:
$config = new Config([ 'driver' => 'mysql', 'address' => 'localhost', // Your MySQL server address 'port' => '3306', // Your MySQL port 'username' => 'root', // Your MySQL username 'password' => '', // Your MySQL password 'database' => 'b4xattendance', 'debug' => true // Change to false for production ]);
- Save the file.
3. Test the API
- Open a browser or use a tool like Postman.
- Visit the following URL to test the API:
- If set up correctly, you should see data from the tbl_shift table.
4. Set Up the Mobile App (B4A)
- Open the B4A project (located in the b4a folder) in the B4A IDE.
- In the app, access the API endpoint configuration option.
- Enter the API endpoint using your computer’s IPv4 address (e.g., http://192.168.1.x/api/api.php/records/). Note: B4A does not support localhost or 127.0.0.1. To find your IPv4 address, run ipconfig in the Command Prompt (Windows) and look for "IPv4 Address".
- Compile and deploy the app to an Android device.
- Test login with employee credentials created by the admin.
5. Set Up the Admin Panel (B4J)
- Open the B4J project (located in the b4j folder) in the B4J IDE.
- In the panel, access the API endpoint configuration option.
- Enter the API endpoint (e.g., http://localhost/api/api.php/records/).
- Compile and run the admin panel.
- Log in with the default admin credentials:
- Email: admin@admin.com
- Password: admin
6. Access the System
- Mobile App: Use an Android device to log in as an employee and record time-in/out with selfies.
- Admin Panel: Run the B4J app on a desktop to create employees and manage the system.
- API: Access at http://localhost/api/api.php/records/ for data operations.
Default Credentials
- Admin (B4J):
- Email: admin@admin.com
- Password: admin
- Employee (B4A): Created by the admin in the B4J panel.
Notes
- Employees must be created by the admin in the B4J panel.
- The B4A app requires an Android device with camera and GPS for selfies and location.
- Ensure the API is running on the web server for the mobile app and admin panel to function.
- For production, secure the API with authentication and use HTTPS.
- The b4xattendance.sql file contains the database structure and initial data.
- The source code is for educational purposes and can be modified freely.
Pricing and Payment
Price:
- $15 until May 1, 2025 (promotional period).
- $30 after promotional period
- Payment Method: PayPal
- Send payment to: abdullcadre@gmail.com
- Note: Contact the developer via PayPal or email for access to the source code after payment.
Last edited: