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


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

import{v as _,E as S,x as te,r as d,t,D as ae,B as k,L as oe,G as x}from"./index-ChT0xYiY.js";import{I as F}from"./index-DS2IDMzI.js";import{s as H,a as I,t as se,p as ne,f as q}from"./sem-DLpF_ddZ.js";import{g as re,a as le,d as de}from"./UploadQpPattern-D3NTHJAy.js";import{f,g as D}from"./datatable-Pmr3nCys.js";import{D as P,R as L}from"./react-datepicker-BivQ-NNH.js";import{S as ie}from"./index-CCqRUA_e.js";import{R as ce}from"./StopOutlined-r47AxIUf.js";import{R as pe}from"./SaveOutlined-tAGeQ51X.js";import{R as ge}from"./HomeOutlined-C_Cn3B9w.js";import{R as B,C as u}from"./row-BiiVUFlR.js";import{F as me}from"./Table-74BLe3me.js";import{P as N}from"./index-CetxONwl.js";import{C}from"./index-G2j282sA.js";import"./responsiveObserver-CMjrehYy.js";import"./index-BDLcy6G-.js";import"./index-cEGmOHHy.js";const he=(...o)=>async(n,m)=>{try{const i=m();let h=localStorage.getItem("dbname");n({type:"SET_LOADER"});const l=await _.get("app.php?a=getAssignModeratorDetails&db="+h+"&board="+o[1]+"&qpcode="+o[2]+"&deggrp="+o[0]+"&qptype="+o[3]+"&fuser="+i.loginfo.userData.fregno+"&flogtyp="+o[4]);if(n({type:"UNSET_LOADER"}),l.data.error_code===0){const y=l.data.data.mod.map((c,p)=>({...c,key:p,fslno:p+1})),b=l.data.data.teach.map((c,p)=>({key:p,value:c.fteachcode,label:c.fteachname+" ["+c.fteachcode+"]"}));n({type:"MOD_DETAILS",payload:y}),n({type:"TEACHER_DETAILS",payload:[...H,...b]})}else n({type:"MOD_DETAILS",payload:[]}),n({type:"TEACHER_DETAILS",payload:[]})}catch(i){S("error",i.message)}},xe=o=>async(n,m)=>{try{const i=m();let h=localStorage.getItem("dbname");n({type:"SET_LOADER"});const l=await _.post("app.php?a=saveAssignModerator&db="+h,o);n({type:"UNSET_LOADER"}),l.data.error_code===0?S("success",l.data.data.msg):S("info",l.data.data.msg)}catch(i){S("error",i.message)}},fe=o=>{const[n,m]=d.useState("Select"),[i,h]=d.useState("All"),[l,y]=d.useState("All"),[b,c]=d.useState("THEORY"),[p,v]=d.useState("All"),[w,A]=d.useState([]),[z,E]=d.useState(!1),[ye,O]=d.useState(!1),[be,M]=d.useState(!1);d.useEffect(()=>{o.getQpDeggrp()},[]),d.useEffect(()=>{A(o.getAssignMod)},[o.getAssignMod]);const j=async(e,a)=>{a==="deggrp"&&(m(e),y("All"),await o.getQpBoard(e),await o.getAvailableSubjects(e,"All")),a==="board"&&(h(e),await o.getAvailableSubjects(n,e)),a==="qpcode"&&y(e),a==="type"&&c(e),a==="loginType"&&v(e)},Q=async()=>{if(n==="Select")return S("info","Please Select Degree Group"),!1;await o.getAssignModeratorDetails(n,i,l,b,p),E(!0)},$=[...o.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),...H],Y=o.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),U=[...I,...Y],G=o.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname+" ["+e.fqpcode+"]",value:e.fqpcode})),J=[...I,...G],g=(e,a,s)=>{const r=w;r[a.key][s]=e,r[a.key].onchange="T",A([...r])},R=async(e,a,s)=>{O(!1),M(!1);const r=new Date(e),ee=K(r),T=w;T[a][s]=ee,T[a].onchange="T",A([...T])},K=e=>{if(!(e instanceof Date))return"";const a=e.getDate().toString().padStart(2,"0"),s=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getFullYear();return`${a}/${s}/${r}`},V=[{key:"All",label:"All",value:"All"},{key:"Allowed",label:"Allowed",value:"Allowed"},{key:"NotAllowed",label:"Not Allowed",value:"NotAllowed"}],W=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"QP Code",dataIndex:"fqpcode",...D("fqpcode","qpcode"),align:"center",width:"9%"},{title:"Subject Name",dataIndex:"fsubname",...D("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,a)=>t.jsx(x,{size:"mini",showSearch:!0,optionFilterProp:"label",filterOption:f,style:{width:"100%"},value:a.fteachcode,options:o.teachers,onChange:s=>g(s,a,"fteachcode")}),...D("fteachcode","teachcode"),width:"19%"},{title:"From Date",render:(e,a)=>t.jsxs("div",{children:[t.jsx(F,{style:{height:"35px"},formatChars:q,className:"date-input",mask:"ed/nm/zyyy",value:a.ffromdate,onChange:s=>g(s.target.value,a,"ffromdate"),placeholder:"dd/mm/yyyy"}),t.jsx(N,{content:t.jsx("div",{style:{padding:"5px",borderRadius:"8px"},children:t.jsx(P,{onChange:s=>R(s,a.key,"ffromdate"),dateFormat:"dd/MM/yyyy",inline:!0,onClickOutside:()=>O(!1)})}),trigger:"click",children:t.jsx(L,{style:{position:"absolute",top:"45%",right:"15px",transform:"translateY(-50%)",fontSize:"20px",cursor:"pointer"}})})]}),width:"12%"},{title:"To Date",render:(e,a)=>t.jsxs("div",{children:[t.jsx(F,{style:{height:"35px"},formatChars:q,className:"date-input",mask:"ed/nm/zyyy",value:a.ftodate,onChange:s=>g(s.target.value,a,"ftodate"),placeholder:"dd/mm/yyyy"}),t.jsx(N,{content:t.jsx("div",{style:{padding:"5px",borderRadius:"8px"},children:t.jsx(P,{onChange:s=>R(s,a.key,"ftodate"),dateFormat:"dd/MM/yyyy",inline:!0,onClickOutside:()=>M(!1)})}),trigger:"click",children:t.jsx(L,{style:{position:"absolute",top:"45%",right:"15px",transform:"translateY(-50%)",fontSize:"20px",cursor:"pointer"}})})]}),align:"center",width:"12%"},{title:"Allow Login?",render:(e,a)=>t.jsx(C,{checked:a.fstatus==="T",onChange:s=>{let r=s.target.checked?"T":"F";g(r,a,"fstatus")}}),align:"center",width:"5%"},{title:"Send Email",render:(e,a)=>t.jsx(C,{checked:a.emailstatus==="T",onChange:s=>{let r=s.target.checked?"T":"F";g(r,a,"emailstatus")}}),align:"center",width:"5%"},{title:"Freeze",render:(e,a)=>t.jsx(C,{checked:a.fmodstatus==="T",onChange:s=>{let r=s.target.checked?"T":"F";g(r,a,"fmodstatus")}}),align:"center",width:"5%"},{title:"Delete?",render:(e,a)=>t.jsx(C,{checked:a.fdeleted==="T",onChange:s=>{let r=s.target.checked?"T":"F";g(r,a,"fdeleted")}}),align:"center",width:"5%"}],X=async()=>{const e=w.filter(s=>s.onchange==="T"),a=new FormData;a.append("user",o.user.fmobile),a.append("univcode",o.user.funivcode),a.append("exam",n),a.append("board",i),a.append("qpcode",l),a.append("qptype",b),a.append("data",JSON.stringify(e)),await o.saveAssignModerator(a)},Z=()=>{m("Select"),h("All"),y("All"),c("THEORY"),v("All"),A([]),E(!1)};return t.jsxs(ae,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Assign Moderator"}),extra:t.jsxs(ie,{children:[t.jsxs(k,{style:{background:"black",color:"white"},onClick:()=>Z(),children:[t.jsx(ce,{})," Clear"]}),t.jsxs(k,{type:"primary",onClick:()=>X(),children:[t.jsx(pe,{})," Save"]}),t.jsx(oe,{to:"/",children:t.jsxs(k,{type:"primary",danger:!0,children:[t.jsx(ge,{})," Exit"]})})]}),children:[t.jsxs(B,{gutter:16,children:[t.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Exam"}),t.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:n,options:$,onChange:e=>j(e,"deggrp")})]}),t.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Board"}),t.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:i,options:U,onChange:e=>j(e,"board")})]}),t.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Subject"}),t.jsx(x,{filterOption:f,showSearch:!0,className:"ant-select-item-option-content",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l,options:J,onChange:e=>j(e,"qpcode")})]})]}),t.jsxs(B,{gutter:16,children:[t.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Type"}),t.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:b,options:se,onChange:e=>j(e,"type")})]}),t.jsxs(u,{xs:12,sm:12,md:6,lg:4,xl:4,xxl:4,children:[t.jsx("label",{children:"Login"}),t.jsx(x,{filterOption:f,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,options:V,onChange:e=>j(e,"loginType")})]}),t.jsxs(u,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("p",{style:{marginTop:"20px"}}),t.jsx(k,{type:"primary",style:{marginBottom:"10px"},onClick:()=>Q(),children:"Submit"})]})]}),z&&t.jsx(me,{dataSource:w,columns:W,scroll:{x:1300,y:300},size:"small",pagination:ne})]})},ue=o=>({deggrp:o.deggrp,board:o.board,qpcode:o.availableSubjects,user:o.loginfo.userData,getAssignMod:o.getAssignMod,teachers:o.teachers}),Be=te(ue,{getQpDeggrp:re,getQpBoard:le,getAvailableSubjects:de,getAssignModeratorDetails:he,saveAssignModerator:xe})(fe);export{Be as default};