0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.119.255.170


Current Path : /proc/thread-self/root/var/www/qpms/assets/
Upload File :
Current File : //proc/thread-self/root/var/www/qpms/assets/TeacherEntry-0Vc-x7Y_.js

import{x as E,O as B,r,y as R,t as e,D,L as g,B as d,R as O,F as i,G as j,E as u}from"./index-CoLgoWu-.js";import{I as S}from"./index-7wbyj5j5.js";import{f as H,e as I}from"./sem-DLpF_ddZ.js";import{s as N,g as $,a as A,c as F}from"./TeacherEntry-SzI_4afv.js";import{S as L}from"./index-WY2ZM78R.js";import{R as P}from"./StopOutlined-CssYq0j8.js";import{R as q}from"./HomeOutlined-Bfy-GkWd.js";import{R as m,C as n}from"./row-s2Fr6JP2.js";import"./responsiveObserver-BUjGGPy3.js";const M=t=>{const s=B();r.useRef(null);const[l,x]=r.useState({teachcode:"",name:"",dob:"",email:"",mobile:"",college:"",examiner:"",fcollname:""}),[y,h]=r.useState(!1);R();const[b,p]=r.useState(!0);r.useEffect(()=>{s.type!=="insert"&&(h(!0),x({...l,teachcode:s.teachcode,mobile:s.mobileno}),t.getTeachdet(s.teachcode)),t.getCollegeDetails()},[]),r.useEffect(()=>{s.type!=="insert"&&(h(!0),x({...l,teachcode:s.teachcode,mobile:s.mobileno,name:t.teachdet.fteachname,dob:t.teachdet.fdob,email:t.teachdet.femail,college:t.teachdet.fcollcode,examiner:t.teachdet.fexaminer}))},[t.teachdet]);const o=(a,c)=>{c=="college"&&a=="OTHR"&&p(!1),x({...l,[c]:a})},f=async a=>{a=="teachcode"?await t.checkTeachcode(l.teachcode,a):s.type==="insert"&&await t.checkTeachcode(l.mobile,a)},v=async()=>{if(t.funivcode!="061"){if(l.name==""||l.email==""||l.mobile==""||l.dob==""||l.college==""||l.examiner==""){u("warning","All the fields are mandatory");return}}else if(l.name==""||l.email==""||l.mobile==""||l.college==""||l.examiner==""){u("warning","All the fields are mandatory");return}if(l.college=="OTHR"&&l.fcollname==""){u("warning","Enter External College name");return}const a=new FormData;a.append("data",JSON.stringify(l)),a.append("type",s.type),await t.saveTeacherDetails(a)},C=t.college.map((a,c)=>({key:c,value:a.fcollcode,label:a.fcollname})),T=[{key:"Others",label:"Others",value:"OTHR"}],w=[...C,...T],k=()=>{x({teachcode:"",name:"",dob:"",email:"",mobile:"",college:"",examiner:"",fcollname:""}),h(!1)};return e.jsxs(D,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Teacher Entry"}),extra:e.jsxs(L,{children:[e.jsx(g,{to:{pathname:"/qpsettings/teacher-entry/insert"},children:e.jsxs(d,{style:{background:"black",color:"white"},onClick:()=>k(),children:[e.jsx(P,{})," Clear"]})}),e.jsx(g,{to:"/qpsettings/view-teacher-list",children:e.jsxs(d,{style:{background:"green",color:"white"},children:[e.jsx(O,{})," View"]})}),e.jsx(g,{to:"/dashboard",children:e.jsxs(d,{type:"primary",danger:!0,children:[e.jsx(q,{})," Exit"]})})]}),children:[e.jsx(m,{gutter:16,children:e.jsxs(n,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("label",{children:"Teacher Code"}),e.jsx(i,{disabled:y,style:{marginBottom:"10px"},value:l.teachcode,onBlur:()=>f("teachcode"),onChange:a=>o(a.target.value,"teachcode")})]})}),e.jsxs(m,{gutter:16,children:[e.jsxs(n,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("label",{children:"Name"}),e.jsx(i,{style:{marginBottom:"10px"},value:l.name,onChange:a=>o(a.target.value,"name")})]}),e.jsxs(n,{xs:24,sm:24,md:12,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Date of Birth"}),e.jsx(S,{className:"date-input",formatChars:H,mask:"ed/nm/zyyy",placeholder:"dd/mm/yyyy",style:{marginBottom:"10px",height:"35px"},value:l.dob,onChange:a=>o(a.target.value,"dob")})]})]}),e.jsxs(m,{gutter:16,children:[e.jsxs(n,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("label",{children:"Email ID"}),e.jsx(i,{style:{marginBottom:"10px"},value:l.email,onChange:a=>o(a.target.value,"email")})]}),e.jsxs(n,{xs:24,sm:24,md:12,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Mobile No."}),e.jsx(i,{style:{marginBottom:"10px"},value:l.mobile,maxLength:10,onBlur:()=>f("mobile"),onChange:a=>{const c=/^[0-9\b]+$/;(a.target.value==""||c.test(a.target.value))&&o(a.target.value,"mobile")}})]})]}),e.jsxs(m,{gutter:16,children:[e.jsxs(n,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("label",{children:"College"}),e.jsx(j,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l.college,options:w,onChange:a=>o(a,"college")})]}),e.jsxs(n,{xs:24,sm:24,md:12,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Examiner"}),e.jsx(j,{style:{marginBottom:"10px",width:"100%"},value:l.examiner,options:I,onChange:a=>o(a,"examiner")})]})]}),e.jsxs(m,{gutter:16,children:[e.jsxs(n,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,hidden:b,children:[e.jsx("label",{children:"College Name"}),e.jsx(i,{style:{marginBottom:"10px"},value:l.fcollname,onChange:a=>o(a.target.value,"fcollname")})]}),e.jsx(n,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,style:{marginTop:"16px"},children:e.jsx(d,{type:"primary",onClick:()=>v(),children:"Save"})})]})]})},z=t=>({funivcode:t.loginfo.userData.funivcode,college:t.collegeDetails,teachdet:t.teachdet}),Y=E(z,{saveTeacherDetails:N,getCollegeDetails:$,getTeachdet:A,checkTeachcode:F})(M);export{Y as default};