From 114511d04b20d0bca7bf5aa8df5545a434e23e29 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Wed, 24 Sep 2025 16:22:31 -0600 Subject: [PATCH 1/9] added new style responsive --- app/(private)/Alta/page.tsx | 63 +++++++------------ .../BarNavigation/BarNavigation.css | 7 +-- .../ChangePassword/changePassword.tsx | 2 +- .../StepNavigator/StepNavigator.css | 21 ++++--- app/globals.css | 43 +++++++++++-- 5 files changed, 77 insertions(+), 59 deletions(-) diff --git a/app/(private)/Alta/page.tsx b/app/(private)/Alta/page.tsx index acf3ec2..dc08afd 100644 --- a/app/(private)/Alta/page.tsx +++ b/app/(private)/Alta/page.tsx @@ -1,4 +1,4 @@ -'use client' +"use client"; import { useState } from "react"; import StepNavigator from "@/app/Components/StepNavigator/StepNavigator"; @@ -6,86 +6,71 @@ export default function Page() { const [step, setStep] = useState(1); const [major, setMajor] = useState(""); - const handleNext = (e: any) => { - e.preventDefault(); - if (step < 3) setStep(step + 1); - }; - - const handlePrev = (e: any) => { - e.preventDefault(); - if (step > 1) setStep(step - 1); - }; - return (

ALTA

console.log()}> -
- + + setUser(e.target.value)} - placeholder='Coloca un número de cuenta...' + placeholder="Coloca un número de cuenta..." /> - + setUser(e.target.value)} - placeholder='Coloca el nombre' + placeholder="Coloca el nombre" /> - + setUser(e.target.value)} - placeholder='Coloca el apellido paterno' + placeholder="Coloca el apellido paterno" /> - + setUser(e.target.value)} - placeholder='Coloca el apellido materno' + placeholder="Coloca el apellido materno" />
- + setUser(e.target.value)} - placeholder='Coloca ' + placeholder="Coloca " /> - + setUser(e.target.value)} - placeholder='Coloca ' + placeholder="Coloca " /> - - setMajor(e.target.value)}> -
- -
+ ); } -//IO \ No newline at end of file +//IO diff --git a/app/Components/BarNavigation/BarNavigation.css b/app/Components/BarNavigation/BarNavigation.css index fe017fe..b7d7cea 100644 --- a/app/Components/BarNavigation/BarNavigation.css +++ b/app/Components/BarNavigation/BarNavigation.css @@ -56,7 +56,6 @@ align-items: center; justify-content: center; width: 100%; - gap: 10px; position: relative; z-index: 1; border-radius: 4px 4px 0 0; @@ -139,7 +138,7 @@ tbody { .barNavigation ul { position: absolute; - background-color: rgb(1, 92, 184); + background-color: #003e79; flex-direction: column; padding: 10px 0; align-items: center; @@ -160,10 +159,10 @@ tbody { } .subMenu ul { - width: 90%; + width: 100%; border-radius: 4px; position: relative; - background-color: rgba(0, 61, 121, 1); + background-color: rgb(1, 92, 184); } thead, diff --git a/app/Components/ChangePassword/changePassword.tsx b/app/Components/ChangePassword/changePassword.tsx index 7284b98..620a57b 100644 --- a/app/Components/ChangePassword/changePassword.tsx +++ b/app/Components/ChangePassword/changePassword.tsx @@ -14,7 +14,7 @@ export default function ChangePassword() { return (
-
+
Date: Wed, 24 Sep 2025 17:51:54 -0600 Subject: [PATCH 2/9] added new animations --- app/(private)/layout.tsx | 3 +- app/Components/AlertBox/AlertBox.css | 39 ++++++++++++++---- .../BarNavigation/BarNavigation.css | 15 ++++++- .../ChangePassword/changePassword.tsx | 2 +- app/Components/Header/Header.module.css | 10 ++++- app/Components/Impressions/impressions.tsx | 2 +- app/Components/Login/Login.tsx | 4 +- app/Components/Logout/Logout.css | 6 +-- app/Components/Receipt/Receipt.tsx | 2 +- app/globals.css | 16 ++++++- public/rock2.jpg | Bin 0 -> 550016 bytes 11 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 public/rock2.jpg diff --git a/app/(private)/layout.tsx b/app/(private)/layout.tsx index 64368d2..4eb8832 100644 --- a/app/(private)/layout.tsx +++ b/app/(private)/layout.tsx @@ -1,5 +1,4 @@ import { ReactNode } from "react"; -import { PrivateRoute } from "../Routes/PrivateRoute"; import BarNavigation from "../Components/BarNavigation/BarNavigation"; import Logout from "../Components/Logout/Logout"; @@ -8,7 +7,7 @@ export default function PrivateLayout({ children }: { children: ReactNode }) {
- +
{children}
diff --git a/app/Components/AlertBox/AlertBox.css b/app/Components/AlertBox/AlertBox.css index f33818d..894252f 100644 --- a/app/Components/AlertBox/AlertBox.css +++ b/app/Components/AlertBox/AlertBox.css @@ -1,3 +1,26 @@ +/* Animaciones */ +@keyframes slideInLeft { + 0% { + opacity: 0; + transform: translateX(-100%); + } + 100% { + opacity: 0.9; + transform: translateX(0); + } +} + +@keyframes slideOutRight { + 0% { + opacity: 0.9; + transform: translateX(0); + } + 100% { + opacity: 0; + transform: translateX(100%); + } +} + .messageBox { display: flex; position: absolute; @@ -6,20 +29,20 @@ font-weight: bold; font-size: 2rem; text-align: center; - opacity: 1; z-index: 100; top: 0; left: 0; - width: 100%; + max-width: 500px; max-height: min-content; - opacity: 0.9; - transition: opacity 0.5s ease, transform 0.5s ease; + opacity: 0; +} + +.messageBox:not(.hidden) { + animation: slideInLeft 0.5s ease forwards; } .messageBox.hidden { - opacity: 0; - pointer-events: none; - transition: opacity 1s ease-out,transform 0.5 ease; + animation: slideOutRight 0.5s ease forwards; } .success { @@ -32,4 +55,4 @@ background-color: #ffcdd2; color: #000000; border: 1px solid #ef9a9a; -} \ No newline at end of file +} diff --git a/app/Components/BarNavigation/BarNavigation.css b/app/Components/BarNavigation/BarNavigation.css index b7d7cea..0f3debf 100644 --- a/app/Components/BarNavigation/BarNavigation.css +++ b/app/Components/BarNavigation/BarNavigation.css @@ -62,13 +62,19 @@ } .subMenu ul { - display: none; + opacity: 0; + max-height: 0; position: absolute; flex-direction: column; top: 100%; width: 100%; background-color: #003e79; - transition: color 0.3s ease, opacity 0.3s ease; + transition: color 0.3s ease; + transition: opacity 0.4s ease, max-height 0.4s ease; +} + +.subMenu ul a { + display: none; } .subMenu.open ul { @@ -81,6 +87,11 @@ } .subMenu:hover ul { + opacity: 1; + max-height: 500px; +} + +.subMenu:hover ul a { display: flex; } diff --git a/app/Components/ChangePassword/changePassword.tsx b/app/Components/ChangePassword/changePassword.tsx index 620a57b..95b95a6 100644 --- a/app/Components/ChangePassword/changePassword.tsx +++ b/app/Components/ChangePassword/changePassword.tsx @@ -42,7 +42,7 @@ export default function ChangePassword() {
{ setconfirmNewPass(e.target.value); diff --git a/app/Components/Header/Header.module.css b/app/Components/Header/Header.module.css index 464ed6f..f1773e4 100644 --- a/app/Components/Header/Header.module.css +++ b/app/Components/Header/Header.module.css @@ -26,10 +26,16 @@ content: ""; top: 0; left: -20px; - width: 50%; + width: 65%; height: 100%; min-width: 300px; - background: #bd8c01; + background: linear-gradient(to right, #bd8c01, #f9f9f9); transform: skew(-45deg); z-index: 0; } + +@media (max-width: 800px) { + .yellowPart { + background: #bd8c01; + } +} diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index b0ad63d..4c55d7f 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -84,7 +84,7 @@ function Impressions({ costs, numAcount }: ImpressionsProps) {
-
+ {showError && ( - + <> + + )} {showSuccess && ( diff --git a/app/(private)/Programas/page.tsx b/app/(private)/Programas/page.tsx index 3722faf..4477740 100644 --- a/app/(private)/Programas/page.tsx +++ b/app/(private)/Programas/page.tsx @@ -62,7 +62,7 @@ export default function Page() {
- - +
); } diff --git a/app/(private)/Alta/style.css b/app/(private)/Alta/style.css new file mode 100644 index 0000000..bf559d8 --- /dev/null +++ b/app/(private)/Alta/style.css @@ -0,0 +1,23 @@ +.gridAlta { + display: grid; + grid-template-columns: 1fr 1fr; +} +.containerAlta { + background-color: #f9f9f9; + width: 100%; + max-width: 900px; + padding: 1rem; + border-radius: 4px; +} + +@media (max-width: 800px) { + .gridAlta { + grid-template-columns: 1fr; + justify-items: center; + min-width: max-content; + } + + .containerAlta { + width: 80%; + } +} diff --git a/app/(private)/AsignacionEquipo/asignacionEquipos..css b/app/(private)/AsignacionEquipo/asignacionEquipos..css deleted file mode 100644 index e73c9f3..0000000 --- a/app/(private)/AsignacionEquipo/asignacionEquipos..css +++ /dev/null @@ -1,29 +0,0 @@ - -.availableTablesContainer { - /* You can add specific styles for the table list here */ - width: 45%; /* Adjust width to fit the layout */ - background-color: #f9f9f9; - border-radius: 8px; - padding: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -} - -.tableList { - list-style: none; - padding: 0; - display: flex; - flex-direction: column; /* Or use flex-wrap to make it a grid */ - height: 200px; /* Or a fixed height with overflow */ - overflow-y: auto; -} - -.tableList li { - padding: 8px; - border-bottom: 1px solid #ddd; - cursor: pointer; - transition: background-color 0.2s; -} - -.tableList li:hover { - background-color: #f0f0f0; -} diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index f4160e9..67a73e7 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -1,6 +1,6 @@ "use client"; -import SearchUser from "@/app/Components/SearchUser/searchUser"; -import Toggle from "@/app/Components/Toggle/Toggle"; +import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; +import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default function Page() { return ( diff --git a/app/(private)/AsignacionMesas/asignacionmesas.css b/app/(private)/AsignacionMesas/asignacionmesas.css deleted file mode 100644 index e73c9f3..0000000 --- a/app/(private)/AsignacionMesas/asignacionmesas.css +++ /dev/null @@ -1,29 +0,0 @@ - -.availableTablesContainer { - /* You can add specific styles for the table list here */ - width: 45%; /* Adjust width to fit the layout */ - background-color: #f9f9f9; - border-radius: 8px; - padding: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -} - -.tableList { - list-style: none; - padding: 0; - display: flex; - flex-direction: column; /* Or use flex-wrap to make it a grid */ - height: 200px; /* Or a fixed height with overflow */ - overflow-y: auto; -} - -.tableList li { - padding: 8px; - border-bottom: 1px solid #ddd; - cursor: pointer; - transition: background-color 0.2s; -} - -.tableList li:hover { - background-color: #f0f0f0; -} diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 7551292..6b67fd1 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -1,6 +1,6 @@ "use client"; -import SearchUser from "@/app/Components/SearchUser/searchUser"; -import Toggle from "@/app/Components/Toggle/Toggle"; +import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; +import Toggle from "@/app/Components/Global/Toggle/Toggle"; import { useState } from "react"; export default function Page() { diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 5d68131..0731acc 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -1,10 +1,10 @@ "use client"; -import Toggle from "@/app/Components/Toggle/Toggle"; -import Sanciones from "@/app/Components/BitacoraSanciones/Sanciones"; -import BitacoraMesas from "@/app/Components/BitacoraSanciones/BitacoraMesas"; -import BitacoraAlumno from "@/app/Components/BitacoraSanciones/BitacoraAlumno"; -import BitacoraEquipo from "@/app/Components/BitacoraSanciones/BitacoraEquipo"; +import BitacoraAlumno from "@/app/Components/Reportes/BitacoraSanciones/BitacoraAlumno"; +import BitacoraEquipo from "@/app/Components/Reportes/BitacoraSanciones/BitacoraEquipo"; +import BitacoraMesas from "@/app/Components/Reportes/BitacoraSanciones/BitacoraMesas"; +import Sanciones from "@/app/Components/Reportes/BitacoraSanciones/Sanciones"; +import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default function Page() { return ( diff --git a/app/(private)/CambiarPass/page.tsx b/app/(private)/CambiarPass/page.tsx index 00fba34..66b6423 100644 --- a/app/(private)/CambiarPass/page.tsx +++ b/app/(private)/CambiarPass/page.tsx @@ -1,13 +1,12 @@ -import ChangePassword from "../../Components/ChangePassword/changePassword"; +import ChangePassword from "@/app/Components/auth/ChangePassword/changePassword"; export default function Page() { return ( -
-

Cambiar contraseña

+
+

Cambiar contraseña

- +
- ); } -//IO \ No newline at end of file +//IO diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index c83e1cd..8ebe9eb 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -1,12 +1,13 @@ -import SearchUser from "../../Components/SearchUser/searchUser"; +import SearchUser from "../../Components/Global/SearchUser/searchUser"; import Receipt from "../../Components/Receipt/Receipt"; -import Impressions from "../../Components/Impressions/impressions"; -import Toggle from "../../Components/Toggle/Toggle"; -import Information from "../../Components/Information/information"; -import AlertBox from "@/app/Components/AlertBox/AlertBox"; +import Toggle from "../../Components/Global/Toggle/Toggle"; +import Information from "../../Components/Global/Information/information"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import { GetStudent } from "@/app/lib/getStudent"; import "@/app/globals.css"; +import Impressions from "@/app/Components/Servicios/Impressions/impressions"; + export default async function Page(props: { searchParams?: Promise<{ numAcount: string; @@ -17,14 +18,14 @@ export default async function Page(props: { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; const showSuccess = params?.success ? params.success : null; - let showError = params?.error ? params.error : null; + const showError = params?.error ? params.error : null; let student: any = null; + if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { - showError = "Alumno no encontrado"; } else { student = result; } diff --git a/app/(private)/InformacionEquipo/page.tsx b/app/(private)/InformacionEquipo/page.tsx index 743d05a..0721229 100644 --- a/app/(private)/InformacionEquipo/page.tsx +++ b/app/(private)/InformacionEquipo/page.tsx @@ -1,8 +1,8 @@ -import ProgramSelector from "@/app/Components/ProgramSelector/ProgramSelector"; -import Toggle from "@/app/Components/Toggle/Toggle"; +import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import ProgramSelector from "@/app/Components/Equipo/ProgramSelector/ProgramSelector"; +import Equipos from "@/app/Components/Equipo/Equipos/equipos"; import "./informacionequipo.css"; -import Equipos from "@/app/Components/Equipos/equipos"; export default function Page() { return ( diff --git a/app/(private)/Inscripciones/inscriptions.css b/app/(private)/Inscripcion/inscriptions.css similarity index 100% rename from app/(private)/Inscripciones/inscriptions.css rename to app/(private)/Inscripcion/inscriptions.css diff --git a/app/(private)/Inscripciones/page.tsx b/app/(private)/Inscripcion/page.tsx similarity index 55% rename from app/(private)/Inscripciones/page.tsx rename to app/(private)/Inscripcion/page.tsx index c14b5a4..168a4af 100644 --- a/app/(private)/Inscripciones/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -1,27 +1,31 @@ -import SearchUser from "@/app/Components/SearchUser/searchUser"; -import Information from "@/app/Components/Information/information"; -import StepNavigator from "@/app/Components/StepNavigator/StepNavigator"; +import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; +import Information from "@/app/Components/Global/Information/information"; +import StepNavigator from "@/app/Components/Global/StepNavigator/StepNavigator"; import Receipt from "@/app/Components/Receipt/Receipt"; import Selection from "@/app/Components/Selection/Selection"; import { GetStudent } from "@/app/lib/getStudent"; import "./inscriptions.css"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; + success?: string; + error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; + const showSuccess = params?.success ? params.success : null; + let showError = params?.error ? params.error : null; let student: any = null; - let error: string | null = null; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { - error = result.error; + showError = "Alumno no encontrado"; } else { student = result; } @@ -29,9 +33,19 @@ export default async function Page(props: { return (
+ {showError && ( + <> + + + )} + + {showSuccess && ( + + )} +

INSCRIPCION

- + {student ? ( <> @@ -44,7 +58,7 @@ export default async function Page(props: { - + ) : ( diff --git a/app/(private)/Mensajes/page.tsx b/app/(private)/Mensajes/page.tsx index ed3d6b6..4fd79b2 100644 --- a/app/(private)/Mensajes/page.tsx +++ b/app/(private)/Mensajes/page.tsx @@ -1,7 +1,7 @@ "use client"; -import EnviarMensaje from "@/app/Components/EviarMensaje/EnviarMensaje"; -import Toggle from "@/app/Components/Toggle/Toggle"; +import EnviarMensaje from "@/app/Components/Equipo/EviarMensaje/EnviarMensaje"; +import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default function Page() { return ( diff --git a/app/(private)/Programas/page.tsx b/app/(private)/Programas/page.tsx index 4477740..014e048 100644 --- a/app/(private)/Programas/page.tsx +++ b/app/(private)/Programas/page.tsx @@ -3,7 +3,6 @@ import { useState } from "react"; import styleprograms from "./programas.module.css"; export default function Page() { - // modo puede ser: "ver", "editar", "nuevo" const [modo, setModo] = useState("ver"); const handleNuevo = () => { diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index 1040422..957ceb1 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -1,6 +1,6 @@ "use client"; -import SearchUser from "@/app/Components/SearchUser/searchUser"; +import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import QuitarSancion from "@/app/Components/QuitarSancion/QuitarSancion"; export default function Page() { diff --git a/app/(private)/Reportes/page.tsx b/app/(private)/Reportes/page.tsx index 9624bec..fae8ae7 100644 --- a/app/(private)/Reportes/page.tsx +++ b/app/(private)/Reportes/page.tsx @@ -2,8 +2,8 @@ import { useState } from "react"; import styles from "./Page.module.css"; // importamos el css -import Toggle from "@/app/Components/Toggle/Toggle"; -import SearchDateBetween from "@/app/Components/SearchDateBetween/SearchDateBetween"; +import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import SearchDateBetween from "@/app/Components/Reportes/SearchDateBetween/SearchDateBetween"; export default function Page() { const [reportes] = useState([ @@ -69,7 +69,7 @@ export default function Page() { label: "Por Servicio", content: ( <> - +
diff --git a/app/(private)/layout.tsx b/app/(private)/layout.tsx index 4eb8832..565678d 100644 --- a/app/(private)/layout.tsx +++ b/app/(private)/layout.tsx @@ -1,8 +1,12 @@ import { ReactNode } from "react"; -import BarNavigation from "../Components/BarNavigation/BarNavigation"; -import Logout from "../Components/Logout/Logout"; +import BarNavigation from "../Components/layout/BarNavigation/BarNavigation"; +import Logout from "../Components/auth/Logout/Logout"; -export default function PrivateLayout({ children }: { children: ReactNode }) { +export default async function PrivateLayout({ + children, +}: { + children: ReactNode; +}) { return (
diff --git a/app/Components/ActivosMantenimiento/Areas.tsx b/app/Components/Equipo/ActivosMantenimiento/Areas.tsx similarity index 100% rename from app/Components/ActivosMantenimiento/Areas.tsx rename to app/Components/Equipo/ActivosMantenimiento/Areas.tsx diff --git a/app/Components/ActivosMantenimiento/Equipos.tsx b/app/Components/Equipo/ActivosMantenimiento/Equipos.tsx similarity index 100% rename from app/Components/ActivosMantenimiento/Equipos.tsx rename to app/Components/Equipo/ActivosMantenimiento/Equipos.tsx diff --git a/app/Components/ActivosMantenimiento/Mesas.tsx b/app/Components/Equipo/ActivosMantenimiento/Mesas.tsx similarity index 100% rename from app/Components/ActivosMantenimiento/Mesas.tsx rename to app/Components/Equipo/ActivosMantenimiento/Mesas.tsx diff --git a/app/Components/Equipos/equipos.tsx b/app/Components/Equipo/Equipos/equipos.tsx similarity index 100% rename from app/Components/Equipos/equipos.tsx rename to app/Components/Equipo/Equipos/equipos.tsx diff --git a/app/Components/EviarMensaje/EnviarMensaje.tsx b/app/Components/Equipo/EviarMensaje/EnviarMensaje.tsx similarity index 100% rename from app/Components/EviarMensaje/EnviarMensaje.tsx rename to app/Components/Equipo/EviarMensaje/EnviarMensaje.tsx diff --git a/app/Components/ProgramSelector/ProgramSelector.tsx b/app/Components/Equipo/ProgramSelector/ProgramSelector.tsx similarity index 100% rename from app/Components/ProgramSelector/ProgramSelector.tsx rename to app/Components/Equipo/ProgramSelector/ProgramSelector.tsx diff --git a/app/Components/AlertBox/AlertBox.css b/app/Components/Global/AlertBox/AlertBox.css similarity index 100% rename from app/Components/AlertBox/AlertBox.css rename to app/Components/Global/AlertBox/AlertBox.css diff --git a/app/Components/AlertBox/AlertBox.tsx b/app/Components/Global/AlertBox/AlertBox.tsx similarity index 100% rename from app/Components/AlertBox/AlertBox.tsx rename to app/Components/Global/AlertBox/AlertBox.tsx diff --git a/app/Components/ClearParams/ClearParams.tsx b/app/Components/Global/ClearParams/ClearParams.tsx similarity index 100% rename from app/Components/ClearParams/ClearParams.tsx rename to app/Components/Global/ClearParams/ClearParams.tsx diff --git a/app/Components/Information/information.tsx b/app/Components/Global/Information/information.tsx similarity index 100% rename from app/Components/Information/information.tsx rename to app/Components/Global/Information/information.tsx diff --git a/app/Components/SearchUser/searchUser.css b/app/Components/Global/SearchUser/searchUser.css similarity index 100% rename from app/Components/SearchUser/searchUser.css rename to app/Components/Global/SearchUser/searchUser.css diff --git a/app/Components/SearchUser/searchUser.tsx b/app/Components/Global/SearchUser/searchUser.tsx similarity index 100% rename from app/Components/SearchUser/searchUser.tsx rename to app/Components/Global/SearchUser/searchUser.tsx diff --git a/app/Components/StepNavigator/StepNavigator.css b/app/Components/Global/StepNavigator/StepNavigator.css similarity index 100% rename from app/Components/StepNavigator/StepNavigator.css rename to app/Components/Global/StepNavigator/StepNavigator.css diff --git a/app/Components/StepNavigator/StepNavigator.tsx b/app/Components/Global/StepNavigator/StepNavigator.tsx similarity index 100% rename from app/Components/StepNavigator/StepNavigator.tsx rename to app/Components/Global/StepNavigator/StepNavigator.tsx diff --git a/app/Components/Toggle/Toggle.tsx b/app/Components/Global/Toggle/Toggle.tsx similarity index 100% rename from app/Components/Toggle/Toggle.tsx rename to app/Components/Global/Toggle/Toggle.tsx diff --git a/app/Components/visual/FallingSquares/FallingSquares.tsx b/app/Components/Global/visual/FallingSquares/FallingSquares.tsx similarity index 100% rename from app/Components/visual/FallingSquares/FallingSquares.tsx rename to app/Components/Global/visual/FallingSquares/FallingSquares.tsx diff --git a/app/Components/visual/FallingSquares/style.css b/app/Components/Global/visual/FallingSquares/style.css similarity index 100% rename from app/Components/visual/FallingSquares/style.css rename to app/Components/Global/visual/FallingSquares/style.css diff --git a/app/Components/visual/GlobalAlert.tsx b/app/Components/Global/visual/GlobalAlert.tsx similarity index 78% rename from app/Components/visual/GlobalAlert.tsx rename to app/Components/Global/visual/GlobalAlert.tsx index 5f97eef..0587640 100644 --- a/app/Components/visual/GlobalAlert.tsx +++ b/app/Components/Global/visual/GlobalAlert.tsx @@ -1,8 +1,8 @@ "use client"; import { useEffect, useState } from "react"; -import AlertBox from "@/app/Components/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/ClearParams/ClearParams"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default function GlobalAlert() { const [showSuccess, setShowSuccess] = useState(null); @@ -22,14 +22,12 @@ export default function GlobalAlert() { {showError && ( <> - )} {showSuccess && ( <> - )} diff --git a/app/Components/visual/Wave/wave.module.css b/app/Components/Global/visual/Wave/wave.module.css similarity index 100% rename from app/Components/visual/Wave/wave.module.css rename to app/Components/Global/visual/Wave/wave.module.css diff --git a/app/Components/visual/Wave/wavesBack.tsx b/app/Components/Global/visual/Wave/wavesBack.tsx similarity index 100% rename from app/Components/visual/Wave/wavesBack.tsx rename to app/Components/Global/visual/Wave/wavesBack.tsx diff --git a/app/Components/Inscripciones/Alta/registerAlta.tsx b/app/Components/Inscripciones/Alta/registerAlta.tsx new file mode 100644 index 0000000..6e0aebf --- /dev/null +++ b/app/Components/Inscripciones/Alta/registerAlta.tsx @@ -0,0 +1,68 @@ +"use client"; +import { useState } from "react"; + +export default function RegisterAlta() { + const [major, setMajor] = useState(""); + return ( +
+
+ + setUser(e.target.value)} + placeholder="Coloca un número de cuenta..." + /> +
+ +
+ + setUser(e.target.value)} + placeholder="Coloca el nombre" + /> +
+ +
+ + setUser(e.target.value)} + placeholder="Coloca el apellido paterno" + /> +
+ +
+ + setUser(e.target.value)} + placeholder="Coloca el apellido materno" + /> +
+ +
+ + setUser(e.target.value)} + placeholder="Coloca fecha empezando por año" + /> +
+ +
+ + +
+ + + + ); +} diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 46b5931..29f9af1 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -89,7 +89,7 @@ function Receipt({ urlBase, numAcount }: ReceiptsProps) { value={folio} onChange={(error) => { const value = error.target.value; - if (/^\d*$/.test(value)) { + if (/^\d*$/.test(value) && value.length <= 7) { setFolio(value); } }} @@ -114,7 +114,7 @@ function Receipt({ urlBase, numAcount }: ReceiptsProps) { setAmount(value); } else { router.push( - `/Impresiones?numAcount=${numAcount}&error=El monto no puede superar $1000.00` + `${urlBase}?numAcount=${numAcount}&error=El monto no puede superar $1000.00` ); } } diff --git a/app/Components/BitacoraSanciones/BitacoraAlumno.tsx b/app/Components/Reportes/BitacoraSanciones/BitacoraAlumno.tsx similarity index 100% rename from app/Components/BitacoraSanciones/BitacoraAlumno.tsx rename to app/Components/Reportes/BitacoraSanciones/BitacoraAlumno.tsx diff --git a/app/Components/BitacoraSanciones/BitacoraEquipo.tsx b/app/Components/Reportes/BitacoraSanciones/BitacoraEquipo.tsx similarity index 100% rename from app/Components/BitacoraSanciones/BitacoraEquipo.tsx rename to app/Components/Reportes/BitacoraSanciones/BitacoraEquipo.tsx diff --git a/app/Components/BitacoraSanciones/BitacoraMesas.tsx b/app/Components/Reportes/BitacoraSanciones/BitacoraMesas.tsx similarity index 100% rename from app/Components/BitacoraSanciones/BitacoraMesas.tsx rename to app/Components/Reportes/BitacoraSanciones/BitacoraMesas.tsx diff --git a/app/Components/BitacoraSanciones/Page.module.css b/app/Components/Reportes/BitacoraSanciones/Page.module.css similarity index 100% rename from app/Components/BitacoraSanciones/Page.module.css rename to app/Components/Reportes/BitacoraSanciones/Page.module.css diff --git a/app/Components/BitacoraSanciones/Sanciones.tsx b/app/Components/Reportes/BitacoraSanciones/Sanciones.tsx similarity index 95% rename from app/Components/BitacoraSanciones/Sanciones.tsx rename to app/Components/Reportes/BitacoraSanciones/Sanciones.tsx index 696b989..118a3ae 100644 --- a/app/Components/BitacoraSanciones/Sanciones.tsx +++ b/app/Components/Reportes/BitacoraSanciones/Sanciones.tsx @@ -1,8 +1,8 @@ "use client"; import { useEffect, useState } from "react"; import styles from "./Page.module.css"; -import SearchUser from "../SearchUser/searchUser"; -import Information from "../Information/information"; +import SearchUser from "../../Global/SearchUser/searchUser"; +import Information from "../../Global/Information/information"; import { GetStudent } from "@/app/lib/getStudent"; import { envConfig } from "@/app/lib/config"; diff --git a/app/Components/SearchDate/SearchDate.tsx b/app/Components/Reportes/SearchDate/SearchDate.tsx similarity index 100% rename from app/Components/SearchDate/SearchDate.tsx rename to app/Components/Reportes/SearchDate/SearchDate.tsx diff --git a/app/Components/SearchDateBetween/SearchDateBetween.tsx b/app/Components/Reportes/SearchDateBetween/SearchDateBetween.tsx similarity index 96% rename from app/Components/SearchDateBetween/SearchDateBetween.tsx rename to app/Components/Reportes/SearchDateBetween/SearchDateBetween.tsx index 4145493..2cfb89b 100644 --- a/app/Components/SearchDateBetween/SearchDateBetween.tsx +++ b/app/Components/Reportes/SearchDateBetween/SearchDateBetween.tsx @@ -1,5 +1,5 @@ "use client"; -import { Margarine } from "next/font/google"; + import { useState } from "react"; function SearchDateBetween() { diff --git a/app/Components/Impressions/Impressions.css b/app/Components/Servicios/Impressions/Impressions.css similarity index 100% rename from app/Components/Impressions/Impressions.css rename to app/Components/Servicios/Impressions/Impressions.css diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Servicios/Impressions/impressions.tsx similarity index 100% rename from app/Components/Impressions/impressions.tsx rename to app/Components/Servicios/Impressions/impressions.tsx diff --git a/app/Components/ChangePassword/changePassword.tsx b/app/Components/auth/ChangePassword/changePassword.tsx similarity index 100% rename from app/Components/ChangePassword/changePassword.tsx rename to app/Components/auth/ChangePassword/changePassword.tsx diff --git a/app/Components/Login/Login.css b/app/Components/auth/Login/Login.css similarity index 100% rename from app/Components/Login/Login.css rename to app/Components/auth/Login/Login.css diff --git a/app/Components/Login/Login.tsx b/app/Components/auth/Login/Login.tsx similarity index 97% rename from app/Components/Login/Login.tsx rename to app/Components/auth/Login/Login.tsx index a1cb223..e5adf37 100644 --- a/app/Components/Login/Login.tsx +++ b/app/Components/auth/Login/Login.tsx @@ -3,8 +3,8 @@ import { useState } from "react"; import { loginUser } from "@/app/lib/login"; import { useRouter } from "next/navigation"; -import AlertBox from "../AlertBox/AlertBox"; import "./Login.css"; +import AlertBox from "../../Global/AlertBox/AlertBox"; function Login() { const [user, setUser] = useState(""); diff --git a/app/Components/Logout/Logout.css b/app/Components/auth/Logout/Logout.css similarity index 100% rename from app/Components/Logout/Logout.css rename to app/Components/auth/Logout/Logout.css diff --git a/app/Components/Logout/Logout.tsx b/app/Components/auth/Logout/Logout.tsx similarity index 100% rename from app/Components/Logout/Logout.tsx rename to app/Components/auth/Logout/Logout.tsx diff --git a/app/Components/BarNavigation/BarNavigation.css b/app/Components/layout/BarNavigation/BarNavigation.css similarity index 100% rename from app/Components/BarNavigation/BarNavigation.css rename to app/Components/layout/BarNavigation/BarNavigation.css diff --git a/app/Components/BarNavigation/BarNavigation.tsx b/app/Components/layout/BarNavigation/BarNavigation.tsx similarity index 95% rename from app/Components/BarNavigation/BarNavigation.tsx rename to app/Components/layout/BarNavigation/BarNavigation.tsx index ad4ac0e..d8009bb 100644 --- a/app/Components/BarNavigation/BarNavigation.tsx +++ b/app/Components/layout/BarNavigation/BarNavigation.tsx @@ -24,7 +24,7 @@ function BarNavigation() {
  • - toggleSubMenu(0)}>Inscripciones + toggleSubMenu(0)}>Inscripcion
    • Alta
    • @@ -32,8 +32,8 @@ function BarNavigation() {
    • Agregar Tiempo
    • - -
    • Inscripciones
    • + +
    • Inscripcion
  • diff --git a/app/Components/Footer/Footer.module.css b/app/Components/layout/Footer/Footer.module.css similarity index 100% rename from app/Components/Footer/Footer.module.css rename to app/Components/layout/Footer/Footer.module.css diff --git a/app/Components/Footer/Footer.tsx b/app/Components/layout/Footer/Footer.tsx similarity index 100% rename from app/Components/Footer/Footer.tsx rename to app/Components/layout/Footer/Footer.tsx diff --git a/app/Components/Header/Header.module.css b/app/Components/layout/Header/Header.module.css similarity index 100% rename from app/Components/Header/Header.module.css rename to app/Components/layout/Header/Header.module.css diff --git a/app/Components/Header/Header.tsx b/app/Components/layout/Header/Header.tsx similarity index 100% rename from app/Components/Header/Header.tsx rename to app/Components/layout/Header/Header.tsx diff --git a/app/globals.css b/app/globals.css index e101602..e2a3ac0 100644 --- a/app/globals.css +++ b/app/globals.css @@ -164,6 +164,7 @@ footer p { input, select { flex: 1; + width: 100%; min-width: 200px; max-width: 500px; padding: 1rem; diff --git a/app/layout.tsx b/app/layout.tsx index 5ad6218..6de073d 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,10 +1,10 @@ import type { Metadata } from "next"; import { Poppins } from "next/font/google"; -import Header from "./Components/Header/Header"; -import Footer from "./Components/Footer/Footer"; + +import Header from "./Components/layout/Header/Header"; +import Footer from "./Components/layout/Footer/Footer"; import "./globals.css"; -import GlobalAlert from "./Components/visual/GlobalAlert"; const poppins = Poppins({ variable: "--font-poppins", diff --git a/app/page.tsx b/app/page.tsx index 3790a03..0070e55 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,4 +1,4 @@ -import Login from "./Components/Login/Login"; +import Login from "./Components/auth/Login/Login"; import { LoginRedirect } from "./Routes/LoginRedirect"; export default function Home() { @@ -13,4 +13,4 @@ export default function Home() {
); } -//IO \ No newline at end of file +//IO From d13ceed45e63e0165566c088a67d21c659c5cd0b Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Fri, 26 Sep 2025 17:42:52 -0600 Subject: [PATCH 5/9] tring to fix sanciones --- app/(private)/BitacoraSanciones/page.tsx | 2 - app/(private)/Impresiones/page.tsx | 6 +- .../Reportes/BitacoraSanciones/Sanciones.tsx | 116 +++++------------- .../BitacoraSanciones/UbicacionEquipo.tsx | 92 ++++++++++++++ 4 files changed, 128 insertions(+), 88 deletions(-) create mode 100644 app/Components/Reportes/BitacoraSanciones/UbicacionEquipo.tsx diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 0731acc..6445267 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -1,5 +1,3 @@ -"use client"; - import BitacoraAlumno from "@/app/Components/Reportes/BitacoraSanciones/BitacoraAlumno"; import BitacoraEquipo from "@/app/Components/Reportes/BitacoraSanciones/BitacoraEquipo"; import BitacoraMesas from "@/app/Components/Reportes/BitacoraSanciones/BitacoraMesas"; diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 8ebe9eb..4c4b924 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -3,10 +3,10 @@ import Receipt from "../../Components/Receipt/Receipt"; import Toggle from "../../Components/Global/Toggle/Toggle"; import Information from "../../Components/Global/Information/information"; import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import Impressions from "@/app/Components/Servicios/Impressions/impressions"; import { GetStudent } from "@/app/lib/getStudent"; import "@/app/globals.css"; -import Impressions from "@/app/Components/Servicios/Impressions/impressions"; export default async function Page(props: { searchParams?: Promise<{ @@ -46,7 +46,7 @@ export default async function Page(props: {

IMPRESIONES Y PLOTEO

- {student ? ( + {student && ( <> - ) : ( - <> )} ); diff --git a/app/Components/Reportes/BitacoraSanciones/Sanciones.tsx b/app/Components/Reportes/BitacoraSanciones/Sanciones.tsx index 118a3ae..28d6cf2 100644 --- a/app/Components/Reportes/BitacoraSanciones/Sanciones.tsx +++ b/app/Components/Reportes/BitacoraSanciones/Sanciones.tsx @@ -1,97 +1,49 @@ -"use client"; -import { useEffect, useState } from "react"; -import styles from "./Page.module.css"; import SearchUser from "../../Global/SearchUser/searchUser"; import Information from "../../Global/Information/information"; +import AlertBox from "../../Global/AlertBox/AlertBox"; import { GetStudent } from "@/app/lib/getStudent"; -import { envConfig } from "@/app/lib/config"; -interface sancion { - no_cuenta: number; - nombre: string; - motivo: string; - duracion: number; - fecha_sancion: string; - utilizar_hasta: number; -} +export default async function Sanciones(props: { + searchParams?: Promise<{ + numAcount: string; + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; + const showSuccess = params?.success ? params.success : null; + let showError = params?.error ? params.error : null; -export default function Sanciones() { - const [sanciones, setSanciones] = useState([]); - const [ubicacion_equipo, setUbicacionEquipo] = useState(""); - const [no_cuenta, setNo_cuenta] = useState(""); + let student: any = null; - useEffect(() => { - fetch(`${envConfig.apiUrl}/student/${no_cuenta}`).then( - ( - response // Revisar - ) => response.json().then((data) => setNo_cuenta(data[0].sancion)) - ); - }, [no_cuenta]); + if (numAcount) { + const result = await GetStudent(parseInt(numAcount)); + + if (result.error) { + showError = "alumno no encontrado"; + } else { + student = result; + } + } return ( <> - + {showError && ( + <> + + + )} - {/* */} + {showSuccess && ( + + )} -
- + -
- - -
- - -
-
- - - - - - - - - - - {sanciones.map((sancion, index) => ( - - - - - - - - ))} - -
CuentaMotivo de la sancionDuracion (Semanas) Fecha SancionPodra utilizar el servicio hasta
{sancion.no_cuenta}{sancion.motivo}{sancion.fecha_sancion}{sancion.duracion}{sancion.utilizar_hasta}
-
-
-
- - -
-
+ {student && ( + + )} ); } diff --git a/app/Components/Reportes/BitacoraSanciones/UbicacionEquipo.tsx b/app/Components/Reportes/BitacoraSanciones/UbicacionEquipo.tsx new file mode 100644 index 0000000..b4b0c7c --- /dev/null +++ b/app/Components/Reportes/BitacoraSanciones/UbicacionEquipo.tsx @@ -0,0 +1,92 @@ +import { useState } from "react"; +import styles from "./Page.module.css"; + +interface alumno_sancion { + id_alumno_sancion: number; + fecha_inicio: string; + alumno: alumno; + sancion: sancion; +} + +interface alumno { + id_cuenta: number; + nombre: string; + credito: number; +} + +interface sancion { + id_sancion: number; + sancion: string; + duracion: number; +} + +export default function UbicacionEquipo() { + const [ubicacionEquipo, setUbicacionEquipo] = useState(""); + const [sanciones, setSanciones] = useState<>([]); + + return ( + <> +
+ + +
+ + +
+
+ +
+ + + + + + + + + + + + {sanciones && + sanciones.map((sancion, index) => ( + + + + + + + + ))} + +
CuentaMotivo de la sancionDuracion (Semanas) Fecha SancionPodra utilizar el servicio hasta
{sancion.id_sancion}{sancion.sancion}{sancion.fecha_sancion}{sancion.duracion}{sancion.utilizar_hasta}
+
+ +
+
+ + +
+
+ + ); +} +//IO From d006fc8c0ee1a67ad34ad02a87cc5c458db6a354 Mon Sep 17 00:00:00 2001 From: IO420 Date: Sun, 28 Sep 2025 01:59:16 -0600 Subject: [PATCH 6/9] file restructuring --- .example.txt | 1 - app/(private)/ActivosMantenimiento/page.tsx | 29 +++- app/(private)/Alta/page.tsx | 23 ++- app/(private)/AsignacionEquipo/page.tsx | 31 +++- app/(private)/BitacoraSanciones/page.tsx | 56 +++++-- app/(private)/CambiarPass/page.tsx | 20 ++- app/(private)/Impresiones/page.tsx | 24 +-- app/(private)/InformacionEquipo/page.tsx | 29 +++- app/(private)/Inscripcion/page.tsx | 6 +- app/(private)/Inscritos/page.tsx | 13 +- app/(private)/Mensajes/page.tsx | 28 +++- app/(private)/Monitor/page.tsx | 138 ++---------------- app/(private)/QuitarSancion/page.tsx | 21 ++- app/(private)/Reportes/page.tsx | 7 +- .../ActivosMantenimiento/Areas.tsx | 0 .../ActivosMantenimiento/Equipos.tsx | 0 .../ActivosMantenimiento/Mesas.tsx | 0 .../{Inscripciones => }/Alta/registerAlta.tsx | 0 .../BitacoraSanciones/BitacoraAlumno.tsx | 5 +- .../BitacoraSanciones/BitacoraEquipo.tsx | 5 +- .../BitacoraSanciones/BitacoraMesas.tsx | 8 +- .../BitacoraSanciones/Page.module.css | 0 .../BitacoraSanciones/Sanciones.tsx | 20 +++ .../BitacoraSanciones/UbicacionEquipo.tsx | 15 +- .../{Equipo => }/Equipos/equipos.tsx | 2 +- .../EviarMensaje/EnviarMensaje.tsx | 0 app/Components/Global/Toggle/Toggle.tsx | 16 +- .../Impressions/impressions.tsx | 7 +- .../ProgramSelector.tsx | 1 - .../QuitarSancion/QuitarSancion.tsx | 1 + .../Reportes/BitacoraSanciones/Sanciones.tsx | 49 ------- .../{Reportes => }/SearchDate/SearchDate.tsx | 0 .../SearchDateBetween/SearchDateBetween.tsx | 0 .../Servicios/Impressions/Impressions.css | 0 app/Components/layout/Header/Header.tsx | 52 ++++--- app/api/Login/route.ts | 33 ----- app/globals.css | 19 ++- app/layout.tsx | 2 +- 38 files changed, 342 insertions(+), 319 deletions(-) delete mode 100644 .example.txt rename app/Components/{Equipo => }/ActivosMantenimiento/Areas.tsx (100%) rename app/Components/{Equipo => }/ActivosMantenimiento/Equipos.tsx (100%) rename app/Components/{Equipo => }/ActivosMantenimiento/Mesas.tsx (100%) rename app/Components/{Inscripciones => }/Alta/registerAlta.tsx (100%) rename app/Components/{Reportes => }/BitacoraSanciones/BitacoraAlumno.tsx (99%) rename app/Components/{Reportes => }/BitacoraSanciones/BitacoraEquipo.tsx (99%) rename app/Components/{Reportes => }/BitacoraSanciones/BitacoraMesas.tsx (94%) rename app/Components/{Reportes => }/BitacoraSanciones/Page.module.css (100%) create mode 100644 app/Components/BitacoraSanciones/Sanciones.tsx rename app/Components/{Reportes => }/BitacoraSanciones/UbicacionEquipo.tsx (84%) rename app/Components/{Equipo => }/Equipos/equipos.tsx (97%) rename app/Components/{Equipo => }/EviarMensaje/EnviarMensaje.tsx (100%) rename app/Components/{Servicios => }/Impressions/impressions.tsx (93%) rename app/Components/{Equipo/ProgramSelector => InformacionEquipos}/ProgramSelector.tsx (98%) delete mode 100644 app/Components/Reportes/BitacoraSanciones/Sanciones.tsx rename app/Components/{Reportes => }/SearchDate/SearchDate.tsx (100%) rename app/Components/{Reportes => }/SearchDateBetween/SearchDateBetween.tsx (100%) delete mode 100644 app/Components/Servicios/Impressions/Impressions.css delete mode 100644 app/api/Login/route.ts diff --git a/.example.txt b/.example.txt deleted file mode 100644 index 4b73e25..0000000 --- a/.example.txt +++ /dev/null @@ -1 +0,0 @@ -NEXT_PUBLIC_API_URL= \ No newline at end of file diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 61bb673..87949da 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -1,21 +1,33 @@ -"use client"; -import Areas from "@/app/Components/Equipo/ActivosMantenimiento/Areas"; -import Mesas from "@/app/Components/Equipo/ActivosMantenimiento/Mesas"; -import Equipos from "@/app/Components/Equipo/Equipos/equipos"; +import Areas from "@/app/Components/ActivosMantenimiento/Areas"; +import Mesas from "@/app/Components/ActivosMantenimiento/Mesas"; +import Equipos from "@/app/Components/Equipos/equipos"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; -export default function Page(props: { +export default async function Page(props: { searchParams?: Promise<{ - numAcount: string; + numAcount?: string; + machine?: string; success?: string; error?: string; }>; }) { - const params = props.searchParams; + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; return (
+ {showError && ( + + )} + + {showSuccess && ( + + )} +

EQUIPOS ACTIVOS Y EN MANTENIMIENTO

- + ), @@ -54,3 +66,4 @@ export default function Page(props: {
); } +//IO diff --git a/app/(private)/Alta/page.tsx b/app/(private)/Alta/page.tsx index f78797d..167f43c 100644 --- a/app/(private)/Alta/page.tsx +++ b/app/(private)/Alta/page.tsx @@ -1,9 +1,28 @@ -import RegisterAlta from "@/app/Components/Inscripciones/Alta/registerAlta"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import RegisterAlta from "@/app/Components/Alta/registerAlta"; + import "./style.css"; -export default function Page() { +export default async function Page(props: { + searchParams?: Promise<{ + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; + return (
+ {showError && ( + + )} + + {showSuccess && ( + + )} +

ALTA

diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 67a73e7..7c5cf3d 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -1,10 +1,31 @@ -"use client"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; -export default function Page() { +export default async function Page(props: { + searchParams?: Promise<{ + numAcount?: string; + machine?:string; + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; + const machine = params?.machine ? params.machine : null; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; + return (
+ {showError && ( + + )} + + {showSuccess && ( + + )} +

ASIGNACION DE EQUIPOS

- +
@@ -34,7 +55,8 @@ export default function Page() { Cuenta - + + ), }, @@ -43,3 +65,4 @@ export default function Page() {
); } +//IO diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 6445267..f4bb4ed 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -1,19 +1,53 @@ -import BitacoraAlumno from "@/app/Components/Reportes/BitacoraSanciones/BitacoraAlumno"; -import BitacoraEquipo from "@/app/Components/Reportes/BitacoraSanciones/BitacoraEquipo"; -import BitacoraMesas from "@/app/Components/Reportes/BitacoraSanciones/BitacoraMesas"; -import Sanciones from "@/app/Components/Reportes/BitacoraSanciones/Sanciones"; +import BitacoraAlumno from "@/app/Components/BitacoraSanciones/BitacoraAlumno"; +import BitacoraEquipo from "@/app/Components/BitacoraSanciones/BitacoraEquipo"; +import BitacoraMesas from "@/app/Components/BitacoraSanciones/BitacoraMesas"; +import Sanciones from "@/app/Components/BitacoraSanciones/Sanciones"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import { GetStudent } from "@/app/lib/getStudent"; + +export default async function Page(props: { + searchParams?: Promise<{ + key?: string; + numAcount?: string; + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const key = params?.key && params.key ; + const numAcount = params?.numAcount ? params.numAcount : null; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; + + let student: any = null; + + if (numAcount) { + const result = await GetStudent(parseInt(numAcount)); + + if (result.error) { + } else { + student = result; + } + } -export default function Page() { return (
+ {showError && ( + + )} + + {showSuccess && ( + + )} +

BITACORA Y SANCIONES

@@ -22,7 +56,7 @@ export default function Page() { ), }, { - key: "2", + key: "Alumno", label: "Bitacora alumno", content: ( <> @@ -31,7 +65,7 @@ export default function Page() { ), }, { - key: "3", + key: "Mesas", label: "Bitacora mesas", content: ( <> @@ -40,11 +74,11 @@ export default function Page() { ), }, { - key: "4", + key: "Sanciones", label: "Sanciones", content: ( <> - + ), }, diff --git a/app/(private)/CambiarPass/page.tsx b/app/(private)/CambiarPass/page.tsx index 66b6423..2c88235 100644 --- a/app/(private)/CambiarPass/page.tsx +++ b/app/(private)/CambiarPass/page.tsx @@ -1,8 +1,26 @@ import ChangePassword from "@/app/Components/auth/ChangePassword/changePassword"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; + +export default async function Page(props: { + searchParams?: Promise<{ + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; -export default function Page() { return (
+ {showError && ( + + )} + + {showSuccess && ( + + )} +

Cambiar contraseña

diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 4c4b924..106b06e 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -3,19 +3,21 @@ import Receipt from "../../Components/Receipt/Receipt"; import Toggle from "../../Components/Global/Toggle/Toggle"; import Information from "../../Components/Global/Information/information"; import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import Impressions from "@/app/Components/Servicios/Impressions/impressions"; +import Impressions from "@/app/Components/Impressions/impressions"; import { GetStudent } from "@/app/lib/getStudent"; import "@/app/globals.css"; export default async function Page(props: { searchParams?: Promise<{ + key: string; numAcount: string; success?: string; error?: string; }>; }) { const params = await props.searchParams; + const key = params?.key && params.key; const numAcount = params?.numAcount ? params.numAcount : null; const showSuccess = params?.success ? params.success : null; const showError = params?.error ? params.error : null; @@ -34,9 +36,7 @@ export default async function Page(props: { return (
{showError && ( - <> - - + )} {showSuccess && ( @@ -56,10 +56,10 @@ export default async function Page(props: { /> ), }, { - key: "3", + key: "color", label: "Impresiones color", content: ( diff --git a/app/(private)/InformacionEquipo/page.tsx b/app/(private)/InformacionEquipo/page.tsx index 0721229..b61b282 100644 --- a/app/(private)/InformacionEquipo/page.tsx +++ b/app/(private)/InformacionEquipo/page.tsx @@ -1,12 +1,32 @@ import Toggle from "@/app/Components/Global/Toggle/Toggle"; -import ProgramSelector from "@/app/Components/Equipo/ProgramSelector/ProgramSelector"; -import Equipos from "@/app/Components/Equipo/Equipos/equipos"; +import Equipos from "@/app/Components/Equipos/equipos"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import ProgramSelector from "@/app/Components/InformacionEquipos/ProgramSelector"; import "./informacionequipo.css"; -export default function Page() { +export default async function Page(props: { + searchParams?: Promise<{ + machine: string; + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const machine = params?.machine ? params.machine : null; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; + return (
+ {showError && ( + + )} + + {showSuccess && ( + + )} +

INFORMACION DE EQUIPOS

, + content: , }, { key: "2", @@ -44,3 +64,4 @@ export default function Page() {
); } +//IO diff --git a/app/(private)/Inscripcion/page.tsx b/app/(private)/Inscripcion/page.tsx index 168a4af..72c7c8e 100644 --- a/app/(private)/Inscripcion/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -3,10 +3,10 @@ import Information from "@/app/Components/Global/Information/information"; import StepNavigator from "@/app/Components/Global/StepNavigator/StepNavigator"; import Receipt from "@/app/Components/Receipt/Receipt"; import Selection from "@/app/Components/Selection/Selection"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import { GetStudent } from "@/app/lib/getStudent"; import "./inscriptions.css"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; export default async function Page(props: { searchParams?: Promise<{ @@ -34,9 +34,7 @@ export default async function Page(props: { return (
{showError && ( - <> - - + )} {showSuccess && ( diff --git a/app/(private)/Inscritos/page.tsx b/app/(private)/Inscritos/page.tsx index 7195f72..6f2bd45 100644 --- a/app/(private)/Inscritos/page.tsx +++ b/app/(private)/Inscritos/page.tsx @@ -1,5 +1,16 @@ -export default function Page() { +export default async function Page(props: { + searchParams?: Promise<{ + period: string; + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const period = params?.period ? params.period : null; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; + return (

INSCRITOS

diff --git a/app/(private)/Mensajes/page.tsx b/app/(private)/Mensajes/page.tsx index 4fd79b2..ac09c40 100644 --- a/app/(private)/Mensajes/page.tsx +++ b/app/(private)/Mensajes/page.tsx @@ -1,15 +1,33 @@ -"use client"; - -import EnviarMensaje from "@/app/Components/Equipo/EviarMensaje/EnviarMensaje"; +import EnviarMensaje from "@/app/Components/EviarMensaje/EnviarMensaje"; +import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; -export default function Page() { +export default async function Page(props: { + searchParams?: Promise<{ + key:string; + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const key = params?.key && params.key ; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; + return (
+ {showError && ( + + )} + + {showSuccess && ( + + )} +

Enviar mensaje

; +}) { + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; return (
@@ -144,7 +34,7 @@ export default function Page() { - {machines.map((machine, index) => ( + {/* {machines.map((machine, index) => ( {machine.ubicacion} {machine.nombre} @@ -154,7 +44,7 @@ export default function Page() { {machine.disponible ? "si" : "no"} - ))} + ))} */} diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index 957ceb1..d33b5de 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -1,15 +1,26 @@ -"use client"; - import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import QuitarSancion from "@/app/Components/QuitarSancion/QuitarSancion"; -export default function Page() { +export default async function Page(props: { + searchParams?: Promise<{ + numAcount: string; + success?: string; + error?: string; + }>; +}) { + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; + const showSuccess = params?.success ? params.success : null; + const showError = params?.error ? params.error : null; + return ( + <> +

Quitar Sanciones

-

Quitar Sanciones

- +
+ ); } //IO diff --git a/app/(private)/Reportes/page.tsx b/app/(private)/Reportes/page.tsx index fae8ae7..7915e91 100644 --- a/app/(private)/Reportes/page.tsx +++ b/app/(private)/Reportes/page.tsx @@ -1,9 +1,10 @@ "use client"; -import { useState } from "react"; -import styles from "./Page.module.css"; // importamos el css +import styles from "./Page.module.css"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; -import SearchDateBetween from "@/app/Components/Reportes/SearchDateBetween/SearchDateBetween"; +import SearchDateBetween from "@/app/Components/SearchDateBetween/SearchDateBetween"; + +import { useState } from "react"; export default function Page() { const [reportes] = useState([ diff --git a/app/Components/Equipo/ActivosMantenimiento/Areas.tsx b/app/Components/ActivosMantenimiento/Areas.tsx similarity index 100% rename from app/Components/Equipo/ActivosMantenimiento/Areas.tsx rename to app/Components/ActivosMantenimiento/Areas.tsx diff --git a/app/Components/Equipo/ActivosMantenimiento/Equipos.tsx b/app/Components/ActivosMantenimiento/Equipos.tsx similarity index 100% rename from app/Components/Equipo/ActivosMantenimiento/Equipos.tsx rename to app/Components/ActivosMantenimiento/Equipos.tsx diff --git a/app/Components/Equipo/ActivosMantenimiento/Mesas.tsx b/app/Components/ActivosMantenimiento/Mesas.tsx similarity index 100% rename from app/Components/Equipo/ActivosMantenimiento/Mesas.tsx rename to app/Components/ActivosMantenimiento/Mesas.tsx diff --git a/app/Components/Inscripciones/Alta/registerAlta.tsx b/app/Components/Alta/registerAlta.tsx similarity index 100% rename from app/Components/Inscripciones/Alta/registerAlta.tsx rename to app/Components/Alta/registerAlta.tsx diff --git a/app/Components/Reportes/BitacoraSanciones/BitacoraAlumno.tsx b/app/Components/BitacoraSanciones/BitacoraAlumno.tsx similarity index 99% rename from app/Components/Reportes/BitacoraSanciones/BitacoraAlumno.tsx rename to app/Components/BitacoraSanciones/BitacoraAlumno.tsx index f5e8ff5..4d0ffe1 100644 --- a/app/Components/Reportes/BitacoraSanciones/BitacoraAlumno.tsx +++ b/app/Components/BitacoraSanciones/BitacoraAlumno.tsx @@ -1,7 +1,8 @@ "use client"; -import { useState } from "react"; -import styles from "./Page.module.css"; import SearchDate from "../SearchDate/SearchDate"; +import { useState } from "react"; + +import styles from "./Page.module.css"; interface alumnos { tiempo_entrada: string; diff --git a/app/Components/Reportes/BitacoraSanciones/BitacoraEquipo.tsx b/app/Components/BitacoraSanciones/BitacoraEquipo.tsx similarity index 99% rename from app/Components/Reportes/BitacoraSanciones/BitacoraEquipo.tsx rename to app/Components/BitacoraSanciones/BitacoraEquipo.tsx index 29bdac9..e243683 100644 --- a/app/Components/Reportes/BitacoraSanciones/BitacoraEquipo.tsx +++ b/app/Components/BitacoraSanciones/BitacoraEquipo.tsx @@ -1,7 +1,8 @@ "use client"; -import { useState } from "react"; -import styles from "./Page.module.css"; import SearchDate from "../SearchDate/SearchDate"; +import { useState } from "react"; + +import styles from "./Page.module.css"; interface equipos { hora_entrada: string; diff --git a/app/Components/Reportes/BitacoraSanciones/BitacoraMesas.tsx b/app/Components/BitacoraSanciones/BitacoraMesas.tsx similarity index 94% rename from app/Components/Reportes/BitacoraSanciones/BitacoraMesas.tsx rename to app/Components/BitacoraSanciones/BitacoraMesas.tsx index 9d5a712..59ef913 100644 --- a/app/Components/Reportes/BitacoraSanciones/BitacoraMesas.tsx +++ b/app/Components/BitacoraSanciones/BitacoraMesas.tsx @@ -1,8 +1,8 @@ "use client"; -import { useState } from "react"; -import styles from "./Page.module.css"; - import SearchDate from "../SearchDate/SearchDate"; +import { useState } from "react"; + +import styles from "./Page.module.css"; interface tables { no_mesa: number; @@ -14,7 +14,7 @@ interface tables { function BitacoraMesas() { const [tables, setTables] = useState([]); - const [ubicacion_equipo, setUbicacionEquipo] = useState(""); + return ( <> diff --git a/app/Components/Reportes/BitacoraSanciones/Page.module.css b/app/Components/BitacoraSanciones/Page.module.css similarity index 100% rename from app/Components/Reportes/BitacoraSanciones/Page.module.css rename to app/Components/BitacoraSanciones/Page.module.css diff --git a/app/Components/BitacoraSanciones/Sanciones.tsx b/app/Components/BitacoraSanciones/Sanciones.tsx new file mode 100644 index 0000000..c0199cf --- /dev/null +++ b/app/Components/BitacoraSanciones/Sanciones.tsx @@ -0,0 +1,20 @@ +import Information from "../Global/Information/information"; +import SearchUser from "../Global/SearchUser/searchUser"; + +interface Student { + id_cuenta: string ; + nombre: string ; +} + +export default async function Sanciones(props: { student?: Student }) { + const idCuenta = props?.student?.id_cuenta ?? null; + + return ( + <> + + {props.student && ( + + )} + + ); +} diff --git a/app/Components/Reportes/BitacoraSanciones/UbicacionEquipo.tsx b/app/Components/BitacoraSanciones/UbicacionEquipo.tsx similarity index 84% rename from app/Components/Reportes/BitacoraSanciones/UbicacionEquipo.tsx rename to app/Components/BitacoraSanciones/UbicacionEquipo.tsx index b4b0c7c..1482c17 100644 --- a/app/Components/Reportes/BitacoraSanciones/UbicacionEquipo.tsx +++ b/app/Components/BitacoraSanciones/UbicacionEquipo.tsx @@ -1,4 +1,5 @@ import { useState } from "react"; + import styles from "./Page.module.css"; interface alumno_sancion { @@ -20,9 +21,8 @@ interface sancion { duracion: number; } -export default function UbicacionEquipo() { +export default function UbicacionEquipo(sanciones:alumno_sancion[]) { const [ubicacionEquipo, setUbicacionEquipo] = useState(""); - const [sanciones, setSanciones] = useState<>([]); return ( <> @@ -59,13 +59,12 @@ export default function UbicacionEquipo() { {sanciones && - sanciones.map((sancion, index) => ( + sanciones.map((s, index) => ( - {sancion.id_sancion} - {sancion.sancion} - {sancion.fecha_sancion} - {sancion.duracion} - {sancion.utilizar_hasta} + {s.sancion.id_sancion} + {s.sancion.sancion} + {s.fecha_inicio} + {s.sancion.duracion} ))} diff --git a/app/Components/Equipo/Equipos/equipos.tsx b/app/Components/Equipos/equipos.tsx similarity index 97% rename from app/Components/Equipo/Equipos/equipos.tsx rename to app/Components/Equipos/equipos.tsx index 122a384..81afc2a 100644 --- a/app/Components/Equipo/Equipos/equipos.tsx +++ b/app/Components/Equipos/equipos.tsx @@ -30,7 +30,7 @@ export default function Equipos() {
{ setEquipo(e.target.value); diff --git a/app/Components/Equipo/EviarMensaje/EnviarMensaje.tsx b/app/Components/EviarMensaje/EnviarMensaje.tsx similarity index 100% rename from app/Components/Equipo/EviarMensaje/EnviarMensaje.tsx rename to app/Components/EviarMensaje/EnviarMensaje.tsx diff --git a/app/Components/Global/Toggle/Toggle.tsx b/app/Components/Global/Toggle/Toggle.tsx index 4a9dcff..6fc4c0c 100644 --- a/app/Components/Global/Toggle/Toggle.tsx +++ b/app/Components/Global/Toggle/Toggle.tsx @@ -1,5 +1,7 @@ "use client"; +import { useSearchParams } from "next/navigation"; +import { useRouter } from "next/navigation"; import { useState, ReactNode } from "react"; interface ToggleOption { @@ -14,8 +16,19 @@ interface ToggleProps { } export default function Toggle({ options, defaultView }: ToggleProps) { + const router = useRouter(); + const searchParams = useSearchParams(); const [view, setView] = useState(defaultView || options[0].key); + const handleClick = (key: string) => { + setView(key); + + const params = new URLSearchParams(searchParams.toString()); + params.set("key", key); + + router.replace(`${window.location.pathname}?${params.toString()}`); + }; + return (
@@ -23,7 +36,7 @@ export default function Toggle({ options, defaultView }: ToggleProps) { @@ -36,3 +49,4 @@ export default function Toggle({ options, defaultView }: ToggleProps) {
); } +//IO \ No newline at end of file diff --git a/app/Components/Servicios/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx similarity index 93% rename from app/Components/Servicios/Impressions/impressions.tsx rename to app/Components/Impressions/impressions.tsx index 4c55d7f..1197b47 100644 --- a/app/Components/Servicios/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -5,8 +5,6 @@ import { useState } from "react"; import { useRouter } from "next/navigation"; import { PostImpressions } from "@/app/lib/postImpressions"; -import "./Impressions.css"; - interface CostOption { value: number; } @@ -110,10 +108,11 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { />
-
+
+
diff --git a/app/Components/Equipo/ProgramSelector/ProgramSelector.tsx b/app/Components/InformacionEquipos/ProgramSelector.tsx similarity index 98% rename from app/Components/Equipo/ProgramSelector/ProgramSelector.tsx rename to app/Components/InformacionEquipos/ProgramSelector.tsx index d08e070..3ea9b2c 100644 --- a/app/Components/Equipo/ProgramSelector/ProgramSelector.tsx +++ b/app/Components/InformacionEquipos/ProgramSelector.tsx @@ -12,7 +12,6 @@ function ProgramSelector({ titulo, opcion }: DatosEquipo) { return (
- {/* Label dinámico con el título que recibimos */} {/* Renderizamos UN solo + -
-
- +
@@ -48,12 +59,10 @@ export default async function Page(props: { - - +
CarreraProfesores
- ); } -//IO \ No newline at end of file +//IO diff --git a/app/(private)/Mensajes/page.tsx b/app/(private)/Mensajes/page.tsx index ac09c40..eaeaf38 100644 --- a/app/(private)/Mensajes/page.tsx +++ b/app/(private)/Mensajes/page.tsx @@ -1,5 +1,6 @@ import EnviarMensaje from "@/app/Components/EviarMensaje/EnviarMensaje"; import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default async function Page(props: { @@ -17,11 +18,17 @@ export default async function Page(props: { return (
{showError && ( - + <> + + + )} {showSuccess && ( - + <> + + + )}

Enviar mensaje

diff --git a/app/Components/BitacoraSanciones/Sanciones.tsx b/app/Components/BitacoraSanciones/Sanciones.tsx index c0199cf..ac97716 100644 --- a/app/Components/BitacoraSanciones/Sanciones.tsx +++ b/app/Components/BitacoraSanciones/Sanciones.tsx @@ -1,9 +1,10 @@ import Information from "../Global/Information/information"; import SearchUser from "../Global/SearchUser/searchUser"; +import TableSancion from "./TableSancion"; interface Student { - id_cuenta: string ; - nombre: string ; + id_cuenta: string; + nombre: string; } export default async function Sanciones(props: { student?: Student }) { @@ -13,7 +14,14 @@ export default async function Sanciones(props: { student?: Student }) { <> {props.student && ( - + <> + + + + )} ); diff --git a/app/Components/BitacoraSanciones/TableSancion.tsx b/app/Components/BitacoraSanciones/TableSancion.tsx new file mode 100644 index 0000000..4c83424 --- /dev/null +++ b/app/Components/BitacoraSanciones/TableSancion.tsx @@ -0,0 +1,58 @@ +import styles from "./Page.module.css"; + +interface alumno_sancion { + id_alumno_sancion: number; + fecha_inicio: string; + alumno: alumno; + sancion: sancion; +} + +interface alumno { + id_cuenta: number; + nombre: string; + credito: number; +} + +interface sancion { + id_sancion: number; + sancion: string; + duracion: number; +} + +export default function TableSancion() { + + return ( + <> +
+ + + + + + + + + + + + + +
CuentaMotivo de la sancionDuracion (Semanas) Fecha SancionPodra utilizar el servicio hasta
+
+ +
+
+ + +
+
+ + ); +} +//IO diff --git a/app/Components/BitacoraSanciones/UbicacionEquipo.tsx b/app/Components/BitacoraSanciones/UbicacionEquipo.tsx deleted file mode 100644 index 1482c17..0000000 --- a/app/Components/BitacoraSanciones/UbicacionEquipo.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { useState } from "react"; - -import styles from "./Page.module.css"; - -interface alumno_sancion { - id_alumno_sancion: number; - fecha_inicio: string; - alumno: alumno; - sancion: sancion; -} - -interface alumno { - id_cuenta: number; - nombre: string; - credito: number; -} - -interface sancion { - id_sancion: number; - sancion: string; - duracion: number; -} - -export default function UbicacionEquipo(sanciones:alumno_sancion[]) { - const [ubicacionEquipo, setUbicacionEquipo] = useState(""); - - return ( - <> -
- - -
- - -
-
- -
- - - - - - - - - - - - {sanciones && - sanciones.map((s, index) => ( - - - - - - - ))} - -
CuentaMotivo de la sancionDuracion (Semanas) Fecha SancionPodra utilizar el servicio hasta
{s.sancion.id_sancion}{s.sancion.sancion}{s.fecha_inicio}{s.sancion.duracion}
-
- -
-
- - -
-
- - ); -} -//IO diff --git a/app/Components/Global/AlertBox/AlertBox.tsx b/app/Components/Global/AlertBox/AlertBox.tsx index e8863ea..aa295e5 100644 --- a/app/Components/Global/AlertBox/AlertBox.tsx +++ b/app/Components/Global/AlertBox/AlertBox.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import "./AlertBox.css"; +import ClearParams from "../ClearParams/ClearParams"; interface AlertBoxProps { message: string | null; diff --git a/app/Components/Global/FormHandle.tsx b/app/Components/Global/FormHandle.tsx new file mode 100644 index 0000000..6f3d3c9 --- /dev/null +++ b/app/Components/Global/FormHandle.tsx @@ -0,0 +1,40 @@ +"use client"; + +import { ReactNode, useCallback } from "react"; +import { useRouter, usePathname, useSearchParams } from "next/navigation"; + +interface FormHandlerProps { + children: ReactNode; + onSubmit: () => Promise; +} + +export default function FormHandler({ children, onSubmit }: FormHandlerProps) { + const router = useRouter(); + const searchParams = useSearchParams(); + const pathname = usePathname(); + + const updateParams = useCallback( + (updates: Record) => { + const params = new URLSearchParams(searchParams.toString()); + + Object.entries(updates).forEach(([key, value]) => { + if (value === null) params.delete(key); + else params.set(key, value); + }); + + router.push(`${pathname}?${params.toString()}`); + }, + [searchParams, router, pathname] + ); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + try { + await onSubmit(); + } catch (err: any) { + updateParams({ error: String(err) }); + } + }; + + return
{children}
; +} diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 1197b47..018a35d 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -27,25 +27,24 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { }; const handlePayment = async () => { + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(); + + const setError = (msg: string) => { + params.set("error", msg); + router.push(`${currentUrl}&${params.toString()}`); + }; + if (!numAcount) { - router.push( - `/Impresiones?numAcount=${numAcount}&error=Error busca denuevo al estudiante` - ); - return; + return setError("busca de nuevo al estudiante"); } if (!pages) { - router.push( - `/Impresiones?numAcount=${numAcount}&error=Ingresa el numero de hojas a imprimir` - ); - return; + return setError("Ingresa el numero de hojas a imprimir"); } if (!cost) { - router.push( - `/Impresiones?numAcount=${numAcount}&error=Selecciona un costo` - ); - return; + return setError("Selecciona un costo"); } const result = await PostImpressions({ @@ -57,18 +56,16 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { if (result.error) { if (result.error === "Token inválido") handleLogout(); else { - router.push( - `/Impresiones?numAcount=${numAcount}&error=${result.error}` - ); + return setError(`Error: ${result.error}`); } return; } setPages(""); setCost(""); - router.push( - `/Impresiones?numAcount=${numAcount}&success=Impresion cobrada correctamente` - ); + params.delete("error"); + params.set("success", "Impresion cobrada correctamente"); + router.push(`${currentUrl}&${params.toString()}`); }; return ( @@ -109,10 +106,12 @@ function Impressions({ costs, numAcount }: ImpressionsProps) {
-
diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 29f9af1..60efc9d 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -7,11 +7,10 @@ import { useRouter } from "next/navigation"; import "./Receipt.css"; interface ReceiptsProps { - urlBase: string; numAcount: number | null; } -function Receipt({ urlBase, numAcount }: ReceiptsProps) { +function Receipt({ numAcount }: ReceiptsProps) { const router = useRouter(); const [folio, setFolio] = useState(""); @@ -29,30 +28,28 @@ function Receipt({ urlBase, numAcount }: ReceiptsProps) { //restrict this month// const handleSaveReceipt = async () => { + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(); + + const setError = (msg: string) => { + params.set("error", msg); + router.push(`${currentUrl}&${params.toString()}`); + }; + if (!numAcount) { - router.push( - `${urlBase}?numAcount=${numAcount}&error=Error busca denuevo al estudiante` - ); - return; + return setError("busca de nuevo al estudiante"); } if (!folio) { - router.push( - `${urlBase}?numAcount=${numAcount}&error=Ingresa el folio del tiket` - ); - return; + return setError("Ingresa el folio del ticket"); } if (!amount) { - router.push( - `${urlBase}?numAcount=${numAcount}&error=coloca el monto a depositar` - ); - return; + return setError("Coloca el monto a depositar"); } if (!date) { - router.push(`${urlBase}?numAcount=${numAcount}&error=coloca la fecha`); - return; + return setError("Coloca la fecha"); } try { @@ -67,10 +64,11 @@ function Receipt({ urlBase, numAcount }: ReceiptsProps) { setAmount(""); setDate(""); - router.push(`${urlBase}?numAcount=${numAcount}&success=Recibo guardado`); + params.delete("error"); + params.set("success", "Recibo guardado"); + router.push(`${currentUrl}&${params.toString()}`); } catch (err: any) { - console.error(err); - router.push(`${urlBase}?numAcount=${numAcount}&error=${err}`); + setError(String(err)); } }; @@ -113,9 +111,10 @@ function Receipt({ urlBase, numAcount }: ReceiptsProps) { if (value === "" || numericValue <= 1000) { setAmount(value); } else { - router.push( - `${urlBase}?numAcount=${numAcount}&error=El monto no puede superar $1000.00` - ); + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(); + params.set("error", "El monto no puede superar $1000.00"); + router.push(`${currentUrl}&${params.toString()}`); } } }} diff --git a/app/globals.css b/app/globals.css index f00aa1b..2431623 100644 --- a/app/globals.css +++ b/app/globals.css @@ -14,6 +14,7 @@ html { box-sizing: border-box; font-size: 62.5%; overflow-y: auto; + scrollbar-width: none; } body { From 68d9dc97c1f58ced572c86425f44fea2fe12422e Mon Sep 17 00:00:00 2001 From: IO420 Date: Mon, 29 Sep 2025 19:57:02 -0600 Subject: [PATCH 8/9] change to pathname and params --- app/(private)/ActivosMantenimiento/page.tsx | 2 +- app/(private)/AgregarTiempo/page.tsx | 2 +- app/(private)/AsignacionEquipo/page.tsx | 24 +++++++++++++++---- app/(private)/AsignacionMesas/page.tsx | 4 ++-- app/(private)/Impresiones/page.tsx | 2 +- .../InformacionEquipo/informacionequipo.css | 1 - app/(private)/InformacionEquipo/page.tsx | 12 ++++++---- app/(private)/Inscripcion/page.tsx | 2 +- app/(private)/QuitarSancion/page.tsx | 2 +- app/Components/ActivosMantenimiento/Mesas.tsx | 5 ++-- .../BitacoraSanciones/Sanciones.tsx | 2 +- .../Global/ClearParams/ClearParams.tsx | 1 + .../Global/SearchUser/searchUser.tsx | 22 +++++++++-------- app/Components/Global/Toggle/Toggle.tsx | 5 ++-- app/Components/Global/visual/GlobalAlert.tsx | 7 +++--- app/Components/Impressions/impressions.tsx | 11 +++++---- app/Components/Receipt/Receipt.tsx | 16 ++++++------- app/globals.css | 18 ++++++++++++++ 18 files changed, 89 insertions(+), 49 deletions(-) diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 9657fd0..2f0136d 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -45,7 +45,7 @@ export default async function Page(props: { label: "Equipos", content: ( <> - + ), diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index bbf12da..723498d 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -49,7 +49,7 @@ export default async function Page(props: {

AGREGAR TIEMPO

- + {student ? ( <> diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 5c5437e..7e4976d 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -2,11 +2,14 @@ import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import { GetStudent } from "@/app/lib/getStudent"; + +import '@/app/globals.css' export default async function Page(props: { searchParams?: Promise<{ numAcount?: string; - machine?:string; + machine?: string; success?: string; error?: string; }>; @@ -17,6 +20,17 @@ export default async function Page(props: { const showSuccess = params?.success ? params.success : null; const showError = params?.error ? params.error : null; + let student: any = null; + + if (numAcount) { + const result = await GetStudent(parseInt(numAcount)); + + if (result.error) { + } else { + student = result; + } + } + return (
{showError && ( @@ -32,7 +46,7 @@ export default async function Page(props: { )} - +

ASIGNACION DE EQUIPOS

- + -
+ {student &&

No hay records disponibles

} ), }, @@ -63,7 +77,7 @@ export default async function Page(props: {
- + ), }, diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 6b67fd1..4396bbb 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -18,7 +18,7 @@ export default function Page() { label: "Asignar mesa", content: ( <> - +
@@ -56,7 +56,7 @@ export default function Page() { Cuenta - + ), }, diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index f02e6d2..f78b77e 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -51,7 +51,7 @@ export default async function Page(props: { )}

IMPRESIONES Y PLOTEO

- + {student && ( <> diff --git a/app/(private)/InformacionEquipo/informacionequipo.css b/app/(private)/InformacionEquipo/informacionequipo.css index 3edf365..151831f 100644 --- a/app/(private)/InformacionEquipo/informacionequipo.css +++ b/app/(private)/InformacionEquipo/informacionequipo.css @@ -44,7 +44,6 @@ display: grid; grid-template-columns: repeat(3, 240px); /* ancho fijo por columna */ gap: 6px 20px; - margin-bottom: 20px; flex-wrap: wrap; margin-right: 2px; } diff --git a/app/(private)/InformacionEquipo/page.tsx b/app/(private)/InformacionEquipo/page.tsx index f0d7e2b..e664473 100644 --- a/app/(private)/InformacionEquipo/page.tsx +++ b/app/(private)/InformacionEquipo/page.tsx @@ -8,12 +8,14 @@ import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ - machine: string; + key?:string; + machine?: string; success?: string; error?: string; }>; }) { const params = await props.searchParams; + const key = params?.key && params.key; const machine = params?.machine ? params.machine : null; const showSuccess = params?.success ? params.success : null; const showError = params?.error ? params.error : null; @@ -37,15 +39,15 @@ export default async function Page(props: {

INFORMACION DE EQUIPOS

, }, { - key: "2", + key: "Equipo", label: "Programa por equipo", content: ( INSCRIPCION - + {student && ( <> diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index d33b5de..74d7ef3 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -17,7 +17,7 @@ export default async function Page(props: { <>

Quitar Sanciones

- +
diff --git a/app/Components/ActivosMantenimiento/Mesas.tsx b/app/Components/ActivosMantenimiento/Mesas.tsx index 42b2eef..cf4f3e7 100644 --- a/app/Components/ActivosMantenimiento/Mesas.tsx +++ b/app/Components/ActivosMantenimiento/Mesas.tsx @@ -22,9 +22,10 @@ function Mesas() { -
+
+
+ +

{button ?

desactivado

:

activado

}

); } diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 0f1a2cf..018a35d 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -2,7 +2,7 @@ import Cookies from "js-cookie"; import { useState } from "react"; -import { usePathname, useRouter, useSearchParams } from "next/navigation"; +import { useRouter } from "next/navigation"; import { PostImpressions } from "@/app/lib/postImpressions"; interface CostOption { @@ -19,8 +19,6 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { const [cost, setCost] = useState(""); const router = useRouter(); - const pathname = usePathname(); - const searchParams = useSearchParams(); const handleLogout = () => { Cookies.remove("token"); @@ -29,11 +27,12 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { }; const handlePayment = async () => { - const params = new URLSearchParams(searchParams.toString()); + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(); const setError = (msg: string) => { params.set("error", msg); - router.push(`${pathname}&${params.toString()}`); + router.push(`${currentUrl}&${params.toString()}`); }; if (!numAcount) { @@ -66,7 +65,7 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { setCost(""); params.delete("error"); params.set("success", "Impresion cobrada correctamente"); - router.push(`${pathname}&${params.toString()}`); + router.push(`${currentUrl}&${params.toString()}`); }; return ( diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 019ed29..60efc9d 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { PostReceipt } from "@/app/lib/postReceipt"; -import { usePathname, useRouter, useSearchParams } from "next/navigation"; +import { useRouter } from "next/navigation"; import "./Receipt.css"; @@ -12,8 +12,6 @@ interface ReceiptsProps { function Receipt({ numAcount }: ReceiptsProps) { const router = useRouter(); - const pathname = usePathname(); - const searchParams = useSearchParams(); const [folio, setFolio] = useState(""); const [amount, setAmount] = useState(""); @@ -30,11 +28,12 @@ function Receipt({ numAcount }: ReceiptsProps) { //restrict this month// const handleSaveReceipt = async () => { - const params = new URLSearchParams(searchParams.toString()); + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(); const setError = (msg: string) => { params.set("error", msg); - router.push(`${pathname}&${params.toString()}`); + router.push(`${currentUrl}&${params.toString()}`); }; if (!numAcount) { @@ -67,7 +66,7 @@ function Receipt({ numAcount }: ReceiptsProps) { params.delete("error"); params.set("success", "Recibo guardado"); - router.push(`${pathname}&${params.toString()}`); + router.push(`${currentUrl}&${params.toString()}`); } catch (err: any) { setError(String(err)); } @@ -112,9 +111,10 @@ function Receipt({ numAcount }: ReceiptsProps) { if (value === "" || numericValue <= 1000) { setAmount(value); } else { - const params = new URLSearchParams(searchParams.toString()); + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(); params.set("error", "El monto no puede superar $1000.00"); - router.push(`${pathname}&${params.toString()}`); + router.push(`${currentUrl}&${params.toString()}`); } } }}