This commit is contained in:
2025-09-22 10:32:28 -06:00
16 changed files with 193 additions and 191 deletions
+11 -8
View File
@@ -5,15 +5,18 @@ import { GetStudent } from "@/app/lib/getStudent";
import "./addTime.css";
export default async function Page({ searchParams }: any) {
export default async function Page(props:{
searchParams?: Promise<{
numAcount:string;
}>
}) {
const params =await props.searchParams;
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
const numAccount = searchParams?.numAccount
? Number(searchParams.numAccount)
: null;
let student: any = null;
if (numAccount) {
student = await GetStudent(numAccount);
if (numAcount) {
student = await GetStudent(numAcount);
}
return (
@@ -27,7 +30,7 @@ export default async function Page({ searchParams }: any) {
<Information NoCuenta={student.id_cuenta} Nombre={student.nombre} />
<div className="addTime">
<Receipt />
<Receipt numAcount={student.id_cuenta} />
</div>
</>
) : (
+7 -2
View File
@@ -8,8 +8,13 @@ import Information from "@/app/Components/Information/information";
import SearchUser from "@/app/Components/SearchUser/searchUser";
import { GetStudent } from "@/app/lib/getStudent";
export default function Page({ searchParams }: any) {
const params = searchParams;
export default async function Page(props:{
searchParams?: Promise<{
numAcount:string;
}>
}) {
const params =await props.searchParams;
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
let student: any = null;
let error: string | null = null;
+14 -10
View File
@@ -8,14 +8,18 @@ import AlertBox from "@/app/Components/AlertBox/AlertBox";
import { GetStudent } from "@/app/lib/getStudent";
import "@/app/globals.css";
export default async function Page({ searchParams }: any) {
const params = await searchParams;
const numAccount = params.numAccount ? Number(params.numAccount) : null;
export default async function Page(props: {
searchParams?: Promise<{
numAcount: string;
}>;
}) {
const params = await props.searchParams;
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
let student: any = null;
let error: string | null = null;
if (numAccount) {
const result = await GetStudent(numAccount);
if (numAcount) {
const result = await GetStudent(numAcount);
if (result.error) {
error = result.error;
@@ -46,7 +50,7 @@ export default async function Page({ searchParams }: any) {
{
key: "1",
label: "Recibo",
content: <Receipt numAccount={student.id_cuenta}/>,
content: <Receipt numAcount={student.id_cuenta} />,
},
{
key: "2",
@@ -54,7 +58,7 @@ export default async function Page({ searchParams }: any) {
content: (
<Impressions
costs={[{ value: 1 }, { value: 2 }]}
numAccount={student.id_cuenta}
numAcount={student.id_cuenta}
/>
),
},
@@ -73,7 +77,7 @@ export default async function Page({ searchParams }: any) {
{ value: 12 },
{ value: 14 },
]}
numAccount={student.id_cuenta}
numAcount={student.id_cuenta}
/>
),
},
@@ -101,7 +105,7 @@ export default async function Page({ searchParams }: any) {
{ value: 150 },
{ value: 200 },
]}
numAccount={student.id_cuenta}
numAcount={student.id_cuenta}
/>
),
},
@@ -111,7 +115,7 @@ export default async function Page({ searchParams }: any) {
content: (
<Impressions
costs={[{ value: 1 }, { value: 2 }, { value: 5 }]}
numAccount={student.id_cuenta}
numAcount={student.id_cuenta}
/>
),
},
+14 -8
View File
@@ -1,5 +1,3 @@
import "./inscriptions.css";
import SearchUser from "@/app/Components/SearchUser/searchUser";
import Information from "@/app/Components/Information/information";
import StepNavigator from "@/app/Components/StepNavigator/StepNavigator";
@@ -7,14 +5,21 @@ import Receipt from "@/app/Components/Receipt/Receipt";
import Selection from "@/app/Components/Selection/Selection";
import { GetStudent } from "@/app/lib/getStudent";
export default async function Page({ searchParams }: any) {
const params = await searchParams;
const numAccount = params.numAccount ? Number(params.numAccount) : null;
import "./inscriptions.css";
export default async function Page(props:{
searchParams?: Promise<{
numAcount:string;
}>
}) {
const params =await props.searchParams;
const numAcount = params?.numAcount ? parseInt(params.numAcount) : null;
let student: any = null;
let error: string | null = null;
if (numAccount) {
const result = await GetStudent(numAccount);
if (numAcount) {
const result = await GetStudent(numAcount);
if (result.error) {
error = result.error;
@@ -40,7 +45,7 @@ export default async function Page({ searchParams }: any) {
<StepNavigator totalSteps={2}>
<Selection />
<Receipt numAccount={student.id_cuenta}/>
<Receipt numAcount={student.id_cuenta}/>
</StepNavigator>
</>
) : (
@@ -49,3 +54,4 @@ export default async function Page({ searchParams }: any) {
</section>
);
}
//IO
+1 -1
View File
@@ -4,7 +4,7 @@
padding: 0.5rem 1.25rem;
border-radius: 0 4px 4px 0;
font-weight: bold;
font-size: 1.5rem;
font-size: 2rem;
text-align: center;
opacity: 1;
z-index: 100;
+115 -115
View File
@@ -1,173 +1,173 @@
.barNavigation {
text-align: center;
background-color: rgb(1, 92, 184);
padding: 0 20px;
display: flex;
width: 100%;
top: 0;
min-height: 40px;
text-align: center;
background-color: rgb(1, 92, 184);
padding: 0 20px;
display: flex;
width: 100%;
top: 0;
min-height: 40px;
}
.barNavigation ul {
display: flex;
justify-content: space-around;
width: 100%;
display: flex;
justify-content: space-around;
width: 100%;
}
.barNavigation li {
transition: all 0.3s ease;
cursor: pointer;
color: white;
font-weight: bold;
width: 100%;
transition: background-color 0.3s ease;
transition: all 0.3s ease;
cursor: pointer;
color: white;
font-weight: bold;
width: 100%;
transition: background-color 0.3s ease;
font-size: 2rem;
}
.barNavigation li:hover {
background-color: #d59f0f;
background-color: #d59f0f;
}
.barNavigation ul.active {
display: flex;
width: 100%;
display: flex;
width: 100%;
}
.menuToggle {
display: none;
flex-direction: column;
align-items: center;
gap: 4px;
cursor: pointer;
padding: 10px;
margin-right: 10px;
display: none;
flex-direction: column;
align-items: center;
gap: 4px;
cursor: pointer;
padding: 10px;
margin-right: 10px;
}
.menuToggle div {
width: 25px;
height: 3px;
background-color: white;
border-radius: 4px;
width: 25px;
height: 3px;
background-color: white;
border-radius: 4px;
}
.subMenu {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
gap: 10px;
position: relative;
z-index: 1;
border-radius: 4px 4px 0 0;
padding: 5px 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
gap: 10px;
position: relative;
z-index: 1;
border-radius: 4px 4px 0 0;
}
.subMenu ul {
display: none;
position: absolute;
flex-direction: column;
top: 100%;
width: 100%;
background-color: rgba(0, 61, 121, 1);
transition: color 0.3s ease, opacity 0.3s ease;
display: none;
position: absolute;
flex-direction: column;
top: 100%;
width: 100%;
background-color: rgba(0, 61, 121, 1);
transition: color 0.3s ease, opacity 0.3s ease;
}
.subMenu.open ul {
display: flex;
color: rgba(0, 61, 121, 1);
display: flex;
color: rgba(0, 61, 121, 1);
}
.subMenu ul:hover {
color: #5b8cc9;
color: #5b8cc9;
}
.subMenu:hover ul {
display: flex;
display: flex;
}
.subMenu li {
padding: 10px 0;
padding: 10px 0;
}
.subMenu span {
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
color: rgb(255, 255, 255);
font-size: 1.5rem;
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
color: rgb(255, 255, 255);
font-size: 2rem;
}
.containerLinks {
padding: 0 !important;
border-radius: 0 0 4px 4px;
padding: 0 !important;
border-radius: 0 0 4px 4px;
}
.links {
display: flex;
justify-content: center;
align-items: center;
color: white;
width: 100%;
height: 100%;
font-size: 1.5rem;
display: flex;
justify-content: center;
align-items: center;
color: white;
width: 100%;
height: 100%;
font-size: 1.5rem;
}
thead,tbody{
font-size: 1.25rem;
thead,
tbody {
font-size: 1.25rem;
}
@media (max-width: 800px) {
.menuToggle {
display: flex;
position: relative;
align-items: end;
transition: transform 0.3s ease;
}
.menuToggle {
display: flex;
position: relative;
align-items: end;
transition: transform 0.3s ease;
}
.menuToggle.center {
align-items: center;
margin: 0;
}
.menuToggle.center {
align-items: center;
margin: 0;
}
.barNavigation {
font-size: 15px;
display: block;
}
.barNavigation {
font-size: 15px;
display: block;
}
.barNavigation ul {
position: absolute;
background-color: rgb(1, 92, 184);
flex-direction: column;
padding: 10px 0;
align-items: center;
display: none;
z-index: 1;
height: auto;
}
.barNavigation ul {
position: absolute;
background-color: rgb(1, 92, 184);
flex-direction: column;
padding: 10px 0;
align-items: center;
display: none;
z-index: 1;
height: auto;
}
.barNavigation {
padding: 0;
}
.barNavigation {
padding: 0;
}
.barNavigation li:hover {
background-color: #d59f0f;
color: white;
border-radius: 0;
border: none;
}
.barNavigation li:hover {
background-color: #d59f0f;
color: white;
border-radius: 0;
border: none;
}
.subMenu ul {
width: 90%;
border-radius: 4px;
position: relative;
background-color: rgba(0, 61, 121, 1);
}
.subMenu ul {
width: 90%;
border-radius: 4px;
position: relative;
background-color: rgba(0, 61, 121, 1);
}
thead,tbody{
font-size: 1rem;
}
}
thead,
tbody {
font-size: 1rem;
}
}
@@ -90,12 +90,12 @@ function BarNavigation() {
</li>
<li className="subMenu" onClick={toggleMenu}>
<Link href="/QuitarSancion" className="links">
Quitar sancion
<span>Quitar sancion</span>
</Link>
</li>
<li className="subMenu" onClick={toggleMenu}>
<Link href="/CambiarPass" className="links">
Cambiar contraseña
<span> Cambiar contraseña</span>
</Link>
</li>
</ul>
+4 -4
View File
@@ -14,10 +14,10 @@ interface CostOption {
interface ImpressionsProps {
costs: CostOption[];
numAccount: number | null;
numAcount: number | null;
}
function Impressions({ costs, numAccount }: ImpressionsProps) {
function Impressions({ costs, numAcount }: ImpressionsProps) {
const [pages, setPages] = useState("");
const [cost, setCost] = useState("");
@@ -33,7 +33,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) {
const handlePayment = async () => {
setError("");
if (!numAccount) {
if (!numAcount) {
setError("Error busca denuevo al estudiante");
return;
}
@@ -49,7 +49,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) {
}
const result = await PostImpressions({
id_cuenta:numAccount,
id_cuenta:numAcount,
numero_hojas : parseInt(pages),
monto: parseInt(cost) * parseInt(pages),
});
+1 -1
View File
@@ -14,7 +14,7 @@
@media (max-width: 800px) {
.button-logout {
color: transparent;
padding: 1.5rem;
padding: 2rem;
font-size: 0px;
top: 15px;
}
+4 -4
View File
@@ -7,10 +7,10 @@ import Cookies from "js-cookie";
import "./Receipt.css";
interface ReceiptsProps {
numAccount: number | null;
numAcount: number | null;
}
function Receipt({ numAccount }: ReceiptsProps) {
function Receipt({ numAcount }: ReceiptsProps) {
const [folio, setFolio] = useState("");
const [amount, setAmount] = useState("");
const [date, setDate] = useState("");
@@ -29,7 +29,7 @@ function Receipt({ numAccount }: ReceiptsProps) {
//restrict this month//
const handleSaveReceipt = () => {
if (!numAccount) {
if (!numAcount) {
setError("Error busca denuevo al estudiante");
return;
}
@@ -50,7 +50,7 @@ function Receipt({ numAccount }: ReceiptsProps) {
}
PostReceipt({
id_cuenta: numAccount,
id_cuenta: numAcount,
folio_recibo: folio,
monto: Number(amount),
fecha_recibo: date,
+5 -5
View File
@@ -8,14 +8,14 @@ interface urlProp{
}
function SearchUser(url:urlProp) {
const [numAccount, setNumAccount] = useState("");
const [numAcount, setnumAcount] = useState("");
const router = useRouter();
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
if (numAccount) {
router.push(`/${url.urlBase}?numAccount=${numAccount}`);
if (numAcount) {
router.push(`/${url.urlBase}?numAcount=${numAcount}`);
}
};
@@ -27,11 +27,11 @@ function SearchUser(url:urlProp) {
<div className="groupInput">
<input
type="text"
value={numAccount}
value={numAcount}
onChange={(e) => {
const value = e.target.value;
if (/^\d*$/.test(value) && value.length <= 9) {
setNumAccount(value);
setnumAcount(value);
}
}}
placeholder="Coloca un número de cuenta..."
+10 -10
View File
@@ -5,17 +5,17 @@ import { useRouter } from "next/navigation";
import { useEffect } from "react";
export const LoginRedirect = ({ children }: { children: React.ReactNode }) => {
const { loading, authenticated } = useAuth();
const router = useRouter();
const { loading, authenticated } = useAuth();
const router = useRouter();
useEffect(() => {
if (!loading && authenticated) {
router.push("/Impresiones");
}
}, [loading, authenticated, router]);
useEffect(() => {
if (!loading && authenticated) {
router.push("/Impresiones");
}
}, [loading, authenticated, router]);
if (loading) return <p>Cargando...</p>;
if (loading) return <p>Cargando...</p>;
return !authenticated ? <>{children}</> : null;
return !authenticated ? <>{children}</> : null;
};
//IO
//IO
+1 -1
View File
@@ -18,4 +18,4 @@ export const PrivateRoute = ({ children }: { children: React.ReactNode }) => {
return authenticated ? <>{children}</> : null;
};
//IO
//IO
+1 -1
View File
@@ -25,7 +25,7 @@ export default function RootLayout({
}>) {
return (
<html lang="es">
<body className={poppins.variable}>
<body className={poppins.variable} suppressHydrationWarning>
<Header />
<main>
{children}
+2 -2
View File
@@ -1,9 +1,9 @@
import axios from "axios";
import { envConfig } from "./config";
export async function GetStudent(numAccount: number) {
export async function GetStudent(numAcount: number) {
try {
const response = await axios.get(`${envConfig.apiUrl}/student/${numAccount}`);
const response = await axios.get(`${envConfig.apiUrl}/student/${numAcount}`);
console.log(response.data)
return response.data;
} catch (error: any) {
+1 -17
View File
@@ -13,22 +13,6 @@ export function middleware(request: NextRequest) {
}
export const config = {
matcher: [
"/Reportes",
"/Monitor",
"/QuitarSancion",
"/Programas",
"/Mensajes",
"/Inscritos",
"/Inscripciones",
"/InformacionEquipo",
"/Impresiones",
"/CambiarPass",
"/BitacoraSanciones",
"/AsignacionMesas",
"/AsignacionEquipo",
"/Alta",
"/AgregarTiempo",
"/ActivosMantenimiento"],
matcher: []
};
//IO