-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,395 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import React, { useState } from 'react'; | ||
import StudentInfo from './../components/DashBoard/studentInfo'; | ||
import Training from './../components/DashBoard/studentTraining'; | ||
import Footer from './../components/header_footer/Footer'; | ||
import '../../node_modules/bootstrap/dist/css/bootstrap.min.css'; | ||
import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom'; | ||
import './StudentDashboard.css'; | ||
|
||
function DataTable() { | ||
const [currentView, setCurrentView] = useState('StudentInfo'); | ||
|
||
const handleNavigation = (viewName) => { | ||
setCurrentView(viewName); | ||
}; | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
return ( | ||
<div className="student-dashboard"> | ||
<nav className="navbar navbar-expand-lg navbar-light bg-light"> | ||
<a className="navbar-brand" href="#"> | ||
<img className="logo" src="https://i.ibb.co/CMwkBmw/lSgDz8N.png" alt="logo" /> | ||
</a> | ||
<ul className="navbar-nav ms-auto"> | ||
<li style={{padding: '2vh'}}> | ||
<a className="nav-link" href="#">Nguyen Van A - SVxxxxx</a> | ||
</li> | ||
<li style={{padding: '2vh'}}> | ||
<i className="fa fa-solid fa-bell fa-lg fa-3x"></i> | ||
Logout | ||
</li> | ||
</ul> | ||
</nav> | ||
|
||
<div className="container-fluid"> | ||
<div className="row"> | ||
<div className="col-md-2 leftBody"> | ||
<ul className="nav flex-column"> | ||
<li className="nav-item" style={{ paddingTop: '2rem' }}> | ||
<i className="fas fa-solid fa-home fa-md fa-2x"></i> Home | ||
</li> | ||
<li className="nav-item" style={{ paddingTop: '2rem' }}> | ||
<i className="fas fa-regular fa-id-badge fa-md fa-2x"></i> Student | ||
</li> | ||
<li className="nav-item" style={{ paddingTop: '2rem', cursor: 'pointer'}} onClick={() => setIsOpen(!isOpen)}> | ||
<i className="fa fa-solid fa-book fa-md fa-2x"></i> Study | ||
<i class="fa-solid fa-angles-down"></i> | ||
{isOpen && ( | ||
<ul> | ||
<li className="nav-item" style={{ paddingTop: '2rem'}}><Link to={'/course'} style={{color: 'white', padding: '0'}}>Course</Link></li> | ||
<li className="nav-item" style={{ paddingTop: '2rem' }}><Link to={'/course1'} style={{color: 'white', padding: '0'}}>Course registration</Link></li> | ||
</ul> | ||
)} | ||
</li> | ||
<li className="nav-item" style={{ paddingTop: '2rem' }}> | ||
<i className="fa fa-solid fa-question fa-md fa-2x"></i> Assistant | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div className="col-md-10 rightBody"> | ||
<div className="dataTable mx-auto"> | ||
<nav> | ||
<div className="navigation"> | ||
<a | ||
onClick={() => handleNavigation('StudentInfo')} | ||
style={{ fontWeight: 'bold'}} | ||
className={currentView === 'StudentInfo' ? 'active' : ''} | ||
> | ||
Student Information | ||
</a> | ||
<a | ||
href="#" | ||
onClick={() => handleNavigation('Training')} | ||
style={{ fontWeight: 'bold' }} | ||
className={currentView === 'Training' ? 'active' : ''} | ||
> | ||
Training Information | ||
</a> | ||
</div> | ||
</nav> | ||
<div style={{ padding: '10px' }}> | ||
<i style={{ fontWeight: 'bold' }}>Last updated time: dd/mm/yyyy realtime</i> | ||
</div> | ||
{currentView === 'StudentInfo' && <StudentInfo />} | ||
{currentView === 'Training' && <Training />} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<Footer /> | ||
</div> | ||
); | ||
} | ||
|
||
export default DataTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const bangdiemModel = require("../../../models/course.model"); | ||
const student = require("../../../models/student.model") | ||
|
||
const getbangdiem = async (req, res) => { | ||
const { mssv } = req.user; | ||
try { | ||
const sv_filter = {"mssv": mssv}; | ||
const st = await student.findOne(sv_filter) | ||
const cou = st.courseEnroll; | ||
if (!cou) { | ||
return res.status(404).json({ message: "Bang diem not found." }); | ||
} | ||
res.send(cou); | ||
} | ||
catch (error) { | ||
res.status(500).json({ message: error.message }); | ||
} | ||
} | ||
|
||
const getbangdiemBySem = async (req, res) => { | ||
const { mssv } = req.user; | ||
const { semester } = req.params | ||
try { | ||
const sv_filter = {"mssv": mssv}; | ||
const sem_filter = {"semester": semester} | ||
const cou = await student.aggregate([ | ||
{$match: sv_filter}, | ||
{$unwind: "$courseEnroll"}, | ||
{$replaceRoot: {newRoot: "$courseEnroll"}}, | ||
{$match: sem_filter} | ||
]) | ||
if (!cou) { | ||
return res.status(404).json({ message: "Bang diem not found." }); | ||
} | ||
res.send(cou); | ||
} | ||
catch (error) { | ||
res.status(500).json({ message: error.message }); | ||
} | ||
} | ||
|
||
module.exports = { getbangdiem, getbangdiemBySem }; |
Oops, something went wrong.