PageSourceSearch

https://enrollment.addu.edu.ph/build/assets/ReinstatementForm-Budzi6AQ.js

js addu.edu.ph collected 2026-09-24 10:01:09 UTC 7,993 bytes, 1 lines download raw bytes

1import{a as w,X as $,r as u,j as e,t as y,A as B}from"./app-C-q8qtPv.js";import{L as G}from"./LawLayout-DS1h7QdD.js";import{I as d,A as H,C as A}from"./APISearchSelect-Djp4VZxY.js";import{c as Y}from"./react-m230iRoC.js";import{B as U}from"./Badge-CPeSzwRU.js";import{F as i}from"./Form-jxfazzpJ.js";import{B as D}from"./Button-CFkSnZxs.js";import"./Navbar-CpVtoahs.js";import"./transition-CNq8E805.js";import"./keyboard-D8C1IA8E.js";import"./input-BYVGLxoG.js";import"./createLucideIcon-E-iNjsGt.js";import"./dialog-h4hMkCxz.js";import"./utils-KaZsniaC.js";import"./clsx-B-dksMZM.js";import"./index-DZeBAudb.js";import"./index-neeymzZK.js";import"./index-CzMmYkNE.js";import"./floating-ui.react-dom-15AqOyCe.js";import"./floating-ui.dom-DaxT6Ert.js";import"./button-DNXcleKW.js";import"./ThemeProvider-Dphc_mwV.js";import"./index-DwL9Slqx.js";import"./Button-D4BARxAf.js";const P=Y(t=>({students:[],loading:!1,error:null,success:!1,message:null,fetchStudents:async c=>{if(!(c!=null&&c.trim()))return t({students:[]}),[];t({loading:!0});try{const{data:o}=await w.get("/api/loa/select-student",{params:{query:c}});return t({students:o,loading:!1}),o}catch(o){return console.error(o),t({error:o,students:[],loading:!1}),[]}},submitReinstatement:async c=>{var o,p;t({loading:!0,error:null,success:!1,message:null});try{const l=new FormData;Object.entries(c).forEach(([v,h])=>{h!=null&&l.append(v,h)}),console.log("payload on reinstatement form",[...l]);const{data:f}=await w.post("/api/reinstatement/submit",l,{headers:{"Content-Type":"multipart/form-data"}});return t({loading:!1,success:!0,message:f.message}),f}catch(l){throw console.error(l),console.log(l.response.data),t({loading:!1,success:!1,error:l,message:((p=(o=l.response)==null?void 0:o.data)==null?void 0:p.message)??"Submission failed."}),l}},clearStudents:()=>t({students:[],error:null}),clearMessage:()=>t({success:!1,message:null,error:null})})),ge=({auth:t,upcoming_sy:c,upcoming_sem:o,isAdduEmail:p})=>{const{students:l,loading:f,error:v,success:h,message:X,fetchStudents:b,submitReinstatement:L}=P(),E={email:t.user.email,studentcode:"",upcoming_sy:c,upcoming_sem:o,last_sy:"",last_sem:"",last_course:"",last_div:"",last_dept:"",academic_level:"",firstname:"",middlename:"",lastname:"",tor:"",honorable:"",good_moral:"",latest_div:"",div_code:""},g=$().props.auth.user,S=g==null?void 0:g.email,[a,x]=u.useState(E),[n,j]=u.useState(null),[C,O]=u.useState({}),[T,I]=u.useState(!1),[F,N]=u.useState(!1),R=()=>{const s={};return a.email.trim()||(s.email="Email is required."),a.studentcode.trim()||(s.studentcode="Choosing a student is required."),O(s),Object.keys(s).length===0},_=async s=>{j(s),x(m=>({...m,studentcode:s.CODE,last_course:s.COURSECODE,last_div:s.DIVISIONCODE,last_sy:s.SCHOOLYEAR,last_sem:s.SEMESTER,last_dept:s.SchoolCode,academic_level:s.AcademicLevel,firstname:s.FIRSTNAME,middlename:s.MIDDLENAME,lastname:s.LASTNAME,div_code:s.DIVCODE,latest_div:s.LATESTDIVISION}))};u.useEffect(()=>{console.log("selectedStudent updated:",n),console.log("formValues updated:",a)},[n,a]),u.useEffect(()=>{(async()=>{if(p&&S){const m=await b(S);j(m[0]),_(m[0])}})()},[p,S]);const M=()=>{R()&&N(!0)},V=()=>{x(E),j(null),O({})},k=async()=>{var s,m;try{const r=await L(a);r!=null&&r.success?(y.success(r==null?void 0:r.message),N(!1),setTimeout(()=>{B.visit("/reinstatement/dashboard")},2e3)):y.error(r==null?void 0:r.message)}catch(r){y.error(((m=(s=r.response)==null?void 0:s.data)==null?void 0:m.message)??"Submission failed.")}};return e.jsx(G,{pageTitle:"Reinstatement Form",children:e.jsxs("div",{className:"min-h-screen w-full ",children:[e.jsx("main",{className:"flex-grow px-2 py-15",children:e.jsxs("div",{className:"md:min-w-xl px-6 md:px-10",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold mb-6",style:{fontFamily:"'Trajan'"},children:"Reinstatement Form"}),e.jsx("br",{}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 bg-white p-5 rounded-md w-full",children:[e.jsxs("div",{className:"col-span-2 flex flex-col gap-1",children:[p?e.jsx(d,{fieldName:"Student:",value:n&&`${n.FIRSTNAME} ${n.LASTNAME}`,readOnly:!0}):e.jsx(H,{value:n,options:l,onSearch:b,onChange:_,getLabel:s=>`${s.FIRSTNAME} ${s.LASTNAME}`,getValue:s=>s.CODE,placeholder:"Search your (student) name...",subtitle:s=>
1`${s.CODE} | ${s.DIVISIONCODE}`}),C.studentcode&&e.jsx("span",{className:"text-red-600 text-sm",children:C.studentcode})]}),e.jsxs("div",{className:"col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Logged In Email",subFieldName:"Ex. [email protected]",name:"email",value:a.email,readOnly:!0})]}),e.jsxs("div",{className:"col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Last School Year Attended",name:"last_sy",value:a.last_sy,readOnly:!0})]}),e.jsxs("div",{className:" col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Last Semester Attended",name:"last_sem",value:a.last_sem,readOnly:!0})]}),e.jsxs("div",{className:"col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Last Course Attended",name:"last_course",value:a.last_course,readOnly:!0})]}),e.jsxs("div",{className:"col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Last Division",name:"last_div",value:a.last_div,readOnly:!0})]}),e.jsxs("div",{className:"col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Last Department",name:"last_dept",value:a.last_dept,readOnly:!0})]}),e.jsxs("div",{className:"col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Apply for School Year",name:"upcoming_sy",value:a.upcoming_sy,readOnly:!0})]}),e.jsxs("div",{className:"col-span-2 md:col-span-1",children:[" ",e.jsx(d,{fieldName:"Apply for Semester",name:"upcoming_sem",value:a.upcoming_sem,readOnly:!0})]})]}),(n==null?void 0:n.LATESTDIVISION)==="DISMISSED"&&e.jsxs("div",{className:"w-full bg-white p-5 mt-4 rounded-md flex flex-col gap-3",children:[e.jsxs("p",{className:"col-span-3",children:["Status:"," ",e.jsx(U,{bg:"secondary",children:n.LATESTDIVISION})]}),e.jsxs("span",{className:"col-span-3 text-sm opacity-75",children:["For returning students who were previously",e.jsx("strong",{className:"italic",children:"DISMISSED"})," ","from the university, you are required to have ",e.jsx("strong",{children:"taken"}),"and ",e.jsx("strong",{children:"passed"})," at least 30 units from a different Higher Education Institution (HEI). Furthermore, kindly submit the required documents below:"]}),e.jsxs(i,{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 mt-2 gap-3",children:[e.jsxs(i.Group,{children:[e.jsxs(i.Label,{children:["Transcript of Records (TOR)"," ",e.jsx("span",{className:"text-red-600 font-bold",children:"*"})]}),e.jsx(i.Control,{type:"file",name:"tor",onChange:s=>x({...a,tor:s.target.files[0]})})]}),e.jsxs(i.Group,{children:[e.jsxs(i.Label,{children:["Honorable Dismissal"," ",e.jsx("span",{className:"text-red-600 font-bold",children:"*"})]}),e.jsx(i.Control,{type:"file",name:"honorable",onChange:s=>x({...a,honorable:s.target.files[0]})})]}),e.jsxs(i.Group,{children:[e.jsxs(i.Label,{children:["Good Moral Certificate"," ",e.jsx("span",{className:"text-red-600 font-bold",children:"*"})]}),e.jsx(i.Control,{type:"file",name:"good_moral",onChange:s=>x({...a,good_moral:s.target.files[0]})})]})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row w-full justify-between mt-5 gap-2",children:[e.jsx(D,{className:"w-full md:w-[200px]",variant:"secondary",onClick:()=>I(!0),children:"Clear Form"}),e.jsx(D,{className:"w-full md:w-[200px]",onClick:M,disabled:f||!a.studentcode,children:f?"Submitting...":"Submit"})]})]})}),e.jsx(A,{isOpen:T,onClose:()=>I(!1),onConfirm:V,title:"CLEAR FORM",description:"Are you sure you want to clear all fields in this form? This action cannot be undone.",confirmText:"Clear",confirmVariant:"destructive"}),e.jsx(A,{isOpen:F,onClose:()=>N(!1),onConfirm:k,title:"SUBMIT FORM",description:"Are you sure you want to submit this form? Make sure all entries are correct.",confirmText:"Submit"})]})})};export{ge as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.