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


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

import{v as E,M as T,E as u,x as K,r as i,y as B,t,B as g,D as z,L as M,G as Y}from"./index-CXvb2HGZ.js";import{U as b,R as k}from"./UploadOutlined-DPMk2jaQ.js";import{S as H}from"./index-DHyLT5wt.js";import{R as V}from"./HomeOutlined-C8RZrmCV.js";import{R as W,C as $}from"./row-ClTxCJ8m.js";import{F as G}from"./Table-CNMkxNHM.js";import"./index-DmW51NFT.js";import"./index-ZzgtcyQj.js";import"./DeleteOutlined-CQo1x9J5.js";import"./responsiveObserver-DVDafNTv.js";import"./index-DakHim_F.js";const J=(n,y)=>async(s,h)=>{try{const r=h();let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const p=await E.get("app.php?a=getQpUploadDetails&db="+o+"&userid="+r.loginfo.userData.fregno+"&fstatus="+y);if(s({type:"UNSET_LOADER"}),p.data.error_code===-2)T.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 p.data!="object")u("Error","Something Went wrong, please try again later");else if(p.data.error_code===0){let m=p.data.data.result.map((x,f)=>({...x,key:f,fslno:f+1}));s({type:"SET_QP_UPLOAD_DETAILS",payload:m}),s({type:"QP_UPD_NOTE",payload:p.data.data.fnote})}else s({type:"CLEAR_SET_QP_UPLOAD_DETAILS",payload:[]}),s({type:"CLEAR_QP_UPD_NOTE",payload:{}}),u("Info","No data found")}catch(r){console.log(r.message)}},X=(n,y)=>async(s,h)=>{try{let r=localStorage.getItem("dbname");s({type:"SET_LOADER"});const o=await E.post("app.php?a=uploadQuestionPaper&db="+r,n);s({type:"UNSET_LOADER"}),o.data.error_code===0?(u("success",o.data.data.msg),y()):u("info",o.data.data.msg)}catch(r){u("Error",r.message)}},Z=n=>{const y="https://qp-scheme.s3.ap-south-1.amazonaws.com/",s="https://qp-upd.s3.ap-south-1.amazonaws.com/",[h,r]=i.useState([]),[o,p]=i.useState([]),[m,x]=i.useState([]),[f,S]=i.useState([]),[q,F]=i.useState([]),[Q,U]=i.useState([]),[C,P]=i.useState([]),[te,L]=i.useState(""),[I,w]=i.useState(""),[ae,D]=i.useState(""),[_,R]=i.useState("Pending"),A=B();i.useEffect(()=>{n.getQpUploadDetails(A,_)},[]),i.useEffect(()=>{r(n.qpUpdData)},[n.qpUpdData]);const j=async(a,e,c)=>{if(c==="anskey"){const d={...o};if(a.fileList.length>0){const l=a.fileList[0].name.split(".").pop();if(l!=="docx"&&l!=="doc"){u("info","Select word file only");return}d[e.key]=a.fileList,p(d),L(e.key),F("Yes")}else{const l={...o,[e.key]:[]};p(l),L(""),F("No")}}else if(c==="qp"){const d={...m};if(a.fileList.length>0){const l=a.fileList[0].name.split(".").pop();if(l!=="docx"&&l!=="doc"){u("info","Select word file only");return}d[e.key]=a.fileList,x(d),w(e.key),U("Yes")}else{const l={...d,[e.key]:[]};x(l),w(""),U("No")}}else if(c==="rem"){const d={...f};if(a.fileList.length>0){const l=a.fileList[0].name.split(".").pop();if(l!=="docx"&&l!=="doc"){u("info","Select word file only");return}d[e.key]=a.fileList,S(d),D(e.key),P("Yes")}else{const l={...d,[e.key]:[]};S(l),D(""),P("No")}}},v=[{key:"All",label:"All",value:"All"},{key:"Uploaded",label:"Uploaded",value:"Uploaded"},{key:"Pending",label:"Pending",value:"Pending"}],N=async a=>{if(a.key!=I){u("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",q),e.append("qpstatus",Q),e.append("remstatus",C),f[a.key]&&f[a.key][0]&&e.append("remfile",f[a.key][0].originFileObj),m[a.key]&&m[a.key][0]&&e.append("qpfile",m[a.key][0].originFileObj),o[a.key]&&o[a.key][0]&&e.append("anskeyfile",o[a.key][0].originFileObj),await n.uploadQuestionPaper(e,n.getQpUploadDetails)},O=[{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:y+e.FQPSYLLABUS,target:"_blank",download:!0,children:"Download"}),align:"center"},{title:"QP Pattern",render:(a,e)=>t.jsx("a",{href:y+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:()=>p([]),fileList:o[e.key]||[],onChange:c=>j(c,e,"anskey"),beforeUpload:()=>!1,children:t.jsx(g,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fanskeypath!==""&&t.jsx("a",{href:s+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:()=>x([]),fileList:m[e.key]||[],onChange:c=>j(c,e,"qp"),beforeUpload:()=>!1,children:t.jsx(g,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fqpfilepath!==""&&t.jsx("a",{href:s+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:f[e.key]||[],onChange:c=>j(c,e,"rem"),beforeUpload:()=>!1,children:t.jsx(g,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fremfile!==""&&t.jsx("a",{href:s+e.fremfile,target:"_blank",download:!0,children:"View"})]}),align:"center",hidden:n.user.funivcode!="040"&&!0},{title:"Action",render:(a,e)=>t.jsx(g,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>N(e),children:t.jsx(k,{})}),align:"center"}];return t.jsxs(z,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Upload Question Paper"}),extra:t.jsx(H,{children:t.jsx(M,{to:"/",children:t.jsxs(g,{type:"primary",danger:!0,children:[t.jsx(V,{})," 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(W,{gutter:10,children:t.jsxs($,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Status"}),t.jsx(Y,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:_,options:v,onChange:a=>{R(a),n.getQpUploadDetails(A,a)}})]})}),t.jsx(G,{dataSource:h,columns:O,pagination:!1,scroll:{x:1300}})]})},ee=n=>({user:n.loginfo.userData,qpUpdData:n.qpUpdData,qpUpdNote:n.qpUpdNote}),me=K(ee,{getQpUploadDetails:J,uploadQuestionPaper:X})(Z);export{me as default};