PageSourceSearch

https://thinkproedge.com/_next/static/chunks/pages/admin/timetable-50e42e71599baefd.js

js thinkproedge.com collected 2026-10-02 01:49:29 UTC 8,923 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5994],{95965:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/timetable",function(){return n(51897)}])},7194:function(e,t,n){"use strict";var r=n(85893),i=n(48764),a=n(25543),s=n(3689),o=(0,i.B)({colors:{brand:{primary:"#f15a2d",secondary:"#372d63"}},styles:{global:{}},components:{Button:{variants:{theme:{bg:"#f15a2d",color:"white",border:"2px solid #f15a2d",_hover:{bg:"white",color:"#f15a2d"},_active:{bg:"white",color:"#f15a2d"}}}},Menu:{parts:["menu","item"],baseStyle:{menu:{},item:{fontWeight:"medium",lineHeight:"normal",color:"gray.600",fontSize:"0.95rem",pl:5,py:3}}}}});t.Z=function(e){var t=e.children;return(0,r.jsxs)(a.x,{theme:o,children:[(0,r.jsx)(s.m,{}),t]})}},37597:function(e,t,n){"use strict";var r=n(85893),i=n(74860),a=n(64115),s=n(15267),o=n(49444);t.Z=function(e){var t=e.list,n=e.limit;console.log("list",t);var l=(0,i.q)(),c=l.isOpen,u=l.onToggle,d=t.length;return(0,r.jsxs)(r.Fragment,{children:[t.slice(0,n).map((function(e,t){return(0,r.jsx)(a.x,{children:e},t)})),d>n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.U,{in:c,animateOpacity:!0,children:t.slice(n).map((function(e,t){return(0,r.jsx)(a.x,{children:e},t)}))}),(0,r.jsx)(o.r,{color:"blue.500",onClick:u,children:c?"Collapse -":"Expand +"})]})]})}},97696:function(e,t,n){"use strict";var r=n(26042),i=n(69396),a=n(85893),s=n(67294),o=n(79521),l=n(48017),c=n(83346),u=n(40980),d=n(64115),h=n(38448),m=n(38104),f=n(85105),x=n(79887),p=n(94096),g=n(87341),j=n(9345),v=n(92362),b=n(84646),Z=n(7869),S=n.n(Z);t.Z=function(e){var t=e.title,n=e.columnsArray,Z=e.dataArray,D=e.customPageSize,w=(0,s.useRef)(null),_=s.useMemo((function(){return Z}),[]),y=s.useMemo((function(){return n}),[]),C=(0,o.useTable)({columns:y,data:_,initialState:{pageSize:D||10}},o.useGlobalFilter,o.useSortBy,o.usePagination),P=C.getTableProps,T=C.getTableBodyProps,Y=C.headerGroups,k=C.prepareRow,E=C.rows,M=C.page,N=C.canPreviousPage,A=C.canNextPage,z=(C.pageOptions,C.pageCount,C.gotoPage,C.nextPage),H=C.previousPage,I=C.setPageSize,F=C.state,B=F.pageIndex,O=F.pageSize,R=C.setGlobalFilter,G=(0,s.useState)(""),W=G[0],X=G[1],$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=(0,s.useState)(e),r=n[0],i=n[1];return(0,s.useEffect)((function(){var n=setTimeout((function(){i(e)}),t);return function(){clearTimeout(n)}}),[e,t]),r}(W,200);(0,s.useEffect)((function(){R($||void 0)}),[$]);return(0,a.jsxs)(l.xu,{mx:"5",my:"8",children:[(0,a.jsx)(d.x,{fontSize:"xl",children:t}),(0,a.jsxs)(j.r,{mt:"5",templateColumns:"repeat(6, 1fr)",gap:[3,6,6],children:[(0,a.jsx)(j.P,{colSpan:[6,2,1],children:(0,a.jsxs)(h.M,{children:["Show",(0,a.jsx)(m.Ph,{mx:"1",value:O,onChange:function(e){I(Number(e.target.value))},children:[5,10,20,30,40,50].map((function(e){return(0,a.jsx)("option",{value:e,children:e},e)}))}),"entries"]})}),(0,a.jsx)(j.P,{colSpan:[6,2,3],children:(0,a.jsx)(h.M,{children:(0,a.jsx)(f.z,{variant:"theme",onClick:function(){var e=[];E.map((function(t){var r=t.values,i=[];n.map((function(e){0!=e.exportToExcel&&(i[e.Header]=r[e.accessor])})),e.push(i)}));var t=S().utils.book_new(),r=S().utils.json_to_sheet(e);S().utils.book_append_sheet(t,r,["Sheet 1"]),S().writeFile(t,"export.xlsx")},children:"Export to Excel"})})}),(0,a.jsx)(j.P,{colSpan:[6,2,2],children:(0,a.jsxs)(h.M,{children:["Search:",(0,a.jsx)(x.I,{ml:"2",type:"text",onChange:function(e){return X(e.target.value)}})]})})]}),(0,a.jsx)(l.xu,{my:"3",borderWidth:"1px",borderRadius:"lg",overflow:"auto",children:(0,a.jsxs)(c.iA,(0,i.Z)((0,r.Z)({ref:w},P()),{children:[(0,a.jsx)(c.hr,{children:Y.map((function(e){return(0,a.jsx)(c.Tr,(0,i.Z)((0,r.Z)({},e.getHeaderGroupProps()),{children:e.headers.map((function(e){return(0,a.jsxs)(c.Th,(0,i.Z)((0,r.Z)({},e.getHeaderProps(e.getSortByToggleProps())),{isNumeric:e.isNumeric,style:{width:e.width?e.width:"100%"},children:[e.render("Header"),(0,a.jsx)(u.chakra.span,{pl:"4",children:e.isSorted?e.isSortedDesc?(0,a.jsx)(v.A,{"aria-label":"sorted descending"}):(0,a.jsx)(b.$,{"aria-label":"sorted ascending"}):null})]}))}))}))}))}),(0,a.jsx)(c.p3,(0,i.Z)((0,r.Z)({},T()),{children:0==E.length?(0,a.jsx)(c.Tr,{children:(0,a.jsx)(c.Td,{colSpan:n.length,children:(0,a.jsx)(h.M,{children:"No data available"})})}):M.map((function(e,t){return k(e),(0,a.jsx)(c.Tr,(0,i.Z)((0,r.Z)({}
1,e.getRowProps()),{children:e.cells.map((function(e){return(0,a.jsx)(c.Td,(0,i.Z)((0,r.Z)({},e.getCellProps()),{isNumeric:e.column.isNumeric,children:e.render("Cell")}))}))}))}))}))]}))}),(0,a.jsxs)(p.k,{mt:"3",children:[(0,a.jsxs)(d.x,{children:["Showing ",B*O+1," to"," ",B*O+M.length," of ",E.length," entries"]}),(0,a.jsx)(g.L,{}),(0,a.jsx)(f.z,{mr:"2",onClick:function(){return H()},disabled:!N,children:"Previous"}),(0,a.jsx)(f.z,{onClick:function(){return z()},disabled:!A,children:"Next"})]})]})}},51897:function(e,t,n){"use strict";n.r(t);var r=n(4111),i=n(51438),a=n(52951),s=n(14924),o=n(88029),l=n(7297),c=n(60460),u=n(85893),d=n(11163),h=n.n(d),m=n(67294),f=n(70978),x=n(53850),p=n(48017),g=n(64115),j=n(24003),v=n(38448),b=n(85105),Z=n(45754),S=n(94096),D=n(109),w=n(7194),_=n(64790),y=n(97696),C=n(17289),P=n(46737),T=n.n(P),Y=n(30381),k=n.n(Y),E=n(37597);function M(){var e=(0,l.Z)([","]);return M=function(){return e},e}var N=function(e){(0,o.Z)(n,e);var t=(0,c.Z)(n);function n(){var e;return(0,i.Z)(this,n),e=t.apply(this,arguments),(0,s.Z)((0,r.Z)(e),"state",{loggedIn:!1,loading:!1,viewData:!1,timetable:[],admissionCodes:[],selectedAids:[],startDate:k()().format("YYYY-MM-DD"),endDate:k()().format("YYYY-MM-DD"),columns:[{Header:"ID",accessor:"id"},{Header:"Date",accessor:"class_date"},{Header:"Title",accessor:"title"},{Header:"Admission Codes",accessor:"admission_codes"},{Header:"Start Time",accessor:"time_from"},{Header:"Actions",accessor:"action"}]}),(0,s.Z)((0,r.Z)(e),"getTimetableData",(function(){var t=e.state,n=(t.selectedAids,t.startDate,t.endDate,t.admissionCodes);e.setState({loading:!0,viewData:!1}),(0,C.kel)().then((function(t){var r=t.data.map((function(t){var r=t.id,i=t.title,a=t.start_date,s=t.aid,o=t.time_from,l=s.split(M()).map((function(e){return n.filter((function(t){return t.aid==+e}))}));return{id:r,title:i,start_date:a,time_from:o,admission_codes:(0,u.jsx)(E.Z,{limit:3,list:l&&l.map((function(e){var t;return null===(t=e[0])||void 0===t?void 0:t.admission_code}))}),action:(0,u.jsxs)(S.k,{alignItems:"center",children:[(0,u.jsx)(D.u,{hasArrow:!0,label:"Delete",placement:"top",children:(0,u.jsx)(b.z,{size:"xs",onClick:function(){return e.deleteTimetable(r)},mr:1,children:(0,u.jsx)("i",{className:"fas fa-trash","aria-hidden":"true"})})}),(0,u.jsx)(D.u,{hasArrow:!0,label:"Edit",placement:"top",children:(0,u.jsx)(b.z,{size:"xs",onClick:function(){return h().push("timetable/"+r+"/edit")},ml:1,children:(0,u.jsx)("i",{className:"fas fa-pencil-alt","aria-hidden":"true"})})})]})}}));e.setState({timetable:r,loading:!1,viewData:!0})})).catch((function(t){console.log("Error ",t),e.setState({loading:!1})}))})),(0,s.Z)((0,r.Z)(e),"setStartDate",(function(t){t=k()(t).format("YYYY-MM-DD"),e.setState({startDate:t})})),(0,s.Z)((0,r.Z)(e),"setEndDate",(function(t){(t=k()(t).format("YYYY-MM-DD"))<e.state.startDate?T()("Error","End date should be greater than start date","error"):(e.setState({endDate:t}),console.log(t<e.state.startDate))})),(0,s.Z)((0,r.Z)(e),"deleteTimetable",(function(e){T()("Are you sure you want to delete?",{buttons:{Yes:{text:"Yes",value:"Yes"},No:!0}}).then((function(e){if("Yes"!==e)return!1}))})),e}return(0,a.Z)(n,[{key:"componentDidMount",value:function(){var e=this;if(!(0,f.jl)("admin"))return h().push("/login");this.setState({loggedIn:!0}),(0,C.b3x)().then((function(t){var n=t.data;e.setState({admissionCodes:n})})).then((function(){return e.getTimetableData()})).catch((function(e){console.log("Error ",e)}))}},{key:"handleAdmissionCodeChange",value:function(e){var t=[];e.map((function(e){var n=e.value;t.push(n)})),this.setState({selectedAids:t})}},{key:"render",value:function(){return this.state.loggedIn&&(0,u.jsx)(w.Z,{children:(0,u.jsx)(_.Z,{children:(0,u.jsx)(x.W,{bg:"gray.100",minWidth:"full",p:[2,10,10],minHeight:"100vh",children:(0,u.jsxs)(p.xu,{bg:"white",p:"7",border:"1px",borderColor:"gray.200",borderRadius:"5",children:[(0,u.jsx)(g.x,{fontSize:"2xl",children:"Timetable"}),(0,u.jsx)(j.i,{my:"4"}),this.state.loading&&(0,u.jsx)(v.M,{mt:"5",children:(0,u.jsx)(Z.$,{})}),this.state.viewData&&(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(y.Z,{columnsArray:this.state.columns,dataArray:this.state.timetable})})]})})})})}}]),n}(m.Component);t.default=N},18685:function(){},20067:function(){},55382:function(){},72095:function(){},72061:function(){},61219:function(){}},function(e){e.O(0,[4885,2599,3524,4849,5844,9676,7612,5543,9667,9697,2328,4005,9015,1641,6737,9521,9690,9092,3147,4790,9774,2888,179],(function(){return t=95965,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.