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


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/GenerateBill-5x_jc6Fd.js

import{v as A,E as j,x as G,r as s,t,D as N,L as Q,B as w,G as m,F as B,R as V}from"./index-DuwC-VT_.js";import{g as H,e as M}from"./UploadQpPattern-CBNvv8i9.js";import{a as R,r as U,s as $}from"./sem-CXAFzSxe.js";import{S as q}from"./index-DKZf0FLW.js";import{R as z}from"./HomeOutlined-BUGmPuRh.js";import{R as C,C as l}from"./row-DMe-QGJ3.js";import"./responsiveObserver-DYHRiOGe.js";const J=()=>async(r,n)=>{try{const i=n();let c=localStorage.getItem("dbname");r({type:"SET_LOADER"});const p=await A.get("/app.php?a=getTeahcerData&db="+c);if(r({type:"UNSET_LOADER"}),p.data.error_code===0){const d=p.data.data.map((h,o)=>({...h,key:o,fslno:o+1}));r({type:"GENERATE_BILL",payload:d})}else r({type:"CLEAR_GENERATE_BILL",payload:[]}),j("info",p.data.data.msg)}catch(i){console.log("error",i.message)}},K=(r,n,i,c,p,d,h)=>async(o,b)=>{try{const f=b();let E=localStorage.getItem("dbname");o({type:"SET_LOADER"});const g=await A.get("/app.php?a=getTeachValDet&db="+E+"&fdeggrp="+r+"&fdegree="+n+"&fsem="+i+"&freportopt="+c+"&fteacher="+p+"&ffrmDate="+d+"&ftoDate="+h);if(o({type:"UNSET_LOADER"}),g.data.error_code===0){const D=g.data.data.map((y,u)=>({...y,key:u,fslno:u+1}));o({type:"TEACH_VAL_DET",payload:D})}else o({type:"CLEAR_TEACH_VAL_DET",payload:[]}),j("info",g.data.data.msg)}catch(f){console.log("error",f.message)}},W=r=>{const[n,i]=s.useState(""),[c,p]=s.useState("All"),[d,h]=s.useState("All"),[o,b]=s.useState("pdf"),[f,E]=s.useState("teacher"),[g,D]=s.useState("All"),[y,u]=s.useState(""),[S,L]=s.useState("");s.useEffect(()=>{r.getQpDeggrp()},[]);const _=r.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),F=r.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),P=[...R,...F],v=[...R,...$],O=[{key:"teacher",label:"Teacher",value:"teacher"},{key:"moderator",label:"Moderator",value:"moderator"}],k=r.billgenerate.map(e=>({key:e.fteachcode,label:e.teachername,value:e.fteachcode})),x=async(e,a)=>{e=="deggrp"&&(i(a),r.getQpDegree(a),await r.getTeachers()),e=="degree"&&p(a),e=="sem"&&h(a),e=="reportopt"&&b(a),e=="reporttype"&&E(a),e=="teach"&&D(a)},T=(e,a)=>{e=="year"&&u(a),e=="mode"&&L(a)},I=async()=>{if(n==="")return j("info","Please Select Exam"),!1;if(y==="")return j("info","Please Enter From Date"),!1;r.viewTeachBillDet(n,c,d,f,g,y,S)};return t.jsxs(N,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Generate Teacher/Moderator Bill Report"}),extra:t.jsx(q,{children:t.jsx(Q,{to:"/",children:t.jsxs(w,{type:"primary",danger:!0,children:[t.jsx(z,{}),"Exit"]})})}),children:[t.jsxs(C,{gutter:10,children:[t.jsxs(l,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Exam"}),t.jsx(m,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:n,options:_,onChange:e=>x("deggrp",e)})]}),t.jsxs(l,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Degree"}),t.jsx(m,{showSearch:!0,mode:"multiple",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:c,options:P,onChange:e=>x("degree",e)})]}),t.jsxs(l,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Sem"}),t.jsx(m,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:v,value:d,onChange:e=>x("sem",e)})]}),t.jsxs(l,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Report Type"}),t.jsx(m,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:f,options:O,onChange:e=>x("reporttype",e)})]})]}),t.jsxs(C,{gutter:10,children:[t.jsxs(l,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Teacher"}),t.jsx(m,{showSearch:!0,mode:"multiple",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:g,options:k,onChange:e=>x("teach",e)})]}),t.jsxs(l,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Date From"}),t.jsx(B,{type:"date",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:y,onChange:e=>T("year",e.target.value)})]}),t.jsxs(l,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"To"}),t.jsx(B,{type:"date",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:S,onChange:e=>T("mode",e.target.value)})]}),t.jsxs(l,{xs:12,sm:12,md:6,lg:3,xl:3,xxl:3,children:[t.jsx("label",{children:"Excel / PDF"}),t.jsx(m,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:o,options:U,onChange:e=>x("reportopt",e)})]}),t.jsxs(l,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("p",{style:{marginTop:"20px"}}),t.jsxs(w,{type:"primary",style:{marginBottom:"10px"},onClick:()=>I(),children:[t.jsx(V,{}),"View"]})]})]})]})},X=r=>(console.log(r.teachBillDet),{deggrp:r.deggrp,degree:r.degree,billgenerate:r.billgenerate}),se=G(X,{getQpDeggrp:H,viewTeachBillDet:K,getQpDegree:M,getTeachers:J})(W);export{se as default};