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


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

import{v as R,E as i,x as H,r as n,t,D as N,B as h,L as G,G as f}from"./index-QZTwIYNH.js";import{s as C,a as $,t as M,c as U,p as Y}from"./sem-DLpF_ddZ.js";import{g as z,a as J,d as W}from"./UploadQpPattern-CaQ0d1QJ.js";import{f as b,g as E,s as w}from"./datatable-CrsaOLck.js";import{S as K}from"./index-BuLi212C.js";import{R as V}from"./StopOutlined-BBOZBYx0.js";import{R as X}from"./SaveOutlined-B85tiZJV.js";import{R as Z}from"./HomeOutlined-Dqkr2h5y.js";import{R as D,C as g}from"./row-CcxksV_2.js";import{F as ee}from"./Table-Cc25zE5h.js";import{C as te}from"./index-CM8Sh-uj.js";import"./responsiveObserver-DIcRJoDZ.js";import"./index-DBO0RidY.js";import"./index-DOQp1pcZ.js";const ae=(...a)=>async(r,S)=>{try{let o=localStorage.getItem("dbname");r({type:"SET_LOADER"});const l=await R.get("app.php?a=getEligibleQpSetterts&db="+o+"&deggrp="+a[0]+"&board="+a[1]+"&qpcode="+a[2]+"&type="+a[3]+"&selected="+a[4]);if(r({type:"UNSET_LOADER"}),l.data.error_code===0){const p=l.data.data.map((m,c)=>({...m,key:c,fslno:c+1}));r({type:"ELIGIBLE_QP_SETTER",payload:p})}else r({type:"CLEAR_ELIGIBLE_QP_SETTER",payload:[]})}catch(o){i("error",o.message)}},se=a=>async(r,S)=>{try{let o=localStorage.getItem("dbname");r({type:"SET_LOADER"});const l=await R.post("app.php?a=saveQpSetters&db="+o,a);r({type:"UNSET_LOADER"}),l.data.error_code===0?i("success",l.data.data.msg):i("info",l.data.data.msg)}catch(o){i("error",o.message)}},re=a=>{const[r,S]=n.useState("Select"),[o,l]=n.useState("All"),[p,m]=n.useState("Select"),[c,T]=n.useState("THEORY"),[u,y]=n.useState([]),[Q,O]=n.useState("All"),[A,j]=n.useState(!1);n.useEffect(()=>{a.getQpDeggrp()},[]),n.useEffect(()=>{y(a.eligibleQpSetter)},[a.eligibleQpSetter]);const x=async(e,s)=>{j(!1),s==="deggrp"&&(S(e),m("Select"),await a.getQpBoard(e),await a.getAvailableSubjects(e,"All")),s==="board"&&(l(e),await a.getAvailableSubjects(r,e)),s==="qpcode"&&m(e),s==="type"&&T(e),s==="select"&&O(e)},k=async()=>{if(r==="Select")return i("info","Please Select Degree Group"),!1;if(o==="")return i("info","Please Select Board"),!1;if(p==="Select")return i("info","Please Select QP Code"),!1;if(c==="")return i("info","Please Select Type"),!1;await a.getEligibleQpSetterts(r,o,p,c,Q),j(!0)},B=[...a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),...C],P=a.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),I=[...$,...P],q=[...a.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),...C],v=(e,s)=>{const d=[...u];d[s].status=e?"T":"F",d[s].changeStatus="T",y(d)},_=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"8%"},{title:t.jsx("div",{style:{textAlign:"center"},children:"Teach. Code - Name"}),dataIndex:"fteach",...E("fteach","Teacher code / Name"),sorter:(e,s)=>w(e,s,"fteach"),sortDirections:["descend","ascend"],width:"30%"},{title:"Teacher Email ID",dataIndex:"femail",...E("femail","Email"),sorter:(e,s)=>w(e,s,"femail"),sortDirections:["descend","ascend"],width:"39%"},{title:"Mobile No.",dataIndex:"fmobile",...E("fmobile","Mobile no."),sorter:(e,s)=>w(e,s,"fmobile"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Select",render:(e,s)=>t.jsx(te,{checked:s.status==="T",onChange:d=>v(d.target.checked,s.key)}),align:"center",width:"8%"}],L=async()=>{const e=u.filter(d=>d.changeStatus=="T"),s=new FormData;s.append("data",JSON.stringify(e)),s.append("deggrp",r),s.append("board",o),s.append("qpcode",p),s.append("type",c),s.append("userid",a.userid),await a.saveQpSetters(s)},F=()=>{S("Select"),l("All"),m("Select"),T("THEORY"),y([]),O("All"),j(!1)};return t.jsxs(N,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Eligible QP Setters (BOE)"}),extra:t.jsxs(K,{children:[t.jsxs(h,{style:{background:"black",color:"white"},onClick:()=>F(),children:[t.jsx(V,{})," Clear"]}),t.jsxs(h,{type:"primary",onClick:()=>L(),children:[t.jsx(X,{})," Save"]}),t.jsx(G,{to:"/",children:t.jsxs(h,{type:"primary",danger:!0,children:[t.jsx(Z,{})," Exit"]})})]}),children:[t.jsxs(D,{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(f,{filterOption:b,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:r,options:B,onChange:e=>x(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(f,{filterOption:b,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:o,options:I,onChange:e=>x(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(f,{filterOption:b,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,options:q,onChange:e=>x(e,"qpcode")})]})]}),t.jsxs(D,{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(f,{filterOption:b,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:c,options:M,onChange:e=>x(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(f,{filterOption:b,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:Q,options:U,onChange:e=>x(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(h,{type:"primary",style:{marginBottom:"10px"},onClick:()=>k(),children:"Submit"})]})]}),A&&t.jsx(ee,{dataSource:u,columns:_,bordered:!0,scroll:{y:300,x:1e3},style:{marginTop:"20px"},size:"small",pagination:Y})]})},oe=a=>({deggrp:a.deggrp,board:a.board,qpcode:a.availableSubjects,eligibleQpSetter:a.eligibleQpSetter,userid:a.loginfo.userData.fmobile}),Ee=H(oe,{getQpDeggrp:z,getQpBoard:J,getAvailableSubjects:W,getEligibleQpSetterts:ae,saveQpSetters:se})(re);export{Ee as default};