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.219.247.59


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/EligibleQpSetter-BoD4XRVz.js

import{v as Q,E as i,x as L,r as l,t,D as q,B as S,L as F,G as x}from"./index-DuuJ_BVy.js";import{a as N,t as G,b as H,p as M}from"./sem-BK69X1ab.js";import{g as U,a as $,d as z}from"./UploadQpPattern-CiLofBzr.js";import{g as u,s as y}from"./datatable-ZhxhX0N2.js";import{S as J}from"./index-BjlpPnds.js";import{R as W}from"./SaveOutlined-Bja7yXOQ.js";import{R as K}from"./HomeOutlined-COaObuiP.js";import{R as T,C as g}from"./row-Dz_eTgRG.js";import{F as V}from"./Table-CaI-VRgw.js";import{C as X}from"./index-DFKGOmqH.js";import"./responsiveObserver-P-7D2JNj.js";import"./index-BbnbYn0r.js";import"./index-Cfr0AqBF.js";const Y=(...r)=>async(s,f)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await Q.get("app.php?a=getEligibleQpSetterts&db="+o+"&deggrp="+r[0]+"&board="+r[1]+"&qpcode="+r[2]+"&type="+r[3]+"&selected="+r[4]);if(s({type:"UNSET_LOADER"}),n.data.error_code===0){const p=n.data.data.map((h,d)=>({...h,key:d,fslno:d+1}));s({type:"ELIGIBLE_QP_SETTER",payload:p})}else s({type:"CLEAR_ELIGIBLE_QP_SETTER",payload:[]})}catch(o){i("error",o.message)}},Z=r=>async(s,f)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await Q.post("app.php?a=saveQpSetters&db="+o,r);s({type:"UNSET_LOADER"}),n.data.error_code===0?i("success",n.data.data.msg):i("info",n.data.data.msg)}catch(o){i("error",o.message)}},ee=r=>{const[s,f]=l.useState(""),[o,n]=l.useState("All"),[p,h]=l.useState(""),[d,D]=l.useState(""),[b,j]=l.useState([]),[E,C]=l.useState("All"),[B,w]=l.useState(!1);l.useEffect(()=>{r.getQpDeggrp()},[]),l.useEffect(()=>{j(r.eligibleQpSetter)},[r.eligibleQpSetter]);const m=async(e,a)=>{w(!1),a==="deggrp"&&(f(e),await r.getQpBoard(e),await r.getAvailableSubjects(e,"All")),a==="board"&&(n(e),await r.getAvailableSubjects(s,e)),a==="qpcode"&&h(e),a==="type"&&D(e),a==="select"&&C(e)},A=async()=>{if(s==="")return i("info","Please Select Degree Group"),!1;if(o==="")return i("info","Please Select Board"),!1;if(p==="")return i("info","Please Select QP Code"),!1;if(d==="")return i("info","Please Select Type"),!1;await r.getEligibleQpSetterts(s,o,p,d,E),w(!0)},P=r.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),R=r.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),v=[...N,...R],O=r.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),k=(e,a)=>{const c=[...b];c[a].status=e?"T":"F",c[a].changeStatus="T",j(c)},I=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"8%"},{title:t.jsx("div",{style:{textAlign:"center"},children:"Teach. Code - Name"}),render:(e,a)=>t.jsx("div",{children:t.jsx("span",{children:a.fteachcode+" - "+a.fteachname})}),...u("fteachcode","Teacher code"),sorter:(e,a)=>y(e,a,"fteachcode"),sortDirections:["descend","ascend"],width:"30%"},{title:"Teacher Email ID",dataIndex:"femail",...u("femail","Email"),sorter:(e,a)=>y(e,a,"femail"),sortDirections:["descend","ascend"],width:"39%"},{title:"Mobile No.",dataIndex:"fmobile",...u("fmobile","Mobile no."),sorter:(e,a)=>y(e,a,"fmobile"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Select",render:(e,a)=>t.jsx(X,{checked:a.status==="T",onChange:c=>k(c.target.checked,a.key)}),align:"center",width:"8%"}],_=async()=>{const e=b.filter(c=>c.changeStatus=="T"),a=new FormData;a.append("data",JSON.stringify(e)),a.append("deggrp",s),a.append("board",o),a.append("qpcode",p),a.append("type",d),a.append("userid",r.userid),await r.saveQpSetters(a)};return t.jsxs(q,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Eligible QP Setters (BOE)"}),extra:t.jsxs(J,{children:[t.jsxs(S,{type:"primary",onClick:()=>_(),children:[t.jsx(W,{})," Save"]}),t.jsx(F,{to:"/",children:t.jsxs(S,{type:"primary",danger:!0,children:[t.jsx(K,{})," Exit"]})})]}),children:[t.jsxs(T,{gutter:16,children:[t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Degree Group"}),t.jsx(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:s,options:P,onChange:e=>m(e,"deggrp")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Board"}),t.jsx(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:o,options:v,onChange:e=>m(e,"board")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Subject"}),t.jsx(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,options:O,onChange:e=>m(e,"qpcode")})]})]}),t.jsxs(T,{gutter:16,children:[t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Type"}),t.jsx(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:d,options:G,onChange:e=>m(e,"type")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Select"}),t.jsx(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:E,options:H,onChange:e=>m(e,"select")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("p",{style:{marginTop:"20px"}}),t.jsx(S,{type:"primary",style:{marginBottom:"10px"},onClick:()=>A(),children:"Submit"})]})]}),B&&t.jsx(V,{dataSource:b,columns:I,bordered:!0,scroll:{y:300,x:1e3},style:{marginTop:"20px"},size:"small",pagination:M})]})},te=r=>({deggrp:r.deggrp,board:r.board,qpcode:r.availableSubjects,eligibleQpSetter:r.eligibleQpSetter,userid:r.loginfo.userData.fmobile}),fe=L(te,{getQpDeggrp:U,getQpBoard:$,getAvailableSubjects:z,getEligibleQpSetterts:Y,saveQpSetters:Z})(ee);export{fe as default};