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


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/UploadQuestionPaper-DBxHDeOX.js

import{v as w,M as N,E as p,x as T,r as i,y as O,t,B as h,D as v,L as K}from"./index-B1vCiLdb.js";import{U as b,R as k}from"./UploadOutlined-BRk-8zRt.js";import{S as z}from"./index-Bg4J2mA-.js";import{R as B}from"./HomeOutlined-URzAi1xv.js";import{F as M}from"./Table-DAx1ImL3.js";import"./index-BYuc-nPv.js";import"./index-Bk72D_Kc.js";import"./DeleteOutlined-Df0cjl3o.js";import"./index-CQr3Towi.js";import"./responsiveObserver-MZZXoO8e.js";const Y=n=>async(o,c)=>{try{const y=c();let u=localStorage.getItem("dbname");o({type:"SET_LOADER"});const l=await w.get("app.php?a=getQpUploadDetails&db="+u+"&userid="+y.loginfo.userData.fregno);if(o({type:"UNSET_LOADER"}),l.data.error_code===-2)N.confirm({title:"Warning",content:"Please update bank details before you proceed, Click ok to update bank details",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){n("/qpsettings/bank-details")},onCancel(){console.log("Cancelled")}});else if(typeof l.data!="object")p("Error","Something Went wrong, please try again later");else if(l.data.error_code===0){let x=l.data.data.result.map((f,m)=>({...f,key:m,fslno:m+1}));o({type:"SET_QP_UPLOAD_DETAILS",payload:x}),o({type:"QP_UPD_NOTE",payload:l.data.data.fnote})}else o({type:"CLEAR_SET_QP_UPLOAD_DETAILS",payload:[]}),o({type:"CLEAR_QP_UPD_NOTE",payload:{}}),p("Info","No data found")}catch(y){console.log(y.message)}},H=(n,o)=>async(c,y)=>{try{let u=localStorage.getItem("dbname");c({type:"SET_LOADER"});const l=await w.post("app.php?a=uploadQuestionPaper&db="+u,n);c({type:"UNSET_LOADER"}),l.data.error_code===0?(p("success",l.data.data.msg),o()):p("info",l.data.data.msg)}catch(u){p("Error",u.message)}},V=n=>{const o="https://qp-scheme.s3.ap-south-1.amazonaws.com/",c="https://qp-upd.s3.ap-south-1.amazonaws.com/",[y,u]=i.useState([]),[l,x]=i.useState([]),[f,m]=i.useState([]),[g,S]=i.useState([]),[E,F]=i.useState([]),[q,U]=i.useState([]),[Q,L]=i.useState([]),[$,D]=i.useState(""),[A,_]=i.useState(""),[G,P]=i.useState(""),I=O();i.useEffect(()=>{n.getQpUploadDetails(I)},[]),i.useEffect(()=>{u(n.qpUpdData)},[n.qpUpdData]);const j=async(a,e,r)=>{if(r==="anskey"){const d={...l};if(a.fileList.length>0){const s=a.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"){p("info","Select word file only");return}d[e.key]=a.fileList,x(d),D(e.key),F("Yes")}else{const s={...l,[e.key]:[]};x(s),D(""),F("No")}}else if(r==="qp"){const d={...f};if(a.fileList.length>0){const s=a.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"){p("info","Select word file only");return}d[e.key]=a.fileList,m(d),_(e.key),U("Yes")}else{const s={...d,[e.key]:[]};m(s),_(""),U("No")}}else if(r==="rem"){const d={...g};if(a.fileList.length>0){const s=a.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"){p("info","Select word file only");return}d[e.key]=a.fileList,S(d),P(e.key),L("Yes")}else{const s={...d,[e.key]:[]};S(s),P(""),L("No")}}},C=async a=>{if(a.key!=A){p("info","Please select the files to upload");return}const e=new FormData;e.append("qpcode",a.fqpcode),e.append("set",a.fset),e.append("yearmode",a.fexam),e.append("type",a.ftype),e.append("userid",n.user.fregno),e.append("collcode",n.user.fcollcode),e.append("mobileno",n.user.fmobile),e.append("univcode",n.user.funivcode),e.append("ansstatus",E),e.append("qpstatus",q),e.append("remstatus",Q),g[a.key]&&g[a.key][0]&&e.append("remfile",g[a.key][0].originFileObj),f[a.key]&&f[a.key][0]&&e.append("qpfile",f[a.key][0].originFileObj),l[a.key]&&l[a.key][0]&&e.append("anskeyfile",l[a.key][0].originFileObj),await n.uploadQuestionPaper(e,n.getQpUploadDetails)},R=[{title:"Sl. No.",dataIndex:"fslno",align:"center"},{title:"QP. Code",dataIndex:"fqpcode",align:"center"},{title:"Subject Name",render:(a,e)=>t.jsx("span",{children:e.fsubname+" - "+e.FSUBSHORT})},{title:"Max. Marks",dataIndex:"fvalmax",align:"center",hidden:n.user.funivcode=="030"&&!0},{title:"Set No.",dataIndex:"fset",align:"center"},{title:"Type",dataIndex:"ftype",align:"center"},{title:"Syllabus with CO's",render:(a,e)=>t.jsx("a",{href:o+e.FQPSYLLABUS,target:"_blank",download:!0,children:"Download"}),align:"center"},{title:"QP Pattern",render:(a,e)=>t.jsx("a",{href:o+e.FQPPATREN,target:"_blank",download:!0,children:"Download"}),align:"center"},{title:"Uploaded Date",dataIndex:"qpupd",align:"center"},{title:"Status",render:(a,e)=>t.jsx("p",{children:e.qpupd!=""?t.jsx("span",{style:{color:"green"},children:" Completed "}):t.jsx("span",{style:{color:"red"},children:" Pending"})}),align:"center"},{title:"Upload Ans Key",render:(a,e)=>t.jsxs("div",{children:[t.jsx(b,{onClick:()=>x([]),fileList:l[e.key]||[],onChange:r=>j(r,e,"anskey"),beforeUpload:()=>!1,children:t.jsx(h,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fanskeypath!==""&&t.jsx("a",{href:c+e.fanskeypath,target:"_blank",download:!0,children:"View"})]}),align:"center",hidden:n.user.funivcode=="040"&&!0},{title:"Upload QP",render:(a,e)=>t.jsxs("div",{children:[t.jsx(b,{onClick:()=>m([]),fileList:f[e.key]||[],onChange:r=>j(r,e,"qp"),beforeUpload:()=>!1,children:t.jsx(h,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fqpfilepath!==""&&t.jsx("a",{href:c+e.fqpfilepath,target:"_blank",download:!0,children:"View"})]}),align:"center"},{title:"Remuneration Det.",render:(a,e)=>t.jsxs("div",{children:[t.jsx(b,{onClick:()=>S([]),fileList:g[e.key]||[],onChange:r=>j(r,e,"rem"),beforeUpload:()=>!1,children:t.jsx(h,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fremfile!==""&&t.jsx("a",{href:c+e.fremfile,target:"_blank",download:!0,children:"View"})]}),align:"center",hidden:n.user.funivcode!="040"&&!0},{title:"Action",render:(a,e)=>t.jsx(h,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>C(e),children:t.jsx(k,{})}),align:"center"}];return t.jsxs(v,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Upload Question Paper"}),extra:t.jsx(z,{children:t.jsx(K,{to:"/",children:t.jsxs(h,{type:"primary",danger:!0,children:[t.jsx(B,{})," Exit"]})})}),children:[n.user.funivcode=="040"?t.jsxs("p",{children:[t.jsx("b",{style:{color:"red",textAlign:"justify"},children:"Attention: "}),"Only one bill will be considered. Additional bills uploaded will not be taken into account."]}):t.jsx("div",{style:{color:"red",marginBottom:"20px"},dangerouslySetInnerHTML:{__html:n.qpUpdNote.fnote}}),t.jsx(M,{dataSource:y,columns:R,pagination:!1,scroll:{x:1300}})]})},W=n=>({user:n.loginfo.userData,qpUpdData:n.qpUpdData,qpUpdNote:n.qpUpdNote}),oe=T(W,{getQpUploadDetails:Y,uploadQuestionPaper:H})(V);export{oe as default};