diff --git a/asset-manifest.json b/asset-manifest.json
index ad46eda..a92aaf8 100644
--- a/asset-manifest.json
+++ b/asset-manifest.json
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "/CS311S20PID08/static/css/main.7f40d95c.chunk.css",
- "main.js": "/CS311S20PID08/static/js/main.9cb34831.chunk.js",
- "main.js.map": "/CS311S20PID08/static/js/main.9cb34831.chunk.js.map",
+ "main.js": "/CS311S20PID08/static/js/main.e50115e3.chunk.js",
+ "main.js.map": "/CS311S20PID08/static/js/main.e50115e3.chunk.js.map",
"runtime-main.js": "/CS311S20PID08/static/js/runtime-main.e176d59b.js",
"runtime-main.js.map": "/CS311S20PID08/static/js/runtime-main.e176d59b.js.map",
"static/css/2.3c03f26f.chunk.css": "/CS311S20PID08/static/css/2.3c03f26f.chunk.css",
"static/js/2.16d0b8c0.chunk.js": "/CS311S20PID08/static/js/2.16d0b8c0.chunk.js",
"static/js/2.16d0b8c0.chunk.js.map": "/CS311S20PID08/static/js/2.16d0b8c0.chunk.js.map",
"index.html": "/CS311S20PID08/index.html",
- "precache-manifest.c70676f876d100c86c822815eb5aad89.js": "/CS311S20PID08/precache-manifest.c70676f876d100c86c822815eb5aad89.js",
+ "precache-manifest.6e56fceddf970a2b98a0d612d46cd9fa.js": "/CS311S20PID08/precache-manifest.6e56fceddf970a2b98a0d612d46cd9fa.js",
"service-worker.js": "/CS311S20PID08/service-worker.js",
"static/css/2.3c03f26f.chunk.css.map": "/CS311S20PID08/static/css/2.3c03f26f.chunk.css.map",
"static/css/main.7f40d95c.chunk.css.map": "/CS311S20PID08/static/css/main.7f40d95c.chunk.css.map",
@@ -21,6 +21,6 @@
"static/css/2.3c03f26f.chunk.css",
"static/js/2.16d0b8c0.chunk.js",
"static/css/main.7f40d95c.chunk.css",
- "static/js/main.9cb34831.chunk.js"
+ "static/js/main.e50115e3.chunk.js"
]
}
\ No newline at end of file
diff --git a/index.html b/index.html
index faa0e58..9987104 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-
Activity Scheduler You need to enable JavaScript to run this app.
\ No newline at end of file
+Activity Scheduler You need to enable JavaScript to run this app.
\ No newline at end of file
diff --git a/precache-manifest.c70676f876d100c86c822815eb5aad89.js b/precache-manifest.6e56fceddf970a2b98a0d612d46cd9fa.js
similarity index 80%
rename from precache-manifest.c70676f876d100c86c822815eb5aad89.js
rename to precache-manifest.6e56fceddf970a2b98a0d612d46cd9fa.js
index 3aee2a4..17ce582 100644
--- a/precache-manifest.c70676f876d100c86c822815eb5aad89.js
+++ b/precache-manifest.6e56fceddf970a2b98a0d612d46cd9fa.js
@@ -1,6 +1,6 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
- "revision": "bde285e3d03651b187945c0626075521",
+ "revision": "b51e0a066115e722eed5808760929ed6",
"url": "/CS311S20PID08/index.html"
},
{
@@ -8,7 +8,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/CS311S20PID08/static/css/2.3c03f26f.chunk.css"
},
{
- "revision": "b352457c2add34202a9a",
+ "revision": "c96f548a2cffad01b120",
"url": "/CS311S20PID08/static/css/main.7f40d95c.chunk.css"
},
{
@@ -20,8 +20,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/CS311S20PID08/static/js/2.16d0b8c0.chunk.js.LICENSE.txt"
},
{
- "revision": "b352457c2add34202a9a",
- "url": "/CS311S20PID08/static/js/main.9cb34831.chunk.js"
+ "revision": "c96f548a2cffad01b120",
+ "url": "/CS311S20PID08/static/js/main.e50115e3.chunk.js"
},
{
"revision": "7278be927bf4602f11ec",
diff --git a/service-worker.js b/service-worker.js
index 3ec5853..4370762 100644
--- a/service-worker.js
+++ b/service-worker.js
@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
- "/CS311S20PID08/precache-manifest.c70676f876d100c86c822815eb5aad89.js"
+ "/CS311S20PID08/precache-manifest.6e56fceddf970a2b98a0d612d46cd9fa.js"
);
self.addEventListener('message', (event) => {
diff --git a/static/js/main.9cb34831.chunk.js.map b/static/js/main.9cb34831.chunk.js.map
deleted file mode 100644
index af3a03d..0000000
--- a/static/js/main.9cb34831.chunk.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["components/Logo/activity.png","components/Logo/Logo.js","components/Home/Appbar.js","constants/docs.js","components/Home/InputCards/subjectInput.js","components/Home/InputCards/sectionInput.js","components/Home/InputCards/teacherInput.js","components/Home/Tables/subjectTable.js","components/Home/Tables/sectionTable.js","components/Home/Tables/teacherTable.js","components/Home/lectures/lectureInput.js","components/Home/lectures/lectureTable.js","components/Home/InputCards/workingtimeInput.js","components/Home/Tables/workingtimeTable.js","components/Home/timetable.js","components/Home/home.js","components/App.js","serviceWorker.js","index.js"],"names":["module","exports","useStyle","makeStyles","theme","root","display","justifyContent","breakpoints","up","margin","marginTop","Tilt","background","borderRadius","boxShadow","down","alignItems","width","Logo","classes","className","options","max","style","height","src","activity","paddingTop","alt","useStyles","grow","flexGrow","title","sectionDesktop","sectionMobile","PrimaryAppBar","React","useState","mobileMoreAnchorEl","setMobileMoreAnchorEl","isMobileMenuOpen","Boolean","renderMobileMenu","Menu","anchorEl","anchorOrigin","vertical","horizontal","keepMounted","transformOrigin","open","onClose","MenuItem","IconButton","aria-label","aria-haspopup","color","firebase","auth","currentUser","displayName","onClick","signOut","AppBar","position","Toolbar","Typography","variant","noWrap","edge","console","log","event","currentTarget","docs","subjects","sections","teachers","lectures","workingTime","timeTable","minHeight","fontSize","textField","hrs","hours","button","SubjectInput","setSubjects","setTitle","code","setCode","contactHrs","setcontantHrs","creditHrs","setcreditHrs","titleError","setTitleError","codeError","setCodeError","contantHrsError","setcontantHrsError","creditHrsError","setcreditHrsError","setRequiredError","addButton","temp","findIndex","e","push","Card","TextField","onChange","target","value","required","id","label","error","helperText","type","select","InputLabelProps","shrink","map","option","key","onKeyDown","keyCode","Button","size","SectionInput","setSections","TeacherInput","setTeachers","name","setName","nameError","setNameError","createData","contantHrs","descendingComparator","a","b","orderBy","headCells","numeric","disablePadding","EnhancedTableHead","props","onSelectAllClick","order","numSelected","rowCount","onRequestSort","TableHead","TableRow","TableCell","padding","Checkbox","indeterminate","checked","inputProps","headCell","align","sortDirection","TableSortLabel","active","direction","property","visuallyHidden","useToolbarStyles","paddingLeft","spacing","paddingRight","highlight","palette","secondary","main","backgroundColor","lighten","light","text","primary","dark","flex","EnhancedTableToolbar","selected","setSelected","clsx","component","Tooltip","forEach","element","splice","paper","marginBottom","table","border","clip","overflow","top","SubjectTable","rows","subject","setOrder","setOrderBy","page","setPage","rowsPerPage","setRowsPerPage","emptyRows","Math","min","length","Paper","TableContainer","Table","aria-labelledby","newSelecteds","n","TableBody","array","comparator","stabilizedThis","el","index","sort","stableSort","getComparator","slice","row","isItemSelected","indexOf","labelId","hover","selectedIndex","newSelected","concat","handleClick","role","aria-checked","tabIndex","scope","colSpan","TablePagination","rowsPerPageOptions","count","onChangePage","newPage","onChangeRowsPerPage","parseInt","SectionTable","section","TeacherTable","teacher","minWidth","content","marginLeft","lectureArrangement","LectureInput","setLectures","setsubject","setsection","setteacher","lectureArr","setlectureArr","subjectError","setsubjectError","sectionError","setsectionError","teacherError","setteacherError","lecturearrError","setlecturearrError","subjectIndex","CardContent","textAlign","disabled","arrangement","lectureID","LectureTable","lecture","WorkingtimeInput","setworkingTime","day","setday","period","setperiod","dayError","setdayError","periodError","setperiodError","Object","entries","filter","WorkingtimeTable","time","lectureCount","StyledTableCell","withStyles","head","common","black","white","body","StyledTableRow","action","weekDays","Timetable","i","r","j","cardHolder","flexFlow","genButton","wrapper","buttonProgress","weekSchedule","MON","TUE","WED","THU","FRI","SAT","Home","userRef","firestore","collection","uid","loading","setloading","undefined","timetable","settimetable","updateDB","sub","docType","doc","set","then","catch","fetchTimetable","useCallback","db","FieldPath","documentId","onSnapshot","snapshot","empty","lecSec","snap","values","data","fetchRecords","get","snapShot","records","useEffect","card","requestOptions","method","headers","JSON","stringify","userID","fetch","response","json","CircularProgress","keys","sec","initializeApp","apiKey","authDomain","databaseURL","projectId","storageBucket","messagingSenderId","appId","particlesOptions","particles","number","density","enable","value_area","App","state","isSignedIn","uiConfig","signInFlow","signInOptions","GoogleAuthProvider","PROVIDER_ID","EmailAuthProvider","FacebookAuthProvider","callbacks","signInSuccessWithAuthResult","componentDidMount","onAuthStateChanged","user","setState","this","params","firebaseAuth","Component","window","location","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister","message"],"mappings":"qHAAAA,EAAOC,QAAU,IAA0B,sC,mUCKrCC,EAAWC,aAAW,SAACC,GAAD,MAAY,CACtCC,KAAK,aACHC,QAAS,OACTC,eAAgB,UACfH,EAAMI,YAAYC,GAAG,MAAQ,CAC5BC,OAAQ,OACRC,UAAW,IAGfC,KAAK,aACHC,WAAY,mDACZC,aAAc,SACdC,UAAW,wCACVX,EAAMI,YAAYQ,KAAK,MAAQ,CAC9BV,QAAS,OACTW,WAAY,SACZN,UAAW,MACXO,MAAO,cA0BEC,EArBF,WACX,IAAMC,EAAUlB,IAChB,OACE,yBAAKmB,UAAWD,EAAQf,MACtB,kBAAC,IAAD,CACEgB,UAAWD,EAAQR,KACnBU,QAAS,CAAEC,IAAK,IAChBC,MAAO,CAAEC,OAAQ,IAAKP,MAAO,MAE7B,yBAAKG,UAAU,kBACb,yBACEK,IAAKC,IACLH,MAAO,CAAEI,WAAY,OACrBC,IAAI,4B,gLC1BVC,EAAY3B,aAAW,SAACC,GAAD,MAAY,CACvC2B,KAAM,CACJC,SAAU,GAEZC,MAAO,CACL3B,QAAS,SAEX4B,eAAe,aACb5B,QAAS,QACRF,EAAMI,YAAYC,GAAG,MAAQ,CAC5BH,QAAS,SAGb6B,cAAc,aACZ7B,QAAS,QACRF,EAAMI,YAAYC,GAAG,MAAQ,CAC5BH,QAAS,aAKA,SAAS8B,IACtB,IAAMhB,EAAUU,IADsB,EAEcO,IAAMC,SAAS,MAF7B,mBAE/BC,EAF+B,KAEXC,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AmBC,WACrBA,UAAUC,cAAcC,MACrB5E,MAAK,SAAA6E,GACJA,EAAaC,gBAEd7E,OAAM,SAAA/N,GACLhD,QAAQgD,MAAMA,EAAM6S,c","file":"static/js/main.9cb34831.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/activity.f54fa458.png\";","import React from \"react\";\r\nimport Tilt from \"react-tilt\";\r\nimport activity from \"./activity.png\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nconst useStyle = makeStyles((theme) => ({\r\n root: {\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n [theme.breakpoints.up(\"sm\")]: {\r\n margin: \"2rem\",\r\n marginTop: 0,\r\n },\r\n },\r\n Tilt: {\r\n background: \"linear-gradient(89deg, #ff5edf 0%, #04c8de 100%)\",\r\n borderRadius: \".25rem\",\r\n boxShadow: \"0px 0px 8px 2px rgba( 0, 0, 0, 0.2 )\",\r\n [theme.breakpoints.down(\"xs\")]: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n marginTop: \"20%\",\r\n width: \"600px\",\r\n },\r\n },\r\n}));\r\n\r\nconst Logo = () => {\r\n const classes = useStyle();\r\n return (\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default Logo;\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport AppBar from \"@material-ui/core/AppBar\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport MenuItem from \"@material-ui/core/MenuItem\";\r\nimport Menu from \"@material-ui/core/Menu\";\r\nimport AccountCircle from \"@material-ui/icons/AccountCircle\";\r\nimport ExitToAppIcon from \"@material-ui/icons/ExitToApp\";\r\nimport MoreIcon from \"@material-ui/icons/MoreVert\";\r\nimport firebase from \"firebase\";\r\n\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n grow: {\r\n flexGrow: 1,\r\n },\r\n title: {\r\n display: \"block\",\r\n },\r\n sectionDesktop: {\r\n display: \"none\",\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"flex\",\r\n },\r\n },\r\n sectionMobile: {\r\n display: \"flex\",\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"none\",\r\n },\r\n },\r\n}));\r\n\r\nexport default function PrimaryAppBar() {\r\n const classes = useStyles();\r\n const [mobileMoreAnchorEl, setMobileMoreAnchorEl] = React.useState(null);\r\n\r\n const isMobileMenuOpen = Boolean(mobileMoreAnchorEl);\r\n\r\n const handleMobileMenuClose = () => {\r\n setMobileMoreAnchorEl(null);\r\n };\r\n\r\n const handleMobileMenuOpen = (event) => {\r\n setMobileMoreAnchorEl(event.currentTarget);\r\n };\r\n\r\n const renderMobileMenu = (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {firebase.auth().currentUser\r\n ? firebase.auth().currentUser.displayName\r\n : \"Ehmad\"}\r\n
\r\n \r\n {\r\n firebase.auth().signOut();\r\n }}\r\n >\r\n \r\n \r\n \r\n Sign Out
\r\n \r\n \r\n );\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n Activity Scheduler\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n {firebase.auth().currentUser\r\n ? firebase.auth().currentUser.displayName\r\n : \"Ehmad\"}\r\n
\r\n \r\n
{\r\n firebase.auth().signOut();\r\n console.log(\"signout\");\r\n }}\r\n color=\"inherit\"\r\n >\r\n \r\n Sign Out
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n {renderMobileMenu}\r\n
\r\n );\r\n}\r\n","const docs = {\r\n subjects: \"subjects\",\r\n sections: \"sections\",\r\n teachers: \"teachers\",\r\n lectures: \"lectures\",\r\n workingTime: \"workingTime\",\r\n timeTable: \"timeTable\",\r\n};\r\n\r\nexport default docs;\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n TextField,\r\n Card,\r\n Button,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // minWidth: 275,\r\n margin: 10,\r\n borderRadius: 20,\r\n minHeight: 360,\r\n },\r\n title: {\r\n fontSize: 14,\r\n },\r\n textField: {\r\n margin: 5,\r\n },\r\n hrs: {\r\n margin: \"5% 10%\",\r\n },\r\n hours: {\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n alignItems: \"baseline\",\r\n },\r\n button: {},\r\n}));\r\n\r\nexport default function SubjectInput({ subjects, setSubjects }) {\r\n const classes = useStyles();\r\n\r\n const [title, setTitle] = React.useState(\"\");\r\n const [code, setCode] = React.useState(\"\");\r\n const [contactHrs, setcontantHrs] = React.useState(\"\");\r\n const [creditHrs, setcreditHrs] = React.useState(\"\");\r\n\r\n const [titleError, setTitleError] = React.useState(\"\");\r\n const [codeError, setCodeError] = React.useState(\"\");\r\n const [contantHrsError, setcontantHrsError] = React.useState(\"\");\r\n const [creditHrsError, setcreditHrsError] = React.useState(\"\");\r\n\r\n const titleChange = (event) => {\r\n setTitle(event.target.value);\r\n };\r\n const codeChange = (event) => {\r\n setCode(event.target.value);\r\n };\r\n const contacthrsChange = (event) => {\r\n setcontantHrs(event.target.value);\r\n };\r\n const creditrsChange = (event) => {\r\n setcreditHrs(event.target.value);\r\n };\r\n const setRequiredError = () => {\r\n !title ? setTitleError(\"Required\") : setTitleError(\"\");\r\n !code ? setCodeError(\"Required\") : setCodeError(\"\");\r\n !contactHrs ? setcontantHrsError(\"Required\") : setcontantHrsError(\"\");\r\n !creditHrs ? setcreditHrsError(\"Required\") : setcreditHrsError(\"\");\r\n };\r\n const setEmptyTextfields = () => {\r\n setTitle(\"\");\r\n setCode(\"\");\r\n setcontantHrs(\"\");\r\n setcreditHrs(\"\");\r\n\r\n setTitleError(\"\");\r\n setCodeError(\"\");\r\n setcontantHrsError(\"\");\r\n setcreditHrsError(\"\");\r\n };\r\n const addButton = () => {\r\n let temp = [...subjects];\r\n if (title && code && contactHrs && creditHrs) {\r\n if (creditHrs <= contactHrs) {\r\n if (temp) {\r\n if (temp.findIndex((e) => e[1] === code) === -1)\r\n temp.push([title, code, contactHrs, creditHrs]);\r\n else {\r\n setRequiredError();\r\n setCodeError(\"Subject already exists\");\r\n return;\r\n }\r\n } else temp = [[title, code, contactHrs, creditHrs]];\r\n setSubjects(temp, docs.subjects);\r\n setEmptyTextfields();\r\n } else {\r\n setcreditHrsError(\"Credits hrs must !> contact hrs\");\r\n }\r\n } else {\r\n setRequiredError();\r\n }\r\n };\r\n return (\r\n \r\n Add Subject \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n {[1, 2, 3].map((option) => (\r\n \r\n {option}\r\n \r\n ))}\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {[1, 2, 3].map((option) => (\r\n \r\n {option}\r\n \r\n ))}\r\n \r\n
\r\n \r\n + Add Subject\r\n \r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport { TextField, Card, Button } from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // minWidth: 275,\r\n borderRadius: 20,\r\n margin: 10,\r\n minHeight: 360,\r\n display: 'grid',\r\n },\r\n title: {\r\n fontSize: 14,\r\n },\r\n textField: {\r\n margin: 5,\r\n },\r\n\r\n button: {\r\n },\r\n}));\r\n\r\nexport default function SectionInput({ sections, setSections }) {\r\n const classes = useStyles();\r\n\r\n const [title, setTitle] = React.useState(\"\");\r\n const [code, setCode] = React.useState(\"\");\r\n\r\n const [titleError, setTitleError] = React.useState(\"\");\r\n const [codeError, setCodeError] = React.useState(\"\");\r\n\r\n const titleChange = (event) => {\r\n setTitle(event.target.value);\r\n };\r\n const codeChange = (event) => {\r\n setCode(event.target.value);\r\n };\r\n\r\n const setRequiredError = () => {\r\n !title ? setTitleError(\"Required\") : setTitleError(\"\");\r\n !code ? setCodeError(\"Required\") : setCodeError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setTitle(\"\");\r\n setCode(\"\");\r\n\r\n setTitleError(\"\");\r\n setCodeError(\"\");\r\n };\r\n const addButton = () => {\r\n let temp = [...sections];\r\n if (title && code) {\r\n if (temp) {\r\n if (temp.findIndex((e) => e[1] === code) === -1)\r\n temp.push([title, code]);\r\n else {\r\n setRequiredError();\r\n setCodeError(\"Subject already exists\");\r\n return;\r\n }\r\n } else temp = [[title, code]];\r\n\r\n setSections(temp, docs.sections);\r\n setEmptyTextfields();\r\n } else {\r\n setRequiredError();\r\n }\r\n };\r\n return (\r\n \r\n Add Section \r\n \r\n \r\n
\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n />\r\n
\r\n \r\n \r\n + Add Section\r\n \r\n
\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport { TextField, Card, Button } from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // minWidth: 275,\r\n borderRadius: 20,\r\n margin: 10,\r\n minHeight: 360,\r\n display: \"grid\",\r\n },\r\n textField: {\r\n margin: 5,\r\n },\r\n button: {},\r\n}));\r\n\r\nexport default function TeacherInput({ teachers, setTeachers }) {\r\n const classes = useStyles();\r\n\r\n const [name, setName] = React.useState(\"\");\r\n const [code, setCode] = React.useState(\"\");\r\n\r\n const [nameError, setNameError] = React.useState(\"\");\r\n const [codeError, setCodeError] = React.useState(\"\");\r\n\r\n const nameChange = (event) => {\r\n setName(event.target.value);\r\n };\r\n const codeChange = (event) => {\r\n setCode(event.target.value);\r\n };\r\n\r\n const setRequiredError = () => {\r\n !name ? setNameError(\"Required\") : setNameError(\"\");\r\n !code ? setCodeError(\"Required\") : setCodeError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setName(\"\");\r\n setCode(\"\");\r\n\r\n setNameError(\"\");\r\n setCodeError(\"\");\r\n };\r\n const addButton = () => {\r\n let temp = [...teachers];\r\n if (name && code) {\r\n if (temp) {\r\n if (temp.findIndex((e) => e[1] === code) === -1)\r\n temp.push([name, code]);\r\n else {\r\n setRequiredError();\r\n setCodeError(\"Subject already exists\");\r\n return;\r\n }\r\n } else temp = [[name, code]];\r\n\r\n setTeachers(temp, docs.teachers);\r\n setEmptyTextfields();\r\n } else {\r\n setRequiredError();\r\n }\r\n };\r\n\r\n return (\r\n \r\n Add Teacher \r\n \r\n \r\n
\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n />\r\n
\r\n \r\n \r\n + Add Teacher\r\n \r\n
\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(name, code, contantHrs) {\r\n return { name, code, contantHrs };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"name\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Title\",\r\n },\r\n { id: \"code\", numeric: true, disablePadding: false, label: \"Code\" },\r\n {\r\n id: \"contantHrs\",\r\n numeric: true,\r\n disablePadding: false,\r\n label: \"Contact Hrs\",\r\n },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, subjects, setSubjects } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...subjects];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[1] === element);\r\n temp.splice(target, 1);\r\n });\r\n\r\n setSubjects(temp, docs.subjects);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Subject Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n subjects: PropTypes.array,\r\n setSubjects: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Subject Table Export\r\n\r\nexport default function SubjectTable({ subjects, setSubjects }) {\r\n const rows = subjects\r\n ? subjects.map((subject) => createData(subject[0], subject[1], subject[2]))\r\n : createData(\"\", \"\", \"\");\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"code\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.code);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, code) => {\r\n const selectedIndex = selected.indexOf(code);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, code);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (name) => selected.indexOf(name) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.code);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.code)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.code ? row.code : \"rowCode\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.name}\r\n \r\n \r\n {row.code}\r\n \r\n {row.contantHrs} \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(name, code) {\r\n return { name, code };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"name\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Title\",\r\n },\r\n { id: \"code\", numeric: true, disablePadding: false, label: \"Code\" },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, sections, setSections } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...sections];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[1] === element);\r\n temp.splice(target, 1);\r\n });\r\n setSections(temp, docs.sections);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Section Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n sections: PropTypes.array,\r\n setSections: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Section Table Export Function\r\nexport default function SectionTable({ sections, setSections }) {\r\n const rows = sections\r\n ? sections.map((section) => createData(section[0], section[1]))\r\n : [createData(\"\", \"\")];\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"code\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.code);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, code) => {\r\n const selectedIndex = selected.indexOf(code);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, code);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (name) => selected.indexOf(name) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.code);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.code)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.code ? row.code : \"rowCode\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.name}\r\n \r\n \r\n {row.code}\r\n \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(name, code) {\r\n return { name, code };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"name\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Name\",\r\n },\r\n { id: \"code\", numeric: true, disablePadding: false, label: \"Code\" },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, teachers, setTeachers } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...teachers];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[1] === element);\r\n temp.splice(target, 1);\r\n });\r\n setTeachers(temp, docs.teachers);\r\n setSelected([]);\r\n };\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Teacher Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n teachers: PropTypes.array,\r\n setTeachers: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\nexport default function TeacherTable({ teachers, setTeachers }) {\r\n const rows = teachers\r\n ? teachers.map((teacher) => createData(teacher[0], teacher[1]))\r\n : [createData(\"\", \"\")];\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"code\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.code);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, code) => {\r\n const selectedIndex = selected.indexOf(code);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, code);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (name) => selected.indexOf(name) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.code);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.code)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.code ? row.code : \"rowCode\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.name}\r\n \r\n \r\n {row.code}\r\n \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n TextField,\r\n Card,\r\n CardContent,\r\n Button,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n minWidth: 275,\r\n margin: 10,\r\n borderRadius: 20,\r\n },\r\n content: {\r\n [theme.breakpoints.down(\"sm\")]: {\r\n padding: \"5% 10%\",\r\n },\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"flex\",\r\n justifyContent: \"space-around\",\r\n },\r\n },\r\n textField: {\r\n margin: 5,\r\n minWidth: 200,\r\n },\r\n button: {\r\n [theme.breakpoints.up(\"sm\")]: {\r\n marginLeft: \"5%\",\r\n },\r\n },\r\n}));\r\n\r\nconst lectureArrangement = [[\"1\"], [\"1 - 1\", \"2\"], [\"1 - 1 - 1\", \"2 - 1\", \"3\"]];\r\nexport default function LectureInput({\r\n lectures,\r\n setLectures,\r\n subjects,\r\n sections,\r\n teachers,\r\n}) {\r\n const classes = useStyles();\r\n const [subject, setsubject] = useState(\"\");\r\n const [section, setsection] = useState(\"\");\r\n const [teacher, setteacher] = useState(\"\");\r\n const [lectureArr, setlectureArr] = useState(\"\");\r\n\r\n const [subjectError, setsubjectError] = useState(\"\");\r\n const [sectionError, setsectionError] = useState(\"\");\r\n const [teacherError, setteacherError] = useState(\"\");\r\n const [lecturearrError, setlecturearrError] = useState(\"\");\r\n\r\n const subjectChange = (event) => {\r\n setlectureArr(\"\");\r\n setsubject(event.target.value);\r\n };\r\n\r\n const sectionChange = (event) => {\r\n setsection(event.target.value);\r\n };\r\n\r\n const teacherChange = (event) => {\r\n setteacher(event.target.value);\r\n };\r\n\r\n const lecturesChange = (event) => {\r\n setlectureArr(event.target.value);\r\n };\r\n\r\n const setRequiredError = () => {\r\n !subject ? setsubjectError(\"Required\") : setsubjectError(\"\");\r\n !teacher ? setteacherError(\"Required\") : setteacherError(\"\");\r\n !section ? setsectionError(\"Required\") : setsectionError(\"\");\r\n !lectureArr ? setlecturearrError(\"Required\") : setlecturearrError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setlectureArr(\"\");\r\n setsubject(\"\");\r\n setteacher(\"\");\r\n setsection(\"\");\r\n\r\n setsubjectError(\"\");\r\n setteacherError(\"\");\r\n setsectionError(\"\");\r\n setlecturearrError(\"\");\r\n };\r\n\r\n const addButton = () => {\r\n if (subject && teacher && section && lectureArr) {\r\n let temp = [...lectures];\r\n \r\n if (lectures) {\r\n if (\r\n temp.findIndex(\r\n (e) =>\r\n e[4] === teacher + section ||\r\n (e[1] === section && e[2] === subject)\r\n ) === -1\r\n )\r\n temp.push([teacher, section, subject, lectureArr, teacher + section]);\r\n else {\r\n setRequiredError();\r\n setteacherError(\"Lecture already exists\");\r\n setsubjectError(\"Lecture already exists\");\r\n setsectionError(\"Lecture already exists\");\r\n return;\r\n }\r\n } else\r\n temp = [[teacher, section, subject, lectureArr, teacher + section]];\r\n\r\n setLectures(temp, docs.lectures);\r\n setEmptyTextfields();\r\n } else setRequiredError();\r\n };\r\n\r\n const selectedIndex = (array, element, index) =>\r\n array[array.findIndex((e) => e[index] === element)];\r\n\r\n const subjectIndex = selectedIndex(subjects, subject, 1);\r\n\r\n return (\r\n \r\n \r\n Add Lectures \r\n \r\n \r\n {teachers.map((option) => (\r\n \r\n {option[0]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n \r\n {sections.map((option) => (\r\n \r\n {option[1]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n \r\n {subjects.map((option) => (\r\n \r\n {option[1]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {subject && subjectIndex ? (\r\n lectureArrangement[subjectIndex[2] - 1].map((option) => (\r\n \r\n {option}\r\n \r\n ))\r\n ) : (\r\n \r\n )}\r\n \r\n
\r\n\r\n \r\n + Add Lecture\r\n \r\n \r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(teacher, section, subject, arrangement, lectureID) {\r\n return { teacher, section, subject, arrangement, lectureID };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"teacher\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Teacher\",\r\n },\r\n { id: \"section\", numeric: true, disablePadding: false, label: \"Section\" },\r\n {\r\n id: \"subject\",\r\n numeric: true,\r\n disablePadding: false,\r\n label: \"Subject\",\r\n },\r\n // {\r\n // id: \"arrangement\",\r\n // numeric: true,\r\n // disablePadding: false,\r\n // label: \"Arrangement\",\r\n // },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, lectures, setLectures } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...lectures];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[4] === element);\r\n temp.splice(target, 1);\r\n });\r\n\r\n setLectures(temp, docs.lectures);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Lecture Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n lectures: PropTypes.array,\r\n setLectures: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Lecture Table Export\r\nexport default function LectureTable({ lectures, setLectures }) {\r\n const rows = lectures\r\n ? lectures.map((lecture) =>\r\n createData(lecture[0], lecture[1], lecture[2], lecture[3], lecture[4])\r\n )\r\n : [createData(\"\", \"\", \"\", \"\", \"\")];\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"lectureID\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.lectureID);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, lectureID) => {\r\n const selectedIndex = selected.indexOf(lectureID);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, lectureID);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (element) => selected.indexOf(element) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.lectureID);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.lectureID)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.lectureID ? row.lectureID : \"rowlectureID\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.teacher}\r\n \r\n \r\n {row.section}\r\n \r\n {row.subject} \r\n {/* {row.arrangement} */}\r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n TextField,\r\n Card,\r\n CardContent,\r\n Button,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n minWidth: 275,\r\n margin: 10,\r\n borderRadius: 20,\r\n },\r\n content: {\r\n [theme.breakpoints.down(\"sm\")]: {\r\n padding: \"5% 10%\",\r\n },\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n },\r\n },\r\n textField: {\r\n margin: 5,\r\n minWidth: 200,\r\n [theme.breakpoints.up(\"md\")]: {\r\n minWidth: 150,\r\n },\r\n },\r\n button: {\r\n [theme.breakpoints.up(\"sm\")]: {\r\n marginLeft: \"5%\",\r\n },\r\n },\r\n}));\r\n\r\nexport default function WorkingtimeInput({\r\n workingTime,\r\n setworkingTime,\r\n sections,\r\n}) {\r\n const classes = useStyles();\r\n\r\n const [day, setday] = useState(\"\");\r\n const [period, setperiod] = useState(\"\");\r\n // const [room, setroom] = useState(sections.length);\r\n\r\n const [dayError, setdayError] = useState(\"\");\r\n const [periodError, setperiodError] = useState(\"\");\r\n\r\n const dayChange = (event) => {\r\n setday(event.target.value);\r\n };\r\n\r\n const periodChange = (event) => {\r\n setperiod(event.target.value);\r\n };\r\n // const roomChange = (event) => {\r\n // setroom(event.target.value);\r\n // };\r\n\r\n const setRequiredError = () => {\r\n !day ? setdayError(\"Required\") : setdayError(\"\");\r\n !period ? setperiodError(\"Required\") : setperiodError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setday(\"\");\r\n setperiod(\"\");\r\n\r\n setdayError(\"\");\r\n setperiodError(\"\");\r\n };\r\n\r\n const addButton = () => {\r\n if (day && period) {\r\n let temp = { ...workingTime };\r\n temp[day] = period;\r\n // temp = temp.filter((value) => value !== day);\r\n setworkingTime(temp, docs.workingTime);\r\n\r\n setEmptyTextfields();\r\n } else setRequiredError();\r\n };\r\n\r\n return (\r\n \r\n \r\n Working Days & Periods \r\n\r\n \r\n \r\n {Object.entries(workingTime)\r\n .filter((e) => e[1] === 0)\r\n .map((option) => (\r\n \r\n {option[0]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {[1, 2, 3, 4, 5, 6, 7].map((option) => (\r\n \r\n {option}\r\n \r\n ))}\r\n \r\n
\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {\r\n \r\n {sections.length}\r\n \r\n }\r\n \r\n
\r\n \r\n +Add\r\n \r\n \r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(day, lectureCount) {\r\n return { day, lectureCount };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"day\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Day\",\r\n },\r\n {\r\n id: \"lectureCount\",\r\n numeric: true,\r\n disablePadding: false,\r\n label: \"Lectures\",\r\n },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const {\r\n numSelected,\r\n selected,\r\n setSelected,\r\n workingTime,\r\n setworkingTime,\r\n } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = { ...workingTime };\r\n console.log(selected);\r\n selected.forEach((element) => {\r\n temp[element] = 0;\r\n });\r\n setworkingTime(temp, docs.workingTime);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Working Days\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n workingTime: PropTypes.object,\r\n setworkingTime: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Section Table Export Function\r\nexport default function WorkingtimeTable({ workingTime, setworkingTime }) {\r\n const rows = Object.entries(workingTime)\r\n .filter((e) => e[1] !== 0)\r\n .map((time) => createData(time[0], time[1]));\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"lectureCount\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.day);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, element) => {\r\n const selectedIndex = selected.indexOf(element);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, element);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (element) => selected.indexOf(element) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.day);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.day)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.day ? row.day : \"rowDay\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.day}\r\n \r\n \r\n {row.lectureCount}\r\n \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { withStyles, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\n\r\nconst StyledTableCell = withStyles((theme) => ({\r\n head: {\r\n backgroundColor: theme.palette.common.black,\r\n color: theme.palette.common.white,\r\n },\r\n body: {\r\n fontSize: 14,\r\n },\r\n}))(TableCell);\r\n\r\nconst StyledTableRow = withStyles((theme) => ({\r\n root: {\r\n \"&:nth-of-type(odd)\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n },\r\n}))(TableRow);\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n margin: theme.spacing(2),\r\n },\r\n table: {\r\n minWidth: 360,\r\n },\r\n}));\r\n\r\nconst weekDays = [\"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"];\r\n\r\nexport default function Timetable({ timeTable, section }) {\r\n const classes = useStyles();\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n Section {section}\r\n \r\n {timeTable ? (\r\n timeTable[0].map((day, i) => (\r\n \r\n Lecture {i + 1}\r\n \r\n ))\r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n {timeTable.map((row, i) => (\r\n \r\n \r\n {weekDays[i]}\r\n \r\n {row.map((r, j) => (\r\n \r\n {r ? r : \"FREE\"}\r\n \r\n ))}\r\n \r\n ))}\r\n \r\n
\r\n \r\n );\r\n}\r\n","import React, { useState, useCallback } from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport PrimaryAppBar from './Appbar';\r\nimport SubjectInput from './InputCards/subjectInput';\r\nimport SectionInput from './InputCards/sectionInput';\r\nimport TeacherInput from './InputCards/teacherInput';\r\nimport SubjectTable from './Tables/subjectTable';\r\nimport SectionTable from './Tables/sectionTable';\r\nimport TeacherTable from './Tables/teacherTable';\r\nimport LectureInput from './lectures/lectureInput';\r\nimport LectureTable from './lectures/lectureTable';\r\nimport WorkingtimeInput from './InputCards/workingtimeInput';\r\nimport WorkingtimeTable from './Tables/workingtimeTable';\r\nimport Timetable from './timetable';\r\nimport { Button, CircularProgress } from '@material-ui/core';\r\nimport './home.css';\r\nimport docs from '../../constants/docs';\r\nimport firebase from 'firebase';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n cardHolder: {\r\n display: 'flex',\r\n flexFlow: 'row wrap',\r\n justifyContent: 'space-evenly',\r\n marginTop: 10,\r\n },\r\n lectures: {\r\n width: '100%',\r\n margin: '0% 5%',\r\n },\r\n genButton: {\r\n marginBottom: 25,\r\n },\r\n wrapper: {\r\n position: 'relative',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n },\r\n buttonProgress: {\r\n position: 'absolute',\r\n top: '3%',\r\n },\r\n}));\r\n\r\nconst weekSchedule = { MON: 0, TUE: 0, WED: 0, THU: 0, FRI: 0, SAT: 0 };\r\n\r\nconst Home = () => {\r\n const db = firebase.firestore();\r\n const userRef = db.collection(firebase.auth().currentUser.uid);\r\n const classes = useStyles();\r\n\r\n const [subjects, setSubjects] = useState([]);\r\n const [sections, setSections] = useState([]);\r\n const [teachers, setTeachers] = useState([]);\r\n const [lectures, setLectures] = useState([]);\r\n const [workingTime, setworkingTime] = useState(weekSchedule);\r\n const [loading, setloading] = useState(false);\r\n const [timetable, settimetable] = useState(undefined);\r\n\r\n const updateDB = (sub, docType) => {\r\n switch (docType) {\r\n case 'subjects':\r\n setSubjects(sub);\r\n break;\r\n case 'sections':\r\n setSections(sub);\r\n break;\r\n case 'teachers':\r\n setTeachers(sub);\r\n break;\r\n case 'lectures':\r\n setLectures(sub);\r\n break;\r\n case 'workingTime':\r\n setworkingTime(sub);\r\n break;\r\n default:\r\n console.error('Wrong Document');\r\n }\r\n userRef\r\n .doc(docType)\r\n .set(docType === docs.workingTime ? sub : { ...Object(sub) })\r\n .then((e) => console.log('saved'))\r\n .catch((e) => console.error('error', e));\r\n };\r\n\r\n const fetchTimetable = useCallback(async () => {\r\n const db = firebase.firestore();\r\n const userRef = db.collection(firebase.auth().currentUser.uid);\r\n\r\n const temp = {};\r\n\r\n await userRef\r\n .doc(docs.timeTable)\r\n .collection(docs.timeTable)\r\n .orderBy(firebase.firestore.FieldPath.documentId())\r\n .onSnapshot((snapshot) => {\r\n if (!snapshot.empty) {\r\n const lecSec = [];\r\n snapshot.forEach((snap) => {\r\n temp[snap.id] = Object.values(snap.data());\r\n lecSec.push(snap.id);\r\n });\r\n settimetable(temp);\r\n }\r\n });\r\n }, []);\r\n\r\n const fetchRecords = useCallback(async () => {\r\n const db = firebase.firestore();\r\n const userRef = db.collection(firebase.auth().currentUser.uid);\r\n userRef\r\n .get()\r\n .then((snapShot) => {\r\n snapShot.forEach((doc) => {\r\n const records =\r\n doc.id === docs.workingTime\r\n ? doc.data()\r\n : Object.values(doc.data());\r\n switch (doc.id) {\r\n case docs.subjects:\r\n setSubjects(records);\r\n break;\r\n case docs.sections:\r\n setSections(records);\r\n break;\r\n case docs.teachers:\r\n setTeachers(records);\r\n break;\r\n case docs.lectures:\r\n setLectures(records);\r\n break;\r\n case docs.workingTime:\r\n setworkingTime(records);\r\n break;\r\n\r\n default:\r\n console.error('Wrong Document');\r\n }\r\n });\r\n })\r\n .catch((e) => console.log('err', e));\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n fetchRecords();\r\n fetchTimetable();\r\n }, [fetchRecords, fetchTimetable]);\r\n\r\n const generateButton = () => {\r\n const requestOptions = {\r\n method: 'POST',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify({ userID: firebase.auth().currentUser.uid }),\r\n };\r\n setloading(true);\r\n fetch('http://localhost:3001/generate', requestOptions)\r\n .then((response) => response.json())\r\n .then(async () => {\r\n fetchTimetable();\r\n setloading(false);\r\n })\r\n .catch((e) => {\r\n console.log(e);\r\n setloading(false);\r\n });\r\n };\r\n // console.log(subjects);\r\n // console.log(sections);\r\n // console.log(teachers);\r\n // console.log(lectures);\r\n // console.log(workingTime);\r\n console.log(timetable);\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n Generate Timetable\r\n \r\n {loading && (\r\n \r\n )}\r\n
\r\n
\r\n {timetable ? (\r\n Object.keys(timetable).map((sec, i) => (\r\n
\r\n ))\r\n ) : (\r\n
\r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Home;\r\n","import React, { Component } from \"react\";\nimport \"./App.css\";\nimport StyledFirebaseAuth from \"react-firebaseui/StyledFirebaseAuth\";\nimport firebase from \"firebase\";\nimport Logo from \"./Logo/Logo\";\nimport Particles from \"react-particles-js\";\nimport \"tachyons\";\nimport Home from \"./Home/home\";\n\nfirebase.initializeApp({\n apiKey: \"AIzaSyBwPBLFoMMqwyUJcJewqLip4guij7CNjZg\",\n authDomain: \"activity-scheduling-d6be4.firebaseapp.com\",\n databaseURL: \"https://activity-scheduling-d6be4.firebaseio.com\",\n projectId: \"activity-scheduling-d6be4\",\n storageBucket: \"activity-scheduling-d6be4.appspot.com\",\n messagingSenderId: \"1050964579186\",\n appId: \"1:1050964579186:web:85db424e474670098b03eb\",\n});\n\nconst particlesOptions = {\n particles: {\n number: {\n value: 100,\n density: {\n enable: true,\n value_area: 700,\n },\n },\n },\n};\n\nclass App extends Component {\n state = { isSignedIn: false };\n uiConfig = {\n signInFlow: \"popup\",\n signInOptions: [\n firebase.auth.GoogleAuthProvider.PROVIDER_ID,\n firebase.auth.EmailAuthProvider.PROVIDER_ID,\n firebase.auth.FacebookAuthProvider.PROVIDER_ID,\n ],\n callbacks: {\n signInSuccessWithAuthResult: () => false,\n },\n };\n\n componentDidMount = () => {\n firebase.auth().onAuthStateChanged((user) => {\n this.setState({ isSignedIn: !!user });\n });\n };\n\n render() {\n return (\n \n {this.state.isSignedIn ? (\n
\n ) : (\n
\n )}\n
\n );\n }\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./index.css\";\nimport App from \"./components/App\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nReactDOM.render( , document.getElementById(\"root\"));\n\nserviceWorker.unregister();\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/static/js/main.9cb34831.chunk.js b/static/js/main.e50115e3.chunk.js
similarity index 81%
rename from static/js/main.9cb34831.chunk.js
rename to static/js/main.e50115e3.chunk.js
index a3125ba..6c7e410 100644
--- a/static/js/main.9cb34831.chunk.js
+++ b/static/js/main.e50115e3.chunk.js
@@ -1,2 +1,2 @@
-(this["webpackJsonpactivity-scheduling"]=this["webpackJsonpactivity-scheduling"]||[]).push([[0],{160:function(e,t,a){e.exports=a.p+"static/media/activity.f54fa458.png"},183:function(e,t,a){e.exports=a(424)},188:function(e,t,a){},189:function(e,t,a){},423:function(e,t,a){},424:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),c=a(16),l=a.n(c),i=(a(188),a(155)),o=a(156),s=a(170),u=a(169),d=(a(189),a(157)),m=a.n(d),b=a(20),p=a.n(b),g=a(18),h=a(159),f=a.n(h),E=a(160),v=a.n(E),j=a(451),k=Object(j.a)((function(e){return{root:Object(g.a)({display:"flex",justifyContent:"center"},e.breakpoints.up("sm"),{margin:"2rem",marginTop:0}),Tilt:Object(g.a)({background:"linear-gradient(89deg, #ff5edf 0%, #04c8de 100%)",borderRadius:".25rem",boxShadow:"0px 0px 8px 2px rgba( 0, 0, 0, 0.2 )"},e.breakpoints.down("xs"),{display:"flex",alignItems:"center",marginTop:"20%",width:"600px"})}})),y=function(){var e=k();return r.a.createElement("div",{className:e.root},r.a.createElement(f.a,{className:e.Tilt,options:{max:25},style:{height:400,width:600}},r.a.createElement("div",{className:"Tilt-inner pa3"},r.a.createElement("img",{src:v.a,style:{paddingTop:"5px"},alt:"activity scheduling"}))))},O=a(164),S=a.n(O),C=(a(420),a(29)),x=a.n(C),w=a(104),N=a(63),P=a(8),T=a(457),I=a(458),R=a(456),D=a(459),q=a(477),L=a(168),A=a(117),F=a.n(A),B=a(118),H=a.n(B),z=a(166),U=a.n(z),W=Object(j.a)((function(e){return{grow:{flexGrow:1},title:{display:"block"},sectionDesktop:Object(g.a)({display:"none"},e.breakpoints.up("md"),{display:"flex"}),sectionMobile:Object(g.a)({display:"flex"},e.breakpoints.up("md"),{display:"none"})}}));function M(){var e=W(),t=r.a.useState(null),a=Object(P.a)(t,2),n=a[0],c=a[1],l=Boolean(n),i=r.a.createElement(L.a,{anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:l,onClose:function(){c(null)}},r.a.createElement(q.a,null,r.a.createElement(R.a,{"aria-label":"Logged In User","aria-haspopup":"true",color:"inherit"},r.a.createElement(F.a,null)),r.a.createElement("p",null,p.a.auth().currentUser?p.a.auth().currentUser.displayName:"Ehmad")),r.a.createElement(q.a,{onClick:function(){p.a.auth().signOut()}},r.a.createElement(R.a,{"aria-label":"SignOut",color:"inherit"},r.a.createElement(H.a,null)),r.a.createElement("p",null,"Sign Out")));return r.a.createElement("div",{className:e.grow},r.a.createElement(T.a,{position:"static"},r.a.createElement(I.a,null,r.a.createElement(D.a,{className:e.title,variant:"h6",noWrap:!0},"Activity Scheduler"),r.a.createElement("div",{className:e.grow}),r.a.createElement("div",{className:e.sectionDesktop},r.a.createElement(R.a,{edge:"end","aria-label":"Logged In User","aria-haspopup":"true",color:"inherit"},r.a.createElement(F.a,null),r.a.createElement("div",{className:"f3"},p.a.auth().currentUser?p.a.auth().currentUser.displayName:"Ehmad")),r.a.createElement(R.a,{edge:"end","aria-label":"Sign Out","aria-haspopup":"true",onClick:function(){p.a.auth().signOut(),console.log("signout")},color:"inherit"},r.a.createElement(H.a,null),r.a.createElement("div",{className:"f5"},"Sign Out"))),r.a.createElement("div",{className:e.sectionMobile},r.a.createElement(R.a,{"aria-label":"show more","aria-haspopup":"true",onClick:function(e){c(e.currentTarget)},color:"inherit"},r.a.createElement(U.a,null))))),i)}var K=a(24),J=a(460),_=a(472),G=a(463),V={subjects:"subjects",sections:"sections",teachers:"teachers",lectures:"lectures",workingTime:"workingTime",timeTable:"timeTable"},Z=Object(j.a)((function(e){return{root:{margin:10,borderRadius:20,minHeight:360},title:{fontSize:14},textField:{margin:5},hrs:{margin:"5% 10%"},hours:{display:"flex",justifyContent:"center",alignItems:"baseline"},button:{}}}));function $(e){var t=e.subjects,a=e.setSubjects,n=Z(),c=r.a.useState(""),l=Object(P.a)(c,2),i=l[0],o=l[1],s=r.a.useState(""),u=Object(P.a)(s,2),d=u[0],m=u[1],b=r.a.useState(""),p=Object(P.a)(b,2),g=p[0],h=p[1],f=r.a.useState(""),E=Object(P.a)(f,2),v=E[0],j=E[1],k=r.a.useState(""),y=Object(P.a)(k,2),O=y[0],S=y[1],C=r.a.useState(""),x=Object(P.a)(C,2),w=x[0],N=x[1],T=r.a.useState(""),I=Object(P.a)(T,2),R=I[0],D=I[1],L=r.a.useState(""),A=Object(P.a)(L,2),F=A[0],B=A[1],H=function(){S(i?"":"Required"),N(d?"":"Required"),D(g?"":"Required"),B(v?"":"Required")},z=function(){var e=Object(K.a)(t);if(i&&d&&g&&v)if(v<=g){if(e){if(-1!==e.findIndex((function(e){return e[1]===d})))return H(),void N("Subject already exists");e.push([i,d,g,v])}else e=[[i,d,g,v]];a(e,V.subjects),o(""),m(""),h(""),j(""),S(""),N(""),D(""),B("")}else B("Credits hrs must !> contact hrs");else H()};return r.a.createElement(J.a,{className:n.root},r.a.createElement("h3",null,"Add Subject"),r.a.createElement("div",null,r.a.createElement(_.a,{className:O?"":n.textField,onChange:function(e){o(e.target.value)},value:i,required:!0,id:"course-title",label:"Title",variant:"outlined",error:!!O,helperText:O})),r.a.createElement("div",null,r.a.createElement(_.a,{required:!0,className:w?"":n.textField,value:d,onChange:function(e){m(e.target.value)},id:"course-code",label:"Course Code",variant:"outlined",error:!!w,helperText:w})),r.a.createElement("div",{className:n.hours},r.a.createElement(_.a,{type:"number",className:F?"":n.hrs,id:"credit-hours",label:"Credit Hours",select:!0,required:!0,error:!!F,helperText:F,onChange:function(e){j(e.target.value)},value:v,InputLabelProps:{shrink:!0},variant:"outlined"},[1,2,3].map((function(e){return r.a.createElement(q.a,{key:e,value:e},e)}))),r.a.createElement(_.a,{type:"number",className:R?"":n.hrs,id:"contact-hours",label:"Contact Hours",select:!0,required:!0,error:!!R,helperText:R,onChange:function(e){h(e.target.value)},value:g,onKeyDown:function(e){13===e.keyCode&&z()},InputLabelProps:{shrink:!0},variant:"outlined"},[1,2,3].map((function(e){return r.a.createElement(q.a,{key:e,value:e},e)})))),r.a.createElement(G.a,{className:n.button,variant:"contained",color:"primary",size:"medium",onClick:z},"+ Add Subject"))}var Q=Object(j.a)((function(e){return{root:{borderRadius:20,margin:10,minHeight:360,display:"grid"},title:{fontSize:14},textField:{margin:5},button:{}}}));function X(e){var t=e.sections,a=e.setSections,n=Q(),c=r.a.useState(""),l=Object(P.a)(c,2),i=l[0],o=l[1],s=r.a.useState(""),u=Object(P.a)(s,2),d=u[0],m=u[1],b=r.a.useState(""),p=Object(P.a)(b,2),g=p[0],h=p[1],f=r.a.useState(""),E=Object(P.a)(f,2),v=E[0],j=E[1],k=function(){h(i?"":"Required"),j(d?"":"Required")},y=function(){var e=Object(K.a)(t);if(i&&d){if(e){if(-1!==e.findIndex((function(e){return e[1]===d})))return k(),void j("Subject already exists");e.push([i,d])}else e=[[i,d]];a(e,V.sections),o(""),m(""),h(""),j("")}else k()};return r.a.createElement(J.a,{className:n.root},r.a.createElement("h3",null,"Add Section"),r.a.createElement("div",null,r.a.createElement(_.a,{className:n.textField,required:!0,id:"class-title",label:"Class Title",variant:"outlined",value:i,onChange:function(e){o(e.target.value)},error:!!g,helperText:g})),r.a.createElement("div",null,r.a.createElement(_.a,{required:!0,className:n.textField,id:"class-code",label:"Class Code",variant:"outlined",error:!!v,helperText:v,value:d,onChange:function(e){m(e.target.value)},onKeyDown:function(e){13===e.keyCode&&y()}})),r.a.createElement("div",null,r.a.createElement(G.a,{className:n.button,variant:"contained",color:"primary",size:"medium",onClick:y},"+ Add Section")))}var Y=Object(j.a)((function(e){return{root:{borderRadius:20,margin:10,minHeight:360,display:"grid"},textField:{margin:5},button:{}}}));function ee(e){var t=e.teachers,a=e.setTeachers,n=Y(),c=r.a.useState(""),l=Object(P.a)(c,2),i=l[0],o=l[1],s=r.a.useState(""),u=Object(P.a)(s,2),d=u[0],m=u[1],b=r.a.useState(""),p=Object(P.a)(b,2),g=p[0],h=p[1],f=r.a.useState(""),E=Object(P.a)(f,2),v=E[0],j=E[1],k=function(){h(i?"":"Required"),j(d?"":"Required")},y=function(){var e=Object(K.a)(t);if(i&&d){if(e){if(-1!==e.findIndex((function(e){return e[1]===d})))return k(),void j("Subject already exists");e.push([i,d])}else e=[[i,d]];a(e,V.teachers),o(""),m(""),h(""),j("")}else k()};return r.a.createElement(J.a,{className:n.root},r.a.createElement("h3",null,"Add Teacher"),r.a.createElement("div",null,r.a.createElement(_.a,{className:n.textField,required:!0,id:"teacher-name",label:"Teacher Name",variant:"outlined",value:i,onChange:function(e){o(e.target.value)},error:!!g,helperText:g})),r.a.createElement("div",null,r.a.createElement(_.a,{required:!0,className:n.textField,id:"teacher-code",label:"Teacher Code",variant:"outlined",error:!!v,helperText:v,value:d,onChange:function(e){m(e.target.value)},onKeyDown:function(e){13===e.keyCode&&y()}})),r.a.createElement("div",null,r.a.createElement(G.a,{className:n.button,variant:"contained",color:"primary",size:"medium",onClick:y},"+ Add Teacher")))}var te=a(6),ae=a(15),ne=a(468),re=a(469),ce=a(466),le=a(467),ie=a(464),oe=a(476),se=a(465),ue=a(479),de=a(172),me=a(474),be=a(480),pe=a(38),ge=a.n(pe);function he(e,t,a){return{name:e,code:t,contantHrs:a}}function fe(e,t,a){return t[a]e[a]?1:0}var Ee=[{id:"name",numeric:!1,disablePadding:!0,label:"Title"},{id:"code",numeric:!0,disablePadding:!1,label:"Code"},{id:"contantHrs",numeric:!0,disablePadding:!1,label:"Contact Hrs"}];function ve(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),Ee.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var je=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),ke=function(e){var t=je(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.subjects,i=e.setSubjects;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Subject Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[1]===t}));e.splice(a,1)})),i(e,V.subjects),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},ye=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function Oe(e){var t=e.subjects,a=e.setSubjects,n=t?t.map((function(e){return he(e[0],e[1],e[2])})):he("","",""),c=ye(),l=r.a.useState("asc"),i=Object(P.a)(l,2),o=i[0],s=i[1],u=r.a.useState("code"),d=Object(P.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(P.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(P.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(P.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(ke,{numSelected:h.length,selected:h,setSelected:f,subjects:t,setSubjects:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(ve,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.code}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return fe(e,a,t)}:function(e,a){return-fe(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.code,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.code)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.code?e.code:"rowCode",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.name),r.a.createElement(ce.a,{component:"th",id:c,align:"right",scope:"row"},e.code),r.a.createElement(ce.a,{align:"right"},e.contantHrs))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}function Se(e,t){return{name:e,code:t}}function Ce(e,t,a){return t[a]e[a]?1:0}var xe=[{id:"name",numeric:!1,disablePadding:!0,label:"Title"},{id:"code",numeric:!0,disablePadding:!1,label:"Code"}];function we(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),xe.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var Ne=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),Pe=function(e){var t=Ne(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.sections,i=e.setSections;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Section Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[1]===t}));e.splice(a,1)})),i(e,V.sections),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},Te=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function Ie(e){var t=e.sections,a=e.setSections,n=t?t.map((function(e){return Se(e[0],e[1])})):[Se("","")],c=Te(),l=r.a.useState("asc"),i=Object(P.a)(l,2),o=i[0],s=i[1],u=r.a.useState("code"),d=Object(P.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(P.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(P.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(P.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(Pe,{numSelected:h.length,selected:h,setSelected:f,sections:t,setSections:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(we,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.code}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return Ce(e,a,t)}:function(e,a){return-Ce(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.code,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.code)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.code?e.code:"rowCode",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.name),r.a.createElement(ce.a,{component:"th",id:c,align:"right",scope:"row"},e.code))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}function Re(e,t){return{name:e,code:t}}function De(e,t,a){return t[a]e[a]?1:0}var qe=[{id:"name",numeric:!1,disablePadding:!0,label:"Name"},{id:"code",numeric:!0,disablePadding:!1,label:"Code"}];function Le(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),qe.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var Ae=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),Fe=function(e){var t=Ae(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.teachers,i=e.setTeachers;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Teacher Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[1]===t}));e.splice(a,1)})),i(e,V.teachers),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},Be=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function He(e){var t=e.teachers,a=e.setTeachers,n=t?t.map((function(e){return Re(e[0],e[1])})):[Re("","")],c=Be(),l=r.a.useState("asc"),i=Object(P.a)(l,2),o=i[0],s=i[1],u=r.a.useState("code"),d=Object(P.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(P.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(P.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(P.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(Fe,{numSelected:h.length,selected:h,setSelected:f,teachers:t,setTeachers:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(Le,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.code}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return De(e,a,t)}:function(e,a){return-De(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.code,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.code)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.code?e.code:"rowCode",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.name),r.a.createElement(ce.a,{component:"th",id:c,align:"right",scope:"row"},e.code))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}var ze=a(470),Ue=Object(j.a)((function(e){var t;return{root:{minWidth:275,margin:10,borderRadius:20},content:(t={},Object(g.a)(t,e.breakpoints.down("sm"),{padding:"5% 10%"}),Object(g.a)(t,e.breakpoints.up("md"),{display:"flex",justifyContent:"space-around"}),t),textField:{margin:5,minWidth:200},button:Object(g.a)({},e.breakpoints.up("sm"),{marginLeft:"5%"})}})),We=[["1"],["1 - 1","2"],["1 - 1 - 1","2 - 1","3"]];function Me(e){var t,a,c,l=e.lectures,i=e.setLectures,o=e.subjects,s=e.sections,u=e.teachers,d=Ue(),m=Object(n.useState)(""),b=Object(P.a)(m,2),p=b[0],g=b[1],h=Object(n.useState)(""),f=Object(P.a)(h,2),E=f[0],v=f[1],j=Object(n.useState)(""),k=Object(P.a)(j,2),y=k[0],O=k[1],S=Object(n.useState)(""),C=Object(P.a)(S,2),x=C[0],w=C[1],N=Object(n.useState)(""),T=Object(P.a)(N,2),I=T[0],R=T[1],D=Object(n.useState)(""),L=Object(P.a)(D,2),A=L[0],F=L[1],B=Object(n.useState)(""),H=Object(P.a)(B,2),z=H[0],U=H[1],W=Object(n.useState)(""),M=Object(P.a)(W,2),Z=M[0],$=M[1],Q=function(){R(p?"":"Required"),U(y?"":"Required"),F(E?"":"Required"),$(x?"":"Required")},X=function(){if(p&&y&&E&&x){var e=Object(K.a)(l);if(l){if(-1!==e.findIndex((function(e){return e[4]===y+E||e[1]===E&&e[2]===p})))return Q(),U("Lecture already exists"),R("Lecture already exists"),void F("Lecture already exists");e.push([y,E,p,x,y+E])}else e=[[y,E,p,x,y+E]];i(e,V.lectures),w(""),g(""),O(""),v(""),R(""),U(""),F(""),$("")}else Q()},Y=(a=p,c=1,(t=o)[t.findIndex((function(e){return e[c]===a}))]);return r.a.createElement(J.a,{className:d.root},r.a.createElement(ze.a,{className:d.content},r.a.createElement("h3",{style:{textAlign:"left"}},"Add Lectures"),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"teacher",label:"Teacher",select:!0,required:!0,error:!!z,helperText:z,onChange:function(e){O(e.target.value)},value:y,InputLabelProps:{shrink:!0},variant:"outlined"},u.map((function(e){return r.a.createElement(q.a,{key:e[1]?e[1]:"teacher",value:e[0]},e[0])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"section",label:"Section",select:!0,required:!0,error:!!A,helperText:A,onChange:function(e){v(e.target.value)},value:E,InputLabelProps:{shrink:!0},variant:"outlined"},s.map((function(e){return r.a.createElement(q.a,{key:e[1]?e[1]:"section",value:e[1]},e[1])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"subject",label:"Subject",select:!0,required:!0,error:!!I,helperText:I,onChange:function(e){w(""),g(e.target.value)},value:p,InputLabelProps:{shrink:!0},variant:"outlined"},o.map((function(e){return r.a.createElement(q.a,{key:e[1]?e[1]:"subject",value:e[1]},e[1])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"lecture",label:"Lecture Arrangement",select:!0,required:!0,error:!!Z,helperText:Z,onChange:function(e){w(e.target.value)},value:x,disabled:!p,onKeyDown:function(e){13===e.keyCode&&X()},InputLabelProps:{shrink:!0},variant:"outlined"},p&&Y?We[Y[2]-1].map((function(e){return r.a.createElement(q.a,{key:e||"lecture",value:e},e)})):r.a.createElement(q.a,null))),r.a.createElement(G.a,{className:d.button,variant:"contained",color:"primary",size:"medium",onClick:X},"+ Add Lecture")))}function Ke(e,t,a,n,r){return{teacher:e,section:t,subject:a,arrangement:n,lectureID:r}}function Je(e,t,a){return t[a]e[a]?1:0}var _e=[{id:"teacher",numeric:!1,disablePadding:!0,label:"Teacher"},{id:"section",numeric:!0,disablePadding:!1,label:"Section"},{id:"subject",numeric:!0,disablePadding:!1,label:"Subject"}];function Ge(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),_e.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"section"===e.id?"center":"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var Ve=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),Ze=function(e){var t=Ve(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.lectures,i=e.setLectures;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Lecture Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[4]===t}));e.splice(a,1)})),i(e,V.lectures),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},$e=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function Qe(e){var t=e.lectures,a=e.setLectures,n=t?t.map((function(e){return Ke(e[0],e[1],e[2],e[3],e[4])})):[Ke("","","","","")],c=$e(),l=r.a.useState("asc"),i=Object(P.a)(l,2),o=i[0],s=i[1],u=r.a.useState("lectureID"),d=Object(P.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(P.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(P.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(P.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(Ze,{numSelected:h.length,selected:h,setSelected:f,lectures:t,setLectures:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"teacher",size:"small","aria-label":"enhanced table"},r.a.createElement(Ge,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.lectureID}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return Je(e,a,t)}:function(e,a){return-Je(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.lectureID,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.lectureID)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.lectureID?e.lectureID:"rowlectureID",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.teacher),r.a.createElement(ce.a,{component:"th",id:c,align:"center",scope:"row"},e.section),r.a.createElement(ce.a,{align:"right"},e.subject))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}var Xe=Object(j.a)((function(e){var t;return{root:{minWidth:275,margin:10,borderRadius:20},content:(t={},Object(g.a)(t,e.breakpoints.down("sm"),{padding:"5% 10%"}),Object(g.a)(t,e.breakpoints.up("md"),{display:"flex",justifyContent:"center"}),t),textField:Object(g.a)({margin:5,minWidth:200},e.breakpoints.up("md"),{minWidth:150}),button:Object(g.a)({},e.breakpoints.up("sm"),{marginLeft:"5%"})}}));function Ye(e){var t=e.workingTime,a=e.setworkingTime,c=e.sections,l=Xe(),i=Object(n.useState)(""),o=Object(P.a)(i,2),s=o[0],u=o[1],d=Object(n.useState)(""),m=Object(P.a)(d,2),b=m[0],p=m[1],g=Object(n.useState)(""),h=Object(P.a)(g,2),f=h[0],E=h[1],v=Object(n.useState)(""),j=Object(P.a)(v,2),k=j[0],y=j[1],O=function(){if(s&&b){var e=Object(N.a)({},t);e[s]=b,a(e,V.workingTime),u(""),p(""),E(""),y("")}else E(s?"":"Required"),y(b?"":"Required")};return r.a.createElement(J.a,{className:l.root},r.a.createElement(ze.a,{className:l.content},r.a.createElement("h3",{style:{textAlign:"left"}},"Working Days & Periods"),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:l.textField,id:"day",label:"Day",select:!0,required:!0,error:!!f,helperText:f,onChange:function(e){u(e.target.value)},value:s,InputLabelProps:{shrink:!0},variant:"outlined"},Object.entries(t).filter((function(e){return 0===e[1]})).map((function(e){return r.a.createElement(q.a,{key:e[0],value:e[0]},e[0])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:l.textField,id:"periods",label:"Periods(hr)",select:!0,required:!0,error:!!k,helperText:k,onChange:function(e){p(e.target.value)},value:b,onKeyDown:function(e){13===e.keyCode&&O()},InputLabelProps:{shrink:!0},variant:"outlined"},[1,2,3,4,5,6,7].map((function(e){return r.a.createElement(q.a,{key:e,value:e},e)})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:l.textField,id:"days",label:"Rooms",select:!0,required:!0,value:c.length,onKeyDown:function(e){13===e.keyCode&&O()},InputLabelProps:{shrink:!0},variant:"outlined"},r.a.createElement(q.a,{key:"rooms",value:c.length},c.length))),r.a.createElement(G.a,{className:l.button,variant:"contained",color:"primary",size:"medium",onClick:O},"+Add")))}function et(e,t,a){return t[a]e[a]?1:0}var tt=[{id:"day",numeric:!1,disablePadding:!0,label:"Day"},{id:"lectureCount",numeric:!0,disablePadding:!1,label:"Lectures"}];function at(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),tt.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"center":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var nt=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),rt=function(e){var t=nt(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.workingTime,i=e.setworkingTime;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Working Days"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(N.a)({},l);console.log(n),n.forEach((function(t){e[t]=0})),i(e,V.workingTime),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},ct=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function lt(e){var t=e.workingTime,a=e.setworkingTime,n=Object.entries(t).filter((function(e){return 0!==e[1]})).map((function(e){return t=e[0],a=e[1],{day:t,lectureCount:a};var t,a})),c=ct(),l=r.a.useState("asc"),i=Object(P.a)(l,2),o=i[0],s=i[1],u=r.a.useState("lectureCount"),d=Object(P.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(P.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(P.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(P.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(rt,{numSelected:h.length,selected:h,setSelected:f,workingTime:t,setworkingTime:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(at,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.day}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return et(e,a,t)}:function(e,a){return-et(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.day,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.day)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.day?e.day:"rowDay",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.day),r.a.createElement(ce.a,{component:"th",id:c,align:"center",scope:"row"},e.lectureCount))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}var it=a(7),ot=Object(it.a)((function(e){return{head:{backgroundColor:e.palette.common.black,color:e.palette.common.white},body:{fontSize:14}}}))(ce.a),st=Object(it.a)((function(e){return{root:{"&:nth-of-type(odd)":{backgroundColor:e.palette.action.hover}}}}))(se.a),ut=Object(j.a)((function(e){return{root:{margin:e.spacing(2)},table:{minWidth:360}}})),dt=["MON","TUE","WED","THU","FRI","SAT"];function mt(e){var t=e.timeTable,a=e.section,n=ut();return r.a.createElement(le.a,{className:n.root,component:de.a},r.a.createElement(ne.a,{className:n.table,"aria-label":"customized table"},r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ot,{key:"sec"+a},"Section ",a),t?t[0].map((function(e,t){return r.a.createElement(ot,{key:"lectures"+a+t,align:"right"},"Lecture ",t+1)})):r.a.createElement(ot,{key:"lectures"+a}))),r.a.createElement(re.a,null,t.map((function(e,t){return r.a.createElement(st,{key:t+a},r.a.createElement(ot,{key:dt[t]+a,component:"th",scope:"column"},dt[t]),e.map((function(e,t){return r.a.createElement(ot,{key:e+t+a,align:"right"},e||"FREE")})))})))))}var bt=a(471),pt=(a(423),Object(j.a)((function(e){return{cardHolder:{display:"flex",flexFlow:"row wrap",justifyContent:"space-evenly",marginTop:10},lectures:{width:"100%",margin:"0% 5%"},genButton:{marginBottom:25},wrapper:{position:"relative",display:"flex",justifyContent:"center"},buttonProgress:{position:"absolute",top:"3%"}}}))),gt={MON:0,TUE:0,WED:0,THU:0,FRI:0,SAT:0},ht=function(){var e=p.a.firestore().collection(p.a.auth().currentUser.uid),t=pt(),a=Object(n.useState)([]),c=Object(P.a)(a,2),l=c[0],i=c[1],o=Object(n.useState)([]),s=Object(P.a)(o,2),u=s[0],d=s[1],m=Object(n.useState)([]),b=Object(P.a)(m,2),g=b[0],h=b[1],f=Object(n.useState)([]),E=Object(P.a)(f,2),v=E[0],j=E[1],k=Object(n.useState)(gt),y=Object(P.a)(k,2),O=y[0],S=y[1],C=Object(n.useState)(!1),T=Object(P.a)(C,2),I=T[0],R=T[1],D=Object(n.useState)(void 0),q=Object(P.a)(D,2),L=q[0],A=q[1],F=function(t,a){switch(a){case"subjects":i(t);break;case"sections":d(t);break;case"teachers":h(t);break;case"lectures":j(t);break;case"workingTime":S(t);break;default:console.error("Wrong Document")}e.doc(a).set(a===V.workingTime?t:Object(N.a)({},Object(t))).then((function(e){return console.log("saved")})).catch((function(e){return console.error("error",e)}))},B=Object(n.useCallback)(Object(w.a)(x.a.mark((function e(){var t,a,n;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.a.firestore(),a=t.collection(p.a.auth().currentUser.uid),n={},e.next=5,a.doc(V.timeTable).collection(V.timeTable).orderBy(p.a.firestore.FieldPath.documentId()).onSnapshot((function(e){if(!e.empty){var t=[];e.forEach((function(e){n[e.id]=Object.values(e.data()),t.push(e.id)})),A(n)}}));case 5:case"end":return e.stop()}}),e)}))),[]),H=Object(n.useCallback)(Object(w.a)(x.a.mark((function e(){var t;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=p.a.firestore(),t.collection(p.a.auth().currentUser.uid).get().then((function(e){e.forEach((function(e){var t=e.id===V.workingTime?e.data():Object.values(e.data());switch(e.id){case V.subjects:i(t);break;case V.sections:d(t);break;case V.teachers:h(t);break;case V.lectures:j(t);break;case V.workingTime:S(t);break;default:console.error("Wrong Document")}}))})).catch((function(e){return console.log("err",e)}));case 3:case"end":return e.stop()}}),e)}))),[]);r.a.useEffect((function(){H(),B()}),[H,B]);return console.log(L),r.a.createElement("div",null,r.a.createElement(M,null),r.a.createElement("div",{className:t.cardHolder},r.a.createElement("div",null,r.a.createElement($,{className:t.card,subjects:l,setSubjects:F,docs:V}),r.a.createElement(Oe,{subjects:l,setSubjects:F,docType:V})),r.a.createElement("div",null,r.a.createElement(X,{className:t.card,sections:u,setSections:F,docs:V}),r.a.createElement(Ie,{sections:u,setSections:F,docs:V})),r.a.createElement("div",null,r.a.createElement(ee,{className:t.card,teachers:g,setTeachers:F,docs:V}),r.a.createElement(He,{teachers:g,setTeachers:F,docs:V})),r.a.createElement("div",{className:t.lectures},r.a.createElement(Me,{lectures:v,setLectures:F,docs:V,subjects:l,sections:u,teachers:g}),r.a.createElement(Qe,{lectures:v,setLectures:F,docs:V})),r.a.createElement("div",null,r.a.createElement(Ye,{workingTime:O,setworkingTime:F,sections:u,docs:V}),r.a.createElement(lt,{workingTime:O,setworkingTime:F,docs:V}))),r.a.createElement("div",{className:t.wrapper},r.a.createElement(G.a,{variant:"contained",color:"secondary",size:"large",className:t.genButton,onClick:function(){var e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userID:p.a.auth().currentUser.uid})};R(!0),fetch("http://localhost:3001/generate",e).then((function(e){return e.json()})).then(Object(w.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:B(),R(!1);case 2:case"end":return e.stop()}}),e)})))).catch((function(e){console.log(e),R(!1)}))},disabled:!v.length||I},"Generate Timetable"),I&&r.a.createElement(bt.a,{color:"secondary",size:38,className:t.buttonProgress})),r.a.createElement("div",{className:t.cardHolder},L?Object.keys(L).map((function(e,t){return r.a.createElement(mt,{timeTable:L[e],section:e,key:e})})):r.a.createElement("div",null)))};p.a.initializeApp({apiKey:"AIzaSyBwPBLFoMMqwyUJcJewqLip4guij7CNjZg",authDomain:"activity-scheduling-d6be4.firebaseapp.com",databaseURL:"https://activity-scheduling-d6be4.firebaseio.com",projectId:"activity-scheduling-d6be4",storageBucket:"activity-scheduling-d6be4.appspot.com",messagingSenderId:"1050964579186",appId:"1:1050964579186:web:85db424e474670098b03eb"});var ft={particles:{number:{value:100,density:{enable:!0,value_area:700}}}},Et=function(e){Object(s.a)(a,e);var t=Object(u.a)(a);function a(){var e;Object(i.a)(this,a);for(var n=arguments.length,r=new Array(n),c=0;c contact hrs");else H()};return r.a.createElement(J.a,{className:n.root},r.a.createElement("h3",null,"Add Subject"),r.a.createElement("div",null,r.a.createElement(_.a,{className:O?"":n.textField,onChange:function(e){o(e.target.value)},value:i,required:!0,id:"course-title",label:"Title",variant:"outlined",error:!!O,helperText:O})),r.a.createElement("div",null,r.a.createElement(_.a,{required:!0,className:w?"":n.textField,value:d,onChange:function(e){m(e.target.value)},id:"course-code",label:"Course Code",variant:"outlined",error:!!w,helperText:w})),r.a.createElement("div",{className:n.hours},r.a.createElement(_.a,{type:"number",className:F?"":n.hrs,id:"credit-hours",label:"Credit Hours",select:!0,required:!0,error:!!F,helperText:F,onChange:function(e){j(e.target.value)},value:v,InputLabelProps:{shrink:!0},variant:"outlined"},[1,2,3].map((function(e){return r.a.createElement(q.a,{key:e,value:e},e)}))),r.a.createElement(_.a,{type:"number",className:R?"":n.hrs,id:"contact-hours",label:"Contact Hours",select:!0,required:!0,error:!!R,helperText:R,onChange:function(e){h(e.target.value)},value:g,onKeyDown:function(e){13===e.keyCode&&z()},InputLabelProps:{shrink:!0},variant:"outlined"},[1,2,3].map((function(e){return r.a.createElement(q.a,{key:e,value:e},e)})))),r.a.createElement(G.a,{className:n.button,variant:"contained",color:"primary",size:"medium",onClick:z},"+ Add Subject"))}var Q=Object(j.a)((function(e){return{root:{borderRadius:20,margin:10,minHeight:360,display:"grid"},title:{fontSize:14},textField:{margin:5},button:{}}}));function X(e){var t=e.sections,a=e.setSections,n=Q(),c=r.a.useState(""),l=Object(T.a)(c,2),i=l[0],o=l[1],s=r.a.useState(""),u=Object(T.a)(s,2),d=u[0],m=u[1],b=r.a.useState(""),p=Object(T.a)(b,2),g=p[0],h=p[1],f=r.a.useState(""),E=Object(T.a)(f,2),v=E[0],j=E[1],k=function(){h(i?"":"Required"),j(d?"":"Required")},y=function(){var e=Object(K.a)(t);if(i&&d){if(e){if(-1!==e.findIndex((function(e){return e[1]===d})))return k(),void j("Subject already exists");e.push([i,d])}else e=[[i,d]];a(e,V.sections),o(""),m(""),h(""),j("")}else k()};return r.a.createElement(J.a,{className:n.root},r.a.createElement("h3",null,"Add Section"),r.a.createElement("div",null,r.a.createElement(_.a,{className:n.textField,required:!0,id:"class-title",label:"Class Title",variant:"outlined",value:i,onChange:function(e){o(e.target.value)},error:!!g,helperText:g})),r.a.createElement("div",null,r.a.createElement(_.a,{required:!0,className:n.textField,id:"class-code",label:"Class Code",variant:"outlined",error:!!v,helperText:v,value:d,onChange:function(e){m(e.target.value)},onKeyDown:function(e){13===e.keyCode&&y()}})),r.a.createElement("div",null,r.a.createElement(G.a,{className:n.button,variant:"contained",color:"primary",size:"medium",onClick:y},"+ Add Section")))}var Y=Object(j.a)((function(e){return{root:{borderRadius:20,margin:10,minHeight:360,display:"grid"},textField:{margin:5},button:{}}}));function ee(e){var t=e.teachers,a=e.setTeachers,n=Y(),c=r.a.useState(""),l=Object(T.a)(c,2),i=l[0],o=l[1],s=r.a.useState(""),u=Object(T.a)(s,2),d=u[0],m=u[1],b=r.a.useState(""),p=Object(T.a)(b,2),g=p[0],h=p[1],f=r.a.useState(""),E=Object(T.a)(f,2),v=E[0],j=E[1],k=function(){h(i?"":"Required"),j(d?"":"Required")},y=function(){var e=Object(K.a)(t);if(i&&d){if(e){if(-1!==e.findIndex((function(e){return e[1]===d})))return k(),void j("Subject already exists");e.push([i,d])}else e=[[i,d]];a(e,V.teachers),o(""),m(""),h(""),j("")}else k()};return r.a.createElement(J.a,{className:n.root},r.a.createElement("h3",null,"Add Teacher"),r.a.createElement("div",null,r.a.createElement(_.a,{className:n.textField,required:!0,id:"teacher-name",label:"Teacher Name",variant:"outlined",value:i,onChange:function(e){o(e.target.value)},error:!!g,helperText:g})),r.a.createElement("div",null,r.a.createElement(_.a,{required:!0,className:n.textField,id:"teacher-code",label:"Teacher Code",variant:"outlined",error:!!v,helperText:v,value:d,onChange:function(e){m(e.target.value)},onKeyDown:function(e){13===e.keyCode&&y()}})),r.a.createElement("div",null,r.a.createElement(G.a,{className:n.button,variant:"contained",color:"primary",size:"medium",onClick:y},"+ Add Teacher")))}var te=a(6),ae=a(15),ne=a(468),re=a(469),ce=a(466),le=a(467),ie=a(464),oe=a(476),se=a(465),ue=a(479),de=a(172),me=a(474),be=a(480),pe=a(38),ge=a.n(pe);function he(e,t,a){return{name:e,code:t,contantHrs:a}}function fe(e,t,a){return t[a]e[a]?1:0}var Ee=[{id:"name",numeric:!1,disablePadding:!0,label:"Title"},{id:"code",numeric:!0,disablePadding:!1,label:"Code"},{id:"contantHrs",numeric:!0,disablePadding:!1,label:"Contact Hrs"}];function ve(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),Ee.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var je=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),ke=function(e){var t=je(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.subjects,i=e.setSubjects;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Subject Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[1]===t}));e.splice(a,1)})),i(e,V.subjects),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},ye=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function Oe(e){var t=e.subjects,a=e.setSubjects,n=t?t.map((function(e){return he(e[0],e[1],e[2])})):he("","",""),c=ye(),l=r.a.useState("asc"),i=Object(T.a)(l,2),o=i[0],s=i[1],u=r.a.useState("code"),d=Object(T.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(T.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(T.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(T.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(ke,{numSelected:h.length,selected:h,setSelected:f,subjects:t,setSubjects:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(ve,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.code}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return fe(e,a,t)}:function(e,a){return-fe(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.code,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.code)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.code?e.code:"rowCode",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.name),r.a.createElement(ce.a,{component:"th",id:c,align:"right",scope:"row"},e.code),r.a.createElement(ce.a,{align:"right"},e.contantHrs))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}function Se(e,t){return{name:e,code:t}}function Ce(e,t,a){return t[a]e[a]?1:0}var xe=[{id:"name",numeric:!1,disablePadding:!0,label:"Title"},{id:"code",numeric:!0,disablePadding:!1,label:"Code"}];function we(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),xe.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var Ne=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),Te=function(e){var t=Ne(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.sections,i=e.setSections;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Section Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[1]===t}));e.splice(a,1)})),i(e,V.sections),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},Pe=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function Ie(e){var t=e.sections,a=e.setSections,n=t?t.map((function(e){return Se(e[0],e[1])})):[Se("","")],c=Pe(),l=r.a.useState("asc"),i=Object(T.a)(l,2),o=i[0],s=i[1],u=r.a.useState("code"),d=Object(T.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(T.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(T.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(T.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(Te,{numSelected:h.length,selected:h,setSelected:f,sections:t,setSections:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(we,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.code}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return Ce(e,a,t)}:function(e,a){return-Ce(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.code,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.code)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.code?e.code:"rowCode",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.name),r.a.createElement(ce.a,{component:"th",id:c,align:"right",scope:"row"},e.code))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}function Re(e,t){return{name:e,code:t}}function De(e,t,a){return t[a]e[a]?1:0}var qe=[{id:"name",numeric:!1,disablePadding:!0,label:"Name"},{id:"code",numeric:!0,disablePadding:!1,label:"Code"}];function Le(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),qe.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var Ae=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),Fe=function(e){var t=Ae(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.teachers,i=e.setTeachers;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Teacher Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[1]===t}));e.splice(a,1)})),i(e,V.teachers),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},Be=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function He(e){var t=e.teachers,a=e.setTeachers,n=t?t.map((function(e){return Re(e[0],e[1])})):[Re("","")],c=Be(),l=r.a.useState("asc"),i=Object(T.a)(l,2),o=i[0],s=i[1],u=r.a.useState("code"),d=Object(T.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(T.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(T.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(T.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(Fe,{numSelected:h.length,selected:h,setSelected:f,teachers:t,setTeachers:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(Le,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.code}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return De(e,a,t)}:function(e,a){return-De(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.code,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.code)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.code?e.code:"rowCode",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.name),r.a.createElement(ce.a,{component:"th",id:c,align:"right",scope:"row"},e.code))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}var ze=a(470),Ue=Object(j.a)((function(e){var t;return{root:{minWidth:275,margin:10,borderRadius:20},content:(t={},Object(g.a)(t,e.breakpoints.down("sm"),{padding:"5% 10%"}),Object(g.a)(t,e.breakpoints.up("md"),{display:"flex",justifyContent:"space-around"}),t),textField:{margin:5,minWidth:200},button:Object(g.a)({},e.breakpoints.up("sm"),{marginLeft:"5%"})}})),We=[["1"],["1 - 1","2"],["1 - 1 - 1","2 - 1","3"]];function Me(e){var t,a,c,l=e.lectures,i=e.setLectures,o=e.subjects,s=e.sections,u=e.teachers,d=Ue(),m=Object(n.useState)(""),b=Object(T.a)(m,2),p=b[0],g=b[1],h=Object(n.useState)(""),f=Object(T.a)(h,2),E=f[0],v=f[1],j=Object(n.useState)(""),k=Object(T.a)(j,2),y=k[0],O=k[1],S=Object(n.useState)(""),C=Object(T.a)(S,2),x=C[0],w=C[1],N=Object(n.useState)(""),P=Object(T.a)(N,2),I=P[0],R=P[1],D=Object(n.useState)(""),L=Object(T.a)(D,2),A=L[0],F=L[1],B=Object(n.useState)(""),H=Object(T.a)(B,2),z=H[0],U=H[1],W=Object(n.useState)(""),M=Object(T.a)(W,2),Z=M[0],$=M[1],Q=function(){R(p?"":"Required"),U(y?"":"Required"),F(E?"":"Required"),$(x?"":"Required")},X=function(){if(p&&y&&E&&x){var e=Object(K.a)(l);if(l){if(-1!==e.findIndex((function(e){return e[4]===y+E||e[1]===E&&e[2]===p})))return Q(),U("Lecture already exists"),R("Lecture already exists"),void F("Lecture already exists");e.push([y,E,p,x,y+E])}else e=[[y,E,p,x,y+E]];i(e,V.lectures),w(""),g(""),O(""),v(""),R(""),U(""),F(""),$("")}else Q()},Y=(a=p,c=1,(t=o)[t.findIndex((function(e){return e[c]===a}))]);return r.a.createElement(J.a,{className:d.root},r.a.createElement(ze.a,{className:d.content},r.a.createElement("h3",{style:{textAlign:"left"}},"Add Lectures"),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"teacher",label:"Teacher",select:!0,required:!0,error:!!z,helperText:z,onChange:function(e){O(e.target.value)},value:y,InputLabelProps:{shrink:!0},variant:"outlined"},u.map((function(e){return r.a.createElement(q.a,{key:e[1]?e[1]:"teacher",value:e[0]},e[0])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"section",label:"Section",select:!0,required:!0,error:!!A,helperText:A,onChange:function(e){v(e.target.value)},value:E,InputLabelProps:{shrink:!0},variant:"outlined"},s.map((function(e){return r.a.createElement(q.a,{key:e[1]?e[1]:"section",value:e[1]},e[1])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"subject",label:"Subject",select:!0,required:!0,error:!!I,helperText:I,onChange:function(e){w(""),g(e.target.value)},value:p,InputLabelProps:{shrink:!0},variant:"outlined"},o.map((function(e){return r.a.createElement(q.a,{key:e[1]?e[1]:"subject",value:e[1]},e[1])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:d.textField,id:"lecture",label:"Lecture Arrangement",select:!0,required:!0,error:!!Z,helperText:Z,onChange:function(e){w(e.target.value)},value:x,disabled:!p,onKeyDown:function(e){13===e.keyCode&&X()},InputLabelProps:{shrink:!0},variant:"outlined"},p&&Y?We[Y[2]-1].map((function(e){return r.a.createElement(q.a,{key:e||"lecture",value:e},e)})):r.a.createElement(q.a,null))),r.a.createElement(G.a,{className:d.button,variant:"contained",color:"primary",size:"medium",onClick:X},"+ Add Lecture")))}function Ke(e,t,a,n,r){return{teacher:e,section:t,subject:a,arrangement:n,lectureID:r}}function Je(e,t,a){return t[a]e[a]?1:0}var _e=[{id:"teacher",numeric:!1,disablePadding:!0,label:"Teacher"},{id:"section",numeric:!0,disablePadding:!1,label:"Section"},{id:"subject",numeric:!0,disablePadding:!1,label:"Subject"}];function Ge(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),_e.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"section"===e.id?"center":"right":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var Ve=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),Ze=function(e){var t=Ve(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.lectures,i=e.setLectures;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Lecture Table"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(K.a)(l);n.forEach((function(t){var a=e.findIndex((function(e){return e[4]===t}));e.splice(a,1)})),i(e,V.lectures),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},$e=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function Qe(e){var t=e.lectures,a=e.setLectures,n=t?t.map((function(e){return Ke(e[0],e[1],e[2],e[3],e[4])})):[Ke("","","","","")],c=$e(),l=r.a.useState("asc"),i=Object(T.a)(l,2),o=i[0],s=i[1],u=r.a.useState("lectureID"),d=Object(T.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(T.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(T.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(T.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(Ze,{numSelected:h.length,selected:h,setSelected:f,lectures:t,setLectures:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"teacher",size:"small","aria-label":"enhanced table"},r.a.createElement(Ge,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.lectureID}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return Je(e,a,t)}:function(e,a){return-Je(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.lectureID,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.lectureID)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.lectureID?e.lectureID:"rowlectureID",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.teacher),r.a.createElement(ce.a,{component:"th",id:c,align:"center",scope:"row"},e.section),r.a.createElement(ce.a,{align:"right"},e.subject))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}var Xe=Object(j.a)((function(e){var t;return{root:{minWidth:275,margin:10,borderRadius:20},content:(t={},Object(g.a)(t,e.breakpoints.down("sm"),{padding:"5% 10%"}),Object(g.a)(t,e.breakpoints.up("md"),{display:"flex",justifyContent:"center"}),t),textField:Object(g.a)({margin:5,minWidth:200},e.breakpoints.up("md"),{minWidth:150}),button:Object(g.a)({},e.breakpoints.up("sm"),{marginLeft:"5%"})}}));function Ye(e){var t=e.workingTime,a=e.setworkingTime,c=e.sections,l=Xe(),i=Object(n.useState)(""),o=Object(T.a)(i,2),s=o[0],u=o[1],d=Object(n.useState)(""),m=Object(T.a)(d,2),b=m[0],p=m[1],g=Object(n.useState)(""),h=Object(T.a)(g,2),f=h[0],E=h[1],v=Object(n.useState)(""),j=Object(T.a)(v,2),k=j[0],y=j[1],O=function(){if(s&&b){var e=Object(N.a)({},t);e[s]=b,a(e,V.workingTime),u(""),p(""),E(""),y("")}else E(s?"":"Required"),y(b?"":"Required")};return r.a.createElement(J.a,{className:l.root},r.a.createElement(ze.a,{className:l.content},r.a.createElement("h3",{style:{textAlign:"left"}},"Working Days & Periods"),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:l.textField,id:"day",label:"Day",select:!0,required:!0,error:!!f,helperText:f,onChange:function(e){u(e.target.value)},value:s,InputLabelProps:{shrink:!0},variant:"outlined"},Object.entries(t).filter((function(e){return 0===e[1]})).map((function(e){return r.a.createElement(q.a,{key:e[0],value:e[0]},e[0])})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:l.textField,id:"periods",label:"Periods(hr)",select:!0,required:!0,error:!!k,helperText:k,onChange:function(e){p(e.target.value)},value:b,onKeyDown:function(e){13===e.keyCode&&O()},InputLabelProps:{shrink:!0},variant:"outlined"},[1,2,3,4,5,6,7].map((function(e){return r.a.createElement(q.a,{key:e,value:e},e)})))),r.a.createElement("div",null,r.a.createElement(_.a,{type:"number",className:l.textField,id:"days",label:"Rooms",select:!0,required:!0,value:c.length,onKeyDown:function(e){13===e.keyCode&&O()},InputLabelProps:{shrink:!0},variant:"outlined"},r.a.createElement(q.a,{key:"rooms",value:c.length},c.length))),r.a.createElement(G.a,{className:l.button,variant:"contained",color:"primary",size:"medium",onClick:O},"+Add")))}function et(e,t,a){return t[a]e[a]?1:0}var tt=[{id:"day",numeric:!1,disablePadding:!0,label:"Day"},{id:"lectureCount",numeric:!0,disablePadding:!1,label:"Lectures"}];function at(e){var t=e.classes,a=e.onSelectAllClick,n=e.order,c=e.orderBy,l=e.numSelected,i=e.rowCount,o=e.onRequestSort;return r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{indeterminate:l>0&&l0&&l===i,onChange:a,inputProps:{"aria-label":"select all desserts"}})),tt.map((function(e){return r.a.createElement(ce.a,{key:e.id,align:e.numeric?"center":"left",padding:e.disablePadding?"none":"default",sortDirection:c===e.id&&n},r.a.createElement(ue.a,{active:c===e.id,direction:c===e.id?n:"asc",onClick:(a=e.id,function(e){o(e,a)})},e.label,c===e.id?r.a.createElement("span",{className:t.visuallyHidden},"desc"===n?"sorted descending":"sorted ascending"):null));var a}))))}var nt=Object(j.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(ae.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}})),rt=function(e){var t=nt(),a=e.numSelected,n=e.selected,c=e.setSelected,l=e.workingTime,i=e.setworkingTime;return r.a.createElement(I.a,{className:Object(te.a)(t.root,Object(g.a)({},t.highlight,a>0))},a>0?r.a.createElement(D.a,{className:t.title,color:"inherit",variant:"subtitle1",component:"div"},a," selected"):r.a.createElement(D.a,{className:t.title,variant:"h6",id:"tableTitle",component:"div"},"Working Days"),a>0?r.a.createElement(be.a,{title:"Delete"},r.a.createElement(R.a,{onClick:function(){var e=Object(N.a)({},l);console.log(n),n.forEach((function(t){e[t]=0})),i(e,V.workingTime),c([])},"aria-label":"delete"},r.a.createElement(ge.a,null))):r.a.createElement("div",null))},ct=Object(j.a)((function(e){return{root:{margin:10},paper:{borderRadius:20,width:"100%",marginBottom:e.spacing(2)},table:{},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function lt(e){var t=e.workingTime,a=e.setworkingTime,n=Object.entries(t).filter((function(e){return 0!==e[1]})).map((function(e){return t=e[0],a=e[1],{day:t,lectureCount:a};var t,a})),c=ct(),l=r.a.useState("asc"),i=Object(T.a)(l,2),o=i[0],s=i[1],u=r.a.useState("lectureCount"),d=Object(T.a)(u,2),m=d[0],b=d[1],p=r.a.useState([]),g=Object(T.a)(p,2),h=g[0],f=g[1],E=r.a.useState(0),v=Object(T.a)(E,2),j=v[0],k=v[1],y=r.a.useState(5),O=Object(T.a)(y,2),S=O[0],C=O[1],x=S-Math.min(S,n.length-j*S);return r.a.createElement("div",{className:c.root},r.a.createElement(de.a,{className:c.paper},r.a.createElement(rt,{numSelected:h.length,selected:h,setSelected:f,workingTime:t,setworkingTime:a}),r.a.createElement(le.a,null,r.a.createElement(ne.a,{className:c.table,"aria-labelledby":"subject",size:"small","aria-label":"enhanced table"},r.a.createElement(at,{classes:c,numSelected:h.length,order:o,orderBy:m,onSelectAllClick:function(e){if(e.target.checked){var t=n.map((function(e){return e.day}));f(t)}else f([])},onRequestSort:function(e,t){s(m===t&&"asc"===o?"desc":"asc"),b(t)},rowCount:n.length}),r.a.createElement(re.a,null,function(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}(n,function(e,t){return"desc"===e?function(e,a){return et(e,a,t)}:function(e,a){return-et(e,a,t)}}(o,m)).slice(j*S,j*S+S).map((function(e,t){var a,n=(a=e.day,-1!==h.indexOf(a)),c="enhanced-table-checkbox-".concat(t);return r.a.createElement(se.a,{hover:!0,onClick:function(t){return function(e,t){var a=h.indexOf(t),n=[];-1===a?n=n.concat(h,t):0===a?n=n.concat(h.slice(1)):a===h.length-1?n=n.concat(h.slice(0,-1)):a>0&&(n=n.concat(h.slice(0,a),h.slice(a+1))),f(n)}(0,e.day)},role:"checkbox","aria-checked":n,tabIndex:-1,key:e.day?e.day:"rowDay",selected:n},r.a.createElement(ce.a,{padding:"checkbox"},r.a.createElement(me.a,{checked:n,inputProps:{"aria-labelledby":c}})),r.a.createElement(ce.a,{align:"left",padding:"none"},e.day),r.a.createElement(ce.a,{component:"th",id:c,align:"center",scope:"row"},e.lectureCount))})),x>0&&r.a.createElement(se.a,{style:{height:33*x}},r.a.createElement(ce.a,{colSpan:6}))))),r.a.createElement(oe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:n.length,rowsPerPage:S,page:j,onChangePage:function(e,t){k(t)},onChangeRowsPerPage:function(e){C(parseInt(e.target.value,10)),k(0)}})))}var it=a(7),ot=Object(it.a)((function(e){return{head:{backgroundColor:e.palette.common.black,color:e.palette.common.white},body:{fontSize:14}}}))(ce.a),st=Object(it.a)((function(e){return{root:{"&:nth-of-type(odd)":{backgroundColor:e.palette.action.hover}}}}))(se.a),ut=Object(j.a)((function(e){return{root:{margin:e.spacing(2)},table:{minWidth:360}}})),dt=["MON","TUE","WED","THU","FRI","SAT"];function mt(e){var t=e.timeTable,a=e.section,n=ut();return r.a.createElement(le.a,{className:n.root,component:de.a},r.a.createElement(ne.a,{className:n.table,"aria-label":"customized table"},r.a.createElement(ie.a,null,r.a.createElement(se.a,null,r.a.createElement(ot,{key:"sec"+a},"Section ",a),t?t[0].map((function(e,t){return r.a.createElement(ot,{key:"lectures"+a+t,align:"right"},"Lecture ",t+1)})):r.a.createElement(ot,{key:"lectures"+a}))),r.a.createElement(re.a,null,t.map((function(e,t){return r.a.createElement(st,{key:t+a},r.a.createElement(ot,{key:dt[t]+a,component:"th",scope:"column"},dt[t]),e.map((function(e,t){return r.a.createElement(ot,{key:e+t+a,align:"right"},e||"FREE")})))})))))}var bt=a(471),pt=(a(423),Object(j.a)((function(e){return{cardHolder:{display:"flex",flexFlow:"row wrap",justifyContent:"space-evenly",marginTop:10},lectures:{width:"100%",margin:"0% 5%"},genButton:{marginBottom:25},wrapper:{position:"relative",display:"flex",justifyContent:"center"},buttonProgress:{position:"absolute",top:"3%"}}}))),gt={MON:0,TUE:0,WED:0,THU:0,FRI:0,SAT:0},ht=function(){var e=p.a.firestore().collection(p.a.auth().currentUser.uid),t=pt(),a=Object(n.useState)([]),c=Object(T.a)(a,2),l=c[0],i=c[1],o=Object(n.useState)([]),s=Object(T.a)(o,2),u=s[0],d=s[1],m=Object(n.useState)([]),b=Object(T.a)(m,2),g=b[0],h=b[1],f=Object(n.useState)([]),E=Object(T.a)(f,2),v=E[0],j=E[1],k=Object(n.useState)(gt),y=Object(T.a)(k,2),O=y[0],S=y[1],C=Object(n.useState)(!1),P=Object(T.a)(C,2),I=P[0],R=P[1],D=Object(n.useState)(void 0),q=Object(T.a)(D,2),L=q[0],A=q[1],F=function(t,a){switch(a){case"subjects":i(t);break;case"sections":d(t);break;case"teachers":h(t);break;case"lectures":j(t);break;case"workingTime":S(t);break;default:console.error("Wrong Document")}e.doc(a).set(a===V.workingTime?t:Object(N.a)({},Object(t))).then((function(e){return console.log("saved")})).catch((function(e){return console.error("error",e)}))},B=Object(n.useCallback)(Object(w.a)(x.a.mark((function e(){var t,a,n;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.a.firestore(),a=t.collection(p.a.auth().currentUser.uid),n={},e.next=5,a.doc(V.timeTable).collection(V.timeTable).onSnapshot((function(e){if(!e.empty){var t=[];e.forEach((function(e){n[e.id]=Object.values(e.data()),t.push(e.id)})),A(n)}}));case 5:case"end":return e.stop()}}),e)}))),[]),H=Object(n.useCallback)(Object(w.a)(x.a.mark((function e(){var t;return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=p.a.firestore(),t.collection(p.a.auth().currentUser.uid).get().then((function(e){e.forEach((function(e){var t=e.id===V.workingTime?e.data():Object.values(e.data());switch(e.id){case V.subjects:i(t);break;case V.sections:d(t);break;case V.teachers:h(t);break;case V.lectures:j(t);break;case V.workingTime:S(t);break;default:console.error("Wrong Document")}}))})).catch((function(e){return console.log("err",e)}));case 3:case"end":return e.stop()}}),e)}))),[]);r.a.useEffect((function(){H(),B()}),[H,B]);return console.log(L),r.a.createElement("div",null,r.a.createElement(M,null),r.a.createElement("div",{className:t.cardHolder},r.a.createElement("div",null,r.a.createElement($,{className:t.card,subjects:l,setSubjects:F,docs:V}),r.a.createElement(Oe,{subjects:l,setSubjects:F,docType:V})),r.a.createElement("div",null,r.a.createElement(X,{className:t.card,sections:u,setSections:F,docs:V}),r.a.createElement(Ie,{sections:u,setSections:F,docs:V})),r.a.createElement("div",null,r.a.createElement(ee,{className:t.card,teachers:g,setTeachers:F,docs:V}),r.a.createElement(He,{teachers:g,setTeachers:F,docs:V})),r.a.createElement("div",{className:t.lectures},r.a.createElement(Me,{lectures:v,setLectures:F,docs:V,subjects:l,sections:u,teachers:g}),r.a.createElement(Qe,{lectures:v,setLectures:F,docs:V})),r.a.createElement("div",null,r.a.createElement(Ye,{workingTime:O,setworkingTime:F,sections:u,docs:V}),r.a.createElement(lt,{workingTime:O,setworkingTime:F,docs:V}))),r.a.createElement("div",{className:t.wrapper},r.a.createElement(G.a,{variant:"contained",color:"secondary",size:"large",className:t.genButton,onClick:function(){var e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userID:p.a.auth().currentUser.uid})};R(!0),fetch("http://localhost:3001/generate",e).then((function(e){return e.json()})).then(Object(w.a)(x.a.mark((function e(){return x.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:B(),R(!1);case 2:case"end":return e.stop()}}),e)})))).catch((function(e){console.log(e),R(!1)}))},disabled:!v.length||I},"Generate Timetable"),I&&r.a.createElement(bt.a,{color:"secondary",size:38,className:t.buttonProgress})),r.a.createElement("div",{className:t.cardHolder},L?Object.keys(L).sort().map((function(e,t){return r.a.createElement(mt,{timeTable:L[e],section:e,key:e})})):r.a.createElement("div",null)))};p.a.initializeApp({apiKey:"AIzaSyBwPBLFoMMqwyUJcJewqLip4guij7CNjZg",authDomain:"activity-scheduling-d6be4.firebaseapp.com",databaseURL:"https://activity-scheduling-d6be4.firebaseio.com",projectId:"activity-scheduling-d6be4",storageBucket:"activity-scheduling-d6be4.appspot.com",messagingSenderId:"1050964579186",appId:"1:1050964579186:web:85db424e474670098b03eb"});var ft={particles:{number:{value:100,density:{enable:!0,value_area:700}}}},Et=function(e){Object(s.a)(a,e);var t=Object(u.a)(a);function a(){var e;Object(i.a)(this,a);for(var n=arguments.length,r=new Array(n),c=0;c ({\r\n root: {\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n [theme.breakpoints.up(\"sm\")]: {\r\n margin: \"2rem\",\r\n marginTop: 0,\r\n },\r\n },\r\n Tilt: {\r\n background: \"linear-gradient(89deg, #ff5edf 0%, #04c8de 100%)\",\r\n borderRadius: \".25rem\",\r\n boxShadow: \"0px 0px 8px 2px rgba( 0, 0, 0, 0.2 )\",\r\n [theme.breakpoints.down(\"xs\")]: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n marginTop: \"20%\",\r\n width: \"600px\",\r\n },\r\n },\r\n}));\r\n\r\nconst Logo = () => {\r\n const classes = useStyle();\r\n return (\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default Logo;\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport AppBar from \"@material-ui/core/AppBar\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport MenuItem from \"@material-ui/core/MenuItem\";\r\nimport Menu from \"@material-ui/core/Menu\";\r\nimport AccountCircle from \"@material-ui/icons/AccountCircle\";\r\nimport ExitToAppIcon from \"@material-ui/icons/ExitToApp\";\r\nimport MoreIcon from \"@material-ui/icons/MoreVert\";\r\nimport firebase from \"firebase\";\r\n\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n grow: {\r\n flexGrow: 1,\r\n },\r\n title: {\r\n display: \"block\",\r\n },\r\n sectionDesktop: {\r\n display: \"none\",\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"flex\",\r\n },\r\n },\r\n sectionMobile: {\r\n display: \"flex\",\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"none\",\r\n },\r\n },\r\n}));\r\n\r\nexport default function PrimaryAppBar() {\r\n const classes = useStyles();\r\n const [mobileMoreAnchorEl, setMobileMoreAnchorEl] = React.useState(null);\r\n\r\n const isMobileMenuOpen = Boolean(mobileMoreAnchorEl);\r\n\r\n const handleMobileMenuClose = () => {\r\n setMobileMoreAnchorEl(null);\r\n };\r\n\r\n const handleMobileMenuOpen = (event) => {\r\n setMobileMoreAnchorEl(event.currentTarget);\r\n };\r\n\r\n const renderMobileMenu = (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {firebase.auth().currentUser\r\n ? firebase.auth().currentUser.displayName\r\n : \"Ehmad\"}\r\n
\r\n \r\n {\r\n firebase.auth().signOut();\r\n }}\r\n >\r\n \r\n \r\n \r\n Sign Out
\r\n \r\n \r\n );\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n Activity Scheduler\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n {firebase.auth().currentUser\r\n ? firebase.auth().currentUser.displayName\r\n : \"Ehmad\"}\r\n
\r\n \r\n
{\r\n firebase.auth().signOut();\r\n console.log(\"signout\");\r\n }}\r\n color=\"inherit\"\r\n >\r\n \r\n Sign Out
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n {renderMobileMenu}\r\n
\r\n );\r\n}\r\n","const docs = {\r\n subjects: \"subjects\",\r\n sections: \"sections\",\r\n teachers: \"teachers\",\r\n lectures: \"lectures\",\r\n workingTime: \"workingTime\",\r\n timeTable: \"timeTable\",\r\n};\r\n\r\nexport default docs;\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n TextField,\r\n Card,\r\n Button,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // minWidth: 275,\r\n margin: 10,\r\n borderRadius: 20,\r\n minHeight: 360,\r\n },\r\n title: {\r\n fontSize: 14,\r\n },\r\n textField: {\r\n margin: 5,\r\n },\r\n hrs: {\r\n margin: \"5% 10%\",\r\n },\r\n hours: {\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n alignItems: \"baseline\",\r\n },\r\n button: {},\r\n}));\r\n\r\nexport default function SubjectInput({ subjects, setSubjects }) {\r\n const classes = useStyles();\r\n\r\n const [title, setTitle] = React.useState(\"\");\r\n const [code, setCode] = React.useState(\"\");\r\n const [contactHrs, setcontantHrs] = React.useState(\"\");\r\n const [creditHrs, setcreditHrs] = React.useState(\"\");\r\n\r\n const [titleError, setTitleError] = React.useState(\"\");\r\n const [codeError, setCodeError] = React.useState(\"\");\r\n const [contantHrsError, setcontantHrsError] = React.useState(\"\");\r\n const [creditHrsError, setcreditHrsError] = React.useState(\"\");\r\n\r\n const titleChange = (event) => {\r\n setTitle(event.target.value);\r\n };\r\n const codeChange = (event) => {\r\n setCode(event.target.value);\r\n };\r\n const contacthrsChange = (event) => {\r\n setcontantHrs(event.target.value);\r\n };\r\n const creditrsChange = (event) => {\r\n setcreditHrs(event.target.value);\r\n };\r\n const setRequiredError = () => {\r\n !title ? setTitleError(\"Required\") : setTitleError(\"\");\r\n !code ? setCodeError(\"Required\") : setCodeError(\"\");\r\n !contactHrs ? setcontantHrsError(\"Required\") : setcontantHrsError(\"\");\r\n !creditHrs ? setcreditHrsError(\"Required\") : setcreditHrsError(\"\");\r\n };\r\n const setEmptyTextfields = () => {\r\n setTitle(\"\");\r\n setCode(\"\");\r\n setcontantHrs(\"\");\r\n setcreditHrs(\"\");\r\n\r\n setTitleError(\"\");\r\n setCodeError(\"\");\r\n setcontantHrsError(\"\");\r\n setcreditHrsError(\"\");\r\n };\r\n const addButton = () => {\r\n let temp = [...subjects];\r\n if (title && code && contactHrs && creditHrs) {\r\n if (creditHrs <= contactHrs) {\r\n if (temp) {\r\n if (temp.findIndex((e) => e[1] === code) === -1)\r\n temp.push([title, code, contactHrs, creditHrs]);\r\n else {\r\n setRequiredError();\r\n setCodeError(\"Subject already exists\");\r\n return;\r\n }\r\n } else temp = [[title, code, contactHrs, creditHrs]];\r\n setSubjects(temp, docs.subjects);\r\n setEmptyTextfields();\r\n } else {\r\n setcreditHrsError(\"Credits hrs must !> contact hrs\");\r\n }\r\n } else {\r\n setRequiredError();\r\n }\r\n };\r\n return (\r\n \r\n Add Subject \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n \r\n {[1, 2, 3].map((option) => (\r\n \r\n {option}\r\n \r\n ))}\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {[1, 2, 3].map((option) => (\r\n \r\n {option}\r\n \r\n ))}\r\n \r\n
\r\n \r\n + Add Subject\r\n \r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport { TextField, Card, Button } from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // minWidth: 275,\r\n borderRadius: 20,\r\n margin: 10,\r\n minHeight: 360,\r\n display: 'grid',\r\n },\r\n title: {\r\n fontSize: 14,\r\n },\r\n textField: {\r\n margin: 5,\r\n },\r\n\r\n button: {\r\n },\r\n}));\r\n\r\nexport default function SectionInput({ sections, setSections }) {\r\n const classes = useStyles();\r\n\r\n const [title, setTitle] = React.useState(\"\");\r\n const [code, setCode] = React.useState(\"\");\r\n\r\n const [titleError, setTitleError] = React.useState(\"\");\r\n const [codeError, setCodeError] = React.useState(\"\");\r\n\r\n const titleChange = (event) => {\r\n setTitle(event.target.value);\r\n };\r\n const codeChange = (event) => {\r\n setCode(event.target.value);\r\n };\r\n\r\n const setRequiredError = () => {\r\n !title ? setTitleError(\"Required\") : setTitleError(\"\");\r\n !code ? setCodeError(\"Required\") : setCodeError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setTitle(\"\");\r\n setCode(\"\");\r\n\r\n setTitleError(\"\");\r\n setCodeError(\"\");\r\n };\r\n const addButton = () => {\r\n let temp = [...sections];\r\n if (title && code) {\r\n if (temp) {\r\n if (temp.findIndex((e) => e[1] === code) === -1)\r\n temp.push([title, code]);\r\n else {\r\n setRequiredError();\r\n setCodeError(\"Subject already exists\");\r\n return;\r\n }\r\n } else temp = [[title, code]];\r\n\r\n setSections(temp, docs.sections);\r\n setEmptyTextfields();\r\n } else {\r\n setRequiredError();\r\n }\r\n };\r\n return (\r\n \r\n Add Section \r\n \r\n \r\n
\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n />\r\n
\r\n \r\n \r\n + Add Section\r\n \r\n
\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport { TextField, Card, Button } from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // minWidth: 275,\r\n borderRadius: 20,\r\n margin: 10,\r\n minHeight: 360,\r\n display: \"grid\",\r\n },\r\n textField: {\r\n margin: 5,\r\n },\r\n button: {},\r\n}));\r\n\r\nexport default function TeacherInput({ teachers, setTeachers }) {\r\n const classes = useStyles();\r\n\r\n const [name, setName] = React.useState(\"\");\r\n const [code, setCode] = React.useState(\"\");\r\n\r\n const [nameError, setNameError] = React.useState(\"\");\r\n const [codeError, setCodeError] = React.useState(\"\");\r\n\r\n const nameChange = (event) => {\r\n setName(event.target.value);\r\n };\r\n const codeChange = (event) => {\r\n setCode(event.target.value);\r\n };\r\n\r\n const setRequiredError = () => {\r\n !name ? setNameError(\"Required\") : setNameError(\"\");\r\n !code ? setCodeError(\"Required\") : setCodeError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setName(\"\");\r\n setCode(\"\");\r\n\r\n setNameError(\"\");\r\n setCodeError(\"\");\r\n };\r\n const addButton = () => {\r\n let temp = [...teachers];\r\n if (name && code) {\r\n if (temp) {\r\n if (temp.findIndex((e) => e[1] === code) === -1)\r\n temp.push([name, code]);\r\n else {\r\n setRequiredError();\r\n setCodeError(\"Subject already exists\");\r\n return;\r\n }\r\n } else temp = [[name, code]];\r\n\r\n setTeachers(temp, docs.teachers);\r\n setEmptyTextfields();\r\n } else {\r\n setRequiredError();\r\n }\r\n };\r\n\r\n return (\r\n \r\n Add Teacher \r\n \r\n \r\n
\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n />\r\n
\r\n \r\n \r\n + Add Teacher\r\n \r\n
\r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(name, code, contantHrs) {\r\n return { name, code, contantHrs };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"name\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Title\",\r\n },\r\n { id: \"code\", numeric: true, disablePadding: false, label: \"Code\" },\r\n {\r\n id: \"contantHrs\",\r\n numeric: true,\r\n disablePadding: false,\r\n label: \"Contact Hrs\",\r\n },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, subjects, setSubjects } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...subjects];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[1] === element);\r\n temp.splice(target, 1);\r\n });\r\n\r\n setSubjects(temp, docs.subjects);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Subject Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n subjects: PropTypes.array,\r\n setSubjects: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Subject Table Export\r\n\r\nexport default function SubjectTable({ subjects, setSubjects }) {\r\n const rows = subjects\r\n ? subjects.map((subject) => createData(subject[0], subject[1], subject[2]))\r\n : createData(\"\", \"\", \"\");\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"code\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.code);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, code) => {\r\n const selectedIndex = selected.indexOf(code);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, code);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (name) => selected.indexOf(name) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.code);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.code)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.code ? row.code : \"rowCode\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.name}\r\n \r\n \r\n {row.code}\r\n \r\n {row.contantHrs} \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(name, code) {\r\n return { name, code };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"name\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Title\",\r\n },\r\n { id: \"code\", numeric: true, disablePadding: false, label: \"Code\" },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, sections, setSections } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...sections];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[1] === element);\r\n temp.splice(target, 1);\r\n });\r\n setSections(temp, docs.sections);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Section Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n sections: PropTypes.array,\r\n setSections: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Section Table Export Function\r\nexport default function SectionTable({ sections, setSections }) {\r\n const rows = sections\r\n ? sections.map((section) => createData(section[0], section[1]))\r\n : [createData(\"\", \"\")];\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"code\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.code);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, code) => {\r\n const selectedIndex = selected.indexOf(code);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, code);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (name) => selected.indexOf(name) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.code);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.code)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.code ? row.code : \"rowCode\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.name}\r\n \r\n \r\n {row.code}\r\n \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(name, code) {\r\n return { name, code };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"name\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Name\",\r\n },\r\n { id: \"code\", numeric: true, disablePadding: false, label: \"Code\" },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, teachers, setTeachers } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...teachers];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[1] === element);\r\n temp.splice(target, 1);\r\n });\r\n setTeachers(temp, docs.teachers);\r\n setSelected([]);\r\n };\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Teacher Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n teachers: PropTypes.array,\r\n setTeachers: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\nexport default function TeacherTable({ teachers, setTeachers }) {\r\n const rows = teachers\r\n ? teachers.map((teacher) => createData(teacher[0], teacher[1]))\r\n : [createData(\"\", \"\")];\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"code\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.code);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, code) => {\r\n const selectedIndex = selected.indexOf(code);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, code);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (name) => selected.indexOf(name) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.code);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.code)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.code ? row.code : \"rowCode\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.name}\r\n \r\n \r\n {row.code}\r\n \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n TextField,\r\n Card,\r\n CardContent,\r\n Button,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n minWidth: 275,\r\n margin: 10,\r\n borderRadius: 20,\r\n },\r\n content: {\r\n [theme.breakpoints.down(\"sm\")]: {\r\n padding: \"5% 10%\",\r\n },\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"flex\",\r\n justifyContent: \"space-around\",\r\n },\r\n },\r\n textField: {\r\n margin: 5,\r\n minWidth: 200,\r\n },\r\n button: {\r\n [theme.breakpoints.up(\"sm\")]: {\r\n marginLeft: \"5%\",\r\n },\r\n },\r\n}));\r\n\r\nconst lectureArrangement = [[\"1\"], [\"1 - 1\", \"2\"], [\"1 - 1 - 1\", \"2 - 1\", \"3\"]];\r\nexport default function LectureInput({\r\n lectures,\r\n setLectures,\r\n subjects,\r\n sections,\r\n teachers,\r\n}) {\r\n const classes = useStyles();\r\n const [subject, setsubject] = useState(\"\");\r\n const [section, setsection] = useState(\"\");\r\n const [teacher, setteacher] = useState(\"\");\r\n const [lectureArr, setlectureArr] = useState(\"\");\r\n\r\n const [subjectError, setsubjectError] = useState(\"\");\r\n const [sectionError, setsectionError] = useState(\"\");\r\n const [teacherError, setteacherError] = useState(\"\");\r\n const [lecturearrError, setlecturearrError] = useState(\"\");\r\n\r\n const subjectChange = (event) => {\r\n setlectureArr(\"\");\r\n setsubject(event.target.value);\r\n };\r\n\r\n const sectionChange = (event) => {\r\n setsection(event.target.value);\r\n };\r\n\r\n const teacherChange = (event) => {\r\n setteacher(event.target.value);\r\n };\r\n\r\n const lecturesChange = (event) => {\r\n setlectureArr(event.target.value);\r\n };\r\n\r\n const setRequiredError = () => {\r\n !subject ? setsubjectError(\"Required\") : setsubjectError(\"\");\r\n !teacher ? setteacherError(\"Required\") : setteacherError(\"\");\r\n !section ? setsectionError(\"Required\") : setsectionError(\"\");\r\n !lectureArr ? setlecturearrError(\"Required\") : setlecturearrError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setlectureArr(\"\");\r\n setsubject(\"\");\r\n setteacher(\"\");\r\n setsection(\"\");\r\n\r\n setsubjectError(\"\");\r\n setteacherError(\"\");\r\n setsectionError(\"\");\r\n setlecturearrError(\"\");\r\n };\r\n\r\n const addButton = () => {\r\n if (subject && teacher && section && lectureArr) {\r\n let temp = [...lectures];\r\n \r\n if (lectures) {\r\n if (\r\n temp.findIndex(\r\n (e) =>\r\n e[4] === teacher + section ||\r\n (e[1] === section && e[2] === subject)\r\n ) === -1\r\n )\r\n temp.push([teacher, section, subject, lectureArr, teacher + section]);\r\n else {\r\n setRequiredError();\r\n setteacherError(\"Lecture already exists\");\r\n setsubjectError(\"Lecture already exists\");\r\n setsectionError(\"Lecture already exists\");\r\n return;\r\n }\r\n } else\r\n temp = [[teacher, section, subject, lectureArr, teacher + section]];\r\n\r\n setLectures(temp, docs.lectures);\r\n setEmptyTextfields();\r\n } else setRequiredError();\r\n };\r\n\r\n const selectedIndex = (array, element, index) =>\r\n array[array.findIndex((e) => e[index] === element)];\r\n\r\n const subjectIndex = selectedIndex(subjects, subject, 1);\r\n\r\n return (\r\n \r\n \r\n Add Lectures \r\n \r\n \r\n {teachers.map((option) => (\r\n \r\n {option[0]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n \r\n {sections.map((option) => (\r\n \r\n {option[1]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n \r\n {subjects.map((option) => (\r\n \r\n {option[1]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {subject && subjectIndex ? (\r\n lectureArrangement[subjectIndex[2] - 1].map((option) => (\r\n \r\n {option}\r\n \r\n ))\r\n ) : (\r\n \r\n )}\r\n \r\n
\r\n\r\n \r\n + Add Lecture\r\n \r\n \r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(teacher, section, subject, arrangement, lectureID) {\r\n return { teacher, section, subject, arrangement, lectureID };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"teacher\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Teacher\",\r\n },\r\n { id: \"section\", numeric: true, disablePadding: false, label: \"Section\" },\r\n {\r\n id: \"subject\",\r\n numeric: true,\r\n disablePadding: false,\r\n label: \"Subject\",\r\n },\r\n // {\r\n // id: \"arrangement\",\r\n // numeric: true,\r\n // disablePadding: false,\r\n // label: \"Arrangement\",\r\n // },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const { numSelected, selected, setSelected, lectures, setLectures } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = [...lectures];\r\n\r\n selected.forEach((element) => {\r\n let target = temp.findIndex((e) => e[4] === element);\r\n temp.splice(target, 1);\r\n });\r\n\r\n setLectures(temp, docs.lectures);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Lecture Table\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n lectures: PropTypes.array,\r\n setLectures: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Lecture Table Export\r\nexport default function LectureTable({ lectures, setLectures }) {\r\n const rows = lectures\r\n ? lectures.map((lecture) =>\r\n createData(lecture[0], lecture[1], lecture[2], lecture[3], lecture[4])\r\n )\r\n : [createData(\"\", \"\", \"\", \"\", \"\")];\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"lectureID\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.lectureID);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, lectureID) => {\r\n const selectedIndex = selected.indexOf(lectureID);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, lectureID);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (element) => selected.indexOf(element) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.lectureID);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.lectureID)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.lectureID ? row.lectureID : \"rowlectureID\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.teacher}\r\n \r\n \r\n {row.section}\r\n \r\n {row.subject} \r\n {/* {row.arrangement} */}\r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport {\r\n TextField,\r\n Card,\r\n CardContent,\r\n Button,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n minWidth: 275,\r\n margin: 10,\r\n borderRadius: 20,\r\n },\r\n content: {\r\n [theme.breakpoints.down(\"sm\")]: {\r\n padding: \"5% 10%\",\r\n },\r\n [theme.breakpoints.up(\"md\")]: {\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n },\r\n },\r\n textField: {\r\n margin: 5,\r\n minWidth: 200,\r\n [theme.breakpoints.up(\"md\")]: {\r\n minWidth: 150,\r\n },\r\n },\r\n button: {\r\n [theme.breakpoints.up(\"sm\")]: {\r\n marginLeft: \"5%\",\r\n },\r\n },\r\n}));\r\n\r\nexport default function WorkingtimeInput({\r\n workingTime,\r\n setworkingTime,\r\n sections,\r\n}) {\r\n const classes = useStyles();\r\n\r\n const [day, setday] = useState(\"\");\r\n const [period, setperiod] = useState(\"\");\r\n // const [room, setroom] = useState(sections.length);\r\n\r\n const [dayError, setdayError] = useState(\"\");\r\n const [periodError, setperiodError] = useState(\"\");\r\n\r\n const dayChange = (event) => {\r\n setday(event.target.value);\r\n };\r\n\r\n const periodChange = (event) => {\r\n setperiod(event.target.value);\r\n };\r\n // const roomChange = (event) => {\r\n // setroom(event.target.value);\r\n // };\r\n\r\n const setRequiredError = () => {\r\n !day ? setdayError(\"Required\") : setdayError(\"\");\r\n !period ? setperiodError(\"Required\") : setperiodError(\"\");\r\n };\r\n\r\n const setEmptyTextfields = () => {\r\n setday(\"\");\r\n setperiod(\"\");\r\n\r\n setdayError(\"\");\r\n setperiodError(\"\");\r\n };\r\n\r\n const addButton = () => {\r\n if (day && period) {\r\n let temp = { ...workingTime };\r\n temp[day] = period;\r\n // temp = temp.filter((value) => value !== day);\r\n setworkingTime(temp, docs.workingTime);\r\n\r\n setEmptyTextfields();\r\n } else setRequiredError();\r\n };\r\n\r\n return (\r\n \r\n \r\n Working Days & Periods \r\n\r\n \r\n \r\n {Object.entries(workingTime)\r\n .filter((e) => e[1] === 0)\r\n .map((option) => (\r\n \r\n {option[0]}\r\n \r\n ))}\r\n \r\n
\r\n\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {[1, 2, 3, 4, 5, 6, 7].map((option) => (\r\n \r\n {option}\r\n \r\n ))}\r\n \r\n
\r\n \r\n {\r\n if (e.keyCode === 13) addButton();\r\n }}\r\n InputLabelProps={{\r\n shrink: true,\r\n }}\r\n variant=\"outlined\"\r\n >\r\n {\r\n \r\n {sections.length}\r\n \r\n }\r\n \r\n
\r\n \r\n +Add\r\n \r\n \r\n \r\n );\r\n}\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport clsx from \"clsx\";\r\nimport { lighten, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TablePagination from \"@material-ui/core/TablePagination\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableSortLabel from \"@material-ui/core/TableSortLabel\";\r\nimport Toolbar from \"@material-ui/core/Toolbar\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport docs from \"../../../constants/docs\";\r\n\r\nfunction createData(day, lectureCount) {\r\n return { day, lectureCount };\r\n}\r\n\r\nfunction descendingComparator(a, b, orderBy) {\r\n if (b[orderBy] < a[orderBy]) {\r\n return -1;\r\n }\r\n if (b[orderBy] > a[orderBy]) {\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction getComparator(order, orderBy) {\r\n return order === \"desc\"\r\n ? (a, b) => descendingComparator(a, b, orderBy)\r\n : (a, b) => -descendingComparator(a, b, orderBy);\r\n}\r\n\r\nfunction stableSort(array, comparator) {\r\n const stabilizedThis = array.map((el, index) => [el, index]);\r\n stabilizedThis.sort((a, b) => {\r\n const order = comparator(a[0], b[0]);\r\n if (order !== 0) return order;\r\n return a[1] - b[1];\r\n });\r\n return stabilizedThis.map((el) => el[0]);\r\n}\r\n\r\nconst headCells = [\r\n {\r\n id: \"day\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: \"Day\",\r\n },\r\n {\r\n id: \"lectureCount\",\r\n numeric: true,\r\n disablePadding: false,\r\n label: \"Lectures\",\r\n },\r\n];\r\n\r\nfunction EnhancedTableHead(props) {\r\n const {\r\n classes,\r\n onSelectAllClick,\r\n order,\r\n orderBy,\r\n numSelected,\r\n rowCount,\r\n onRequestSort,\r\n } = props;\r\n const createSortHandler = (property) => (event) => {\r\n onRequestSort(event, property);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n 0 && numSelected < rowCount}\r\n checked={rowCount > 0 && numSelected === rowCount}\r\n onChange={onSelectAllClick}\r\n inputProps={{ \"aria-label\": \"select all desserts\" }}\r\n />\r\n \r\n {headCells.map((headCell) => (\r\n \r\n \r\n {headCell.label}\r\n {orderBy === headCell.id ? (\r\n \r\n {order === \"desc\" ? \"sorted descending\" : \"sorted ascending\"}\r\n \r\n ) : null}\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\n\r\nEnhancedTableHead.propTypes = {\r\n classes: PropTypes.object.isRequired,\r\n numSelected: PropTypes.number.isRequired,\r\n onRequestSort: PropTypes.func.isRequired,\r\n onSelectAllClick: PropTypes.func.isRequired,\r\n order: PropTypes.oneOf([\"asc\", \"desc\"]).isRequired,\r\n orderBy: PropTypes.string.isRequired,\r\n rowCount: PropTypes.number.isRequired,\r\n};\r\n\r\nconst useToolbarStyles = makeStyles((theme) => ({\r\n root: {\r\n paddingLeft: theme.spacing(2),\r\n paddingRight: theme.spacing(1),\r\n },\r\n highlight:\r\n theme.palette.type === \"light\"\r\n ? {\r\n color: theme.palette.secondary.main,\r\n backgroundColor: lighten(theme.palette.secondary.light, 0.85),\r\n }\r\n : {\r\n color: theme.palette.text.primary,\r\n backgroundColor: theme.palette.secondary.dark,\r\n },\r\n title: {\r\n flex: \"1 1 100%\",\r\n },\r\n}));\r\n\r\nconst EnhancedTableToolbar = (props) => {\r\n const classes = useToolbarStyles();\r\n const {\r\n numSelected,\r\n selected,\r\n setSelected,\r\n workingTime,\r\n setworkingTime,\r\n } = props;\r\n\r\n const deleteRow = () => {\r\n let temp = { ...workingTime };\r\n console.log(selected);\r\n selected.forEach((element) => {\r\n temp[element] = 0;\r\n });\r\n setworkingTime(temp, docs.workingTime);\r\n setSelected([]);\r\n };\r\n\r\n return (\r\n 0,\r\n })}\r\n >\r\n {numSelected > 0 ? (\r\n \r\n {numSelected} selected\r\n \r\n ) : (\r\n \r\n Working Days\r\n \r\n )}\r\n\r\n {numSelected > 0 ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : (\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nEnhancedTableToolbar.propTypes = {\r\n numSelected: PropTypes.number.isRequired,\r\n selected: PropTypes.array,\r\n setSelected: PropTypes.func,\r\n workingTime: PropTypes.object,\r\n setworkingTime: PropTypes.func,\r\n};\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n // width: \"100%\",\r\n margin: 10,\r\n },\r\n paper: {\r\n borderRadius: 20,\r\n width: \"100%\",\r\n marginBottom: theme.spacing(2),\r\n },\r\n table: {\r\n // minWidth: 750,\r\n },\r\n visuallyHidden: {\r\n border: 0,\r\n clip: \"rect(0 0 0 0)\",\r\n height: 1,\r\n margin: -1,\r\n overflow: \"hidden\",\r\n padding: 0,\r\n position: \"absolute\",\r\n top: 20,\r\n width: 1,\r\n },\r\n}));\r\n\r\n// Section Table Export Function\r\nexport default function WorkingtimeTable({ workingTime, setworkingTime }) {\r\n const rows = Object.entries(workingTime)\r\n .filter((e) => e[1] !== 0)\r\n .map((time) => createData(time[0], time[1]));\r\n\r\n const classes = useStyles();\r\n const [order, setOrder] = React.useState(\"asc\");\r\n const [orderBy, setOrderBy] = React.useState(\"lectureCount\");\r\n const [selected, setSelected] = React.useState([]);\r\n const [page, setPage] = React.useState(0);\r\n const [rowsPerPage, setRowsPerPage] = React.useState(5);\r\n\r\n const handleRequestSort = (event, property) => {\r\n const isAsc = orderBy === property && order === \"asc\";\r\n setOrder(isAsc ? \"desc\" : \"asc\");\r\n setOrderBy(property);\r\n };\r\n\r\n const handleSelectAllClick = (event) => {\r\n if (event.target.checked) {\r\n const newSelecteds = rows.map((n) => n.day);\r\n setSelected(newSelecteds);\r\n return;\r\n }\r\n setSelected([]);\r\n };\r\n\r\n const handleClick = (event, element) => {\r\n const selectedIndex = selected.indexOf(element);\r\n let newSelected = [];\r\n\r\n if (selectedIndex === -1) {\r\n newSelected = newSelected.concat(selected, element);\r\n } else if (selectedIndex === 0) {\r\n newSelected = newSelected.concat(selected.slice(1));\r\n } else if (selectedIndex === selected.length - 1) {\r\n newSelected = newSelected.concat(selected.slice(0, -1));\r\n } else if (selectedIndex > 0) {\r\n newSelected = newSelected.concat(\r\n selected.slice(0, selectedIndex),\r\n selected.slice(selectedIndex + 1)\r\n );\r\n }\r\n\r\n setSelected(newSelected);\r\n };\r\n\r\n const handleChangePage = (event, newPage) => {\r\n setPage(newPage);\r\n };\r\n\r\n const handleChangeRowsPerPage = (event) => {\r\n setRowsPerPage(parseInt(event.target.value, 10));\r\n setPage(0);\r\n };\r\n\r\n const isSelected = (element) => selected.indexOf(element) !== -1;\r\n\r\n const emptyRows =\r\n rowsPerPage - Math.min(rowsPerPage, rows.length - page * rowsPerPage);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n {stableSort(rows, getComparator(order, orderBy))\r\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\r\n .map((row, index) => {\r\n const isItemSelected = isSelected(row.day);\r\n const labelId = `enhanced-table-checkbox-${index}`;\r\n\r\n return (\r\n handleClick(event, row.day)}\r\n role=\"checkbox\"\r\n aria-checked={isItemSelected}\r\n tabIndex={-1}\r\n key={row.day ? row.day : \"rowDay\"}\r\n selected={isItemSelected}\r\n >\r\n \r\n \r\n \r\n \r\n {row.day}\r\n \r\n \r\n {row.lectureCount}\r\n \r\n \r\n );\r\n })}\r\n {emptyRows > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { withStyles, makeStyles } from \"@material-ui/core/styles\";\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableContainer from \"@material-ui/core/TableContainer\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\n\r\nconst StyledTableCell = withStyles((theme) => ({\r\n head: {\r\n backgroundColor: theme.palette.common.black,\r\n color: theme.palette.common.white,\r\n },\r\n body: {\r\n fontSize: 14,\r\n },\r\n}))(TableCell);\r\n\r\nconst StyledTableRow = withStyles((theme) => ({\r\n root: {\r\n \"&:nth-of-type(odd)\": {\r\n backgroundColor: theme.palette.action.hover,\r\n },\r\n },\r\n}))(TableRow);\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n margin: theme.spacing(2),\r\n },\r\n table: {\r\n minWidth: 360,\r\n },\r\n}));\r\n\r\nconst weekDays = [\"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"];\r\n\r\nexport default function Timetable({ timeTable, section }) {\r\n const classes = useStyles();\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n Section {section}\r\n \r\n {timeTable ? (\r\n timeTable[0].map((day, i) => (\r\n \r\n Lecture {i + 1}\r\n \r\n ))\r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n {timeTable.map((row, i) => (\r\n \r\n \r\n {weekDays[i]}\r\n \r\n {row.map((r, j) => (\r\n \r\n {r ? r : \"FREE\"}\r\n \r\n ))}\r\n \r\n ))}\r\n \r\n
\r\n \r\n );\r\n}\r\n","import React, { useState, useCallback } from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport PrimaryAppBar from './Appbar';\r\nimport SubjectInput from './InputCards/subjectInput';\r\nimport SectionInput from './InputCards/sectionInput';\r\nimport TeacherInput from './InputCards/teacherInput';\r\nimport SubjectTable from './Tables/subjectTable';\r\nimport SectionTable from './Tables/sectionTable';\r\nimport TeacherTable from './Tables/teacherTable';\r\nimport LectureInput from './lectures/lectureInput';\r\nimport LectureTable from './lectures/lectureTable';\r\nimport WorkingtimeInput from './InputCards/workingtimeInput';\r\nimport WorkingtimeTable from './Tables/workingtimeTable';\r\nimport Timetable from './timetable';\r\nimport { Button, CircularProgress } from '@material-ui/core';\r\nimport './home.css';\r\nimport docs from '../../constants/docs';\r\nimport firebase from 'firebase';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n cardHolder: {\r\n display: 'flex',\r\n flexFlow: 'row wrap',\r\n justifyContent: 'space-evenly',\r\n marginTop: 10,\r\n },\r\n lectures: {\r\n width: '100%',\r\n margin: '0% 5%',\r\n },\r\n genButton: {\r\n marginBottom: 25,\r\n },\r\n wrapper: {\r\n position: 'relative',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n },\r\n buttonProgress: {\r\n position: 'absolute',\r\n top: '3%',\r\n },\r\n}));\r\n\r\nconst weekSchedule = { MON: 0, TUE: 0, WED: 0, THU: 0, FRI: 0, SAT: 0 };\r\n\r\nconst Home = () => {\r\n const db = firebase.firestore();\r\n const userRef = db.collection(firebase.auth().currentUser.uid);\r\n const classes = useStyles();\r\n\r\n const [subjects, setSubjects] = useState([]);\r\n const [sections, setSections] = useState([]);\r\n const [teachers, setTeachers] = useState([]);\r\n const [lectures, setLectures] = useState([]);\r\n const [workingTime, setworkingTime] = useState(weekSchedule);\r\n const [loading, setloading] = useState(false);\r\n const [timetable, settimetable] = useState(undefined);\r\n\r\n const updateDB = (sub, docType) => {\r\n switch (docType) {\r\n case 'subjects':\r\n setSubjects(sub);\r\n break;\r\n case 'sections':\r\n setSections(sub);\r\n break;\r\n case 'teachers':\r\n setTeachers(sub);\r\n break;\r\n case 'lectures':\r\n setLectures(sub);\r\n break;\r\n case 'workingTime':\r\n setworkingTime(sub);\r\n break;\r\n default:\r\n console.error('Wrong Document');\r\n }\r\n userRef\r\n .doc(docType)\r\n .set(docType === docs.workingTime ? sub : { ...Object(sub) })\r\n .then((e) => console.log('saved'))\r\n .catch((e) => console.error('error', e));\r\n };\r\n\r\n const fetchTimetable = useCallback(async () => {\r\n const db = firebase.firestore();\r\n const userRef = db.collection(firebase.auth().currentUser.uid);\r\n\r\n const temp = {};\r\n\r\n await userRef\r\n .doc(docs.timeTable)\r\n .collection(docs.timeTable)\r\n .onSnapshot((snapshot) => {\r\n if (!snapshot.empty) {\r\n const lecSec = [];\r\n snapshot.forEach((snap) => {\r\n temp[snap.id] = Object.values(snap.data());\r\n lecSec.push(snap.id);\r\n });\r\n settimetable(temp);\r\n }\r\n });\r\n }, []);\r\n\r\n const fetchRecords = useCallback(async () => {\r\n const db = firebase.firestore();\r\n const userRef = db.collection(firebase.auth().currentUser.uid);\r\n userRef\r\n .get()\r\n .then((snapShot) => {\r\n snapShot.forEach((doc) => {\r\n const records =\r\n doc.id === docs.workingTime\r\n ? doc.data()\r\n : Object.values(doc.data());\r\n switch (doc.id) {\r\n case docs.subjects:\r\n setSubjects(records);\r\n break;\r\n case docs.sections:\r\n setSections(records);\r\n break;\r\n case docs.teachers:\r\n setTeachers(records);\r\n break;\r\n case docs.lectures:\r\n setLectures(records);\r\n break;\r\n case docs.workingTime:\r\n setworkingTime(records);\r\n break;\r\n\r\n default:\r\n console.error('Wrong Document');\r\n }\r\n });\r\n })\r\n .catch((e) => console.log('err', e));\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n fetchRecords();\r\n fetchTimetable();\r\n }, [fetchRecords, fetchTimetable]);\r\n\r\n const generateButton = () => {\r\n const requestOptions = {\r\n method: 'POST',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify({ userID: firebase.auth().currentUser.uid }),\r\n };\r\n setloading(true);\r\n fetch('http://localhost:3001/generate', requestOptions)\r\n .then((response) => response.json())\r\n .then(async () => {\r\n fetchTimetable();\r\n setloading(false);\r\n })\r\n .catch((e) => {\r\n console.log(e);\r\n setloading(false);\r\n });\r\n };\r\n // console.log(subjects);\r\n // console.log(sections);\r\n // console.log(teachers);\r\n // console.log(lectures);\r\n // console.log(workingTime);\r\n console.log(timetable);\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n Generate Timetable\r\n \r\n {loading && (\r\n \r\n )}\r\n
\r\n
\r\n {timetable ? (\r\n Object.keys(timetable).sort().map((sec, i) => (\r\n
\r\n ))\r\n ) : (\r\n
\r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Home;\r\n","import React, { Component } from \"react\";\nimport \"./App.css\";\nimport StyledFirebaseAuth from \"react-firebaseui/StyledFirebaseAuth\";\nimport firebase from \"firebase\";\nimport Logo from \"./Logo/Logo\";\nimport Particles from \"react-particles-js\";\nimport \"tachyons\";\nimport Home from \"./Home/home\";\n\nfirebase.initializeApp({\n apiKey: \"AIzaSyBwPBLFoMMqwyUJcJewqLip4guij7CNjZg\",\n authDomain: \"activity-scheduling-d6be4.firebaseapp.com\",\n databaseURL: \"https://activity-scheduling-d6be4.firebaseio.com\",\n projectId: \"activity-scheduling-d6be4\",\n storageBucket: \"activity-scheduling-d6be4.appspot.com\",\n messagingSenderId: \"1050964579186\",\n appId: \"1:1050964579186:web:85db424e474670098b03eb\",\n});\n\nconst particlesOptions = {\n particles: {\n number: {\n value: 100,\n density: {\n enable: true,\n value_area: 700,\n },\n },\n },\n};\n\nclass App extends Component {\n state = { isSignedIn: false };\n uiConfig = {\n signInFlow: \"popup\",\n signInOptions: [\n firebase.auth.GoogleAuthProvider.PROVIDER_ID,\n firebase.auth.EmailAuthProvider.PROVIDER_ID,\n firebase.auth.FacebookAuthProvider.PROVIDER_ID,\n ],\n callbacks: {\n signInSuccessWithAuthResult: () => false,\n },\n };\n\n componentDidMount = () => {\n firebase.auth().onAuthStateChanged((user) => {\n this.setState({ isSignedIn: !!user });\n });\n };\n\n render() {\n return (\n \n {this.state.isSignedIn ? (\n
\n ) : (\n
\n )}\n
\n );\n }\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./index.css\";\nimport App from \"./components/App\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nReactDOM.render( , document.getElementById(\"root\"));\n\nserviceWorker.unregister();\n"],"sourceRoot":""}
\ No newline at end of file