Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DanielRivera03/SistemaBancario/llms.txt

Use this file to discover all available pages before exploring further.

CashMan H.A. uses a GET-parameter front-controller pattern. Two query parameters serve as routing tokens: ?cashmanha= for pre-login/authentication routes handled by cIniciosSesionesUsuarios.php, and ?cashmanhagestion= for post-login application routes handled by cGestionesCashman.php. Every incoming request is dispatched through a PHP switch statement keyed on the value of the relevant parameter — unknown values fall through to a default case that redirects back to the login page, preventing arbitrary parameter injection.

Entry Point

index.php at the application root redirects to:
controlador/cIniciosSesionesUsuarios.php?cashmanha=iniciarsesion
If no ?cashmanha= value is supplied the router defaults to iniciarsesion. Likewise, if no ?cashmanhagestion= value is supplied after login the router defaults to inicioadministradores.

Authentication Routes (?cashmanha=)

These routes are served by controlador/cIniciosSesionesUsuarios.php. None require an active session — they exist specifically to establish or recover one.
RouteMethodRequired RoleDescription
iniciarsesionGETNoneRender login page
validar-sesionesPOSTNoneProcess login, set session variables, redirect by role
credenciales-incorrectasGETNoneLogin error page (bad username or password)
reestablecer-contrasenaGETNoneForgot password form
recuperar-cuentasPOSTNoneGenerate recovery code, send email via PHPMailer, insert token
confirmacion-recuperacion-cuentasGETNoneRecovery email sent confirmation page
codigo-seguridad-recuperacionGETNoneEnter the 5-digit recovery code sent by email
cambio-estado-tokenPOSTNoneValidate recovery code, upgrade $_SESSION['EstadoCodigos'] to ValidarCodigoAcceso
cambio-contrasenia-usuariosGETNoneNew password entry form
cambiar-contrasenia-recuperacionPOSTNoneHash and persist new password, send confirmation email, destroy session
confirmacion-cambio-contraseniaGETNoneSuccess page — destroys session before rendering
error-cambio-contraseniaGETNoneError page — destroys session before rendering
token-codigo-invalidoGETNoneInvalid or expired recovery token page
expiracion-cambio-contraseniaGETNoneSession expiry cleanup — unsets session, redirects to login
cerrarsesionGETAny authenticatedDestroy session (session_unset() + session_destroy()), redirect to login
The password hashing pattern used in validar-sesiones and cambiar-contrasenia-recuperacion is:
$cifrado = sha1($_POST['val-password']);
$Contrasenia = crypt($conectarsistema->real_escape_string($_POST['val-password']), $cifrado);
Both the stored value and the login attempt are hashed identically before comparison. The raw password is never stored.

Session Variables Set on Login

When validar-sesiones succeeds, the following $_SESSION keys are populated from the usuarios table row:
KeySource FieldDescription
id_usuarioidusuariosUser’s unique integer ID
nombre_usuarionombresFirst name
apellido_usuarioapellidosLast name
usuario_unicocodigousuarioUnique username code
id_rolidrolRole integer (1–5)
correo_usuariocorreoEmail address
foto_perfilfotoperfilProfile photo filename
estado_usuarioestado_usuarioAccount state
comprobar_iniciosesion_primeraveznuevousuarioFirst-login flag
habilitar_sistemahabilitarsistemaWhether credit has been approved
comprobacioncuenta_ahorrosposeecuentaHas a savings account
comprobacioncreditos_clientesposeecreditoHas an associated credit

Dashboard Routes (?cashmanhagestion=)

These routes are served by controlador/cGestionesCashman.php. Every case begins by checking $_SESSION['id_rol']; an incorrect role redirects to redirecciones-sistema-cashmanha.

Portal Home Pages

RouteRole RequiredView FileDescription
inicioadministradores1vista/Administradores/inicio-administradores.phpAdministrator dashboard
iniciopresidencia2vista/Presidencia/inicio-presidencia.phpPresidency dashboard
iniciogerencia3vista/Gerencia/inicio-gerencia.phpManagement dashboard
inicioatencionclientes4vista/AtencionClientes/inicio-atencion-clientes.phpCustomer Service dashboard
inicioclientes5vista/Clientes/inicio-clientes.phpClient dashboard

Profile Routes

