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


Current Path : /proc/thread-self/root/var/www/qpms/assets/
Upload File :
Current File : //proc/thread-self/root/var/www/qpms/assets/AssignModerator-oYEqNSL0.js

import{v as R,E as S,x as G,r as c,t as a,D as Y,B as j,L as J,G as x}from"./index-DoOhtRM-.js";import{I as v}from"./index-DEeOvr9M.js";import{s as F,a as O,t as K,p as V,f as q}from"./sem-DLpF_ddZ.js";import{g as W,a as X,d as Z}from"./UploadQpPattern-M42KeA6O.js";import{f,g as C}from"./datatable-YrghQg_b.js";import{S as ee}from"./index-DAtDV0BY.js";import{R as te}from"./StopOutlined-C9S41vGE.js";import{R as ae}from"./SaveOutlined-D4VzuSum.js";import{R as oe}from"./HomeOutlined-RRy07SvX.js";import{R as M,C as u}from"./row-B8SdGvkB.js";import{F as se}from"./Table-Dzx3CwGy.js";import{C as w}from"./index-BKpnzzI6.js";import"./responsiveObserver-BniLz5dQ.js";import"./index-Dp7SaHdv.js";import"./index-Gneb6Krm.js";const le=(...o)=>async(l,m)=>{try{const d=m();let h=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await R.get("app.php?a=getAssignModeratorDetails&db="+h+"&board="+o[1]+"&qpcode="+o[2]+"&deggrp="+o[0]+"&qptype="+o[3]+"&fuser="+d.loginfo.userData.fregno+"&flogtyp="+o[4]);if(l({type:"UNSET_LOADER"}),r.data.error_code===0){const y=r.data.data.mod.map((i,p)=>({...i,key:p,fslno:p+1})),b=r.data.data.teach.map((i,p)=>({key:p,value:i.fteachcode,label:i.fteachname+" ["+i.fteachcode+"]"}));l({type:"MOD_DETAILS",payload:y}),l({type:"TEACHER_DETAILS",payload:[...F,...b]})}else l({type:"MOD_DETAILS",payload:[]}),l({type:"TEACHER_DETAILS",payload:[]})}catch(d){S("error",d.message)}},re=o=>async(l,m)=>{try{const d=m();let h=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await R.post("app.php?a=saveAssignModerator&db="+h,o);l({type:"UNSET_LOADER"}),r.data.error_code===0?S("success",r.data.data.msg):S("info",r.data.data.msg)}catch(d){S("error",d.message)}},ne=o=>{const[l,m]=c.useState("Select"),[d,h]=c.useState("All"),[r,y]=c.useState("All"),[b,i]=c.useState("THEORY"),[p,E]=c.useState("All"),[T,k]=c.useState([]),[I,D]=c.useState(!1);c.useEffect(()=>{o.getQpDeggrp()},[]),c.useEffect(()=>{k(o.getAssignMod)},[o.getAssignMod]);const A=async(e,t)=>{t==="deggrp"&&(m(e),y("All"),await o.getQpBoard(e),await o.getAvailableSubjects(e,"All")),t==="board"&&(h(e),await o.getAvailableSubjects(l,e)),t==="qpcode"&&y(e),t==="type"&&i(e),t==="loginType"&&E(e)},L=async()=>{if(l==="Select")return S("info","Please Select Degree Group"),!1;await o.getAssignModeratorDetails(l,d,r,b,p),D(!0)},B=[...o.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),...F],N=o.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),P=[...O,...N],_=o.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname+" ["+e.fqpcode+"]",value:e.fqpcode})),H=[...O,..._],g=(e,t,s)=>{const n=T;n[t.key][s]=e,n[t.key].onchange="T",k([...n])},Q=[{key:"All",label:"All",value:"All"},{key:"Allowed",label:"Allowed",value:"Allowed"},{key:"NotAllowed",label:"Not Allowed",value:"NotAllowed"}],z=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"QP Code",dataIndex:"fqpcode",...C("fqpcode","qpcode"),align:"center",width:"9%"},{title:"Subject Name",dataIndex:"fsubname",...C("fsubname","subname"),width:"19%"},{title:"QP Count",dataIndex:"fset",align:"center",width:"5%"},{title:"Uploaded Count",dataIndex:"uploaded",align:"center",width:"5%"},{title:"Moderator",render:(e,t)=>a.jsx(x,{size:"mini",showSearch:!0,optionFilterProp:"label",filterOption:f,style:{width:"100%"},value:t.fteachcode,options:o.teachers,onChange:s=>g(s,t,"fteachcode")}),...C("fteachcode","teachcode"),width:"19%"},{title:"From Date",render:(e,t)=>a.jsx(v,{style:{height:"35px"},formatChars:q,className:"date-input",mask:"ed/nm/zyyy",value:t.ffromdate,onChange:s=>g(s.target.value,t,"ffromdate"),placeholder:"dd/mm/yyyy"}),width:"12%"},{title:"To Date",render:(e,t)=>a.jsx(v,{style:{height:"35px"},formatChars:q,className:"date-input",mask:"ed/nm/zyyy",value:t.ftodate,onChange:s=>g(s.target.value,t,"ftodate"),placeholder:"dd/mm/yyyy"}),align:"center",width:"12%"},{title:"Allow Login?",render:(e,t)=>a.jsx(w,{checked:t.fstatus==="T",onChange:s=>{let n=s.target.checked?"T":"F";g(n,t,"fstatus")}}),align:"center",width:"5%"},{title:"Send Email",render:(e,t)=>a.jsx(w,{checked:t.emailstatus==="T",onChange:s=>{let n=s.target.checked?"T":"F";g(n,t,"emailstatus")}}),align:"center",width:"5%"},{title:"Freeze",render:(e,t)=>a.jsx(w,{checked:t.fmodstatus==="T",onChange:s=>{let n=s.target.checked?"T":"F";g(n,t,"fmodstatus")}}),align:"center",width:"5%"},{title:"Delete?",render:(e,t)=>a.jsx(w,{checked:t.fdeleted==="T",onChange:s=>{let n=s.target.checked?"T":"F";g(n,t,"fdeleted")}}),align:"center",width:"5%"}],U=async()=>{const e=T.filter(s=>s.onchange==="T"),t=new FormData;t.append("user",o.user.fmobile),t.append("univcode",o.user.funivcode),t.append("exam",l),t.append("board",d),t.append("qpcode",r),t.append("qptype",b),t.append("data",JSON.stringify(e)),await o.saveAssignModerator(t)},$=()=>{m("Select"),h("All"),y("All"),i("THEORY"),E("All"),k([]),D(!1)};return a.jsxs(Y,{style:{margin:"6rem 10px 10px"},title:a.jsx("h6",{children:"Assign Moderator"}),extra:a.jsxs(ee,{children:[a.jsxs(j,{style:{background:"black",color:"white"},onClick:()=>$(),children:[a.jsx(te,{})," Clear"]}),a.jsxs(j,{type:"primary",onClick:()=>U(),children:[a.jsx(ae,{})," Save"]}),a.jsx(J,{to:"/",children:a.jsxs(j,{type:"primary",danger:!0,children:[a.jsx(oe,{})," Exit"]})})]}),children:[a.jsxs(M,{gutter:16,children:[a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Exam"}),a.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l,options:B,onChange:e=>A(e,"deggrp")})]}),a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Board"}),a.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:d,options:P,onChange:e=>A(e,"board")})]}),a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Subject"}),a.jsx(x,{filterOption:f,showSearch:!0,className:"ant-select-item-option-content",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:r,options:H,onChange:e=>A(e,"qpcode")})]})]}),a.jsxs(M,{gutter:16,children:[a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Type"}),a.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:b,options:K,onChange:e=>A(e,"type")})]}),a.jsxs(u,{xs:12,sm:12,md:6,lg:4,xl:4,xxl:4,children:[a.jsx("label",{children:"Login"}),a.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,options:Q,onChange:e=>A(e,"loginType")})]}),a.jsxs(u,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[a.jsx("p",{style:{marginTop:"20px"}}),a.jsx(j,{type:"primary",style:{marginBottom:"10px"},onClick:()=>L(),children:"Submit"})]})]}),I&&a.jsx(se,{dataSource:T,columns:z,scroll:{x:1300,y:300},size:"small",pagination:V})]})},de=o=>({deggrp:o.deggrp,board:o.board,qpcode:o.availableSubjects,user:o.loginfo.userData,getAssignMod:o.getAssignMod,teachers:o.teachers}),ke=G(de,{getQpDeggrp:W,getQpBoard:X,getAvailableSubjects:Z,getAssignModeratorDetails:le,saveAssignModerator:re})(ne);export{ke as default};