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


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/AcceptQpRequest-CnniGnOk.js

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