RouteRole RequiredDescription
perfiladministradores1Administrator profile
perfilpresidencia2Presidency profile
perfilgerencia3Management profile
perfilatencionclientes4Customer Service profile
perfilclientes5Client profile
actualizar-configuracion-cuenta-administradores1Update admin account settings (JSON response)
actualizar-configuracion-cuenta-presidencia2Update presidency account settings (JSON response)
actualizar-configuracion-cuenta-gerencia3Update management account settings (JSON response)
actualizar-configuracion-cuenta-atencion-al-cliente4Update customer service account settings (JSON response)
actualizar-configuracion-cuenta-clientes5Update client account settings (JSON response)
actualizacion-detalles-perfil-usuarios1–5Update personal profile details for any authenticated role (JSON response)
Profile photo uploads are renamed on the server using the pattern {date("dHi")}_{uniqid()}_{originalname} and stored in vista/images/fotoperfil/. If no new photo is submitted, a separate stored procedure without a photo parameter is called.

User Management Routes

All routes in this section require Role 1 (Administrator).
RouteMethodDescription
registro-usuarios-administradorGETUser registration page — also shows users with incomplete profiles
envio-datos-registro-usuarios-administradorPOSTSubmit new user credentials; stores session data for credential report
registro-detalles-usuarios-administradorGETComplete user profile form (?codigounicousuario=)
envio-datos-registro-detalles-nuevos-usuariosPOSTSubmit full user profile including DUI, NIT, and signature images
mostrar-informe-nuevos-clientes-administradorGETPrintable PDF credential report for the newly registered user
consulta-general-usuarios-administradorGETList all active, inactive, and blocked users
modificar-usuarios-administradorGETEdit user form — requires ?idusuario=
envio-datos-modificar-usuarios-administradorPOSTSubmit user account changes
desactivar-usuarios-clientesPOSTDeactivate user (JSON response, ?idusuario=)
bloquear-usuarios-clientesPOSTBlock user (JSON response, ?idusuario=)
reactivar-usuarios-clientesPOSTReactivate inactive or blocked user (JSON response, ?idusuario=)
The user registration workflow is a two-step process. Step 1 (envio-datos-registro-usuarios-administrador) creates the user account. Step 2 (envio-datos-registro-detalles-nuevos-usuarios) attaches full personal details and identity documents. Document images (DUI front, DUI back, NIT, signature) are renamed with the same date_uniqid_filename scheme and stored in their respective subdirectories under vista/images/.

Credit Routes

RouteRole(s)Description
gestion-creditos-primer-paso-gerencia3, 1First credit review step (Gerencia department)
gestion-creditos-segundo-paso-presidencia2, 1Final credit approval step (Presidencia)
gestionador-cuotas-contratos-creditos1, 4Manage installment schedules and loan contracts
orden-pagos-cuotas-creditos-clientes1, 4Process an installment payment order
consulta-clientes-creditos-activos-en-curso1, 2, 3, 4List all active/in-progress credits
consulta-clientes-creditos-cancelados1, 2, 3, 4Historical list of fully paid or cancelled credits
consulta-clientes-creditos-denegados1, 2, 3, 4List of denied credit requests
consulta-listado-morosos1, 3Delinquent clients with overdue installments
Credit approval follows a strict two-step workflow: Gerencia reviews first (gestion-creditos-primer-paso-gerencia), then Presidencia gives final approval (gestion-creditos-segundo-paso-presidencia). Skipping either step will leave the credit in an incomplete state and the client will not have their system access enabled (habilitarsistema flag).

Savings Account Routes

RouteRole(s)Description
registro-nuevas-cuentas-ahorro1, 4Open a new savings account for a client
registro-deposito-cuenta-ahorro1, 4Record a deposit into a savings account
registro-retiro-cuenta-ahorro1, 4Record a withdrawal from a savings account
registro-transferencia-cuentas1, 4, 5Initiate an inter-account transfer (requires security code via email)
consulta-general-cuentas-ahorros1, 2, 3, 4List all registered savings accounts

AJAX Response Pattern

POST routes that mutate data in cGestionesCashman.php return echo json_encode($result) directly, making them suitable for jQuery AJAX calls. The $result value is a string returned by the model method — "OK" on success or "ERROR" on failure.
$.ajax({
    url: 'cGestionesCashman.php?cashmanhagestion=desactivar-usuarios-clientes&idusuario=' + userId,
    type: 'POST',
    dataType: 'json',
    success: function(response) {
        // handle JSON response
        if (response === 'OK') {
            // operation succeeded
            Swal.fire('Success', 'User deactivated.', 'success');
        }
    },
    error: function(xhr, status, error) {
        console.error('Request failed:', error);
    }
});
CashMan H.A. uses SweetAlert2 (sweetalert2.min.js) and Toastr (toastr.min.js) for user-facing feedback on AJAX responses. These libraries are included via the vista/vendor/ directory.

Build docs developers (and LLMs) love