added request to api
This commit is contained in:
@@ -6,8 +6,14 @@ import Toggle from "@/app/Components/Toggle/Toggle";
|
||||
import SearchDate from "@/app/Components/SearchDate/SearchDate";
|
||||
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;
|
||||
|
||||
let student: any = null;
|
||||
let error: string | null = null;
|
||||
|
||||
export default function Page() {
|
||||
const [usuario_sanciones] = useState([
|
||||
{
|
||||
no_cuenta: "425530275 ",
|
||||
@@ -166,8 +172,26 @@ export default function Page() {
|
||||
label: "Sanciones",
|
||||
content: (
|
||||
<>
|
||||
<SearchUser urlBase="BitacoraSanciones"/>
|
||||
<SearchUser urlBase="BitacoraSanciones" />
|
||||
|
||||
<Information NoCuenta="id cuenta" Nombre="id nombre" />
|
||||
|
||||
<form className="containerForm">
|
||||
<label className="label">Ubicacion de equipo</label>
|
||||
|
||||
<div className="groupInput">
|
||||
<select
|
||||
value={ubicacion_equipo}
|
||||
onChange={(e) => setUbicacionEquipo(e.target.value)}
|
||||
>
|
||||
<option value="">-- Selecciona un equipo --</option>
|
||||
<option value="255">Equipo 255</option>
|
||||
</select>
|
||||
<button className="button buttonSearch" type="submit">
|
||||
Asignar
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div className={styles.tableContainer}>
|
||||
<table className={styles.machineTable}>
|
||||
<thead>
|
||||
@@ -180,22 +204,6 @@ export default function Page() {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<form className="containerForm">
|
||||
<label className="label">Ubicacion de equipo</label>
|
||||
|
||||
<div className="groupInput">
|
||||
<select
|
||||
value={ubicacion_equipo}
|
||||
onChange={(e) => setUbicacionEquipo(e.target.value)}
|
||||
>
|
||||
<option value="">-- Selecciona un equipo --</option>
|
||||
<option value="255">Equipo 255</option>
|
||||
</select>
|
||||
<button className="button buttonSearch" type="submit">
|
||||
Asignar
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{usuario_sanciones.map((sancion, index) => (
|
||||
<tr key={index}>
|
||||
<td>{sancion.no_cuenta}</td>
|
||||
|
||||
@@ -4,12 +4,12 @@ import Impressions from "../../Components/Impressions/impressions";
|
||||
import Toggle from "../../Components/Toggle/Toggle";
|
||||
import Information from "../../Components/Information/information";
|
||||
|
||||
import "@/app/globals.css";
|
||||
import { GetStudent } from "@/app/lib/getStudent";
|
||||
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 params = await searchParams;
|
||||
const numAccount = params.numAccount ? Number(params.numAccount) : null;
|
||||
|
||||
let student: any = null;
|
||||
@@ -26,7 +26,7 @@ export default async function Page({ searchParams }: any) {
|
||||
|
||||
return (
|
||||
<section className="containerSection">
|
||||
{error && <AlertBox message={error} type="error" />}
|
||||
{error && <AlertBox key={error} message={error} type="error" />}
|
||||
|
||||
<h2 className="title">IMPRESIONES Y PLOTEO</h2>
|
||||
<SearchUser urlBase="Impresiones" />
|
||||
@@ -46,7 +46,7 @@ export default async function Page({ searchParams }: any) {
|
||||
{
|
||||
key: "1",
|
||||
label: "Recibo",
|
||||
content: <Receipt />,
|
||||
content: <Receipt numAccount={student.id_cuenta}/>,
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"use client";
|
||||
import "./inscriptions.css";
|
||||
|
||||
import SearchUser from "@/app/Components/SearchUser/searchUser";
|
||||
@@ -6,25 +5,47 @@ import Information from "@/app/Components/Information/information";
|
||||
import StepNavigator from "@/app/Components/StepNavigator/StepNavigator";
|
||||
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;
|
||||
|
||||
let student: any = null;
|
||||
let error: string | null = null;
|
||||
if (numAccount) {
|
||||
const result = await GetStudent(numAccount);
|
||||
|
||||
if (result.error) {
|
||||
error = result.error;
|
||||
} else {
|
||||
student = result;
|
||||
}
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<section className="containerSection">
|
||||
<h2 className="title"> INSCRIPCION </h2>
|
||||
|
||||
<SearchUser urlBase="Inscripciones"/>
|
||||
<SearchUser urlBase="Inscripciones" />
|
||||
|
||||
<Information
|
||||
NoCuenta="idcuanta"
|
||||
Nombre="juan"
|
||||
Carrera="carrera"
|
||||
Credito="credito"
|
||||
/>
|
||||
{student ? (
|
||||
<>
|
||||
<Information
|
||||
NoCuenta={student.id_cuenta}
|
||||
Nombre={student.nombre}
|
||||
Carrera={student.carrera.carrera}
|
||||
Credito={student.credito}
|
||||
/>
|
||||
|
||||
<StepNavigator totalSteps={2} onFinish={() => console.log()}>
|
||||
<Selection />
|
||||
<Receipt />
|
||||
</StepNavigator>
|
||||
<StepNavigator totalSteps={2}>
|
||||
<Selection />
|
||||
<Receipt numAccount={student.id_cuenta}/>
|
||||
</StepNavigator>
|
||||
</>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
import { useState } from "react";
|
||||
import styles from "./Page.module.css"; // importamos el css
|
||||
import styles from "./Page.module.css";
|
||||
import SearchUser from "@/app/Components/SearchUser/searchUser";
|
||||
|
||||
export default function Page() {
|
||||
@@ -17,7 +17,7 @@ export default function Page() {
|
||||
return (
|
||||
<section className="containerSection">
|
||||
<h2 className="title"> Quitar Sanciones </h2>
|
||||
<SearchUser urlBase="QuitarSanciones"/>
|
||||
<SearchUser urlBase="QuitarSancion"/>
|
||||
<div className={styles.tableContainer}>
|
||||
<table className={styles.machineTable}>
|
||||
<thead>
|
||||
|
||||
Reference in New Issue
Block a user