diff --git a/login-frontend/src/components/header_footer/Footer.js b/login-frontend/src/components/header_footer/Footer.js
index e6cb36a..c493842 100644
--- a/login-frontend/src/components/header_footer/Footer.js
+++ b/login-frontend/src/components/header_footer/Footer.js
@@ -5,14 +5,14 @@ import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
function Footer() {
return (
<>
-
+
+
>
);
}
diff --git a/login-frontend/src/components/header_footer/Header.js b/login-frontend/src/components/header_footer/StudentHeader.js
similarity index 86%
rename from login-frontend/src/components/header_footer/Header.js
rename to login-frontend/src/components/header_footer/StudentHeader.js
index 43df0e1..a54a915 100644
--- a/login-frontend/src/components/header_footer/Header.js
+++ b/login-frontend/src/components/header_footer/StudentHeader.js
@@ -4,10 +4,10 @@ import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
import { Navbar, Nav, Form, Button, Row, Col } from "react-bootstrap";
import NavDropdown from 'react-bootstrap/NavDropdown';
-function Header() {
+function StudentHeader() {
return (
<>
-
+
{/**/}
@@ -15,7 +15,7 @@ function Header() {
Khóa học của tôi
- Đăng ký môn học
+ Đăng ký môn học
@@ -34,4 +34,4 @@ function Header() {
);
}
-export default Header;
\ No newline at end of file
+export default StudentHeader;
\ No newline at end of file
diff --git a/login-frontend/src/components/header_footer/TeacherHeader.js b/login-frontend/src/components/header_footer/TeacherHeader.js
new file mode 100644
index 0000000..cae5a62
--- /dev/null
+++ b/login-frontend/src/components/header_footer/TeacherHeader.js
@@ -0,0 +1,28 @@
+import React, { useState, useEffect } from 'react';
+import axios from 'axios';
+import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
+import { Navbar, Nav, Form, Button, Row, Col } from "react-bootstrap";
+import NavDropdown from 'react-bootstrap/NavDropdown';
+
+function TeacherHeader() {
+ return (
+ <>
+
+
+
+
NGUYEN VAN B - MSGV
+
+
+
+ >
+ );
+}
+
+export default TeacherHeader;
\ No newline at end of file
diff --git a/login-frontend/src/context/authContext.js b/login-frontend/src/context/authContext.js
index 25aabd1..dad336d 100644
--- a/login-frontend/src/context/authContext.js
+++ b/login-frontend/src/context/authContext.js
@@ -30,7 +30,5 @@ export function AuthProvider({ children }) {
};
const value = { user, login, register };
- console.log("value after set ", value)
-
return {children};
}
diff --git a/login-frontend/src/pages/authPage.js b/login-frontend/src/pages/authPage.js
index de937ee..141a14b 100644
--- a/login-frontend/src/pages/authPage.js
+++ b/login-frontend/src/pages/authPage.js
@@ -1,18 +1,32 @@
-import React, { useState } from 'react';
+import React, { useEffect, useState } from 'react';
import { AuthProvider } from '../context/authContext';
import Login from '../components/auth/login';
-import Register from '../components/auth/register';
+import ChangePassword from './../components/auth/changePassword';
const authBG = "https://i.ibb.co/9YFh3Tn/lhuEjVn.jpg";
const logo = "https://i.ibb.co/CMwkBmw/lSgDz8N.png";
function App() {
- const [currentView, setCurrentView] = useState('Login');
-
- const handleViewChange = (newView) => {
- setCurrentView(newView);
- };
+ const [authType, setAuthType] = useState('Login');
+ useEffect(() => {
+ const pathname = window.location.pathname;
+
+ const regex = /\/(login|changepassword)/g;
+ const match = pathname.match(regex);
+ if(match[0] === '/login'){
+ setAuthType('Login');
+ }
+ else if(match[0] === '/changepassword'){
+ setAuthType('ChangePassword');
+ }
+ }, []);
+ const switchToChangePassword = () => {
+ switch (authType){
+ case 'Login': return ;
+ case 'ChangePassword': return ;
+ }
+ }
return (
-
+
Welcome
- {currentView === 'Login' ? (
- // Pass prop as function reference
- ) : (
- // Pass prop as function reference
- )}
+ {switchToChangePassword()}
diff --git a/login-frontend/src/components/coursePage/Course.js b/login-frontend/src/pages/coursePage/Course.js
similarity index 82%
rename from login-frontend/src/components/coursePage/Course.js
rename to login-frontend/src/pages/coursePage/Course.js
index 255b412..0dc39b3 100644
--- a/login-frontend/src/components/coursePage/Course.js
+++ b/login-frontend/src/pages/coursePage/Course.js
@@ -7,16 +7,16 @@ import Navbar from 'react-bootstrap/Navbar';
import NavDropdown from 'react-bootstrap/NavDropdown';
import { Button } from 'react-bootstrap';
-import Header from './../header_footer/Header';
-import Footer from './../header_footer/Footer';
+import StudentHeader from '../../components/header_footer/StudentHeader';
+import Footer from '../../components/header_footer/Footer';
function Course() {
const course_bg = 'http://i.ibb.co/GVRnWJC/course-bg.jpg';
return (
<>
-
-
+
+
CHĂM CHỈ DỄ DÀNG THÀNH CÔNG
diff --git a/login-frontend/src/components/coursePage/Course1.js b/login-frontend/src/pages/coursePage/Course1.js
similarity index 90%
rename from login-frontend/src/components/coursePage/Course1.js
rename to login-frontend/src/pages/coursePage/Course1.js
index 339cce9..3806fa0 100644
--- a/login-frontend/src/components/coursePage/Course1.js
+++ b/login-frontend/src/pages/coursePage/Course1.js
@@ -10,13 +10,13 @@ import Card from 'react-bootstrap/Card';
import Col from 'react-bootstrap/Col';
import Row from 'react-bootstrap/Row';
-import Header from './../header_footer/Header';
-import Footer from './../header_footer/Footer';
+import StudentHeader from '../../components/header_footer/StudentHeader';
+import Footer from '../../components/header_footer/Footer';
function Course1() {
return (
<>
-
+
Khóa học của tôi
diff --git a/login-frontend/src/pages/coursePage/CourseRegistration.js b/login-frontend/src/pages/coursePage/CourseRegistration.js
new file mode 100644
index 0000000..caa6bfa
--- /dev/null
+++ b/login-frontend/src/pages/coursePage/CourseRegistration.js
@@ -0,0 +1,200 @@
+import React, { useState, useEffect } from 'react';
+import axios from 'axios';
+import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
+import { Table, Button, Modal, Form, Row, Col, Tab, ListGroup } from 'react-bootstrap';
+
+import StudentHeader from '../../components/header_footer/StudentHeader';
+import Footer from '../../components/header_footer/Footer';
+
+const CourseRegistration = () => {
+ const [courses, setCourses] = useState([]);
+ const [showModal, setShowModal] = useState(false);
+ const [selectedCourse, setSelectedCourse] = useState(null);
+ const [teacher, setTeacher] = useState('');
+ const [time, setTime] = useState('');
+
+ useEffect(() => {
+ fetchCourses();
+ }, []);
+
+ const fetchCourses = async () => {
+ try {
+ const response = await fetch('your_api_endpoint_here');
+ const data = await response.json();
+ setCourses(data);
+ } catch (error) {
+ console.error('Error fetching courses:', error);
+ }
+ };
+
+ const handleRegister = async () => {
+ // Your code to post registration data to the server
+ // This could involve sending selectedCourse, teacher, and time
+ // to the server to handle the registration process
+ alert('Đăng ký môn thành công');
+ setTeacher('');
+ setTime('');
+ setShowModal(false);
+ };
+
+ const handleCloseModal = () => {
+ setTeacher('');
+ setTime('');
+ setShowModal(false);
+ };
+
+ const handleShowModal = () => {
+ //setSelectedCourse(course);
+ setShowModal(true);
+ };
+
+ return (
+ <>
+
+
+
+
+
+
+ Đăng ký học phần
+
+
+ Chương trình đào tạo
+
+
+
+
+
+
+
Chọn môn học đăng ký
+
+
+
+
Tên môn học
+
Phòng học
+
Số lượng
+
Action
+
+
+
+ {/*courses.map(course => (
+
+
{course.name}
+
{course.room}
+
{course.amount}
+
+
+
+
+ ))*/}
+
+
LTNC
+
413-H6
+
40
+
+
+
+
+
+
ABC
+
101-H1
+
50
+
+
+
+
+
+
XYZ
+
202-H2
+
60
+
+
+
+
+
+
+
+
Phiếu đăng ký
+
+
+
+
STT
+
Mã môn học
+
Tên môn học
+
Phòng học
+
Số lượng
+
Giảng viên
+
Giờ học
+
+
+
+
+
1
+
COxxxx
+
LTNC
+
413-H6
+
40
+
Mai Đức Trung
+
13:00-15:00
+
+
+
2
+
COxxxx
+
ABC
+
101-H1
+
50
+
Tên Giảng Viên
+
hh:mm-hh:mm
+
+
+
+
+
+
CHƯƠNG TRÌNH ĐÀO TẠO
+
+
+
+
+
+
+
+
+
+ Đăng ký môn ... {/*selectedCourse && selectedCourse.name*/}
+
+
+
+ Giảng viên
+ setTeacher(e.target.value)}
+ />
+
+
+ Giờ học
+ setTime(e.target.value)}
+ />
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default CourseRegistration;
\ No newline at end of file
diff --git a/login-frontend/src/pages/StudentDashboard.css b/login-frontend/src/pages/dashboardPage/Dashboard.css
similarity index 73%
rename from login-frontend/src/pages/StudentDashboard.css
rename to login-frontend/src/pages/dashboardPage/Dashboard.css
index 1060c35..9265cff 100644
--- a/login-frontend/src/pages/StudentDashboard.css
+++ b/login-frontend/src/pages/dashboardPage/Dashboard.css
@@ -1,5 +1,6 @@
.logo{
width: 40%;
+ padding-left: 10vh;
}
.leftBody {
height: 83vh;
@@ -26,11 +27,23 @@
.navigation {
display: flex;
background-color: wheat;
- height: 8%;
}
-a{
+.long_navigation{
+ display: flex;
+ background-color: white;
+ justify-content: center;
+ padding: 1vh;
+ padding-bottom: 3vh;
+ border-bottom: 1px solid gray;
+}
+.top_navbar{
color: #020202;
padding: 2vh 10vh;
+ font-weight: bold;
+ text-decoration: none;
+}
+.left_navbar{
+ color: white;
text-decoration: none;
}
.active{
diff --git a/login-frontend/src/pages/StudentDashboard.js b/login-frontend/src/pages/dashboardPage/StudentDashboard.js
similarity index 70%
rename from login-frontend/src/pages/StudentDashboard.js
rename to login-frontend/src/pages/dashboardPage/StudentDashboard.js
index f41d615..98d6edf 100644
--- a/login-frontend/src/pages/StudentDashboard.js
+++ b/login-frontend/src/pages/dashboardPage/StudentDashboard.js
@@ -1,10 +1,10 @@
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 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';
+import './Dashboard.css';
function DataTable() {
const [currentView, setCurrentView] = useState('StudentInfo');
@@ -15,7 +15,7 @@ function DataTable() {
const [isOpen, setIsOpen] = useState(false);
return (
-