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 : 52.15.209.178


Current Path : /proc/thread-self/root/var/www/qpms/assets/
Upload File :
Current File : //proc/thread-self/root/var/www/qpms/assets/EligibleQpSetter-C7Me-gyf.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-D91i0Taj.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-B8dlBrDr.js";import{g as u,s as y}from"./datatable-BYAbYtGF.js";import{S as J}from"./index-D6UqdOPV.js";import{R as W}from"./SaveOutlined-BTVxBu3f.js";import{R as K}from"./HomeOutlined-spX06zJ_.js";import{R as T,C as g}from"./row-CNxfkkwo.js";import{F as V}from"./Table-CYC9SXQE.js";import{C as X}from"./index-DkAH2Jx9.js";import"./responsiveObserver-D2HThzTQ.js";import"./index-DZCfXKy8.js";import"./index-DdVV4GJm.js";const Y=(...a)=>async(s,b)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await Q.get("app.php?a=getEligibleQpSetterts&db="+o+"&deggrp="+a[0]+"&board="+a[1]+"&qpcode="+a[2]+"&type="+a[3]+"&selected="+a[4]);if(s({type:"UNSET_LOADER"}),n.data.error_code===0){const p=n.data.data.map((f,d)=>({...f,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=a=>async(s,b)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await Q.post("app.php?a=saveQpSetters&db="+o,a);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=a=>{const[s,b]=l.useState(""),[o,n]=l.useState("All"),[p,f]=l.useState(""),[d,D]=l.useState(""),[h,j]=l.useState([]),[E,C]=l.useState("All"),[B,w]=l.useState(!1);l.useEffect(()=>{a.getQpDeggrp()},[]),l.useEffect(()=>{j(a.eligibleQpSetter)},[a.eligibleQpSetter]);const m=async(e,r)=>{w(!1),r==="deggrp"&&(b(e),await a.getQpBoard(e),await a.getAvailableSubjects(e,"All")),r==="board"&&(n(e),await a.getAvailableSubjects(s,e)),r==="qpcode"&&f(e),r==="type"&&D(e),r==="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 a.getEligibleQpSetterts(s,o,p,d,E),w(!0)},P=a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),R=a.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),I=[...N,...R],O=a.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),k=(e,r)=>{const c=[...h];c[r].status=e?"T":"F",c[r].changeStatus="T",j(c)},v=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"8%"},{title:t.jsx("div",{style:{textAlign:"center"},children:"Teach. Code - Name"}),dataIndex:"fteach",...u("fteach","Teacher code / Name"),sorter:(e,r)=>y(e,r,"fteach"),sortDirections:["descend","ascend"],width:"30%"},{title:"Teacher Email ID",dataIndex:"femail",...u("femail","Email"),sorter:(e,r)=>y(e,r,"femail"),sortDirections:["descend","ascend"],width:"39%"},{title:"Mobile No.",dataIndex:"fmobile",...u("fmobile","Mobile no."),sorter:(e,r)=>y(e,r,"fmobile"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Select",render:(e,r)=>t.jsx(X,{checked:r.status==="T",onChange:c=>k(c.target.checked,r.key)}),align:"center",width:"8%"}],_=async()=>{const e=h.filter(c=>c.changeStatus=="T"),r=new FormData;r.append("data",JSON.stringify(e)),r.append("deggrp",s),r.append("board",o),r.append("qpcode",p),r.append("type",d),r.append("userid",a.userid),await a.saveQpSetters(r)};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:I,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:h,columns:v,bordered:!0,scroll:{y:300,x:1e3},style:{marginTop:"20px"},size:"small",pagination:M})]})},te=a=>({deggrp:a.deggrp,board:a.board,qpcode:a.availableSubjects,eligibleQpSetter:a.eligibleQpSetter,userid:a.loginfo.userData.fmobile}),be=L(te,{getQpDeggrp:U,getQpBoard:$,getAvailableSubjects:z,getEligibleQpSetterts:Y,saveQpSetters:Z})(ee);export{be as default};