Attendance Control

“Attendance Control” is a console application made as an exercise to integrate the different C++ concepts taught in class up to the middle of the year.

The main objective is to be able to develop a employee attendance control which records the times (and justifications, if corresponding) of each time the employees arrive, go to lunch, return from lunch and go back to home.

Sistema de control de asistencia de personal
--------------------------------------------

DNI:

The complete wording says:

Develop an employee attendance control system (for later verification of absences and late arrivals with their corresponding justifications) and its managemente private part (user registration and gathered data visualization).

The main screen must staywaiting for ID [DNI] and password.

There must be a preset admin user with DNI = -1234 and Password = prueba.

In case of being an administrator user, you’ll be able to access the management part, with the following options:

1- Alta de usuario [New user]
2- Lista de usuarios (datos adquiridos) [User list (gathered data)]
3- Salida a archivo [Output to file]
4- Cerrar la aplicación [Close the application]
0- Volver a la pantalla principal [Back to the main screen]

Otherwise, it will be asked which kind of action are you about to do (Arrival [Ingreso], return to home [Salida], lunch [Salida a almuerzo] or return from lunch [Retorno de almuerzo]) and its justification in case it corresponds, and they will be recorded along with the current time in a “Events” record of the corresponding user.

The user required data is:
DNI [ID]
Nombre completo [Full name]
Contraseña [Password]
Si es administrador [Whether it is administrator]
Eventos relacionados [Related events]

It’s desired to use as a base the class “PersonaBasica” [Basic person] which has already been developed by the IT department, whose header file “PersonaBasica.h” is attached below:

#include "String.h"
#include <iostream>

class PersonaBasica
{
	String m_sNombreCompleto;
	long m_nDNI;

public:
	//Construcción
	PersonaBasica() { m_nDNI = 0; }

	//Encapsulaciones
	long DNI() const { return m_nDNI; }
	void DNI(long val) { m_nDNI = val; }

	String NombreCompleto() const { return m_sNombreCompleto; }
	void NombreCompleto(String val) { m_sNombreCompleto = val; }
};

std::ostream& operator<<(std::ostream& oStream, PersonaBasica& rpPersonaBasica);

Note: the lengths of the data to be registered is completely unknown and rumors are circulating that the users are used to write pretty elaborate justifications.

When you first start the program, you can only log in as admin (-1234:prueba)…

Sistema de control de asistencia de personal
--------------------------------------------

DNI: -1234
Contraseña: prueba
Usuario "Administrador" reconocido.

Presione una tecla para continuar...

Then, you’ll get to the administration menu:

Sistema de control de asistencia de personal (ADMNISTRACION)
------------------------------------------------------------

1- Alta de usuario
2- Lista de usuarios (datos adquiridos)
3- Salida a archivo
4- Cerrar la aplicación
0- Volver a la pantalla principal

Ingrese la opción deseada:

The next step should be registering the different users using the first option:

Sistema de control de asistencia de personal (Alta de usuario)
--------------------------------------------------------------

DNI: 12345678
Nombre completo: Pedro Gutierrez
Password: 123bbb
Administrador [1 = Sí/0 = No]: 0

Persona agregada satisfatoriamente.

Presione una tecla para continuar...

After that, they’ll be able to sign in themselves:

Sistema de control de asistencia de personal
--------------------------------------------

DNI: 12345678
Contraseña: 123bbb
Usuario "Pedro Gutierrez" reconocido.

Presione una tecla para continuar...

So they’ll get into the attendance screen to record their actions:

Asistencia de "Pedro Gutierrez"
-------------------------------

Tipo de asistencia:
        1- Ingreso
        2- Salida
        3- Salida a almorzar
        4- Vuelta de almorzar
Selección: 1

Justificación (si corresponde): Llegué tarde porque había
corte de calles.

Evento agregado satisfactoriamente.

Presione una tecla para continuar...

Each of them ’till they go back to home…

Asistencia de "Pedro Gutierrez"
-------------------------------

Tipo de asistencia:
        1- Ingreso
        2- Salida
        3- Salida a almorzar
        4- Vuelta de almorzar
Selección: 2

Justificación (si corresponde): Me voy más temprano porque
tengo que llevar a mi hijo al médico.

Evento agregado satisfactoriamente.

Presione una tecla para continuar...

When any administrator wants to watch the full listing of users and actions, he simply logs in and goes to the second option of the administration menu:

Sistema de control de asistencia de personal (Lista de
usuarios)
------------------------------------------------------

DNI: -1234
Nombre completo: Administrador
Password: ********
Administrador: 1
Cantidad de eventos: 0
Eventos:

[Esta persona no posee eventos]


DNI: 12345678
Nombre completo: Pedro Gutierrez
Password: ********
Administrador: 0
Cantidad de eventos: 4
Eventos:

Hora: 28/07/2009 14:13:27
Tipo: Ingreso
Justificación: Llegué tarde porque había corte de calles.

Hora: 28/07/2009 14:14:23
Tipo: Salida a almorzar
Justificación:

Hora: 28/07/2009 14:14:44
Tipo: Vuelta de almorzar
Justificación:

Hora: 28/07/2009 14:14:52
Tipo: Salida
Justificación: Me voy más temprano porque tengo que llevar a
mi hijo al médico.

Presione una tecla para continuar...

If he wants, he can save that information to a file by using, instead, the third option:

Sistema de control de asistencia de personal (ADMNISTRACION)
------------------------------------------------------------

1- Alta de usuario
2- Lista de usuarios (datos adquiridos)
3- Salida a archivo
4- Cerrar la aplicación
0- Volver a la pantalla principal

Ingrese la opción deseada: 3

Ingrese la ruta del archivo a guardar: c:asistencia.txt
Archivo guardado satisfactoriamente

Presione una tecla para continuar...

Finally, he can close the program by going to the fourth option (losing all the data)…

Sistema de control de asistencia de personal (ADMNISTRACION)
------------------------------------------------------------

1- Alta de usuario
2- Lista de usuarios (datos adquiridos)
3- Salida a archivo
4- Cerrar la aplicación
0- Volver a la pantalla principal

Ingrese la opción deseada: 4
Saliendo de la aplicación...

Presione una tecla para continuar...

That’s the idea of the application…

Now I’ll leave the links for the ones who don’t want to solve it themselves (or the ones who just want to run it and watch it work).

The code is portable between Linux and Windows (I’ve tested it myself on both platforms and it worked seamlessly).

It’s been developed, compiled and tested using wxDev-C++ for Windows with the MinGW compiler (included in the bundle). In Linux, it was compiled using the GNU GCC compiler.

GNU GPL v3 ControlAsistencia is licensed under the GNU GPL v3 (attached)…

Update: minor bug in String.cpp fixed => version 1.01

Support appreciated!

All the content offered in this website is, except noted otherwise, of free nature. This means you can share it wherever you want if you do it freely and stating its source.

If it was useful for you and you’d like to contribute, you can make a donation or, at least, visit one of our advertisers of your choice; they are all around the site.

Incoming search terms for the article:



0 Response to “Attendance Control”


Comments are currently closed.