├── .browserslistrc ├── .editorconfig ├── .gitignore ├── ELearningManagement - backend ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── application │ │ │ ├── ELearningManagementApplication.java │ │ │ ├── controller │ │ │ ├── LoginController.java │ │ │ ├── ProfessorController.java │ │ │ ├── RegistrationController.java │ │ │ └── UserController.java │ │ │ ├── model │ │ │ ├── Chapter.java │ │ │ ├── Course.java │ │ │ ├── Enrollment.java │ │ │ ├── Professor.java │ │ │ ├── User.java │ │ │ └── Wishlist.java │ │ │ ├── repository │ │ │ ├── ChapterRepository.java │ │ │ ├── CourseRepository.java │ │ │ ├── EnrollmentRepository.java │ │ │ ├── ProfessorRepository.java │ │ │ ├── UserRepository.java │ │ │ └── WishlistRepository.java │ │ │ └── services │ │ │ ├── ChapterService.java │ │ │ ├── CourseService.java │ │ │ ├── EnrollmentService.java │ │ │ ├── ProfessorService.java │ │ │ ├── UserService.java │ │ │ └── WishlistService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── application │ └── ELearningManagementApplicationTests.java ├── README.md ├── angular.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src ├── app │ ├── app-routing.module.ts │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── components │ │ ├── addchapter │ │ │ ├── addchapter.component.css │ │ │ ├── addchapter.component.html │ │ │ ├── addchapter.component.spec.ts │ │ │ └── addchapter.component.ts │ │ ├── addcourse │ │ │ ├── addcourse.component.css │ │ │ ├── addcourse.component.html │ │ │ ├── addcourse.component.spec.ts │ │ │ └── addcourse.component.ts │ │ ├── addprofessor │ │ │ ├── addprofessor.component.css │ │ │ ├── addprofessor.component.html │ │ │ ├── addprofessor.component.spec.ts │ │ │ └── addprofessor.component.ts │ │ ├── admindashboard │ │ │ ├── admindashboard.component.css │ │ │ ├── admindashboard.component.html │ │ │ ├── admindashboard.component.spec.ts │ │ │ └── admindashboard.component.ts │ │ ├── approvalstatus │ │ │ ├── approvalstatus.component.css │ │ │ ├── approvalstatus.component.html │ │ │ ├── approvalstatus.component.spec.ts │ │ │ └── approvalstatus.component.ts │ │ ├── courselist │ │ │ ├── courselist.component.css │ │ │ ├── courselist.component.html │ │ │ ├── courselist.component.spec.ts │ │ │ └── courselist.component.ts │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.html │ │ │ ├── footer.component.spec.ts │ │ │ └── footer.component.ts │ │ ├── fullcourse │ │ │ ├── fullcourse.component.css │ │ │ ├── fullcourse.component.html │ │ │ ├── fullcourse.component.spec.ts │ │ │ └── fullcourse.component.ts │ │ ├── header │ │ │ ├── header.component.css │ │ │ ├── header.component.html │ │ │ ├── header.component.spec.ts │ │ │ └── header.component.ts │ │ ├── login │ │ │ ├── login.component.css │ │ │ ├── login.component.html │ │ │ ├── login.component.spec.ts │ │ │ └── login.component.ts │ │ ├── mycourses │ │ │ ├── mycourses.component.css │ │ │ ├── mycourses.component.html │ │ │ ├── mycourses.component.spec.ts │ │ │ └── mycourses.component.ts │ │ ├── mywishlist │ │ │ ├── mywishlist.component.css │ │ │ ├── mywishlist.component.html │ │ │ ├── mywishlist.component.spec.ts │ │ │ └── mywishlist.component.ts │ │ ├── professordashboard │ │ │ ├── professordashboard.component.css │ │ │ ├── professordashboard.component.html │ │ │ ├── professordashboard.component.spec.ts │ │ │ └── professordashboard.component.ts │ │ ├── professorlist │ │ │ ├── professorlist.component.css │ │ │ ├── professorlist.component.html │ │ │ ├── professorlist.component.spec.ts │ │ │ └── professorlist.component.ts │ │ ├── professorprofile │ │ │ ├── professorprofile.component.css │ │ │ ├── professorprofile.component.html │ │ │ ├── professorprofile.component.spec.ts │ │ │ └── professorprofile.component.ts │ │ ├── registration │ │ │ ├── registration.component.css │ │ │ ├── registration.component.html │ │ │ ├── registration.component.spec.ts │ │ │ └── registration.component.ts │ │ ├── registrationsuccess │ │ │ ├── registrationsuccess.component.css │ │ │ ├── registrationsuccess.component.html │ │ │ ├── registrationsuccess.component.spec.ts │ │ │ └── registrationsuccess.component.ts │ │ ├── userdashboard │ │ │ ├── userdashboard.component.css │ │ │ ├── userdashboard.component.html │ │ │ ├── userdashboard.component.spec.ts │ │ │ └── userdashboard.component.ts │ │ ├── userlist │ │ │ ├── userlist.component.css │ │ │ ├── userlist.component.html │ │ │ ├── userlist.component.spec.ts │ │ │ └── userlist.component.ts │ │ ├── userprofile │ │ │ ├── userprofile.component.css │ │ │ ├── userprofile.component.html │ │ │ ├── userprofile.component.spec.ts │ │ │ └── userprofile.component.ts │ │ └── welcomepage │ │ │ ├── welcomepage.component.css │ │ │ ├── welcomepage.component.html │ │ │ ├── welcomepage.component.spec.ts │ │ │ └── welcomepage.component.ts │ ├── guards │ │ ├── admin.guard.spec.ts │ │ ├── admin.guard.ts │ │ ├── professor.guard.spec.ts │ │ ├── professor.guard.ts │ │ ├── router.guard.spec.ts │ │ ├── router.guard.ts │ │ ├── user.guard.spec.ts │ │ └── user.guard.ts │ ├── models │ │ ├── chapter.spec.ts │ │ ├── chapter.ts │ │ ├── course.spec.ts │ │ ├── course.ts │ │ ├── enrollment.spec.ts │ │ ├── enrollment.ts │ │ ├── professor.spec.ts │ │ ├── professor.ts │ │ ├── user.spec.ts │ │ ├── user.ts │ │ ├── wishlist.spec.ts │ │ └── wishlist.ts │ └── services │ │ ├── admin.service.spec.ts │ │ ├── admin.service.ts │ │ ├── login.service.spec.ts │ │ ├── login.service.ts │ │ ├── professor.service.spec.ts │ │ ├── professor.service.ts │ │ ├── registration.service.spec.ts │ │ ├── registration.service.ts │ │ ├── user.service.spec.ts │ │ └── user.service.ts ├── assets │ ├── .gitkeep │ ├── Introduction to Spring MVC.pdf │ └── img │ │ ├── admin.png │ │ ├── alert.gif │ │ ├── femaleprofessor.png │ │ ├── femaleuser.png │ │ ├── livebg.png │ │ ├── lms-bg.png │ │ ├── logout.gif │ │ ├── male.png │ │ ├── maleprofessor.png │ │ ├── maleuser.png │ │ ├── register-fail.gif │ │ ├── success.gif │ │ ├── website.png │ │ ├── websitebg.png │ │ └── youtube.png ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.css └── test.ts ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json /.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. 18 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | 16 | # IDEs and editors 17 | /.idea 18 | .project 19 | .classpath 20 | .c9/ 21 | *.launch 22 | .settings/ 23 | *.sublime-workspace 24 | 25 | # IDE - VSCode 26 | .vscode/* 27 | !.vscode/settings.json 28 | !.vscode/tasks.json 29 | !.vscode/launch.json 30 | !.vscode/extensions.json 31 | .history/* 32 | 33 | # misc 34 | /.sass-cache 35 | /connect.lock 36 | /coverage 37 | /libpeerconnection.log 38 | npm-debug.log 39 | yarn-error.log 40 | testem.log 41 | /typings 42 | 43 | # System Files 44 | .DS_Store 45 | Thumbs.db 46 | -------------------------------------------------------------------------------- /ELearningManagement - backend/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /ELearningManagement - backend/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/ELearningManagement - backend/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /ELearningManagement - backend/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /ELearningManagement - backend/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.5.2 9 | 10 | 11 | com.application 12 | ELearningManagement 13 | 0.0.1-SNAPSHOT 14 | ELearningManagement 15 | eLearning Management System using Angular 8 & Springboot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | mysql 37 | mysql-connector-java 38 | runtime 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-maven-plugin 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/ELearningManagementApplication.java: -------------------------------------------------------------------------------- 1 | package com.application; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ELearningManagementApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ELearningManagementApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.application.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.CrossOrigin; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RestController; 9 | import com.application.model.Professor; 10 | import com.application.model.User; 11 | import com.application.services.ProfessorService; 12 | import com.application.services.UserService; 13 | 14 | @RestController 15 | public class LoginController 16 | { 17 | @Autowired 18 | private UserService userService; 19 | 20 | @Autowired 21 | private ProfessorService professorService; 22 | 23 | @GetMapping("/") 24 | public String welcomeMessage() 25 | { 26 | return "Welcome to Elearning Management system !!!"; 27 | } 28 | 29 | @PostMapping("/loginuser") 30 | @CrossOrigin(origins = "http://localhost:4200") 31 | public User loginUser(@RequestBody User user) throws Exception 32 | { 33 | String currEmail = user.getEmail(); 34 | String currPassword = user.getPassword(); 35 | 36 | User userObj = null; 37 | if(currEmail != null && currPassword != null) 38 | { 39 | userObj = userService.fetchUserByEmailAndPassword(currEmail, currPassword); 40 | } 41 | if(userObj == null) 42 | { 43 | throw new Exception("User does not exists!!! Please enter valid credentials..."); 44 | } 45 | return userObj; 46 | } 47 | 48 | @PostMapping("/loginprofessor") 49 | @CrossOrigin(origins = "http://localhost:4200") 50 | public Professor loginDoctor(@RequestBody Professor professor) throws Exception 51 | { 52 | String currEmail = professor.getEmail(); 53 | String currPassword = professor.getPassword(); 54 | 55 | Professor professorObj = null; 56 | if(currEmail != null && currPassword != null) 57 | { 58 | professorObj = professorService.fetchProfessorByEmailAndPassword(currEmail, currPassword); 59 | } 60 | if(professorObj == null) 61 | { 62 | throw new Exception("Professor does not exists!!! Please enter valid credentials..."); 63 | } 64 | return professorObj; 65 | } 66 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/controller/RegistrationController.java: -------------------------------------------------------------------------------- 1 | package com.application.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.CrossOrigin; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import com.application.model.Professor; 9 | import com.application.model.User; 10 | import com.application.services.ProfessorService; 11 | import com.application.services.UserService; 12 | 13 | @RestController 14 | public class RegistrationController 15 | { 16 | @Autowired 17 | private UserService userService; 18 | 19 | @Autowired 20 | private ProfessorService professorService; 21 | 22 | @PostMapping("/registeruser") 23 | @CrossOrigin(origins = "http://localhost:4200") 24 | public User registerUser(@RequestBody User user) throws Exception 25 | { 26 | String currEmail = user.getEmail(); 27 | String newID = getNewID(); 28 | user.setUserid(newID); 29 | 30 | if(currEmail != null || !"".equals(currEmail)) 31 | { 32 | User userObj = userService.fetchUserByEmail(currEmail); 33 | if(userObj != null) 34 | { 35 | throw new Exception("User with "+currEmail+" already exists !!!"); 36 | } 37 | } 38 | User userObj = null; 39 | userObj = userService.saveUser(user); 40 | return userObj; 41 | } 42 | 43 | @PostMapping("/registerprofessor") 44 | @CrossOrigin(origins = "http://localhost:4200") 45 | public Professor registerDoctor(@RequestBody Professor professor) throws Exception 46 | { 47 | String currEmail = professor.getEmail(); 48 | String newID = getNewID(); 49 | professor.setProfessorid(newID); 50 | 51 | if(currEmail != null || !"".equals(currEmail)) 52 | { 53 | Professor professorObj = professorService.fetchProfessorByEmail(currEmail); 54 | if(professorObj != null) 55 | { 56 | throw new Exception("Professor with "+currEmail+" already exists !!!"); 57 | } 58 | } 59 | Professor professorObj = null; 60 | professorObj = professorService.saveProfessor(professor); 61 | return professorObj; 62 | } 63 | 64 | public String getNewID() 65 | { 66 | String AlphaNumericString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"0123456789"+"abcdefghijklmnopqrstuvxyz"; 67 | StringBuilder sb = new StringBuilder(); 68 | for (int i = 0; i < 12; i++) 69 | { 70 | int index = (int)(AlphaNumericString.length() * Math.random()); 71 | sb.append(AlphaNumericString.charAt(index)); 72 | } 73 | return sb.toString(); 74 | } 75 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/model/Course.java: -------------------------------------------------------------------------------- 1 | package com.application.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | 8 | @Entity 9 | public class Course 10 | { 11 | @Id 12 | @GeneratedValue(strategy = GenerationType.AUTO) 13 | private int id; 14 | private String coursename; 15 | private String courseid; 16 | private String enrolleddate; 17 | private String instructorname; 18 | private String instructorinstitution; 19 | private String enrolledcount; 20 | private String youtubeurl; 21 | private String websiteurl; 22 | private String coursetype; 23 | private String skilllevel; 24 | private String language; 25 | private String description; 26 | 27 | public Course() 28 | { 29 | super(); 30 | } 31 | 32 | public Course(int id, String coursename, String courseid, String enrolleddate, String instructorname, String instructorinstitution, String enrolledcount, String youtubeurl, String websiteurl, String coursetype, String skilllevel, String language, String description) 33 | { 34 | super(); 35 | this.id = id; 36 | this.coursename = coursename; 37 | this.courseid = courseid; 38 | this.enrolleddate = enrolleddate; 39 | this.instructorname = instructorname; 40 | this.instructorinstitution = instructorinstitution; 41 | this.enrolledcount = enrolledcount; 42 | this.youtubeurl = youtubeurl; 43 | this.websiteurl = websiteurl; 44 | this.coursetype = coursetype; 45 | this.skilllevel = skilllevel; 46 | this.language = language; 47 | this.description = description; 48 | } 49 | 50 | public int getId() 51 | { 52 | return id; 53 | } 54 | 55 | public void setId(int id) 56 | { 57 | this.id = id; 58 | } 59 | 60 | public String getCoursename() { 61 | return coursename; 62 | } 63 | 64 | public void setCoursename(String coursename) { 65 | this.coursename = coursename; 66 | } 67 | 68 | public String getCourseid() { 69 | return courseid; 70 | } 71 | 72 | public void setCourseid(String courseid) { 73 | this.courseid = courseid; 74 | } 75 | 76 | public String getEnrolleddate() { 77 | return enrolleddate; 78 | } 79 | 80 | public void setEnrolleddate(String enrolleddate) { 81 | this.enrolleddate = enrolleddate; 82 | } 83 | 84 | public String getInstructorname() { 85 | return instructorname; 86 | } 87 | 88 | public void setInstructorname(String instructorname) { 89 | this.instructorname = instructorname; 90 | } 91 | 92 | public String getInstructorinstitution() { 93 | return instructorinstitution; 94 | } 95 | 96 | public void setInstructorinstitution(String instructorinstitution) { 97 | this.instructorinstitution = instructorinstitution; 98 | } 99 | 100 | public String getEnrolledcount() { 101 | return enrolledcount; 102 | } 103 | 104 | public void setEnrolledcount(String enrolledcount) { 105 | this.enrolledcount = enrolledcount; 106 | } 107 | 108 | public String getYoutubeurl() { 109 | return youtubeurl; 110 | } 111 | 112 | public void setYoutubeurl(String youtubeurl) { 113 | this.youtubeurl = youtubeurl; 114 | } 115 | 116 | public String getWebsiteurl() { 117 | return websiteurl; 118 | } 119 | 120 | public void setWebsiteurl(String websiteurl) { 121 | this.websiteurl = websiteurl; 122 | } 123 | 124 | public String getCoursetype() { 125 | return coursetype; 126 | } 127 | 128 | public void setCoursetype(String coursetype) { 129 | this.coursetype = coursetype; 130 | } 131 | 132 | public String getSkilllevel() { 133 | return skilllevel; 134 | } 135 | 136 | public void setSkilllevel(String skilllevel) { 137 | this.skilllevel = skilllevel; 138 | } 139 | 140 | public String getLanguage() { 141 | return language; 142 | } 143 | 144 | public void setLanguage(String language) { 145 | this.language = language; 146 | } 147 | 148 | public String getDescription() { 149 | return description; 150 | } 151 | 152 | public void setDescription(String description) { 153 | this.description = description; 154 | } 155 | 156 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/model/Enrollment.java: -------------------------------------------------------------------------------- 1 | package com.application.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | 8 | @Entity 9 | public class Enrollment 10 | { 11 | @Id 12 | @GeneratedValue(strategy = GenerationType.AUTO) 13 | private int id; 14 | private String coursename; 15 | private String courseid; 16 | private String enrolleddate; 17 | private String enrolledusername; 18 | private String enrolleduserid; 19 | private String enrolledusertype; 20 | private String instructorname; 21 | private String instructorinstitution; 22 | private String enrolledcount; 23 | private String youtubeurl; 24 | private String websiteurl; 25 | private String coursetype; 26 | private String skilllevel; 27 | private String language; 28 | private String description; 29 | 30 | public Enrollment() 31 | { 32 | super(); 33 | } 34 | 35 | public Enrollment(int id, String coursename, String courseid, String enrolleddate, String enrolledusername, String enrolleduserid, String enrolledusertype, String instructorname, String instructorinstitution, String enrolledcount, String youtubeurl, String websiteurl, String coursetype, String skilllevel, String language, String description) 36 | { 37 | super(); 38 | this.id = id; 39 | this.coursename = coursename; 40 | this.courseid = courseid; 41 | this.enrolleddate = enrolleddate; 42 | this.enrolledusername = enrolledusername; 43 | this.enrolleduserid = enrolleduserid; 44 | this.enrolledusertype = enrolledusertype; 45 | this.instructorname = instructorname; 46 | this.instructorinstitution = instructorinstitution; 47 | this.enrolledcount = enrolledcount; 48 | this.youtubeurl = youtubeurl; 49 | this.websiteurl = websiteurl; 50 | this.coursetype = coursetype; 51 | this.skilllevel = skilllevel; 52 | this.language = language; 53 | this.description = description; 54 | } 55 | 56 | public int getId() 57 | { 58 | return id; 59 | } 60 | 61 | public void setId(int id) 62 | { 63 | this.id = id; 64 | } 65 | 66 | public String getCoursename() 67 | { 68 | return coursename; 69 | } 70 | 71 | public void setCoursename(String coursename) 72 | { 73 | this.coursename = coursename; 74 | } 75 | 76 | public String getCourseid() 77 | { 78 | return courseid; 79 | } 80 | 81 | public void setCourseid(String courseid) 82 | { 83 | this.courseid = courseid; 84 | } 85 | 86 | public String getEnrolleddate() 87 | { 88 | return enrolleddate; 89 | } 90 | 91 | public void setEnrolleddate(String enrolleddate) 92 | { 93 | this.enrolleddate = enrolleddate; 94 | } 95 | 96 | public String getEnrolledusername() 97 | { 98 | return enrolledusername; 99 | } 100 | 101 | public void setEnrolledusername(String enrolledusername) 102 | { 103 | this.enrolledusername = enrolledusername; 104 | } 105 | 106 | public String getEnrolleduserid() 107 | { 108 | return enrolleduserid; 109 | } 110 | 111 | public void setEnrolleduserid(String enrolleduserid) 112 | { 113 | this.enrolleduserid = enrolleduserid; 114 | } 115 | 116 | public String getEnrolledusertype() 117 | { 118 | return enrolledusertype; 119 | } 120 | 121 | public void setEnrolledusertype(String enrolledusertype) 122 | { 123 | this.enrolledusertype = enrolledusertype; 124 | } 125 | 126 | public String getInstructorname() 127 | { 128 | return instructorname; 129 | } 130 | 131 | public void setInstructorname(String instructorname) 132 | { 133 | this.instructorname = instructorname; 134 | } 135 | 136 | public String getInstructorinstitution() 137 | { 138 | return instructorinstitution; 139 | } 140 | 141 | public void setInstructorinstitution(String instructorinstitution) 142 | { 143 | this.instructorinstitution = instructorinstitution; 144 | } 145 | 146 | public String getEnrolledcount() 147 | { 148 | return enrolledcount; 149 | } 150 | 151 | public void setEnrolledcount(String enrolledcount) 152 | { 153 | this.enrolledcount = enrolledcount; 154 | } 155 | 156 | public String getYoutubeurl() 157 | { 158 | return youtubeurl; 159 | } 160 | 161 | public void setYoutubeurl(String youtubeurl) 162 | { 163 | this.youtubeurl = youtubeurl; 164 | } 165 | 166 | public String getWebsiteurl() 167 | { 168 | return websiteurl; 169 | } 170 | 171 | public void setWebsiteurl(String websiteurl) 172 | { 173 | this.websiteurl = websiteurl; 174 | } 175 | 176 | public String getCoursetype() 177 | { 178 | return coursetype; 179 | } 180 | 181 | public void setCoursetype(String coursetype) 182 | { 183 | this.coursetype = coursetype; 184 | } 185 | 186 | public String getSkilllevel() 187 | { 188 | return skilllevel; 189 | } 190 | 191 | public void setSkilllevel(String skilllevel) 192 | { 193 | this.skilllevel = skilllevel; 194 | } 195 | 196 | public String getLanguage() 197 | { 198 | return language; 199 | } 200 | 201 | public void setLanguage(String language) 202 | { 203 | this.language = language; 204 | } 205 | 206 | public String getDescription() 207 | { 208 | return description; 209 | } 210 | 211 | public void setDescription(String description) 212 | { 213 | this.description = description; 214 | } 215 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/model/Professor.java: -------------------------------------------------------------------------------- 1 | package com.application.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | 6 | @Entity 7 | public class Professor 8 | { 9 | @Id 10 | private String email; 11 | private String professorname; 12 | private String professorid; 13 | private String degreecompleted; 14 | private String institutionname; 15 | private String department; 16 | private String experience; 17 | private String mobile; 18 | private String gender; 19 | private String password; 20 | private String status; 21 | 22 | public Professor() 23 | { 24 | super(); 25 | } 26 | 27 | public Professor(String email, String professorname, String professorid, String degreecompleted, String institutionname, String department, String experience, String mobile, String gender, String password, String status) 28 | { 29 | super(); 30 | this.email = email; 31 | this.professorname = professorname; 32 | this.professorid = professorid; 33 | this.degreecompleted = degreecompleted; 34 | this.institutionname = institutionname; 35 | this.department = department; 36 | this.experience = experience; 37 | this.mobile = mobile; 38 | this.gender = gender; 39 | this.password = password; 40 | this.status = status; 41 | } 42 | 43 | public String getEmail() 44 | { 45 | return email; 46 | } 47 | 48 | public void setEmail(String email) 49 | { 50 | this.email = email; 51 | } 52 | 53 | public String getProfessorname() 54 | { 55 | return professorname; 56 | } 57 | 58 | public void setProfessorname(String professorname) 59 | { 60 | this.professorname = professorname; 61 | } 62 | 63 | public String getProfessorid() 64 | { 65 | return professorid; 66 | } 67 | 68 | public void setProfessorid(String professorid) 69 | { 70 | this.professorid = professorid; 71 | } 72 | 73 | public String getDegreecompleted() 74 | { 75 | return degreecompleted; 76 | } 77 | 78 | public void setDegreecompleted(String degreecompleted) 79 | { 80 | this.degreecompleted = degreecompleted; 81 | } 82 | 83 | public String getInstitutionname() 84 | { 85 | return institutionname; 86 | } 87 | 88 | public void setInstitutionname(String institutionname) 89 | { 90 | this.institutionname = institutionname; 91 | } 92 | 93 | public String getDepartment() 94 | { 95 | return department; 96 | } 97 | 98 | public void setDepartment(String department) 99 | { 100 | this.department = department; 101 | } 102 | 103 | public String getExperience() 104 | { 105 | return experience; 106 | } 107 | 108 | public void setExperience(String experience) 109 | { 110 | this.experience = experience; 111 | } 112 | 113 | public String getMobile() 114 | { 115 | return mobile; 116 | } 117 | 118 | public void setMobile(String mobile) 119 | { 120 | this.mobile = mobile; 121 | } 122 | 123 | public String getGender() 124 | { 125 | return gender; 126 | } 127 | 128 | public void setGender(String gender) 129 | { 130 | this.gender = gender; 131 | } 132 | 133 | public String getPassword() 134 | { 135 | return password; 136 | } 137 | 138 | public void setPassword(String password) 139 | { 140 | this.password = password; 141 | } 142 | 143 | public String getStatus() 144 | { 145 | return status; 146 | } 147 | 148 | public void setStatus(String status) 149 | { 150 | this.status = status; 151 | } 152 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/model/User.java: -------------------------------------------------------------------------------- 1 | package com.application.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | 6 | @Entity 7 | public class User 8 | { 9 | @Id 10 | private String email; 11 | private String username; 12 | private String userid; 13 | private String mobile; 14 | private String gender; 15 | private String profession; 16 | private String address; 17 | private String password; 18 | 19 | public User() 20 | { 21 | super(); 22 | } 23 | 24 | public User(String email, String username, String userid, String mobile, String gender, String profession, String address, String password) 25 | { 26 | super(); 27 | this.email = email; 28 | this.username = username; 29 | this.userid = userid; 30 | this.mobile = mobile; 31 | this.gender = gender; 32 | this.profession = profession; 33 | this.address = address; 34 | this.password = password; 35 | } 36 | 37 | public String getEmail() 38 | { 39 | return email; 40 | } 41 | 42 | public void setEmail(String email) 43 | { 44 | this.email = email; 45 | } 46 | 47 | public String getUsername() 48 | { 49 | return username; 50 | } 51 | 52 | public void setUsername(String username) 53 | { 54 | this.username = username; 55 | } 56 | 57 | public String getUserid() 58 | { 59 | return userid; 60 | } 61 | 62 | public void setUserid(String userid) 63 | { 64 | this.userid = userid; 65 | } 66 | 67 | public String getMobile() 68 | { 69 | return mobile; 70 | } 71 | 72 | public void setMobile(String mobile) 73 | { 74 | this.mobile = mobile; 75 | } 76 | 77 | public String getGender() 78 | { 79 | return gender; 80 | } 81 | 82 | public void setGender(String gender) 83 | { 84 | this.gender = gender; 85 | } 86 | 87 | public String getProfession() 88 | { 89 | return profession; 90 | } 91 | 92 | public void setProfession(String profession) 93 | { 94 | this.profession = profession; 95 | } 96 | 97 | public String getAddress() 98 | { 99 | return address; 100 | } 101 | 102 | public void setAddress(String address) 103 | { 104 | this.address = address; 105 | } 106 | 107 | public String getPassword() 108 | { 109 | return password; 110 | } 111 | 112 | public void setPassword(String password) 113 | { 114 | this.password = password; 115 | } 116 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/model/Wishlist.java: -------------------------------------------------------------------------------- 1 | package com.application.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | 6 | @Entity 7 | public class Wishlist 8 | { 9 | @Id 10 | private String coursename; 11 | private String courseid; 12 | private String likeduser; 13 | private String likedusertype; 14 | private String instructorname; 15 | private String instructorinstitution; 16 | private String enrolledcount; 17 | private String coursetype; 18 | private String websiteurl; 19 | private String skilllevel; 20 | private String language; 21 | private String description; 22 | 23 | public Wishlist() 24 | { 25 | super(); 26 | } 27 | 28 | public Wishlist(String coursename, String courseid, String likeduser, String likedusertype, String instructorname, String instructorinstitution, String enrolledcount, String coursetype, String websiteurl, String skilllevel, String language, String description) 29 | { 30 | super(); 31 | this.coursename = coursename; 32 | this.courseid = courseid; 33 | this.likeduser = likeduser; 34 | this.likedusertype = likedusertype; 35 | this.instructorname = instructorname; 36 | this.instructorinstitution = instructorinstitution; 37 | this.enrolledcount = enrolledcount; 38 | this.coursetype = coursetype; 39 | this.websiteurl= websiteurl; 40 | this.skilllevel = skilllevel; 41 | this.language = language; 42 | this.description = description; 43 | } 44 | 45 | public String getCoursename() 46 | { 47 | return coursename; 48 | } 49 | 50 | public void setCoursename(String coursename) 51 | { 52 | this.coursename = coursename; 53 | } 54 | 55 | public String getCourseid() 56 | { 57 | return courseid; 58 | } 59 | 60 | public void setCourseid(String courseid) 61 | { 62 | this.courseid = courseid; 63 | } 64 | 65 | public String getLikeduser() 66 | { 67 | return likeduser; 68 | } 69 | 70 | public void setLikeduser(String likeduser) 71 | { 72 | this.likeduser = likeduser; 73 | } 74 | 75 | public String getLikedusertype() 76 | { 77 | return likedusertype; 78 | } 79 | 80 | public void setLikedusertype(String likedusertype) 81 | { 82 | this.likedusertype = likedusertype; 83 | } 84 | 85 | public String getInstructorname() 86 | { 87 | return instructorname; 88 | } 89 | 90 | public void setInstructorname(String instructorname) 91 | { 92 | this.instructorname = instructorname; 93 | } 94 | 95 | public String getInstructorinstitution() 96 | { 97 | return instructorinstitution; 98 | } 99 | 100 | public void setInstructorinstitution(String instructorinstitution) 101 | { 102 | this.instructorinstitution = instructorinstitution; 103 | } 104 | 105 | public String getEnrolledcount() 106 | { 107 | return enrolledcount; 108 | } 109 | 110 | public void setEnrolledcount(String enrolledcount) 111 | { 112 | this.enrolledcount = enrolledcount; 113 | } 114 | 115 | public String getCoursetype() 116 | { 117 | return coursetype; 118 | } 119 | 120 | public void setCoursetype(String coursetype) 121 | { 122 | this.coursetype = coursetype; 123 | } 124 | 125 | public String getWebsiteurl() 126 | { 127 | return websiteurl; 128 | } 129 | 130 | public void setWebsiteurl(String websiteurl) 131 | { 132 | this.websiteurl = websiteurl; 133 | } 134 | 135 | public String getSkilllevel() 136 | { 137 | return skilllevel; 138 | } 139 | 140 | public void setSkilllevel(String skilllevel) 141 | { 142 | this.skilllevel = skilllevel; 143 | } 144 | 145 | public String getLanguage() 146 | { 147 | return language; 148 | } 149 | 150 | public void setLanguage(String language) 151 | { 152 | this.language = language; 153 | } 154 | 155 | public String getDescription() 156 | { 157 | return description; 158 | } 159 | 160 | public void setDescription(String description) 161 | { 162 | this.description = description; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/repository/ChapterRepository.java: -------------------------------------------------------------------------------- 1 | package com.application.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import java.util.List; 5 | import com.application.model.Chapter; 6 | 7 | public interface ChapterRepository extends CrudRepository 8 | { 9 | public List findByCoursename(String Coursename); 10 | 11 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/repository/CourseRepository.java: -------------------------------------------------------------------------------- 1 | package com.application.repository; 2 | 3 | import java.util.List; 4 | 5 | import javax.transaction.Transactional; 6 | 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.data.repository.CrudRepository; 10 | import com.application.model.Course; 11 | 12 | public interface CourseRepository extends CrudRepository 13 | { 14 | public Course findByCoursename(String coursename); 15 | 16 | public Course findByCourseid(String courseid); 17 | 18 | public List findByInstructorname(String instructorname); 19 | 20 | public List findByInstructorinstitution(String instructorinstitution); 21 | 22 | public List findByEnrolleddate(String enrolleddate); 23 | 24 | public List findByCoursetype(String coursetype); 25 | 26 | public List findByYoutubeurl(String youtubeurl); 27 | 28 | public List findByWebsiteurl(String websiteurl); 29 | 30 | public List findBySkilllevel(String skilllevel); 31 | 32 | public List findByLanguage(String language); 33 | 34 | @Transactional 35 | @Modifying 36 | @Query(value = "update course set enrolledcount = ?1 where coursename = ?2",nativeQuery = true) 37 | public void updateEnrolledcount(int enrolledcount, String coursename); 38 | 39 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/repository/EnrollmentRepository.java: -------------------------------------------------------------------------------- 1 | package com.application.repository; 2 | 3 | import java.util.List; 4 | import javax.transaction.Transactional; 5 | import org.springframework.data.jpa.repository.Modifying; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.CrudRepository; 8 | import com.application.model.Enrollment; 9 | 10 | public interface EnrollmentRepository extends CrudRepository 11 | { 12 | public Enrollment findByCoursename(String coursename); 13 | 14 | public Enrollment findByCourseid(String courseid); 15 | 16 | public List findByEnrolledusername(String enrolledusername); 17 | 18 | public List findByEnrolleduserid(String enrolleduserid); 19 | 20 | public List findByEnrolledusertype(String enrolledusertype); 21 | 22 | public List findByInstructorname(String instructorname); 23 | 24 | public List findByInstructorinstitution(String instructorinstitution); 25 | 26 | public List findByEnrolleddate(String enrolleddate); 27 | 28 | public List findByCoursetype(String coursetype); 29 | 30 | public List findByYoutubeurl(String youtubeurl); 31 | 32 | public List findByWebsiteurl(String websiteurl); 33 | 34 | public List findBySkilllevel(String skilllevel); 35 | 36 | public List findByLanguage(String language); 37 | 38 | @Transactional 39 | @Modifying 40 | @Query(value = "update enrollment set enrolledcount = ?1 where coursename = ?2",nativeQuery = true) 41 | public void updateEnrolledcount(int enrolledcount, String coursename); 42 | 43 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/repository/ProfessorRepository.java: -------------------------------------------------------------------------------- 1 | package com.application.repository; 2 | 3 | import java.util.List; 4 | 5 | import javax.transaction.Transactional; 6 | 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.data.repository.CrudRepository; 10 | import com.application.model.Professor; 11 | 12 | public interface ProfessorRepository extends CrudRepository 13 | { 14 | public Professor findByEmail(String email); 15 | 16 | public List findProfessorListByEmail(String email); 17 | 18 | public Professor findByProfessorname(String professorname); 19 | 20 | public Professor findByEmailAndPassword(String email, String password); 21 | 22 | public List findProfileByEmail(String email); 23 | 24 | @Transactional 25 | @Modifying 26 | @Query(value = "update professor set status = 'accept' where email = ?1", nativeQuery = true) 27 | public void updateStatus(String email); 28 | 29 | @Transactional 30 | @Modifying 31 | @Query(value = "update professor set status = 'reject' where email = ?1", nativeQuery = true) 32 | public void rejectStatus(String email); 33 | 34 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.application.repository; 2 | 3 | import java.util.List; 4 | import org.springframework.data.repository.CrudRepository; 5 | import com.application.model.User; 6 | 7 | public interface UserRepository extends CrudRepository 8 | { 9 | 10 | public User findByEmail(String email); 11 | 12 | public User findByUsername(String username); 13 | 14 | public User findByEmailAndPassword(String email, String password); 15 | 16 | public List findProfileByEmail(String email); 17 | 18 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/repository/WishlistRepository.java: -------------------------------------------------------------------------------- 1 | package com.application.repository; 2 | 3 | import java.util.List; 4 | import org.springframework.data.repository.CrudRepository; 5 | import com.application.model.Wishlist; 6 | 7 | public interface WishlistRepository extends CrudRepository 8 | { 9 | public Wishlist findByCoursename(String coursename); 10 | 11 | public Wishlist findByCourseid(String courseid); 12 | 13 | public List findByLikedusertype(String likedusertype); 14 | 15 | public List findByLikeduser(String likeduser); 16 | 17 | public List findByInstructorname(String instructorname); 18 | 19 | public List findByInstructorinstitution(String instructorinstitution); 20 | 21 | public List findByCoursetype(String coursetype); 22 | 23 | public List findBySkilllevel(String skilllevel); 24 | 25 | public List findByLanguage(String language); 26 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/services/ChapterService.java: -------------------------------------------------------------------------------- 1 | package com.application.services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import java.util.List; 6 | import com.application.model.Chapter; 7 | import com.application.repository.ChapterRepository; 8 | 9 | @Service 10 | public class ChapterService 11 | { 12 | @Autowired 13 | private ChapterRepository chapterRepo; 14 | 15 | public Chapter saveChapter(Chapter chapter) 16 | { 17 | return chapterRepo.save(chapter); 18 | } 19 | 20 | public Chapter addNewChapter(Chapter chapter) 21 | { 22 | return chapterRepo.save(chapter); 23 | } 24 | 25 | public List getAllChapters() 26 | { 27 | return (List)chapterRepo.findAll(); 28 | } 29 | 30 | public List fetchByCoursename(String coursename) 31 | { 32 | return (List)chapterRepo.findByCoursename(coursename); 33 | } 34 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/services/CourseService.java: -------------------------------------------------------------------------------- 1 | package com.application.services; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.application.model.Course; 7 | import com.application.repository.CourseRepository; 8 | 9 | @Service 10 | public class CourseService 11 | { 12 | @Autowired 13 | private CourseRepository courseRepo; 14 | 15 | public Course saveCourse(Course course) 16 | { 17 | return courseRepo.save(course); 18 | } 19 | 20 | public Course addNewCourse(Course course) 21 | { 22 | return courseRepo.save(course); 23 | } 24 | 25 | public List getAllCourses() 26 | { 27 | return (List)courseRepo.findAll(); 28 | } 29 | 30 | public void updateEnrolledcount(String coursename, int enrolledcount) 31 | { 32 | courseRepo.updateEnrolledcount(enrolledcount, coursename); 33 | } 34 | 35 | public Course fetchCourseByCoursename(String coursename) 36 | { 37 | return courseRepo.findByCoursename(coursename); 38 | } 39 | 40 | public Course fetchCourseByCourseid(String courseid) 41 | { 42 | return courseRepo.findByCourseid(courseid); 43 | } 44 | 45 | public List fetchByInstructorname(String instructorname) 46 | { 47 | return (List)courseRepo.findByInstructorname(instructorname); 48 | } 49 | 50 | public List fetchByInstructorinstitution(String instructorinstitution) 51 | { 52 | return (List)courseRepo.findByInstructorinstitution(instructorinstitution); 53 | } 54 | 55 | public List fetchByEnrolleddate(String enrolleddate) 56 | { 57 | return (List)courseRepo.findByEnrolleddate(enrolleddate); 58 | } 59 | 60 | public List fetchByCoursetype(String coursetype) 61 | { 62 | return (List)courseRepo.findByCoursetype(coursetype); 63 | } 64 | 65 | public List fetchByYoutubeurl(String youtubeurl) 66 | { 67 | return (List)courseRepo.findByYoutubeurl(youtubeurl); 68 | } 69 | 70 | public List fetchByWebsiteurl(String websiteurl) 71 | { 72 | return (List)courseRepo.findByWebsiteurl(websiteurl); 73 | } 74 | 75 | public List fetchBySkilllevel(String skilllevel) 76 | { 77 | return (List)courseRepo.findBySkilllevel(skilllevel); 78 | } 79 | 80 | public List fetchByLanguage(String language) 81 | { 82 | return (List)courseRepo.findByLanguage(language); 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/services/EnrollmentService.java: -------------------------------------------------------------------------------- 1 | package com.application.services; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.application.model.Enrollment; 7 | import com.application.repository.EnrollmentRepository; 8 | 9 | @Service 10 | public class EnrollmentService 11 | { 12 | @Autowired 13 | private EnrollmentRepository enrollmentRepo; 14 | 15 | public Enrollment saveEnrollment(Enrollment enrollment) 16 | { 17 | return enrollmentRepo.save(enrollment); 18 | } 19 | 20 | public Enrollment addNewEnrollment(Enrollment enrollment) 21 | { 22 | return enrollmentRepo.save(enrollment); 23 | } 24 | 25 | public List getAllEnrollments() 26 | { 27 | return (List)enrollmentRepo.findAll(); 28 | } 29 | 30 | public void updateEnrolledcount(String coursename, int enrolledcount) 31 | { 32 | enrollmentRepo.updateEnrolledcount(enrolledcount, coursename); 33 | } 34 | 35 | public Enrollment fetchByCoursename(String coursename) 36 | { 37 | return enrollmentRepo.findByCoursename(coursename); 38 | } 39 | 40 | public Enrollment fetchByCourseid(String courseid) 41 | { 42 | return enrollmentRepo.findByCourseid(courseid); 43 | } 44 | 45 | public List fetchByEnrolledusername(String enrolledusername) 46 | { 47 | return (List)enrollmentRepo.findByEnrolledusername(enrolledusername); 48 | } 49 | 50 | public List fetchByEnrolleduserid(String enrolleduserid) 51 | { 52 | return (List)enrollmentRepo.findByEnrolleduserid(enrolleduserid); 53 | } 54 | 55 | public List fetchByEnrolledusertype(String enrolledusertype) 56 | { 57 | return (List)enrollmentRepo.findByEnrolledusertype(enrolledusertype); 58 | } 59 | 60 | public List fetchByInstructorname(String instructorname) 61 | { 62 | return (List)enrollmentRepo.findByInstructorname(instructorname); 63 | } 64 | 65 | public List fetchByInstructorinstitution(String instructorinstitution) 66 | { 67 | return (List)enrollmentRepo.findByInstructorinstitution(instructorinstitution); 68 | } 69 | 70 | public List fetchByEnrolleddate(String enrolleddate) 71 | { 72 | return (List)enrollmentRepo.findByEnrolleddate(enrolleddate); 73 | } 74 | 75 | public List fetchByCoursetype(String coursetype) 76 | { 77 | return (List)enrollmentRepo.findByCoursetype(coursetype); 78 | } 79 | 80 | public List fetchByYoutubeurl(String youtubeurl) 81 | { 82 | return (List)enrollmentRepo.findByYoutubeurl(youtubeurl); 83 | } 84 | 85 | public List fetchByWebsiteurl(String websiteurl) 86 | { 87 | return (List)enrollmentRepo.findByWebsiteurl(websiteurl); 88 | } 89 | 90 | public List fetchBySkilllevel(String skilllevel) 91 | { 92 | return (List)enrollmentRepo.findBySkilllevel(skilllevel); 93 | } 94 | 95 | public List fetchByLanguage(String language) 96 | { 97 | return (List)enrollmentRepo.findByLanguage(language); 98 | } 99 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/services/ProfessorService.java: -------------------------------------------------------------------------------- 1 | package com.application.services; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.application.model.Professor; 7 | import com.application.repository.ProfessorRepository; 8 | 9 | @Service 10 | public class ProfessorService 11 | { 12 | @Autowired 13 | private ProfessorRepository professorRepo; 14 | 15 | public Professor saveProfessor(Professor professor) 16 | { 17 | return professorRepo.save(professor); 18 | } 19 | 20 | public Professor addNewProfessor(Professor professor) 21 | { 22 | return professorRepo.save(professor); 23 | } 24 | 25 | public Professor updateProfessorProfile(Professor professor) 26 | { 27 | return professorRepo.save(professor); 28 | } 29 | 30 | public List getAllProfessors() 31 | { 32 | return (List)professorRepo.findAll(); 33 | } 34 | 35 | public List getProfessorListByEmail(String email) 36 | { 37 | return (List)professorRepo.findProfessorListByEmail(email); 38 | } 39 | 40 | public Professor fetchProfessorByEmail(String email) 41 | { 42 | return professorRepo.findByEmail(email); 43 | } 44 | 45 | public Professor fetchProfessorByProfessorname(String professorname) 46 | { 47 | return professorRepo.findByProfessorname(professorname); 48 | } 49 | 50 | public Professor fetchProfessorByEmailAndPassword(String email, String password) 51 | { 52 | return professorRepo.findByEmailAndPassword(email, password); 53 | } 54 | 55 | public List fetchProfileByEmail(String email) 56 | { 57 | return (List)professorRepo.findProfileByEmail(email); 58 | } 59 | 60 | public void updateStatus(String email) 61 | { 62 | professorRepo.updateStatus(email); 63 | } 64 | 65 | public void rejectStatus(String email) 66 | { 67 | professorRepo.rejectStatus(email); 68 | } 69 | 70 | public List getProfessorsByEmail(String email) 71 | { 72 | return professorRepo.findProfessorListByEmail(email); 73 | } 74 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/services/UserService.java: -------------------------------------------------------------------------------- 1 | package com.application.services; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import com.application.model.User; 8 | import com.application.repository.UserRepository; 9 | 10 | @Service 11 | public class UserService 12 | { 13 | @Autowired 14 | private UserRepository userRepo; 15 | 16 | public User saveUser(User user) 17 | { 18 | return userRepo.save(user); 19 | } 20 | 21 | public User updateUserProfile(User user) 22 | { 23 | return userRepo.save(user); 24 | } 25 | 26 | public List getAllUsers() 27 | { 28 | return (List)userRepo.findAll(); 29 | } 30 | 31 | public User fetchUserByEmail(String email) 32 | { 33 | return userRepo.findByEmail(email); 34 | } 35 | 36 | public User fetchUserByUsername(String username) 37 | { 38 | return userRepo.findByUsername(username); 39 | } 40 | 41 | public User fetchUserByEmailAndPassword(String email, String password) 42 | { 43 | return userRepo.findByEmailAndPassword(email, password); 44 | } 45 | 46 | public List fetchProfileByEmail(String email) 47 | { 48 | return (List)userRepo.findProfileByEmail(email); 49 | } 50 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/java/com/application/services/WishlistService.java: -------------------------------------------------------------------------------- 1 | package com.application.services; 2 | 3 | import java.util.List; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import com.application.model.Wishlist; 7 | import com.application.repository.WishlistRepository; 8 | 9 | @Service 10 | public class WishlistService 11 | { 12 | @Autowired 13 | private WishlistRepository wishlistRepo; 14 | 15 | public Wishlist saveToWishlist(Wishlist course) 16 | { 17 | return wishlistRepo.save(course); 18 | } 19 | 20 | public Wishlist addToWishlist(Wishlist course) 21 | { 22 | return wishlistRepo.save(course); 23 | } 24 | 25 | public List getAllLikedCourses() 26 | { 27 | return (List)wishlistRepo.findAll(); 28 | } 29 | 30 | public Wishlist fetchCourseByCoursename(String coursename) 31 | { 32 | return wishlistRepo.findByCoursename(coursename); 33 | } 34 | 35 | public Wishlist fetchCourseByCourseid(String courseid) 36 | { 37 | return wishlistRepo.findByCourseid(courseid); 38 | } 39 | 40 | public List fetchByInstructorname(String instructorname) 41 | { 42 | return (List)wishlistRepo.findByInstructorname(instructorname); 43 | } 44 | 45 | public List fetchByInstructorinstitution(String instructorinstitution) 46 | { 47 | return (List)wishlistRepo.findByInstructorinstitution(instructorinstitution); 48 | } 49 | 50 | public List fetchByLikeduser(String likeduser) 51 | { 52 | return (List)wishlistRepo.findByLikeduser(likeduser); 53 | } 54 | 55 | public List fetchByLikedusertype(String likedusertype) 56 | { 57 | return (List)wishlistRepo.findByLikedusertype(likedusertype); 58 | } 59 | 60 | public List fetchByCoursetype(String coursetype) 61 | { 62 | return (List)wishlistRepo.findByCoursetype(coursetype); 63 | } 64 | 65 | public List fetchBySkilllevel(String skilllevel) 66 | { 67 | return (List)wishlistRepo.findBySkilllevel(skilllevel); 68 | } 69 | 70 | public List fetchByLanguage(String language) 71 | { 72 | return (List)wishlistRepo.findByLanguage(language); 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /ELearningManagement - backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8080 2 | spring.datasource.url = jdbc:mysql://localhost:3306/elearningsystem 3 | spring.datasource.username = root 4 | spring.datasource.password = /* Enter your password */ 5 | spring.jpa.show-sql = true 6 | security.basic.enable: false 7 | security.ignored=/** 8 | 9 | spring.jpa.hibernate.ddl-auto = update 10 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL55Dialect 11 | -------------------------------------------------------------------------------- /ELearningManagement - backend/src/test/java/com/application/ELearningManagementApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.application; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ELearningManagementApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "ElearningManagement": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:application": { 10 | "strict": true 11 | } 12 | }, 13 | "root": "", 14 | "sourceRoot": "src", 15 | "prefix": "app", 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/ElearningManagement", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "tsconfig.app.json", 25 | "assets": [ 26 | "src/favicon.ico", 27 | "src/assets" 28 | ], 29 | "styles": [ 30 | "src/styles.css", 31 | "node_modules/bootstrap/dist/css/bootstrap.min.css", 32 | "node_modules/font-awesome/css/font-awesome.css", 33 | "node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.carousel.min.css", 34 | "node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.theme.default.min.css" 35 | ], 36 | "scripts": [ 37 | "node_modules/jquery/dist/jquery.js", 38 | "node_modules/bootstrap/dist/js/bootstrap.js" 39 | ] 40 | }, 41 | "configurations": { 42 | "production": { 43 | "budgets": [ 44 | { 45 | "type": "initial", 46 | "maximumWarning": "500kb", 47 | "maximumError": "1mb" 48 | }, 49 | { 50 | "type": "anyComponentStyle", 51 | "maximumWarning": "2kb", 52 | "maximumError": "4kb" 53 | } 54 | ], 55 | "fileReplacements": [ 56 | { 57 | "replace": "src/environments/environment.ts", 58 | "with": "src/environments/environment.prod.ts" 59 | } 60 | ], 61 | "outputHashing": "all" 62 | }, 63 | "development": { 64 | "buildOptimizer": false, 65 | "optimization": false, 66 | "vendorChunk": true, 67 | "extractLicenses": false, 68 | "sourceMap": true, 69 | "namedChunks": true 70 | } 71 | }, 72 | "defaultConfiguration": "production" 73 | }, 74 | "serve": { 75 | "builder": "@angular-devkit/build-angular:dev-server", 76 | "configurations": { 77 | "production": { 78 | "browserTarget": "ElearningManagement:build:production" 79 | }, 80 | "development": { 81 | "browserTarget": "ElearningManagement:build:development" 82 | } 83 | }, 84 | "defaultConfiguration": "development" 85 | }, 86 | "extract-i18n": { 87 | "builder": "@angular-devkit/build-angular:extract-i18n", 88 | "options": { 89 | "browserTarget": "ElearningManagement:build" 90 | } 91 | }, 92 | "test": { 93 | "builder": "@angular-devkit/build-angular:karma", 94 | "options": { 95 | "main": "src/test.ts", 96 | "polyfills": "src/polyfills.ts", 97 | "tsConfig": "tsconfig.spec.json", 98 | "karmaConfig": "karma.conf.js", 99 | "assets": [ 100 | "src/favicon.ico", 101 | "src/assets" 102 | ], 103 | "styles": [ 104 | "src/styles.css" 105 | ], 106 | "scripts": [] 107 | } 108 | } 109 | } 110 | } 111 | }, 112 | "defaultProject": "ElearningManagement" 113 | } 114 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/ElearningManagement'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elearning-management", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "~12.0.3", 14 | "@angular/cdk": "^12.1.1", 15 | "@angular/common": "~12.0.3", 16 | "@angular/compiler": "~12.0.3", 17 | "@angular/core": "~12.0.3", 18 | "@angular/forms": "~12.0.3", 19 | "@angular/platform-browser": "~12.0.3", 20 | "@angular/platform-browser-dynamic": "~12.0.3", 21 | "@angular/router": "~12.0.3", 22 | "@angular/youtube-player": "^12.1.1", 23 | "angular-bootstrap-md": "^11.1.0", 24 | "bootstrap": "^5.0.2", 25 | "font-awesome": "^4.7.0", 26 | "jquery": "^3.6.0", 27 | "ngx-owl-carousel-o": "^6.0.0", 28 | "rxjs": "~6.6.0", 29 | "tslib": "^2.1.0", 30 | "zone.js": "~0.11.4" 31 | }, 32 | "devDependencies": { 33 | "@angular-devkit/build-angular": "~12.0.3", 34 | "@angular/cli": "~12.0.3", 35 | "@angular/compiler-cli": "~12.0.3", 36 | "@types/jasmine": "~3.6.0", 37 | "@types/jquery": "^3.5.5", 38 | "@types/node": "^12.11.1", 39 | "jasmine-core": "~3.7.0", 40 | "karma": "~6.3.0", 41 | "karma-chrome-launcher": "~3.1.0", 42 | "karma-coverage": "~2.0.3", 43 | "karma-jasmine": "~4.0.0", 44 | "karma-jasmine-html-reporter": "^1.5.0", 45 | "typescript": "~4.2.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { AddchapterComponent } from './components/addchapter/addchapter.component'; 4 | import { AddcourseComponent } from './components/addcourse/addcourse.component'; 5 | import { AddprofessorComponent } from './components/addprofessor/addprofessor.component'; 6 | import { AdmindashboardComponent } from './components/admindashboard/admindashboard.component'; 7 | import { ApprovalstatusComponent } from './components/approvalstatus/approvalstatus.component'; 8 | import { CourselistComponent } from './components/courselist/courselist.component'; 9 | import { FullcourseComponent } from './components/fullcourse/fullcourse.component'; 10 | import { LoginComponent } from './components/login/login.component'; 11 | import { MycoursesComponent } from './components/mycourses/mycourses.component'; 12 | import { MywishlistComponent } from './components/mywishlist/mywishlist.component'; 13 | import { ProfessordashboardComponent } from './components/professordashboard/professordashboard.component'; 14 | import { ProfessorlistComponent } from './components/professorlist/professorlist.component'; 15 | import { ProfessorprofileComponent } from './components/professorprofile/professorprofile.component'; 16 | import { RegistrationComponent } from './components/registration/registration.component'; 17 | import { RegistrationsuccessComponent } from './components/registrationsuccess/registrationsuccess.component'; 18 | import { UserdashboardComponent } from './components/userdashboard/userdashboard.component'; 19 | import { UserlistComponent } from './components/userlist/userlist.component'; 20 | import { UserprofileComponent } from './components/userprofile/userprofile.component'; 21 | import { WelcomepageComponent } from './components/welcomepage/welcomepage.component'; 22 | import { AdminGuard } from './guards/admin.guard'; 23 | import { ProfessorGuard } from './guards/professor.guard'; 24 | import { RouterGuard } from './guards/router.guard'; 25 | import { UserGuard } from './guards/user.guard'; 26 | 27 | const routes: Routes = [ 28 | {path:'',component:WelcomepageComponent}, 29 | {path:'login',component:LoginComponent}, 30 | {path:'registration',component:RegistrationComponent}, 31 | {path:'registrationsuccess',component:RegistrationsuccessComponent}, 32 | {path:'admindashboard',component:AdmindashboardComponent,canActivate:[AdminGuard]}, 33 | {path:'userdashboard',component:UserdashboardComponent,canActivate:[UserGuard]}, 34 | {path:'professordashboard',component:ProfessordashboardComponent,canActivate:[ProfessorGuard]}, 35 | {path:'addProfessor',component:AddprofessorComponent,canActivate:[AdminGuard]}, 36 | {path:'addCourse',component:AddcourseComponent,canActivate:[RouterGuard]}, 37 | {path:'approveprofessor',component:ApprovalstatusComponent,canActivate:[RouterGuard]}, 38 | {path:'professorlist',component:ProfessorlistComponent,canActivate:[RouterGuard]}, 39 | {path:'userlist',component:UserlistComponent,canActivate:[RouterGuard]}, 40 | {path:'courselist',component:CourselistComponent,canActivate:[RouterGuard]}, 41 | {path:'addchapter',component:AddchapterComponent,canActivate:[RouterGuard]}, 42 | {path:'fullcourse/:coursename',component:FullcourseComponent,canActivate:[RouterGuard]}, 43 | {path:'editprofessorprofile',component:ProfessorprofileComponent,canActivate:[ProfessorGuard]}, 44 | {path:'edituserprofile',component:UserprofileComponent,canActivate:[UserGuard]}, 45 | {path:'mywishlist',component:MywishlistComponent,canActivate:[RouterGuard]}, 46 | {path:'mycourses',component:MycoursesComponent,canActivate:[RouterGuard]} 47 | ]; 48 | 49 | @NgModule({ 50 | imports: [RouterModule.forRoot(routes)], 51 | exports: [RouterModule] 52 | }) 53 | export class AppRoutingModule { } 54 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/app/app.component.css -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'ElearningManagement'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('ElearningManagement'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement; 33 | expect(compiled.querySelector('.content span').textContent).toContain('ElearningManagement app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ElearningManagement'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { HttpClient, HttpClientModule } from '@angular/common/http'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { AppRoutingModule } from './app-routing.module'; 6 | import { AppComponent } from './app.component'; 7 | import { LoginComponent } from './components/login/login.component'; 8 | import { RegistrationComponent } from './components/registration/registration.component'; 9 | import { RegistrationsuccessComponent } from './components/registrationsuccess/registrationsuccess.component'; 10 | import { UserdashboardComponent } from './components/userdashboard/userdashboard.component'; 11 | import { ProfessordashboardComponent } from './components/professordashboard/professordashboard.component'; 12 | import { AdmindashboardComponent } from './components/admindashboard/admindashboard.component'; 13 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 14 | import { HeaderComponent } from './components/header/header.component'; 15 | import { FooterComponent } from './components/footer/footer.component'; 16 | import { UserprofileComponent } from './components/userprofile/userprofile.component'; 17 | import { ProfessorprofileComponent } from './components/professorprofile/professorprofile.component'; 18 | import { AddprofessorComponent } from './components/addprofessor/addprofessor.component'; 19 | import { ApprovalstatusComponent } from './components/approvalstatus/approvalstatus.component'; 20 | import { AddcourseComponent } from './components/addcourse/addcourse.component'; 21 | import { UserlistComponent } from './components/userlist/userlist.component'; 22 | import { ProfessorlistComponent } from './components/professorlist/professorlist.component'; 23 | import { CourselistComponent } from './components/courselist/courselist.component'; 24 | import { MDBBootstrapModule } from 'angular-bootstrap-md'; 25 | import { CarouselModule } from 'ngx-owl-carousel-o'; 26 | import { YouTubePlayerModule } from '@angular/youtube-player'; 27 | import { FullcourseComponent } from './components/fullcourse/fullcourse.component'; 28 | import { AddchapterComponent } from './components/addchapter/addchapter.component'; 29 | import { MycoursesComponent } from './components/mycourses/mycourses.component'; 30 | import { MywishlistComponent } from './components/mywishlist/mywishlist.component'; 31 | import { WelcomepageComponent } from './components/welcomepage/welcomepage.component'; 32 | 33 | @NgModule({ 34 | declarations: [ 35 | AppComponent, 36 | LoginComponent, 37 | RegistrationComponent, 38 | RegistrationsuccessComponent, 39 | UserdashboardComponent, 40 | ProfessordashboardComponent, 41 | AdmindashboardComponent, 42 | HeaderComponent, 43 | FooterComponent, 44 | UserprofileComponent, 45 | ProfessorprofileComponent, 46 | AddprofessorComponent, 47 | ApprovalstatusComponent, 48 | AddcourseComponent, 49 | UserlistComponent, 50 | ProfessorlistComponent, 51 | CourselistComponent, 52 | FullcourseComponent, 53 | AddchapterComponent, 54 | MycoursesComponent, 55 | MywishlistComponent, 56 | WelcomepageComponent 57 | ], 58 | imports: [ 59 | BrowserModule, 60 | FormsModule, 61 | ReactiveFormsModule, 62 | HttpClientModule, 63 | AppRoutingModule, 64 | CarouselModule, 65 | YouTubePlayerModule, 66 | MDBBootstrapModule.forRoot() 67 | ], 68 | providers: [], 69 | bootstrap: [AppComponent, RegistrationComponent] 70 | }) 71 | export class AppModule { } 72 | -------------------------------------------------------------------------------- /src/app/components/addchapter/addchapter.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Oswald:wght@600&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Volkhov:ital,wght@1,700&display=swap'); 3 | @import url('https://fonts.googleapis.com/css2?family=Mate+SC&display=swap'); 4 | 5 | .container 6 | { 7 | max-width: 700px; 8 | padding: 40px 40px 25px 40px; 9 | border-radius: 10px; 10 | box-shadow: 5px 5px 35px 8px rgb(147, 158, 147); 11 | background-color: white; 12 | margin-top: 2%; 13 | margin-bottom: 50px; 14 | } 15 | input{ 16 | border-radius: 12px; 17 | margin-top: 8px; 18 | } 19 | .textual 20 | { 21 | color: rgb(77, 72, 14); 22 | text-align: center; 23 | margin-top: -20px; 24 | font-family: 'Aladin', cursive; 25 | padding: 5px; 26 | font-weight: bolder; 27 | font-size: 28px; 28 | text-transform: uppercase; 29 | } 30 | label{ 31 | margin-top: 10px; 32 | font-family: 'Volkhov', serif; 33 | letter-spacing: 0px; 34 | font-size: medium; 35 | } 36 | .registerbtn 37 | { 38 | background-color: transparent; 39 | padding-left: 8%; 40 | padding-right: 8%; 41 | margin: auto; 42 | padding-bottom: 7px; 43 | border-radius: 15px; 44 | margin-top: 10px; 45 | display: flex; 46 | justify-content: center; 47 | align-items: center; 48 | color: black; 49 | border: 1px solid black; 50 | } 51 | .registerbtn:hover 52 | { 53 | background-color: rgb(23, 78, 78); 54 | padding-left: 7%; 55 | padding-right: 7%; 56 | cursor: pointer; 57 | color: white; 58 | } -------------------------------------------------------------------------------- /src/app/components/addchapter/addchapter.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AddchapterComponent } from './addchapter.component'; 4 | 5 | describe('AddchapterComponent', () => { 6 | let component: AddchapterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ AddchapterComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AddchapterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/addchapter/addchapter.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormGroup, FormControl, FormArray, FormBuilder } from '@angular/forms' 3 | import { Router } from '@angular/router'; 4 | import { Observable } from 'rxjs'; 5 | import { Chapter } from 'src/app/models/chapter'; 6 | import { ProfessorService } from 'src/app/services/professor.service'; 7 | import * as $ from 'jquery'; 8 | import { Course } from 'src/app/models/course'; 9 | 10 | @Component({ 11 | selector: 'app-addchapter', 12 | templateUrl: './addchapter.component.html', 13 | styleUrls: ['./addchapter.component.css'] 14 | }) 15 | export class AddchapterComponent implements OnInit { 16 | 17 | chapter = new Chapter(); 18 | coursenames : Observable | undefined; 19 | 20 | constructor(private _router : Router, private _service : ProfessorService) {} 21 | 22 | ngOnInit() { 23 | 24 | this.coursenames = this._service.getCourseListNames(); 25 | 26 | $("#chapter2btn,#chapter3btn,#chapter4btn,#chapter5btn,#chapter6btn,#chapter7btn,#chapter8btn").hide(); 27 | $("#chapter2,#chapter3,#chapter4,#chapter5,#chapter6,#chapter7,#chapter8").hide(); 28 | 29 | $("#chapter1btn").click(function(){ 30 | $("#chapter2,#chapter2btn").show(); 31 | $("#chapter1btn").hide(); 32 | }); 33 | $("#chapter2btn").click(function(){ 34 | $("#chapter3,#chapter3btn").show(); 35 | $("#chapter1btn,#chapter2btn,#remove2btn").hide(); 36 | }); 37 | $("#chapter3btn").click(function(){ 38 | $("#chapter4,#chapter4btn").show(); 39 | $("#chapter1btn,#chapter2btn,#chapter3btn,#remove2btn,#remove3btn").hide(); 40 | }); 41 | $("#chapter4btn").click(function(){ 42 | $("#chapter5,#chapter5btn").show(); 43 | $("#chapter1btn,#chapter2btn,#chapter3btn,#chapter4btn,#remove2btn,#remove3btn,#remove4btn").hide(); 44 | }); 45 | $("#chapter5btn").click(function(){ 46 | $("#chapter6,#chapter6btn").show(); 47 | $("#chapter1btn,#chapter2btn,#chapter3btn,#chapter4btn,#chapter5btn,#remove2btn,#remove3btn,#remove4btn,#remove5btn").hide(); 48 | }); 49 | $("#chapter6btn").click(function(){ 50 | $("#chapter7,#chapter7btn").show(); 51 | $("#chapter1btn,#chapter2btn,#chapter3btn,#chapter4btn,#chapter5btn,#chapter6btn,#remove2btn,#remove3btn,#remove4btn,#remove5btn,#remove6btn").hide(); 52 | }); 53 | $("#chapter7btn").click(function(){ 54 | $("#chapter8,#chapter8btn").show(); 55 | $("#chapter1btn,#chapter2btn,#chapter3btn,#chapter4btn,#chapter5btn,#chapter6btn,#chapter7btn,#remove2btn,#remove3btn,#remove4btn,#remove5btn,#remove6btn,#remove7btn").hide(); 56 | }); 57 | 58 | $("#remove2btn").click(function(){ 59 | $("#chapter2").hide(); 60 | $('#chapter2nametxt, #chapter2idtxt').val(''); 61 | $("#chapter1btn").show(); 62 | }); 63 | $("#remove3btn").click(function(){ 64 | $("#chapter3").hide(); 65 | $('#chapter3nametxt, #chapter3idtxt').val(''); 66 | $("#chapter2btn,#remove2btn").show(); 67 | }); 68 | $("#remove4btn").click(function(){ 69 | $("#chapter4").hide(); 70 | $('#chapter4nametxt, #chapter4idtxt').val(''); 71 | $("#chapter3btn,#remove3btn").show(); 72 | }); 73 | $("#remove5btn").click(function(){ 74 | $("#chapter5").hide(); 75 | $('#chapter5nametxt, #chapter5idtxt').val(''); 76 | $("#chapter4btn,#remove4btn").show(); 77 | }); 78 | $("#remove6btn").click(function(){ 79 | $("#chapter6").hide(); 80 | $('#chapter6nametxt, #chapter6idtxt').val(''); 81 | $("#chapter5btn,#remove5btn").show(); 82 | }); 83 | $("#remove7btn").click(function(){ 84 | $("#chapter7").hide(); 85 | $('#chapter7nametxt, #chapter7idtxt').val(''); 86 | $("#chapter6btn,#remove6btn").show(); 87 | }); 88 | $("#remove8btn").click(function(){ 89 | $("#chapter8").hide(); 90 | $('#chapter8nametxt, #chapter8idtxt').val(''); 91 | $("#chapter7btn,#remove7btn").show(); 92 | }); 93 | 94 | } 95 | 96 | addChapters() 97 | { 98 | this._service.addNewChapters(this.chapter).subscribe( 99 | data => { 100 | console.log("chapter added Successfully !!!"); 101 | this._router.navigate(['/professordashboard']); 102 | }, 103 | error => { 104 | console.log("chapter adding Failed !!!"); 105 | console.log(error.error); 106 | } 107 | ) 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/app/components/addcourse/addcourse.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .register{ 4 | background: white; 5 | margin-top: 0.8%; 6 | margin-bottom: 3%; 7 | border-radius: 15px; 8 | padding: 3%; 9 | } 10 | .register-right{ 11 | background: #ffffff; 12 | border-radius: 15px; 13 | box-shadow: 5px 5px 35px 8px rgb(147, 158, 147); 14 | margin-left: auto; 15 | margin-right: auto; 16 | } 17 | .register .register-form{ 18 | padding: 10%; 19 | margin-top: 10%; 20 | } 21 | .btnRegister{ 22 | float: right; 23 | margin-top: -1%; 24 | margin-bottom: 3%; 25 | margin-right: 34%; 26 | border: none; 27 | border-radius: 1.5rem; 28 | padding: 1%; 29 | border: 1px solid #440707; 30 | color: #440707; 31 | font-weight: 600; 32 | font-size: 20px; 33 | width: 30%; 34 | cursor: pointer; 35 | } 36 | .loginbtn 37 | { 38 | float: right; 39 | margin-top: 10%; 40 | margin-right: 25%; 41 | border: none; 42 | border-radius: 1.5rem; 43 | padding: 2%; 44 | background: transparent; 45 | color: #ffffff; 46 | font-weight: bolder; 47 | width: 50%; 48 | cursor: pointer; 49 | } 50 | .loginbtn:hover{ 51 | cursor: pointer; 52 | background: #ffffff; 53 | color: #0a3d3b; 54 | } 55 | .btnRegister:hover{ 56 | background: #440707; 57 | color: #fff; 58 | cursor: pointer; 59 | } 60 | .register .nav-tabs{ 61 | margin-top: 3%; 62 | border: none; 63 | background: #971515; 64 | border-radius: 1.5rem; 65 | width: 28%; 66 | float: right; 67 | } 68 | .register .nav-tabs .nav-link{ 69 | padding: 2%; 70 | height: 34px; 71 | font-weight: 600; 72 | color: #fff; 73 | border-top-right-radius: 1.5rem; 74 | border-bottom-right-radius: 1.5rem; 75 | } 76 | .register .nav-tabs .nav-link:hover{ 77 | border: none; 78 | } 79 | .register .nav-tabs .nav-link.active{ 80 | width: 100px; 81 | color: #0062cc; 82 | border: 2px solid #0062cc; 83 | border-top-left-radius: 1.5rem; 84 | border-bottom-left-radius: 1.5rem; 85 | } 86 | .highlight1, .highlight2{ 87 | width: 100px; 88 | color: #fdfdfd; 89 | background-color: #f14747; 90 | border: 2px solid #440707; 91 | border-top-left-radius: 1.5rem; 92 | border-bottom-left-radius: 1.5rem; 93 | } 94 | .nav1:hover, .nav2:hover{ 95 | cursor: pointer; 96 | } 97 | .register-heading{ 98 | text-align: center; 99 | margin-top: 8%; 100 | font-weight: bold; 101 | font-size: 35px; 102 | letter-spacing: 1.5px; 103 | margin-bottom: -15%; 104 | font-family: 'Aladin', cursive; 105 | color: #413613; 106 | } 107 | #home-tab 108 | { 109 | background-color: none; 110 | } 111 | input 112 | { 113 | border-radius: 10px; 114 | } 115 | label 116 | { 117 | margin-bottom: 1.5%; 118 | font-family: 'Merienda'; 119 | font-weight: 600; 120 | } 121 | .form-group 122 | { 123 | margin-bottom: 4%; 124 | } -------------------------------------------------------------------------------- /src/app/components/addcourse/addcourse.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AddcourseComponent } from './addcourse.component'; 4 | 5 | describe('AddcourseComponent', () => { 6 | let component: AddcourseComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ AddcourseComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AddcourseComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/addcourse/addcourse.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { Course } from 'src/app/models/course'; 4 | import { ProfessorService } from 'src/app/services/professor.service'; 5 | import * as $ from 'jquery'; 6 | 7 | @Component({ 8 | selector: 'app-addcourse', 9 | templateUrl: './addcourse.component.html', 10 | styleUrls: ['./addcourse.component.css'] 11 | }) 12 | export class AddcourseComponent implements OnInit { 13 | 14 | course = new Course(); 15 | msg = ' '; 16 | 17 | constructor(private _professorService : ProfessorService, private _router : Router) { } 18 | 19 | ngOnInit(): void 20 | { 21 | $("#websitelink, #youtubelink").css("display","none"); 22 | $("#websitelink").hide(); 23 | 24 | $("select").on('change', function() { 25 | $(this).find("option:selected").each(function() { 26 | var option = $(this).attr("value"); 27 | if(option === "Website") { 28 | $("#websitelink").css("display","block"); 29 | $("#youtubelink").css("display","none"); 30 | } 31 | else if(option === "Youtube") 32 | { 33 | $("#youtubelink").css("display","block"); 34 | $("#websitelink").css("display","none"); 35 | } 36 | }); 37 | }).change(); 38 | } 39 | 40 | addCourse() 41 | { 42 | this._professorService.addCourse(this.course).subscribe( 43 | data => { 44 | console.log("Course added Successfully !!!"); 45 | this._router.navigate(['/addchapter']); 46 | }, 47 | error => { 48 | console.log("Process Failed"); 49 | console.log(error.error); 50 | this.msg = "Course with "+this.course.coursename+" already exists !!!"; 51 | } 52 | ) 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/app/components/addprofessor/addprofessor.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .register{ 4 | background: white; 5 | margin-top: 0.8%; 6 | margin-bottom: 3%; 7 | border-radius: 15px; 8 | padding: 3%; 9 | } 10 | .register-right{ 11 | background: #ffffff; 12 | border-radius: 15px; 13 | box-shadow: 5px 5px 35px 8px rgb(147, 158, 147); 14 | margin-left: auto; 15 | margin-right: auto; 16 | } 17 | .register .register-form{ 18 | padding: 10%; 19 | margin-top: 10%; 20 | } 21 | .btnRegister{ 22 | float: right; 23 | margin-top: -1%; 24 | margin-bottom: 3%; 25 | margin-right: 34%; 26 | border: none; 27 | border-radius: 1.5rem; 28 | padding: 1%; 29 | border: 1px solid #440707; 30 | color: #440707; 31 | font-weight: 600; 32 | font-size: 20px; 33 | width: 30%; 34 | cursor: pointer; 35 | } 36 | .loginbtn 37 | { 38 | float: right; 39 | margin-top: 10%; 40 | margin-right: 25%; 41 | border: none; 42 | border-radius: 1.5rem; 43 | padding: 2%; 44 | background: transparent; 45 | color: #ffffff; 46 | font-weight: bolder; 47 | width: 50%; 48 | cursor: pointer; 49 | } 50 | .loginbtn:hover{ 51 | cursor: pointer; 52 | background: #ffffff; 53 | color: #0a3d3b; 54 | } 55 | .btnRegister:hover{ 56 | background: #440707; 57 | color: #fff; 58 | cursor: pointer; 59 | } 60 | .register .nav-tabs{ 61 | margin-top: 3%; 62 | border: none; 63 | background: #971515; 64 | border-radius: 1.5rem; 65 | width: 28%; 66 | float: right; 67 | } 68 | .register .nav-tabs .nav-link{ 69 | padding: 2%; 70 | height: 34px; 71 | font-weight: 600; 72 | color: #fff; 73 | border-top-right-radius: 1.5rem; 74 | border-bottom-right-radius: 1.5rem; 75 | } 76 | .register .nav-tabs .nav-link:hover{ 77 | border: none; 78 | } 79 | .register .nav-tabs .nav-link.active{ 80 | width: 100px; 81 | color: #0062cc; 82 | border: 2px solid #0062cc; 83 | border-top-left-radius: 1.5rem; 84 | border-bottom-left-radius: 1.5rem; 85 | } 86 | .highlight1, .highlight2{ 87 | width: 100px; 88 | color: #fdfdfd; 89 | background-color: #f14747; 90 | border: 2px solid #440707; 91 | border-top-left-radius: 1.5rem; 92 | border-bottom-left-radius: 1.5rem; 93 | } 94 | .nav1:hover, .nav2:hover{ 95 | cursor: pointer; 96 | } 97 | .register-heading{ 98 | text-align: center; 99 | margin-top: 8%; 100 | font-weight: bold; 101 | font-size: 35px; 102 | letter-spacing: 1.5px; 103 | margin-bottom: -15%; 104 | font-family: 'Aladin', cursive; 105 | color: #413613; 106 | } 107 | #home-tab 108 | { 109 | background-color: none; 110 | } 111 | input 112 | { 113 | border-radius: 10px; 114 | } 115 | label 116 | { 117 | margin-bottom: 1.5%; 118 | font-family: 'Merienda'; 119 | font-weight: 600; 120 | } 121 | .form-group 122 | { 123 | margin-bottom: 4%; 124 | } -------------------------------------------------------------------------------- /src/app/components/addprofessor/addprofessor.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AddprofessorComponent } from './addprofessor.component'; 4 | 5 | describe('AddprofessorComponent', () => { 6 | let component: AddprofessorComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ AddprofessorComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AddprofessorComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/addprofessor/addprofessor.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { Professor } from 'src/app/models/professor'; 4 | import { User } from 'src/app/models/user'; 5 | import { AdminService } from 'src/app/services/admin.service'; 6 | import { ProfessorService } from 'src/app/services/professor.service'; 7 | import { RegistrationService } from 'src/app/services/registration.service'; 8 | 9 | @Component({ 10 | selector: 'app-addprofessor', 11 | templateUrl: './addprofessor.component.html', 12 | styleUrls: ['./addprofessor.component.css'] 13 | }) 14 | export class AddprofessorComponent implements OnInit { 15 | 16 | user = new User(); 17 | professor = new Professor(); 18 | msg = ' '; 19 | 20 | constructor(private _Service : AdminService, private _professorService : ProfessorService, private _router : Router) { } 21 | 22 | ngOnInit(): void { 23 | } 24 | 25 | addProfessor() 26 | { 27 | this._Service.addProfessor(this.professor).subscribe( 28 | data => { 29 | console.log("Professor added Successfully !!!"); 30 | this._router.navigate(['/admindashboard']); 31 | }, 32 | error => { 33 | console.log("Process Failed"); 34 | console.log(error.error); 35 | this.msg = "Professor with "+this.professor.email+" already exists !!!"; 36 | } 37 | ) 38 | } 39 | registerUser() 40 | { 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/app/components/admindashboard/admindashboard.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Mate+SC&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 3 | 4 | .sidebar-container { 5 | position: relative; 6 | width: 235px; 7 | height: 970px; 8 | left: 0; 9 | overflow-x: hidden; 10 | overflow-y: hidden; 11 | background: #1a1a1a; 12 | color: #fff; 13 | } 14 | 15 | .content-container { 16 | padding-top: 20px; 17 | } 18 | .sidebar-navigation { 19 | padding: 0; 20 | margin: 0; 21 | list-style-type: none; 22 | position: relative; 23 | } 24 | .sidebar-navigation li { 25 | background-color: transparent; 26 | position: relative; 27 | display: inline-block; 28 | width: 100%; 29 | font-weight: bold; 30 | font-size: larger; 31 | line-height: 20px; 32 | padding: 20px 15px 30px 20px; 33 | display: block; 34 | margin-top: 8%; 35 | color: #fff; 36 | transition: transform .2s; 37 | -webkit-transition: background-color 1s ease-out; 38 | -moz-transition: background-color 1s ease-out; 39 | -o-transition: background-color 1s ease-out; 40 | transition: background-color 1s ease-out; 41 | } 42 | .sidebar-navigation li:hover{ 43 | background-color: #c92d2d; 44 | transform: scale(1.1); 45 | cursor: pointer; 46 | } 47 | 48 | .sidebar-navigation li .fa { 49 | margin-right: 10px; 50 | } 51 | 52 | .sidebar-navigation li a:active, 53 | .sidebar-navigation li a:hover, 54 | .sidebar-navigation li a:focus { 55 | text-decoration: none; 56 | outline: none; 57 | } 58 | 59 | .sidebar-navigation li::before { 60 | background-color: #13584f; 61 | 62 | content: ''; 63 | height: 100%; 64 | left: 0; 65 | top: 0; 66 | -webkit-transition: width 0.2s ease-in; 67 | transition: width 0.2s ease-in; 68 | width: 3px; 69 | z-index: -1; 70 | } 71 | 72 | .sidebar-navigation li:hover::before { 73 | width: 100%; 74 | } 75 | 76 | .sidebar-navigation .header { 77 | font-size: 12px; 78 | text-transform: uppercase; 79 | background-color: #151515; 80 | padding: 10px 15px 10px 30px; 81 | } 82 | 83 | .sidebar-navigation .header::before { 84 | background-color: transparent; 85 | } 86 | 87 | .content-container { 88 | padding-left: 220px; 89 | } 90 | #userimg{ 91 | width: 100px; 92 | height: 150px; 93 | display: block; 94 | margin-left: auto; 95 | margin-top: 5%; 96 | margin-right: auto; 97 | } 98 | .home-section{ 99 | position: relative; 100 | background: #E4E9F7; 101 | min-height: 90vh; 102 | top: 0; 103 | left: 78px; 104 | width: calc(100% - 78px); 105 | transition: all 0.5s ease; 106 | z-index: 2; 107 | } 108 | 109 | #userimg{ 110 | width: 100px; 111 | height: 150px; 112 | display: block; 113 | margin-left: auto; 114 | margin-top: 5%; 115 | margin-right: auto; 116 | } 117 | .container 118 | { 119 | margin-left: 23%; 120 | margin-top: -72%; 121 | overflow-x: hidden; 122 | } 123 | .dashboard-card 124 | { 125 | background-color: white; 126 | border-radius: 10px; 127 | border: none; 128 | width: 35%; 129 | transition: transform .4s; 130 | box-shadow: 5px 10px 18px #888888; 131 | margin: 2% 3% 5.5% 3%; 132 | padding: 3%; 133 | } 134 | .dashboard-card:hover 135 | { 136 | transform: scale(1.05); 137 | cursor: pointer; 138 | } 139 | .circle{ 140 | border-radius: 50%; 141 | width: 30%; 142 | height: 80px; 143 | float: right; 144 | background-color: rgb(248, 246, 96); 145 | } 146 | #icons 147 | { 148 | margin-left: 26%; 149 | margin-top: 12%; 150 | font-size: 3.5em; 151 | } 152 | .text 153 | { 154 | font-family: 'aladin'; 155 | letter-spacing: 1px; 156 | font-size: 35px; 157 | font-weight: bolder; 158 | color: rgb(5, 44, 42); 159 | } 160 | .sub-text 161 | { 162 | font-family: 'aladin'; 163 | letter-spacing: 1px; 164 | font-size: 20px; 165 | font-weight: 600; 166 | color: darkred; 167 | } -------------------------------------------------------------------------------- /src/app/components/admindashboard/admindashboard.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 41 | 42 |
43 |
44 |
Welcome to Admin Dashboard - Elearning Management System
45 |
[Author - GowthamRaj K]
46 |
47 |
48 |
Users
49 |
{{user}} users registered
50 |
51 |
52 |
53 |
Professors
54 |
{{professor}} Professors currently teaching the learners
55 |
56 |
57 |
58 |
Courses
59 |
{{course}} courses available
60 |
61 |
62 |
63 |
Leaners
64 |
{{count}} enrollments have been made by {{enrollment}} Learners
65 |
66 |
67 |
68 |
Chapters
69 |
{{chapter}} courses are with its
detailed chapters
70 |
71 |
72 |
73 |
Favourites
74 |
{{wishlists}} courses are loved by most of the Leaners
75 |
76 |
77 |
78 | 79 |



80 | -------------------------------------------------------------------------------- /src/app/components/admindashboard/admindashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdmindashboardComponent } from './admindashboard.component'; 4 | 5 | describe('AdmindashboardComponent', () => { 6 | let component: AdmindashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ AdmindashboardComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdmindashboardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/admindashboard/admindashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { AdminService } from 'src/app/services/admin.service'; 5 | import { UserService } from 'src/app/services/user.service'; 6 | 7 | @Component({ 8 | selector: 'app-admindashboard', 9 | templateUrl: './admindashboard.component.html', 10 | styleUrls: ['./admindashboard.component.css'] 11 | }) 12 | export class AdmindashboardComponent implements OnInit { 13 | 14 | name = 'admin'; 15 | gender = ''; 16 | loggedUser = ''; 17 | currRole = ''; 18 | professors : Observable | undefined; 19 | users : Observable | undefined; 20 | courses : Observable | undefined; 21 | enrollments : Observable | undefined; 22 | enrollmentcount : Observable | undefined; 23 | wishlist : Observable | undefined; 24 | chapters : Observable | undefined; 25 | 26 | constructor(private _route : Router, private _service : AdminService) { } 27 | 28 | ngOnInit(): void 29 | { 30 | this.name = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 31 | this.name = this.name.replace(/"/g, ''); 32 | 33 | this.gender = JSON.stringify(sessionStorage.getItem('gender')|| '{}'); 34 | this.gender = this.gender.replace(/"/g, ''); 35 | 36 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 37 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 38 | 39 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 40 | this.currRole = this.currRole.replace(/"/g, ''); 41 | 42 | this.professors = this._service.getTotalProfessors(); 43 | this.users = this._service.getTotalUsers(); 44 | this.courses = this._service.getTotalCourses(); 45 | this.enrollments = this._service.getTotalEnrollments(); 46 | this.enrollmentcount = this._service.getTotalEnrollmentCount(); 47 | this.wishlist = this._service.getTotalWishlist(); 48 | this.chapters = this._service.getTotalChapters(); 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/app/components/approvalstatus/approvalstatus.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Mate+SC&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Oswald:wght@600&display=swap'); 3 | 4 | .panel-body{ 5 | margin-left: 1%; 6 | margin-right: 2%; 7 | } 8 | thead{ 9 | background-color: rgb(85, 14, 14); 10 | padding: 10px 5px 10px 5px; 11 | } 12 | table, td{ 13 | text-align: center; 14 | align-items: center; 15 | vertical-align: middle; 16 | } 17 | table, td, tr{ 18 | border: 1px solid rgb(163, 161, 161); 19 | font-family: serif; 20 | font-weight: bold; 21 | font-style: normal; 22 | font-size: large; 23 | } 24 | 25 | th{ 26 | text-transform: uppercase; 27 | color: white; 28 | font-family: Helvetica; 29 | font-style: italic; 30 | font-size: normal; 31 | padding: 10px 10px 10px 10px; 32 | border: 1px solid white; 33 | } 34 | td{ 35 | text-transform:none; 36 | padding: 10px; 37 | } 38 | .accepted{ 39 | border: 1px solid black; 40 | border-radius: 10px; 41 | background-color: rgb(30, 116, 30); 42 | padding: 5px 10px 5px 10px; 43 | color: white; 44 | font-weight: bolder; 45 | } 46 | .pending{ 47 | border: 1px solid black; 48 | border-radius: 10px; 49 | background-color: rgb(196, 137, 28); 50 | padding: 5px 10px 5px 10px; 51 | color: white; 52 | font-weight: bolder; 53 | } 54 | .rejected{ 55 | border: 1px solid black; 56 | border-radius: 10px; 57 | background-color: red; 58 | padding: 5px 10px 5px 10px; 59 | color: white; 60 | font-weight: bolder; 61 | } 62 | .date-cover 63 | { 64 | border-radius: 10px; 65 | background-color: rgb(14, 9, 58); 66 | padding: 5px 10px 5px 10px; 67 | color: white; 68 | width: auto; 69 | font-size: 18px; 70 | font-weight: bolder; 71 | } 72 | .headercolor 73 | { 74 | background-color: rgb(3, 70, 3); 75 | } -------------------------------------------------------------------------------- /src/app/components/approvalstatus/approvalstatus.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ApprovalstatusComponent } from './approvalstatus.component'; 4 | 5 | describe('ApprovalstatusComponent', () => { 6 | let component: ApprovalstatusComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ApprovalstatusComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ApprovalstatusComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/approvalstatus/approvalstatus.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { Professor } from 'src/app/models/professor'; 4 | import { ProfessorService } from 'src/app/services/professor.service'; 5 | 6 | @Component({ 7 | selector: 'app-approvalstatus', 8 | templateUrl: './approvalstatus.component.html', 9 | styleUrls: ['./approvalstatus.component.css'] 10 | }) 11 | export class ApprovalstatusComponent implements OnInit { 12 | 13 | currRole = ''; 14 | loggedUser = ''; 15 | approval : Observable | undefined; 16 | professorlist : Observable | undefined; 17 | responses : Observable | undefined; 18 | 19 | constructor(private _service : ProfessorService) { } 20 | 21 | ngOnInit(): void 22 | { 23 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 24 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 25 | 26 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 27 | this.currRole = this.currRole.replace(/"/g, ''); 28 | 29 | this.professorlist = this._service.getProfessorList(); 30 | this.approval = this._service.getProfessorListByEmail(this.loggedUser); 31 | 32 | if(this.currRole === 'professor' || this.currRole === 'PROFESSOR') 33 | { 34 | $("#adminapproval").hide(); 35 | $("#professorapproval").show(); 36 | } 37 | else if(this.currRole === 'admin' || this.currRole === 'ADMIN' && this.loggedUser === 'admin@gmail.com') 38 | { 39 | $("#adminapproval").show(); 40 | $("#professorapproval").hide(); 41 | } 42 | } 43 | 44 | acceptRequest(curremail : string) 45 | { 46 | this.responses = this._service.acceptRequestForProfessorApproval(curremail); 47 | $("#acceptbtn").hide(); 48 | $("#rejectbtn").hide(); 49 | $("#acceptedbtn").show(); 50 | $("#rejectedbtn").hide(); 51 | } 52 | 53 | rejectRequest(curremail : string) 54 | { 55 | this.responses = this._service.rejectRequestForProfessorApproval(curremail); 56 | $("#acceptbtn").hide(); 57 | $("#rejectbtn").hide(); 58 | $("#acceptedbtn").hide(); 59 | $("#rejectedbtn").show(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/app/components/courselist/courselist.component.css: -------------------------------------------------------------------------------- 1 | .headtext 2 | { 3 | margin-bottom: 3%; 4 | font-weight: bolder; 5 | color: darkgreen; 6 | font-family: Georgia, 'Times New Roman', Times, serif; 7 | font-size: 25px; 8 | } 9 | .btn-primary 10 | { 11 | background-color: rgb(17, 93, 95); 12 | border-radius: 10px; 13 | font-weight: bold; 14 | } 15 | .btn-primary:hover 16 | { 17 | background-color: rgb(9, 40, 41); 18 | cursor: pointer; 19 | } 20 | .btn-secondary{ 21 | border-radius: 10px; 22 | background-color: rgb(30, 116, 30); 23 | font-weight: bold; 24 | cursor: context-menu; 25 | } 26 | a{ 27 | text-decoration: none; 28 | } 29 | #enrollsuccessbtn:hover 30 | { 31 | color: rgb(9, 40, 41); 32 | background-color: white; 33 | } -------------------------------------------------------------------------------- /src/app/components/courselist/courselist.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CourselistComponent } from './courselist.component'; 4 | 5 | describe('CourselistComponent', () => { 6 | let component: CourselistComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ CourselistComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CourselistComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/app/components/footer/footer.component.css -------------------------------------------------------------------------------- /src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | © 2021 Copyright: 5 | Gowthamraj K 6 |

7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
-------------------------------------------------------------------------------- /src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit(): void { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/components/fullcourse/fullcourse.component.css: -------------------------------------------------------------------------------- 1 | .continer 2 | { 3 | background-color: white; 4 | border-radius: 10px; 5 | box-shadow: 4px 4px 35px 8px darkgray; 6 | margin: 3% 5% 3% 5%; 7 | padding: 3%; 8 | } 9 | .chapter-list 10 | { 11 | margin-top: -36%; 12 | float: right; 13 | overflow-y: scroll; 14 | padding: 2%; 15 | box-shadow: 4px 4px 25px 8px darkgray; 16 | background-color: white; 17 | width: 36%; 18 | height: 380px; 19 | } 20 | .chapter-list::-webkit-scrollbar { 21 | width: 8px; 22 | } 23 | .chapter-list::-webkit-scrollbar-track { 24 | background: #f1f1f1; 25 | } 26 | .chapter-list::-webkit-scrollbar-thumb { 27 | background: rgb(6, 122, 117); 28 | } 29 | .chapter-list::-webkit-scrollbar-thumb:hover { 30 | background: rgb(3, 54, 52); 31 | } 32 | #select-box 33 | { 34 | width: 25px; 35 | height: 25px; 36 | align-items: center; 37 | border: 1px solid black; 38 | align-content: center; 39 | cursor: pointer; 40 | padding: 2px; 41 | vertical-align: middle; 42 | border-radius: 5px; 43 | background-color: white; 44 | } 45 | .selected 46 | { 47 | background-color: #e1e3e2; 48 | } 49 | .name 50 | { 51 | font-weight: bolder; 52 | font-size: 18px; 53 | margin-top: -8.5%; 54 | cursor: pointer; 55 | margin-left: 12%; 56 | color: rgb(6, 54, 47); 57 | font-family: 'Segoe UI', sans-serif; 58 | } 59 | .chapter1, .chapter2, .chapter3, .chapter4, .chapter5, .chapter6, .chapter7, .chapter8 60 | { 61 | padding: 3%; 62 | } 63 | .fa-check 64 | { 65 | font-weight: bolder; 66 | color: white; 67 | vertical-align: middle; 68 | font-size: large; 69 | display: flex; 70 | } 71 | .sub-container 72 | { 73 | background-color: white; 74 | border-radius: 10px; 75 | box-shadow: 4px 4px 15px 8px darkgray; 76 | margin-top: 2%; 77 | padding: 1%; 78 | width: 100%; 79 | } 80 | .sub-btns 81 | { 82 | background-color: white; 83 | padding: 3%; 84 | } 85 | .btn-info 86 | { 87 | margin-right: 4%; 88 | border: none; 89 | outline: none; 90 | background-color: white; 91 | font-size: 20px; 92 | font-weight: bolder; 93 | cursor: pointer; 94 | } 95 | .btn-info:active, .btn-info:focus, .btn-info:hover 96 | { 97 | border: none; 98 | outline: none; 99 | box-shadow: none; 100 | background-color: white; 101 | } 102 | .descriptions 103 | { 104 | margin-left: 15%; 105 | margin-right: 10%; 106 | background-color: white; 107 | } 108 | .certificate 109 | { 110 | opacity: 0.6; 111 | border: 1px solid black; 112 | font-weight: bolder; 113 | margin-left: 22%; 114 | cursor: pointer; 115 | margin-top: 2%; 116 | display: inline-block; 117 | background-color: white; 118 | padding: 5px 30px 5px 30px; 119 | } 120 | #searchtxt 121 | { 122 | font-weight: bold; 123 | background-color: rgb(238, 236, 236); 124 | padding: 1%; 125 | margin-top: -5.4%; 126 | width: 70%; 127 | margin-bottom: 4%; 128 | } 129 | #questions, #notestxt 130 | { 131 | font-weight: bold; 132 | background-color: rgb(243, 241, 241); 133 | padding: 2%; 134 | margin-top: 3%; 135 | margin-bottom: 8%; 136 | width: 70%; 137 | } 138 | -------------------------------------------------------------------------------- /src/app/components/fullcourse/fullcourse.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FullcourseComponent } from './fullcourse.component'; 4 | 5 | describe('FullcourseComponent', () => { 6 | let component: FullcourseComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ FullcourseComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FullcourseComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/header/header.component.css: -------------------------------------------------------------------------------- 1 | .sidebar-text 2 | { 3 | font-size: medium; 4 | } 5 | .content-container { 6 | padding-top: 20px; 7 | } 8 | 9 | .sidebar-logo { 10 | padding: 15px 15px 15px 30px; 11 | font-size: 20px; 12 | text-align: right; 13 | background-color: #851313; 14 | width: 100%; 15 | } 16 | .logoutbtn{ 17 | border: none; 18 | background:transparent; 19 | color: white; 20 | border-radius: 15px; 21 | margin-left: 10px; 22 | padding: 5px 10px 5px 10px; 23 | font-size: medium; 24 | } 25 | .logoutbtn:hover{ 26 | cursor: pointer; 27 | background-color: #f03e3e; 28 | padding: 5px 10px 5px 10px; 29 | border-radius: 15px; 30 | } -------------------------------------------------------------------------------- /src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-header', 6 | templateUrl: './header.component.html', 7 | styleUrls: ['./header.component.css'] 8 | }) 9 | export class HeaderComponent implements OnInit { 10 | 11 | loggedUser = ''; 12 | currRole = ''; 13 | title = ''; 14 | 15 | constructor(private activatedRoute: ActivatedRoute, private _router : Router) { } 16 | 17 | ngOnInit(): void 18 | { 19 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 20 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 21 | 22 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 23 | this.currRole = this.currRole.replace(/"/g, ''); 24 | 25 | if(this.loggedUser === "admin@gmail.com"){ 26 | this.title = "Admin Dashboard"; 27 | } 28 | else if(this.currRole === "professor"){ 29 | this.title = ""; 30 | } 31 | else if(this.currRole === "user"){ 32 | this.title = ""; 33 | } 34 | } 35 | 36 | logout() 37 | { 38 | sessionStorage.clear(); 39 | this._router.navigate(['/login']); 40 | } 41 | 42 | navigateHome() 43 | { 44 | if(this.loggedUser === "admin@gmail.com"){ 45 | this._router.navigate(['/admindashboard']); 46 | } 47 | else if(this.currRole === "professor"){ 48 | this._router.navigate(['/professordashboard']); 49 | } 50 | else if(this.currRole === "user"){ 51 | this._router.navigate(['/userdashboard']); 52 | } 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/app/components/login/login.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Oswald:wght@600&display=swap'); 2 | @import '~font-awesome/css/font-awesome.css'; 3 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 4 | 5 | .container 6 | { 7 | max-width: 450px; 8 | padding: 3px 40px 40px 40px; 9 | margin-top: 2%; 10 | margin-bottom: 3%; 11 | border-radius: 10px; 12 | box-shadow: 5px 5px 35px 8px rgb(147, 158, 147); 13 | border-top: 8px solid rgb(167, 27, 34); 14 | background-color: white; 15 | } 16 | input{ 17 | border-radius: 12px; 18 | margin-top: 8px; 19 | } 20 | .textual 21 | { 22 | color: rgb(64, 85, 15); 23 | text-align: center; 24 | margin-top: -20px; 25 | font-family: 'Aladin', cursive; 26 | padding: 5px; 27 | text-transform: uppercase; 28 | } 29 | 30 | .loginbtn 31 | { 32 | background-color: transparent; 33 | padding-left: 8%; 34 | padding-right: 8%; 35 | padding-bottom: 7px; 36 | border-radius: 15px; 37 | display: flex; 38 | justify-content: center; 39 | align-items: center; 40 | color: black; 41 | margin: auto; 42 | border: 1px solid black; 43 | margin-top: 10px; 44 | } 45 | .loginbtn:hover 46 | { 47 | background-color: rgb(23, 78, 78); 48 | padding-left: 7%; 49 | padding-right: 7%; 50 | cursor: pointer; 51 | color: white; 52 | } 53 | .fa-google{ 54 | background: conic-gradient(from -45deg, #ea4335 110deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc05 270deg) 73% 55%/150% 150% no-repeat; 55 | -webkit-background-clip: text; 56 | background-clip: text; 57 | color: transparent; 58 | -webkit-text-fill-color: transparent; 59 | cursor: pointer; 60 | } 61 | .fa-linkedin 62 | { 63 | background: #0e76a8; 64 | -webkit-background-clip: text; 65 | background-clip: text; 66 | color: transparent; 67 | -webkit-text-fill-color: transparent; 68 | cursor: pointer; 69 | } 70 | .fa-windows 71 | { 72 | background: conic-gradient(from -90deg, #F65314 90deg, #7CBB00 90deg 180deg, #FFBB00 90deg 270deg, #00A1F1 270deg) 73% 55%/150% 150% no-repeat; 73 | -webkit-background-clip: text; 74 | background-clip: text; 75 | color: transparent; 76 | -webkit-text-fill-color: transparent; 77 | cursor: pointer; 78 | } 79 | .fa-twitter 80 | { 81 | background-color: #1DA1F2; 82 | -webkit-background-clip: text; 83 | background-clip: text; 84 | color: transparent; 85 | -webkit-text-fill-color: transparent; 86 | cursor: pointer; 87 | } 88 | .fa-github 89 | { 90 | background-color: #333; 91 | -webkit-background-clip: text; 92 | background-clip: text; 93 | color: transparent; 94 | -webkit-text-fill-color: transparent; 95 | cursor: pointer; 96 | } 97 | .fa-apple{ 98 | background-color: #16161d; 99 | -webkit-background-clip: text; 100 | background-clip: text; 101 | color: transparent; 102 | -webkit-text-fill-color: transparent; 103 | cursor: pointer; 104 | } 105 | .fa-google:hover, .fa-linkedin:hover, .fa-windows:hover, .fa-github:hover, .fa-twitter:hover, .fa-apple:hover 106 | { 107 | font-size:2.5em; 108 | transition: 1s ease-out; 109 | } 110 | .headbtn1, .headbtn2, .headbtn3{ 111 | border: none; 112 | padding: 2% 20px 2% 20px; 113 | width: 122px; 114 | font-weight: bold; 115 | background-color: transparent; 116 | margin-left: 0px; 117 | } 118 | .headbtn1:hover, .headbtn2:hover, .headbtn3:hover{ 119 | background-color: rgb(223, 231, 184); 120 | } 121 | 122 | .headbtn1{ 123 | margin-top: -40%; 124 | margin-bottom: 10%; 125 | } -------------------------------------------------------------------------------- /src/app/components/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/mycourses/mycourses.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .btn-primary 4 | { 5 | background-color: rgb(17, 93, 95); 6 | border-radius: 10px; 7 | font-weight: bold; 8 | } 9 | .btn-primary:hover 10 | { 11 | background-color: rgb(9, 40, 41); 12 | cursor: pointer; 13 | } 14 | .heading-text 15 | { 16 | font-weight: bolder; 17 | font-size: 40px; 18 | margin-top: 3%; 19 | color: darkgreen; 20 | font-family: 'Aladin', cursive; 21 | letter-spacing: 1px; 22 | margin-left: 42%; 23 | } -------------------------------------------------------------------------------- /src/app/components/mycourses/mycourses.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
My Learning
4 |
5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 |
13 |

{{data.coursename}}

14 |
{{data.courseid}}
15 |
Date: {{data.enrolleddate}}
16 |
Your ID: {{data.enrolleduserid}}
17 |
Instructor: {{data.instructorname}}
18 |
Learners: {{data.enrolledcount}} enrolled previously
19 |
Type: {{data.coursetype}}
20 |
Level: {{data.skilllevel}}
21 |
Language: {{data.language}}
22 |


{{data.description}}

23 | Visit Course 24 |
25 |
26 |
27 |
28 |
29 |
30 | 31 |

32 | -------------------------------------------------------------------------------- /src/app/components/mycourses/mycourses.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MycoursesComponent } from './mycourses.component'; 4 | 5 | describe('MycoursesComponent', () => { 6 | let component: MycoursesComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ MycoursesComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MycoursesComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/mycourses/mycourses.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { OwlOptions } from 'ngx-owl-carousel-o'; 4 | import { Observable } from 'rxjs'; 5 | import { Enrollment } from 'src/app/models/enrollment'; 6 | import { UserService } from 'src/app/services/user.service'; 7 | 8 | @Component({ 9 | selector: 'app-mycourses', 10 | templateUrl: './mycourses.component.html', 11 | styleUrls: ['./mycourses.component.css'] 12 | }) 13 | export class MycoursesComponent implements OnInit { 14 | 15 | myenrollments : Observable | undefined; 16 | loggedUser = ''; 17 | currRole = ''; 18 | 19 | constructor(private _service : UserService, private _router : Router) { } 20 | 21 | ngOnInit(): void 22 | { 23 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 24 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 25 | 26 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 27 | this.currRole = this.currRole.replace(/"/g, ''); 28 | 29 | this.myenrollments = this._service.getEnrollmentByEmail(this.loggedUser,this.currRole); 30 | 31 | const target = 'https://www.youtube.com/iframe_api' 32 | 33 | if (!this.isScriptLoaded(target)) { 34 | const tag = document.createElement('script') 35 | tag.src = target 36 | document.body.appendChild(tag) 37 | } 38 | } 39 | 40 | isScriptLoaded(target: string): boolean 41 | { 42 | return document.querySelector('script[src="' + target + '"]') ? true : false 43 | } 44 | 45 | visitCourse(coursename : string) 46 | { 47 | this._router.navigate(['/fullcourse', coursename]); 48 | } 49 | 50 | owlDragging(e: any){ 51 | console.log(e); 52 | } 53 | 54 | owlOptions: OwlOptions = { 55 | loop: true, 56 | mouseDrag: true, 57 | touchDrag: true, 58 | margin: 50, 59 | stagePadding: 20, 60 | pullDrag: true, 61 | dots: false, 62 | navSpeed: 1000, 63 | autoplay: true, 64 | navText: ['Previous', 'Next'], 65 | responsive: { 66 | 0: { 67 | items: 1 68 | }, 69 | 400: { 70 | items: 2 71 | }, 72 | 767: { 73 | items: 2 74 | }, 75 | 1024: { 76 | items: 3 77 | } 78 | }, 79 | nav: true 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/app/components/mywishlist/mywishlist.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .row 4 | { 5 | margin-left: 10%; 6 | margin-top: 3%; 7 | } 8 | #bloodCards 9 | { 10 | margin-right: 5%; 11 | margin-bottom: 4%; 12 | width: 40%; 13 | border-radius: 15px; 14 | padding: 0px; 15 | transition: transform .2s; 16 | box-shadow: 5px 5px 25px 8px rgb(147, 158, 147); 17 | } 18 | #bloodCards:hover 19 | { 20 | transform: scale(1.05); 21 | cursor: pointer; 22 | } 23 | .card-block 24 | { 25 | margin-top: -33%; 26 | margin-left: 40%; 27 | margin-bottom: 6%; 28 | } 29 | .text{ 30 | font-family: serif; 31 | font-size: larger; 32 | font-weight: bolder; 33 | } 34 | #searchtxt 35 | { 36 | width: 20%; 37 | float: right; 38 | } 39 | .img-block{ 40 | width: 40%; 41 | height: 180px; 42 | border-radius: 15px; 43 | background-color: white; 44 | } 45 | .circle{ 46 | background-color: rgb(243, 233, 97); 47 | margin-left: auto; 48 | margin-right: auto; 49 | align-content: center; 50 | margin-top: 42%; 51 | margin-bottom: auto; 52 | border-radius: 50%; 53 | width: 75%; 54 | height: 78%; 55 | } 56 | .bloodimg 57 | { 58 | margin-left: 0%; 59 | margin-top: 0%; 60 | } 61 | .heading-text 62 | { 63 | font-weight: bolder; 64 | font-size: 40px; 65 | margin-top: 1%; 66 | color: darkgreen; 67 | font-family: 'Aladin', cursive; 68 | letter-spacing: 1px; 69 | margin-left: 41%; 70 | } 71 | .btn-primary 72 | { 73 | background-color: rgb(17, 93, 95); 74 | border-radius: 10px; 75 | font-weight: bold; 76 | } 77 | .btn-primary:hover 78 | { 79 | background-color: rgb(9, 40, 41); 80 | cursor: pointer; 81 | } -------------------------------------------------------------------------------- /src/app/components/mywishlist/mywishlist.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
User WishList
4 |
Professor WishList
5 |
6 |
7 |
8 |
9 | 10 | 11 |
12 |
13 |
14 |
Course : {{course.coursename}}
15 |
Course ID : {{course.courseid}}
16 |
Instructor : {{course.instructorname}}
17 |
Learners : {{course.enrolledcount}} enrolled already
18 |
Type : {{course.coursetype}} Tutorials
19 |
Level : {{course.skilllevel}}
20 |
Language : {{course.language}}
21 | Visit Course 22 | Visit Course 23 |
24 |
25 |
26 | 27 |


28 | 29 | -------------------------------------------------------------------------------- /src/app/components/mywishlist/mywishlist.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MywishlistComponent } from './mywishlist.component'; 4 | 5 | describe('MywishlistComponent', () => { 6 | let component: MywishlistComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ MywishlistComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MywishlistComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/mywishlist/mywishlist.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { Wishlist } from 'src/app/models/wishlist'; 5 | import { UserService } from 'src/app/services/user.service'; 6 | 7 | @Component({ 8 | selector: 'app-mywishlist', 9 | templateUrl: './mywishlist.component.html', 10 | styleUrls: ['./mywishlist.component.css'] 11 | }) 12 | export class MywishlistComponent implements OnInit { 13 | 14 | wishlist : Observable | undefined; 15 | loggedUser = ''; 16 | currRole = ''; 17 | constructor(private _service : UserService, private _router : Router) { } 18 | 19 | ngOnInit(): void 20 | { 21 | 22 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 23 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 24 | 25 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 26 | this.currRole = this.currRole.replace(/"/g, ''); 27 | 28 | if(this.currRole === "admin") 29 | this.wishlist = this._service.getAllWishlist(); 30 | else 31 | this.wishlist = this._service.getWishlistByEmail(this.loggedUser); 32 | } 33 | 34 | visitCourse(coursename : string) 35 | { 36 | this._router.navigate(['/fullcourse', coursename]); 37 | } 38 | 39 | openURL(url : string) 40 | { 41 | (window as any).open(url, "_blank"); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/app/components/professordashboard/professordashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfessordashboardComponent } from './professordashboard.component'; 4 | 5 | describe('ProfessordashboardComponent', () => { 6 | let component: ProfessordashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ProfessordashboardComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProfessordashboardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/professordashboard/professordashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import * as $ from 'jquery'; 3 | import { Observable } from 'rxjs'; 4 | import { AdminService } from 'src/app/services/admin.service'; 5 | 6 | @Component({ 7 | selector: 'app-professordashboard', 8 | templateUrl: './professordashboard.component.html', 9 | styleUrls: ['./professordashboard.component.css'] 10 | }) 11 | export class ProfessordashboardComponent implements OnInit { 12 | 13 | loggedUser = ''; 14 | currRole = ''; 15 | courses : Observable | undefined; 16 | enrollments : Observable | undefined; 17 | enrollmentcount : Observable | undefined; 18 | wishlist : Observable | undefined; 19 | chapters : Observable | undefined; 20 | 21 | constructor(private _service : AdminService) {} 22 | 23 | ngOnInit(): void 24 | { 25 | 26 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 27 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 28 | 29 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 30 | this.currRole = this.currRole.replace(/"/g, ''); 31 | 32 | $("#btn").click(function(){ 33 | $(".sidebar").toggleClass("open"); 34 | menuBtnChange(); 35 | }); 36 | 37 | $(".bx-search").click(function(){ 38 | $(".sidebar").toggleClass("open"); 39 | menuBtnChange(); 40 | }); 41 | 42 | function menuBtnChange() { 43 | if($(".sidebar").hasClass("open")){ 44 | $("#btn").removeClass("fa-bars").addClass("fa-ellipsis-v"); 45 | }else { 46 | $("#btn").removeClass("fa-ellipsis-v").addClass("fa-bars"); 47 | } 48 | } 49 | 50 | this.courses = this._service.getTotalCourses(); 51 | this.enrollments = this._service.getTotalEnrollments(); 52 | this.enrollmentcount = this._service.getTotalEnrollmentCount(); 53 | this.wishlist = this._service.getTotalWishlist(); 54 | this.chapters = this._service.getTotalChapters(); 55 | 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/app/components/professorlist/professorlist.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .row 4 | { 5 | margin-left: 10%; 6 | margin-top: 3%; 7 | } 8 | #bloodCards 9 | { 10 | margin-right: 5%; 11 | margin-bottom: 5%; 12 | border-radius: 15px; 13 | padding: 0px; 14 | width: 40%; 15 | height: 60%; 16 | transition: transform .2s; 17 | box-shadow: 5px 5px 25px 8px rgb(147, 158, 147); 18 | } 19 | #bloodCards:hover 20 | { 21 | transform: scale(1.05); 22 | cursor: pointer; 23 | } 24 | .card-block 25 | { 26 | margin-top: 2%; 27 | margin-left: 10%; 28 | } 29 | .text{ 30 | font-family: serif; 31 | font-size: larger; 32 | font-weight: bolder; 33 | margin-bottom: 1%; 34 | } 35 | #searchtxt 36 | { 37 | width: 20%; 38 | float: right; 39 | } 40 | .img-block 41 | { 42 | width: 100.5%; 43 | height: 180px; 44 | border-top-left-radius: 15px; 45 | border-top-right-radius: 15px; 46 | background-color: rgb(17, 90, 85); 47 | } 48 | .circle{ 49 | background-color: rgb(253, 255, 138); 50 | margin-left: auto; 51 | margin-right: auto; 52 | align-content: center; 53 | margin-top: 5%; 54 | margin-bottom: auto; 55 | border-radius: 50%; 56 | width: 40%; 57 | height: 80%; 58 | } 59 | .bloodimg 60 | { 61 | margin-left: 17%; 62 | margin-top: 3%; 63 | } 64 | .status-btn 65 | { 66 | padding: 4px 30px 5px 30px; 67 | background-color: darkgreen; 68 | color: white; 69 | border-radius: 15px; 70 | text-align: center; 71 | vertical-align: middle; 72 | width: 240px; 73 | font-weight: bold; 74 | margin-top: 4%; 75 | margin-left: 15%; 76 | margin-bottom: 4%; 77 | } 78 | .status-btn1 79 | { 80 | background-color: rgb(199, 93, 32); 81 | padding: 4px 30px 5px 30px; 82 | color: white; 83 | vertical-align: middle; 84 | border-radius: 15px; 85 | width: 200px; 86 | text-align: center; 87 | font-weight: bold; 88 | margin-top: 4%; 89 | margin-left: 20%; 90 | margin-bottom: 4%; 91 | } 92 | .status-btn2 93 | { 94 | background-color: rgb(187, 40, 40); 95 | padding: 4px 30px 5px 30px; 96 | color: white; 97 | vertical-align: middle; 98 | text-align: center; 99 | border-radius: 15px; 100 | width: 200px; 101 | font-weight: bold; 102 | margin-top: 4%; 103 | margin-left: 20%; 104 | margin-bottom: 4%; 105 | } 106 | .heading-text 107 | { 108 | font-weight: bolder; 109 | font-size: 40px; 110 | margin-top: 2%; 111 | color: darkgreen; 112 | font-family: 'Aladin', cursive; 113 | letter-spacing: 1px; 114 | margin-left: 42%; 115 | } 116 | .subheading-text 117 | { 118 | font-weight: bolder; 119 | font-size: 25px; 120 | color: green; 121 | font-family: 'Aladin', cursive; 122 | letter-spacing: 1px; 123 | margin-left: 35%; 124 | margin-bottom: 1%; 125 | } 126 | .date-cover{ 127 | border-radius: 10px; 128 | background-color: rgb(10, 15, 68); 129 | padding: 5px 10px 5px 10px; 130 | color: white; 131 | width: 30%; 132 | font-weight: bolder; 133 | } 134 | .slotcover 135 | { 136 | border-radius: 10px; 137 | background-color: rgb(128, 44, 18); 138 | padding: 5px 10px 5px 10px; 139 | color: white; 140 | width: 30%; 141 | font-weight: bolder; 142 | } -------------------------------------------------------------------------------- /src/app/components/professorlist/professorlist.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Professor List
4 |
5 |
6 |
7 |
8 | 9 | 10 |
11 |
12 |
13 |
Professor ID : {{professor.professorid}}
14 |
Professor Name : {{professor.professorname}}
15 |
Degree Completed : {{professor.degreecompleted}}
16 |
Email : {{professor.email}}
17 |
Institution Name : {{professor.institutionname}}
18 |
Department : {{professor.department}}
19 |
Experience: {{professor.experience}} years
20 |
Gender : {{professor.gender}}
21 |
Mobile : {{professor.mobile}}
22 |
23 |
Approved Professor
24 |
25 |
26 |
Rejected
27 |
28 |
29 |
Approval Pending
30 |
31 |
32 |
33 |
34 |


35 | -------------------------------------------------------------------------------- /src/app/components/professorlist/professorlist.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfessorlistComponent } from './professorlist.component'; 4 | 5 | describe('ProfessorlistComponent', () => { 6 | let component: ProfessorlistComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ProfessorlistComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProfessorlistComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/professorlist/professorlist.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { Professor } from 'src/app/models/professor'; 4 | import { ProfessorService } from 'src/app/services/professor.service'; 5 | 6 | @Component({ 7 | selector: 'app-professorlist', 8 | templateUrl: './professorlist.component.html', 9 | styleUrls: ['./professorlist.component.css'] 10 | }) 11 | export class ProfessorlistComponent implements OnInit { 12 | 13 | loggedUser = ''; 14 | currRole = ''; 15 | professorlist : Observable | undefined; 16 | 17 | constructor(private _service : ProfessorService) { } 18 | 19 | ngOnInit(): void 20 | { 21 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 22 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 23 | 24 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 25 | this.currRole = this.currRole.replace(/"/g, ''); 26 | 27 | this.professorlist = this._service.getProfessorList(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/app/components/professorprofile/professorprofile.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .register{ 4 | background: white; 5 | margin-top: 0.8%; 6 | margin-bottom: 3%; 7 | border-radius: 15px; 8 | padding: 3%; 9 | } 10 | .register-right{ 11 | background: #ffffff; 12 | border-radius: 15px; 13 | box-shadow: 5px 5px 35px 8px rgb(147, 158, 147); 14 | margin-left: auto; 15 | margin-right: auto; 16 | } 17 | .register .register-form{ 18 | padding: 10%; 19 | margin-top: 10%; 20 | } 21 | .btnRegister{ 22 | float: right; 23 | margin-top: 1%; 24 | margin-bottom: 3%; 25 | margin-right: 34%; 26 | border: none; 27 | border-radius: 1.5rem; 28 | padding: 1%; 29 | border: 1px solid #440707; 30 | color: #440707; 31 | font-weight: 600; 32 | font-size: 20px; 33 | width: 30%; 34 | cursor: pointer; 35 | } 36 | .loginbtn 37 | { 38 | float: right; 39 | margin-top: 10%; 40 | margin-right: 25%; 41 | border: none; 42 | border-radius: 1.5rem; 43 | padding: 2%; 44 | background: transparent; 45 | color: #ffffff; 46 | font-weight: bolder; 47 | width: 50%; 48 | cursor: pointer; 49 | } 50 | .loginbtn:hover{ 51 | cursor: pointer; 52 | background: #ffffff; 53 | color: #0a3d3b; 54 | } 55 | .btnRegister:hover{ 56 | background: #440707; 57 | color: #fff; 58 | cursor: pointer; 59 | } 60 | .register-heading{ 61 | text-align: center; 62 | margin-top: 8%; 63 | font-weight: bold; 64 | font-size: 35px; 65 | letter-spacing: 1.5px; 66 | margin-bottom: -15%; 67 | font-family: 'Aladin', cursive; 68 | color: #413613; 69 | } 70 | #home-tab 71 | { 72 | background-color: none; 73 | } 74 | input 75 | { 76 | border-radius: 10px; 77 | } 78 | .form-group 79 | { 80 | margin-bottom: 4%; 81 | } 82 | input{ 83 | border-radius: 12px; 84 | margin-top: 8px; 85 | font-weight: bold; 86 | } 87 | .textual 88 | { 89 | color: maroon; 90 | text-align: center; 91 | margin-top: 2%; 92 | font-family: 'Aladin', sans-serif; 93 | padding: 5px; 94 | font-weight: bolder; 95 | text-transform: uppercase; 96 | } 97 | label{ 98 | margin-top: 8px; 99 | font-weight: bold; 100 | font-family: sans-serif; 101 | letter-spacing: 1px; 102 | } 103 | .registerbtn 104 | { 105 | background-color: transparent; 106 | padding-left: 8%; 107 | padding-right: 8%; 108 | margin: auto; 109 | padding-bottom: 7px; 110 | border-radius: 15px; 111 | margin-top: -7%; 112 | margin-bottom: 4%; 113 | display: flex; 114 | justify-content: center; 115 | align-items: center; 116 | color: black; 117 | border: 1px solid black; 118 | } 119 | .registerbtn:hover 120 | { 121 | background-color: rgb(23, 78, 78); 122 | padding-left: 7%; 123 | padding-right: 7%; 124 | cursor: pointer; 125 | color: white; 126 | } 127 | #bloodCards 128 | { 129 | margin-right: 5%; 130 | margin-bottom: 15%; 131 | width: 55%; 132 | border-radius: 10px; 133 | transition: transform .2s; 134 | padding-left: 2%; 135 | box-shadow: 5px 5px 25px 8px rgb(147, 158, 147); 136 | } 137 | #bloodCards:hover 138 | { 139 | transform: scale(1.05); 140 | cursor: pointer; 141 | } 142 | .bloodimg 143 | { 144 | float: right; 145 | margin-top: 3%; 146 | margin-right: 3%; 147 | } 148 | .card-block 149 | { 150 | margin-top: 3%; 151 | margin-bottom: 3%; 152 | } 153 | .text{ 154 | font-family: verdana; 155 | font-size: medium; 156 | font-weight: 400; 157 | margin-top: 1.5%; 158 | } 159 | .editbtn 160 | { 161 | border: none; 162 | border-radius: 15px; 163 | color: white; 164 | padding: 5px 20px 5px 20px; 165 | margin-top: 5%; 166 | margin-bottom: 1%; 167 | background-color: #13534e; 168 | } 169 | .editbtn:hover{ 170 | cursor: pointer; 171 | } 172 | 173 | .btndiv{ 174 | margin-left: 40%; 175 | align-content: center; 176 | } 177 | #profilecard 178 | { 179 | margin-left: 30%; 180 | margin-top: 5%; 181 | } -------------------------------------------------------------------------------- /src/app/components/professorprofile/professorprofile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfessorprofileComponent } from './professorprofile.component'; 4 | 5 | describe('ProfessorprofileComponent', () => { 6 | let component: ProfessorprofileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ProfessorprofileComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProfessorprofileComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/professorprofile/professorprofile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { Professor } from 'src/app/models/professor'; 5 | import { ProfessorService } from 'src/app/services/professor.service'; 6 | 7 | @Component({ 8 | selector: 'app-professorprofile', 9 | templateUrl: './professorprofile.component.html', 10 | styleUrls: ['./professorprofile.component.css'] 11 | }) 12 | export class ProfessorprofileComponent implements OnInit { 13 | 14 | profileDetails : Observable | undefined; 15 | professor: Professor = new Professor; 16 | msg = ' '; 17 | currRole = ''; 18 | loggedUser = ''; 19 | temp = false; 20 | 21 | constructor(private _service: ProfessorService, private activatedRoute: ActivatedRoute, private _router : Router) { } 22 | 23 | ngOnInit(): void 24 | { 25 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 26 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 27 | 28 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 29 | this.currRole = this.currRole.replace(/"/g, ''); 30 | 31 | $("#profilecard").show(); 32 | $("#profileform").hide(); 33 | this.getProfileDetails(this.loggedUser); 34 | } 35 | 36 | editProfile() 37 | { 38 | $("#profilecard").hide(); 39 | $("#profileform").show(); 40 | } 41 | 42 | getProfileDetails(loggedUser : string) 43 | { 44 | this.profileDetails = this._service.getProfileDetails(this.loggedUser); 45 | console.log(this.profileDetails); 46 | } 47 | 48 | updateProfessorProfile() 49 | { 50 | this._service.UpdateUserProfile(this.professor).subscribe( 51 | data => { 52 | console.log("Professor Profile Updated succesfully"); 53 | this.msg = "Profile Updated Successfully !!!"; 54 | $(".editbtn").hide(); 55 | $("#message").show(); 56 | this.temp = true; 57 | $("#profilecard").show(); 58 | $("#profileform").hide(); 59 | setTimeout(() => { 60 | this._router.navigate(['/professordashboard']); 61 | }, 6000); 62 | }, 63 | error => { 64 | console.log("Profile Updation Failed"); 65 | console.log(error.error); 66 | this.msg = "Profile Updation Failed !!!"; 67 | } 68 | ) 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/app/components/registration/registration.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .register{ 4 | background: white; 5 | margin-top: 0.8%; 6 | margin-bottom: 3%; 7 | border-radius: 15px; 8 | padding: 3%; 9 | } 10 | .register-right{ 11 | background: #ffffff; 12 | border-radius: 15px; 13 | box-shadow: 5px 5px 35px 8px rgb(147, 158, 147); 14 | margin-left: auto; 15 | margin-right: auto; 16 | } 17 | .register .register-form{ 18 | padding: 10%; 19 | margin-top: 10%; 20 | } 21 | .btnRegister{ 22 | float: right; 23 | margin-top: 1%; 24 | margin-bottom: 3%; 25 | margin-right: 34%; 26 | border: none; 27 | border-radius: 1.5rem; 28 | padding: 1%; 29 | border: 1px solid #440707; 30 | color: #440707; 31 | font-weight: 600; 32 | font-size: 20px; 33 | width: 30%; 34 | cursor: pointer; 35 | } 36 | .loginbtn 37 | { 38 | float: right; 39 | margin-top: 10%; 40 | margin-right: 25%; 41 | border: none; 42 | border-radius: 1.5rem; 43 | padding: 2%; 44 | background: transparent; 45 | color: #ffffff; 46 | font-weight: bolder; 47 | width: 50%; 48 | cursor: pointer; 49 | } 50 | .loginbtn:hover{ 51 | cursor: pointer; 52 | background: #ffffff; 53 | color: #0a3d3b; 54 | } 55 | .btnRegister:hover{ 56 | background: #440707; 57 | color: #fff; 58 | cursor: pointer; 59 | } 60 | .register .nav-tabs{ 61 | margin-top: 3%; 62 | border: none; 63 | background: #971515; 64 | border-radius: 1.5rem; 65 | width: 28%; 66 | float: right; 67 | } 68 | .register .nav-tabs .nav-link{ 69 | padding: 2%; 70 | height: 34px; 71 | font-weight: 600; 72 | color: #fff; 73 | border-top-right-radius: 1.5rem; 74 | border-bottom-right-radius: 1.5rem; 75 | } 76 | .register .nav-tabs .nav-link:hover{ 77 | border: none; 78 | } 79 | .register .nav-tabs .nav-link.active{ 80 | width: 100px; 81 | color: #0062cc; 82 | border: 2px solid #0062cc; 83 | border-top-left-radius: 1.5rem; 84 | border-bottom-left-radius: 1.5rem; 85 | } 86 | .highlight1, .highlight2{ 87 | width: 100px; 88 | color: #fdfdfd; 89 | background-color: #f14747; 90 | border: 2px solid #440707; 91 | border-top-left-radius: 1.5rem; 92 | border-bottom-left-radius: 1.5rem; 93 | } 94 | .nav1:hover, .nav2:hover{ 95 | cursor: pointer; 96 | } 97 | .register-heading{ 98 | text-align: center; 99 | margin-top: 8%; 100 | font-weight: bold; 101 | font-size: 35px; 102 | letter-spacing: 1.5px; 103 | margin-bottom: -15%; 104 | font-family: 'Aladin', cursive; 105 | color: #413613; 106 | } 107 | #home-tab 108 | { 109 | background-color: none; 110 | } 111 | input 112 | { 113 | border-radius: 10px; 114 | } 115 | .form-group 116 | { 117 | margin-bottom: 4%; 118 | } -------------------------------------------------------------------------------- /src/app/components/registration/registration.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RegistrationComponent } from './registration.component'; 4 | 5 | describe('RegistrationComponent', () => { 6 | let component: RegistrationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ RegistrationComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(RegistrationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/registration/registration.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { Professor } from 'src/app/models/professor'; 4 | import { User } from 'src/app/models/user'; 5 | import { ProfessorService } from 'src/app/services/professor.service'; 6 | import { RegistrationService } from 'src/app/services/registration.service'; 7 | 8 | @Component({ 9 | selector: 'app-registration', 10 | templateUrl: './registration.component.html', 11 | styleUrls: ['./registration.component.css'] 12 | }) 13 | export class RegistrationComponent implements OnInit { 14 | 15 | user = new User(); 16 | professor = new Professor(); 17 | msg = ' '; 18 | 19 | constructor(private _registrationService : RegistrationService, private _professorService : ProfessorService, private _router : Router) { } 20 | 21 | ngOnInit(): void 22 | { 23 | $(".nav1").addClass("highlight1") 24 | $("#home-tab").click(function(){ 25 | $("#profile").hide(); 26 | $("#home").show(); 27 | $(".nav1").addClass("highlight1") 28 | $(".nav2").removeClass("highlight2") 29 | }); 30 | $("#profile-tab").click(function(){ 31 | $("#home").hide(); 32 | $("#profile").show(); 33 | $(".nav2").addClass("highlight2") 34 | $(".nav1").removeClass("highlight1") 35 | }); 36 | } 37 | 38 | registerUser() 39 | { 40 | this._registrationService.registerUserFromRemote(this.user).subscribe( 41 | data => { 42 | console.log("Registration Success"); 43 | sessionStorage.setItem("username",this.user.username); 44 | sessionStorage.setItem("gender",this.user.gender); 45 | this._router.navigate(['/registrationsuccess']); 46 | }, 47 | error => { 48 | console.log("Registration Failed"); 49 | console.log(error.error); 50 | this.msg = "User with "+this.user.email+" already exists !!!"; 51 | } 52 | ) 53 | } 54 | 55 | registerProfessor() 56 | { 57 | this._registrationService.registerProfessorFromRemote(this.professor).subscribe( 58 | data => { 59 | console.log("Registration Success"); 60 | sessionStorage.setItem("doctorname",this.professor.professorname); 61 | sessionStorage.setItem("gender",this.professor.gender); 62 | this._router.navigate(['/registrationsuccess']); 63 | }, 64 | error => { 65 | console.log("Registration Failed"); 66 | console.log(error.error); 67 | this.msg = "Professor with "+this.professor.email+" already exists !!!"; 68 | } 69 | ) 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /src/app/components/registrationsuccess/registrationsuccess.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/app/components/registrationsuccess/registrationsuccess.component.css -------------------------------------------------------------------------------- /src/app/components/registrationsuccess/registrationsuccess.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 |
6 |
7 |
8 |

Registered Successfully !!!

9 |

You will be re-directed to Login page in few seconds

10 |
11 |
12 |

13 |
14 | -------------------------------------------------------------------------------- /src/app/components/registrationsuccess/registrationsuccess.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RegistrationsuccessComponent } from './registrationsuccess.component'; 4 | 5 | describe('RegistrationsuccessComponent', () => { 6 | let component: RegistrationsuccessComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ RegistrationsuccessComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(RegistrationsuccessComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/registrationsuccess/registrationsuccess.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-registrationsuccess', 6 | templateUrl: './registrationsuccess.component.html', 7 | styleUrls: ['./registrationsuccess.component.css'] 8 | }) 9 | export class RegistrationsuccessComponent implements OnInit { 10 | 11 | constructor(private router : Router) { } 12 | 13 | ngOnInit(): void 14 | { 15 | setTimeout(() => { 16 | this.router.navigate(['login']); 17 | }, 7000); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/app/components/userdashboard/userdashboard.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 70 | 71 |
72 |
73 |
74 |
Welcome to User Dashboard 👋
75 |
[Author - GowthamRaj K]
76 |
77 |
78 |
Courses
79 |
{{course}} courses available
80 |
81 |
82 |
83 |
Leaners
84 |
{{count}} enrollments have been
made by {{enrollment}} Learners
85 |
86 |
87 |
88 |
Chapters
89 |
{{chapter}} courses are with its
detailed chapters
90 |
91 |
92 |
93 |
Favourites
94 |
{{wishlists}} courses are loved by
most of the Leaners
95 |
96 |
97 |
98 |
99 | 100 |



101 | -------------------------------------------------------------------------------- /src/app/components/userdashboard/userdashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { UserdashboardComponent } from './userdashboard.component'; 4 | 5 | describe('UserdashboardComponent', () => { 6 | let component: UserdashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ UserdashboardComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(UserdashboardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/userdashboard/userdashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { AdminService } from 'src/app/services/admin.service'; 4 | 5 | @Component({ 6 | selector: 'app-userdashboard', 7 | templateUrl: './userdashboard.component.html', 8 | styleUrls: ['./userdashboard.component.css'] 9 | }) 10 | export class UserdashboardComponent implements OnInit { 11 | 12 | loggedUser = ''; 13 | currRole = ''; 14 | courses : Observable | undefined; 15 | enrollments : Observable | undefined; 16 | enrollmentcount : Observable | undefined; 17 | wishlist : Observable | undefined; 18 | chapters : Observable | undefined; 19 | 20 | constructor(private _service : AdminService) {} 21 | 22 | ngOnInit(): void 23 | { 24 | 25 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 26 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 27 | 28 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 29 | this.currRole = this.currRole.replace(/"/g, ''); 30 | 31 | $("#btn").click(function(){ 32 | $(".sidebar").toggleClass("open"); 33 | menuBtnChange(); 34 | }); 35 | 36 | $(".bx-search").click(function(){ 37 | $(".sidebar").toggleClass("open"); 38 | menuBtnChange(); 39 | }); 40 | 41 | function menuBtnChange() { 42 | if($(".sidebar").hasClass("open")){ 43 | $("#btn").removeClass("fa-bars").addClass("fa-ellipsis-v"); 44 | }else { 45 | $("#btn").removeClass("fa-ellipsis-v").addClass("fa-bars"); 46 | } 47 | } 48 | 49 | this.courses = this._service.getTotalCourses(); 50 | this.enrollments = this._service.getTotalEnrollments(); 51 | this.enrollmentcount = this._service.getTotalEnrollmentCount(); 52 | this.wishlist = this._service.getTotalWishlist(); 53 | this.chapters = this._service.getTotalChapters(); 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/app/components/userlist/userlist.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .row 4 | { 5 | margin-left: 10%; 6 | margin-top: 3%; 7 | } 8 | #bloodCards 9 | { 10 | margin-right: 5%; 11 | margin-bottom: 4%; 12 | width: 40%; 13 | border-radius: 15px; 14 | padding: 0px; 15 | transition: transform .2s; 16 | box-shadow: 5px 5px 25px 8px rgb(147, 158, 147); 17 | } 18 | #bloodCards:hover 19 | { 20 | transform: scale(1.05); 21 | cursor: pointer; 22 | } 23 | .card-block 24 | { 25 | margin-top: -33%; 26 | margin-left: 40%; 27 | margin-bottom: 6%; 28 | } 29 | .text{ 30 | font-family: serif; 31 | font-size: larger; 32 | font-weight: bolder; 33 | } 34 | #searchtxt 35 | { 36 | width: 20%; 37 | float: right; 38 | } 39 | .img-block{ 40 | width: 40%; 41 | height: 180px; 42 | border-radius: 15px; 43 | background-color: white; 44 | } 45 | .circle{ 46 | background-color: rgb(22, 121, 72); 47 | margin-left: auto; 48 | margin-right: auto; 49 | align-content: center; 50 | margin-top: 20%; 51 | margin-bottom: auto; 52 | border-radius: 50%; 53 | width: 73%; 54 | height: 80%; 55 | } 56 | .bloodimg 57 | { 58 | margin-left: 13%; 59 | margin-top: 8%; 60 | } 61 | .heading-text 62 | { 63 | font-weight: bolder; 64 | font-size: 40px; 65 | margin-top: 1%; 66 | color: darkgreen; 67 | font-family: 'Aladin', cursive; 68 | letter-spacing: 1px; 69 | margin-left: 45%; 70 | } -------------------------------------------------------------------------------- /src/app/components/userlist/userlist.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
User List
4 |
5 |
6 |
7 |
8 | 9 | 10 |
11 |
12 |
13 |
{{user.username}}
14 |
{{user.userid}}
15 |
{{user.email}}
16 |
{{user.profession}}
17 |
{{user.gender}}
18 |
{{user.mobile}}
19 |
20 |
21 |
22 | 23 |


24 | -------------------------------------------------------------------------------- /src/app/components/userlist/userlist.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { UserlistComponent } from './userlist.component'; 4 | 5 | describe('UserlistComponent', () => { 6 | let component: UserlistComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ UserlistComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(UserlistComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/userlist/userlist.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { User } from 'src/app/models/user'; 4 | import { UserService } from 'src/app/services/user.service'; 5 | 6 | @Component({ 7 | selector: 'app-userlist', 8 | templateUrl: './userlist.component.html', 9 | styleUrls: ['./userlist.component.css'] 10 | }) 11 | export class UserlistComponent implements OnInit { 12 | 13 | users : Observable | undefined; 14 | 15 | constructor(private _serive : UserService) { } 16 | 17 | ngOnInit(): void 18 | { 19 | this.users = this._serive.getAllUsers(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/app/components/userprofile/userprofile.component.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Aladin&family=Merienda+One&family=Staatliches&display=swap'); 2 | 3 | .register{ 4 | background: white; 5 | margin-top: 0.8%; 6 | margin-bottom: 3%; 7 | border-radius: 15px; 8 | padding: 3%; 9 | } 10 | .register-right{ 11 | background: #ffffff; 12 | border-radius: 15px; 13 | box-shadow: 5px 5px 35px 8px rgb(147, 158, 147); 14 | margin-left: auto; 15 | margin-right: auto; 16 | } 17 | .register .register-form{ 18 | padding: 10%; 19 | margin-top: 10%; 20 | } 21 | .btnRegister{ 22 | float: right; 23 | margin-top: 1%; 24 | margin-bottom: 3%; 25 | margin-right: 34%; 26 | border: none; 27 | border-radius: 1.5rem; 28 | padding: 1%; 29 | border: 1px solid #440707; 30 | color: #440707; 31 | font-weight: 600; 32 | font-size: 20px; 33 | width: 30%; 34 | cursor: pointer; 35 | } 36 | .loginbtn 37 | { 38 | float: right; 39 | margin-top: 10%; 40 | margin-right: 25%; 41 | border: none; 42 | border-radius: 1.5rem; 43 | padding: 2%; 44 | background: transparent; 45 | color: #ffffff; 46 | font-weight: bolder; 47 | width: 50%; 48 | cursor: pointer; 49 | } 50 | .loginbtn:hover{ 51 | cursor: pointer; 52 | background: #ffffff; 53 | color: #0a3d3b; 54 | } 55 | .btnRegister:hover{ 56 | background: #440707; 57 | color: #fff; 58 | cursor: pointer; 59 | } 60 | .register-heading{ 61 | text-align: center; 62 | margin-top: 8%; 63 | font-weight: bold; 64 | font-size: 35px; 65 | letter-spacing: 1.5px; 66 | margin-bottom: -15%; 67 | font-family: 'Aladin', cursive; 68 | color: #413613; 69 | } 70 | #home-tab 71 | { 72 | background-color: none; 73 | } 74 | input 75 | { 76 | border-radius: 10px; 77 | } 78 | .form-group 79 | { 80 | margin-bottom: 4%; 81 | } 82 | input{ 83 | border-radius: 12px; 84 | margin-top: 8px; 85 | font-weight: bold; 86 | } 87 | .textual 88 | { 89 | color: maroon; 90 | text-align: center; 91 | margin-top: 2%; 92 | font-family: 'Aladin', sans-serif; 93 | padding: 5px; 94 | font-weight: bolder; 95 | text-transform: uppercase; 96 | } 97 | label{ 98 | margin-top: 8px; 99 | font-weight: bold; 100 | font-family: sans-serif; 101 | letter-spacing: 1px; 102 | } 103 | .registerbtn 104 | { 105 | background-color: transparent; 106 | padding-left: 8%; 107 | padding-right: 8%; 108 | margin: auto; 109 | padding-bottom: 7px; 110 | border-radius: 15px; 111 | margin-top: -7%; 112 | margin-bottom: 4%; 113 | display: flex; 114 | justify-content: center; 115 | align-items: center; 116 | color: black; 117 | border: 1px solid black; 118 | } 119 | .registerbtn:hover 120 | { 121 | background-color: rgb(23, 78, 78); 122 | padding-left: 7%; 123 | padding-right: 7%; 124 | cursor: pointer; 125 | color: white; 126 | } 127 | #bloodCards 128 | { 129 | margin-right: 5%; 130 | margin-bottom: 15%; 131 | width: 50%; 132 | border-radius: 10px; 133 | transition: transform .2s; 134 | padding-left: 2%; 135 | box-shadow: 5px 5px 25px 8px rgb(147, 158, 147); 136 | } 137 | #bloodCards:hover 138 | { 139 | transform: scale(1.05); 140 | cursor: pointer; 141 | } 142 | .bloodimg 143 | { 144 | float: right; 145 | margin-top: 3%; 146 | margin-right: 3%; 147 | } 148 | .card-block 149 | { 150 | margin-top: 3%; 151 | margin-bottom: 3%; 152 | } 153 | .text{ 154 | font-family: verdana; 155 | font-size: medium; 156 | font-weight: 400; 157 | margin-top: 1.5%; 158 | } 159 | .editbtn 160 | { 161 | border: none; 162 | border-radius: 15px; 163 | color: white; 164 | padding: 5px 20px 5px 20px; 165 | margin-top: 5%; 166 | margin-bottom: 1%; 167 | background-color: #13534e; 168 | } 169 | .editbtn:hover{ 170 | cursor: pointer; 171 | } 172 | 173 | .btndiv{ 174 | margin-left: 40%; 175 | align-content: center; 176 | } 177 | #profilecard 178 | { 179 | margin-left: 30%; 180 | margin-top: 5%; 181 | } -------------------------------------------------------------------------------- /src/app/components/userprofile/userprofile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { UserprofileComponent } from './userprofile.component'; 4 | 5 | describe('UserprofileComponent', () => { 6 | let component: UserprofileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ UserprofileComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(UserprofileComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/userprofile/userprofile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { User } from 'src/app/models/user'; 5 | import { UserService } from 'src/app/services/user.service'; 6 | 7 | @Component({ 8 | selector: 'app-userprofile', 9 | templateUrl: './userprofile.component.html', 10 | styleUrls: ['./userprofile.component.css'] 11 | }) 12 | export class UserprofileComponent implements OnInit { 13 | 14 | profileDetails : Observable | undefined; 15 | user: User = new User; 16 | msg = ' '; 17 | currRole = ''; 18 | loggedUser = ''; 19 | temp = false; 20 | 21 | constructor(private _service: UserService, private activatedRoute: ActivatedRoute, private _router : Router) { } 22 | 23 | ngOnInit(): void 24 | { 25 | this.loggedUser = JSON.stringify(sessionStorage.getItem('loggedUser')|| '{}'); 26 | this.loggedUser = this.loggedUser.replace(/"/g, ''); 27 | 28 | this.currRole = JSON.stringify(sessionStorage.getItem('ROLE')|| '{}'); 29 | this.currRole = this.currRole.replace(/"/g, ''); 30 | 31 | $("#profilecard").show(); 32 | $("#profileform").hide(); 33 | this.getProfileDetails(this.loggedUser); 34 | } 35 | 36 | editProfile() 37 | { 38 | $("#profilecard").hide(); 39 | $("#profileform").show(); 40 | } 41 | 42 | getProfileDetails(loggedUser : string) 43 | { 44 | this.profileDetails = this._service.getProfileDetails(this.loggedUser); 45 | console.log(this.profileDetails); 46 | } 47 | 48 | updateUserProfile() 49 | { 50 | this._service.UpdateUserProfile(this.user).subscribe( 51 | data => { 52 | console.log("UserProfile Updated succesfully"); 53 | this.msg = "Profile Updated Successfully !!!"; 54 | $(".editbtn").hide(); 55 | $("#message").show(); 56 | this.temp = true; 57 | $("#profilecard").show(); 58 | $("#profileform").hide(); 59 | setTimeout(() => { 60 | this._router.navigate(['/userdashboard']); 61 | }, 6000); 62 | }, 63 | error => { 64 | console.log("Profile Updation Failed"); 65 | console.log(error.error); 66 | this.msg = "Profile Updation Failed !!!"; 67 | } 68 | ) 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/app/components/welcomepage/welcomepage.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WelcomepageComponent } from './welcomepage.component'; 4 | 5 | describe('WelcomepageComponent', () => { 6 | let component: WelcomepageComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ WelcomepageComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(WelcomepageComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/welcomepage/welcomepage.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | import * as $ from 'jquery'; 4 | 5 | @Component({ 6 | selector: 'app-welcomepage', 7 | templateUrl: './welcomepage.component.html', 8 | styleUrls: ['./welcomepage.component.css'] 9 | }) 10 | export class WelcomepageComponent implements OnInit { 11 | 12 | constructor(private activatedRoute: ActivatedRoute,private _router : Router) { } 13 | 14 | ngOnInit(): void 15 | { 16 | $("#subtext1").click(function(){ 17 | $("#innertext1").slideToggle(300); 18 | if($('#innertext2').is(':visible')||$('#innertext3').is(':visible')||$('#innertext4').is(':visible')) 19 | { 20 | $('#innertext2').slideUp(300); 21 | $('#innertext3').slideUp(300); 22 | $('#innertext4').slideUp(300); 23 | } 24 | }); 25 | $("#subtext2").click(function(){ 26 | $("#innertext2").slideToggle(300); 27 | if($('#innertext1').is(':visible')||$('#innertext3').is(':visible')||$('#innertext4').is(':visible')) 28 | { 29 | $('#innertext1').slideUp(300); 30 | $('#innertext3').slideUp(300); 31 | $('#innertext4').slideUp(300); 32 | } 33 | }); 34 | $("#subtext3").click(function(){ 35 | $("#innertext3").slideToggle(300); 36 | if($('#innertext1').is(':visible')||$('#innertext2').is(':visible')||$('#innertext4').is(':visible')) 37 | { 38 | $('#innertext1').slideUp(300); 39 | $('#innertext2').slideUp(300); 40 | $('#innertext4').slideUp(300); 41 | } 42 | }); 43 | $("#subtext4").click(function(){ 44 | $("#innertext4").slideToggle(300); 45 | if($('#innertext1').is(':visible')||$('#innertext2').is(':visible')||$('#innertext3').is(':visible')) 46 | { 47 | $('#innertext1').slideUp(300); 48 | $('#innertext2').slideUp(300); 49 | $('#innertext3').slideUp(300); 50 | } 51 | }); 52 | } 53 | 54 | navigate() 55 | { 56 | this._router.navigate(['/login']); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/app/guards/admin.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminGuard } from './admin.guard'; 4 | 5 | describe('AdminGuard', () => { 6 | let guard: AdminGuard; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | guard = TestBed.inject(AdminGuard); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(guard).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/guards/admin.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { LoginService } from '../services/login.service'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class AdminGuard implements CanActivate 10 | { 11 | constructor(private _router : Router, private _service : LoginService) {} 12 | 13 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) 14 | { 15 | if (this._service.isUserLoggedIn() && this._service.userType() === 'admin' || this._service.userType() === 'ADMIN') 16 | { 17 | return true; 18 | } 19 | this._router.navigate(['login']); 20 | return false; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/app/guards/professor.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfessorGuard } from './professor.guard'; 4 | 5 | describe('ProfessorGuard', () => { 6 | let guard: ProfessorGuard; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | guard = TestBed.inject(ProfessorGuard); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(guard).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/guards/professor.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { LoginService } from '../services/login.service'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class ProfessorGuard implements CanActivate 10 | { 11 | constructor(private router: Router, private _service : LoginService) {} 12 | 13 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) 14 | { 15 | if (this._service.isUserLoggedIn() && this._service.userType() === 'professor' || this._service.userType() === 'PROFESSOR') 16 | { 17 | return true; 18 | } 19 | this.router.navigate(['login']); 20 | return false; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/app/guards/router.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { RouterGuard } from './router.guard'; 4 | 5 | describe('RouterGuard', () => { 6 | let guard: RouterGuard; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | guard = TestBed.inject(RouterGuard); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(guard).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/guards/router.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { LoginService } from '../services/login.service'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class RouterGuard implements CanActivate 10 | { 11 | constructor(private router: Router, private _service : LoginService) { } 12 | 13 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { 14 | 15 | if (this._service.isUserLoggedIn()) { 16 | return true; 17 | } 18 | this.router.navigate(['login']); 19 | return false; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/app/guards/user.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserGuard } from './user.guard'; 4 | 5 | describe('UserGuard', () => { 6 | let guard: UserGuard; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | guard = TestBed.inject(UserGuard); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(guard).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/guards/user.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { LoginService } from '../services/login.service'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class UserGuard implements CanActivate 10 | { 11 | constructor(private router: Router, private _service : LoginService) {} 12 | 13 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) 14 | { 15 | if (this._service.isUserLoggedIn() && this._service.userType() === 'user' || this._service.userType() === 'USER') 16 | { 17 | return true; 18 | } 19 | this.router.navigate(['login']); 20 | return false; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/app/models/chapter.spec.ts: -------------------------------------------------------------------------------- 1 | import { Chapter } from './chapter'; 2 | 3 | describe('Chapter', () => { 4 | it('should create an instance', () => { 5 | expect(new Chapter()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /src/app/models/chapter.ts: -------------------------------------------------------------------------------- 1 | export class Chapter 2 | { 3 | coursename : string = ''; 4 | chapter1name : string = ''; 5 | chapter1id : string = ''; 6 | chapter2name : string = ''; 7 | chapter2id : string = ''; 8 | chapter3name : string = ''; 9 | chapter3id : string = ''; 10 | chapter4name : string = ''; 11 | chapter4id : string = ''; 12 | chapter5name : string = ''; 13 | chapter5id : string = ''; 14 | chapter6name : string = ''; 15 | chapter6id : string = ''; 16 | chapter7name : string = ''; 17 | chapter7id : string = ''; 18 | chapter8name : string = ''; 19 | chapter8id : string = ''; 20 | 21 | constructor() {} 22 | } 23 | -------------------------------------------------------------------------------- /src/app/models/course.spec.ts: -------------------------------------------------------------------------------- 1 | import { Course } from './course'; 2 | 3 | describe('Course', () => { 4 | it('should create an instance', () => { 5 | expect(new Course()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /src/app/models/course.ts: -------------------------------------------------------------------------------- 1 | export class Course 2 | { 3 | coursename : string = ''; 4 | courseid : string = ''; 5 | enrolleddate : string = ''; 6 | instructorname : string = ''; 7 | instructorinstitution : string = ''; 8 | enrolledcount : string = '0'; 9 | youtubeurl : string = ''; 10 | websiteurl : string = ''; 11 | coursetype : string = ''; 12 | skilllevel : string = ''; 13 | language : string = ''; 14 | description : string = ''; 15 | 16 | constructor() {} 17 | 18 | } -------------------------------------------------------------------------------- /src/app/models/enrollment.spec.ts: -------------------------------------------------------------------------------- 1 | import { Enrollment } from './enrollment'; 2 | 3 | describe('Enrollment', () => { 4 | it('should create an instance', () => { 5 | expect(new Enrollment()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /src/app/models/enrollment.ts: -------------------------------------------------------------------------------- 1 | export class Enrollment 2 | { 3 | coursename : string = ''; 4 | courseid : string = ''; 5 | enrolleddate : string = ''; 6 | enrolledusername : string = ''; 7 | enrolleduserid : string = ''; 8 | enrolledusertype : string = ''; 9 | instructorname : string = ''; 10 | instructorinstitution : string = ''; 11 | enrolledcount : string = ''; 12 | youtubeurl : string = ''; 13 | websiteurl : string = ''; 14 | coursetype : string = ''; 15 | skilllevel : string = ''; 16 | language : string = ''; 17 | description : string = ''; 18 | 19 | constructor() {} 20 | } -------------------------------------------------------------------------------- /src/app/models/professor.spec.ts: -------------------------------------------------------------------------------- 1 | import { Professor } from './professor'; 2 | 3 | describe('Professor', () => { 4 | it('should create an instance', () => { 5 | expect(new Professor()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /src/app/models/professor.ts: -------------------------------------------------------------------------------- 1 | export class Professor 2 | { 3 | professorname : string = ''; 4 | professorid : string = 'empty'; 5 | email : string = ''; 6 | degreecompleted : string = ''; 7 | institutionname : string = ''; 8 | department : string = ''; 9 | experience : string = ''; 10 | gender : string = ''; 11 | mobile : string = ''; 12 | password : string = ''; 13 | status : string = 'false'; 14 | 15 | constructor() {} 16 | } 17 | -------------------------------------------------------------------------------- /src/app/models/user.spec.ts: -------------------------------------------------------------------------------- 1 | import { User } from './user'; 2 | 3 | describe('User', () => { 4 | it('should create an instance', () => { 5 | expect(new User()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /src/app/models/user.ts: -------------------------------------------------------------------------------- 1 | export class User 2 | { 3 | 4 | username : string = ''; 5 | userid : string = 'empty'; 6 | email : string = ''; 7 | profession : string = ''; 8 | gender : string = ''; 9 | mobile : string = ''; 10 | address : string = ''; 11 | password : string = ''; 12 | 13 | constructor() {} 14 | } 15 | -------------------------------------------------------------------------------- /src/app/models/wishlist.spec.ts: -------------------------------------------------------------------------------- 1 | import { Wishlist } from './wishlist'; 2 | 3 | describe('Wishlist', () => { 4 | it('should create an instance', () => { 5 | expect(new Wishlist()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /src/app/models/wishlist.ts: -------------------------------------------------------------------------------- 1 | export class Wishlist 2 | { 3 | coursename : string = ''; 4 | courseid : string = ''; 5 | likeduser : string = ''; 6 | likedusertype : string = ''; 7 | instructorname : string = ''; 8 | instructorinstitution : string = ''; 9 | enrolledcount : string = '0'; 10 | coursetype : string = ''; 11 | websiteurl : string = ''; 12 | skilllevel : string = ''; 13 | language : string = ''; 14 | description : string = ''; 15 | 16 | constructor() {} 17 | } 18 | -------------------------------------------------------------------------------- /src/app/services/admin.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminService } from './admin.service'; 4 | 5 | describe('AdminService', () => { 6 | let service: AdminService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(AdminService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/services/admin.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Observable } from 'rxjs'; 4 | import { environment } from 'src/environments/environment'; 5 | import { Professor } from '../models/professor'; 6 | 7 | const NAV_URL = environment.apiURL; 8 | 9 | @Injectable({ 10 | providedIn: 'root' 11 | }) 12 | export class AdminService 13 | { 14 | professor = new Professor(); 15 | 16 | constructor(private _http : HttpClient) { } 17 | 18 | public addProfessor(professor : Professor):Observable 19 | { 20 | return this._http.post(`${NAV_URL}/addProfessor`,professor); 21 | } 22 | 23 | getTotalProfessors(): Observable | undefined 24 | { 25 | return this._http.get(`${NAV_URL}/gettotalprofessors`); 26 | } 27 | 28 | getTotalUsers(): Observable | undefined 29 | { 30 | return this._http.get(`${NAV_URL}/gettotalusers`); 31 | } 32 | 33 | getTotalCourses(): Observable | undefined 34 | { 35 | return this._http.get(`${NAV_URL}/gettotalcourses`); 36 | } 37 | 38 | getTotalWishlist(): Observable | undefined 39 | { 40 | return this._http.get(`${NAV_URL}/gettotalwishlist`); 41 | } 42 | 43 | getTotalEnrollments(): Observable | undefined 44 | { 45 | return this._http.get(`${NAV_URL}/gettotalenrollments`); 46 | } 47 | 48 | getTotalEnrollmentCount(): Observable | undefined 49 | { 50 | return this._http.get(`${NAV_URL}/gettotalenrollmentcount`); 51 | } 52 | 53 | getTotalChapters(): Observable | undefined 54 | { 55 | return this._http.get(`${NAV_URL}/gettotalchapters`); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/app/services/login.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginService } from './login.service'; 4 | 5 | describe('LoginService', () => { 6 | let service: LoginService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(LoginService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/services/login.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Professor } from '../models/professor'; 4 | import { User } from '../models/user'; 5 | import { map } from "rxjs/operators"; 6 | import { environment } from 'src/environments/environment'; 7 | 8 | const NAV_URL = environment.apiURL; 9 | 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class LoginService { 14 | 15 | user = new User(); 16 | professor = new Professor(); 17 | 18 | constructor(private _http : HttpClient) { } 19 | 20 | public loginUserFromRemote(user : User) 21 | { 22 | return this._http.post(`${NAV_URL}/loginuser`,user).pipe( 23 | map( 24 | data => { 25 | sessionStorage.setItem('USER', user.email); 26 | sessionStorage.setItem('ROLE', 'USER'); 27 | sessionStorage.setItem('TOKEN', `Bearer ${data.token}`); 28 | return data; 29 | } 30 | ) 31 | ); 32 | } 33 | 34 | public loginProfessorFromRemote(professor : Professor) 35 | { 36 | console.log(professor); 37 | return this._http.post(`${NAV_URL}/loginprofessor`,professor).pipe( 38 | map( 39 | data => { 40 | sessionStorage.setItem('USER', professor.email); 41 | sessionStorage.setItem('ROLE', 'PROFESSOR'); 42 | sessionStorage.setItem('TOKEN', `Bearer ${data.token}`); 43 | return data; 44 | } 45 | ) 46 | ); 47 | } 48 | 49 | isUserLoggedIn() 50 | { 51 | let user = sessionStorage.getItem('USER'); 52 | if(user === null || user.length === 0) 53 | { 54 | return false; 55 | } 56 | return true; 57 | } 58 | 59 | isProfessorLoggedIn() 60 | { 61 | let user = sessionStorage.getItem('USER'); 62 | if(user === null || user.length === 0) 63 | { 64 | return false; 65 | } 66 | return true; 67 | } 68 | 69 | isAdminLoggedIn() 70 | { 71 | let user = sessionStorage.getItem('USER'); 72 | if(user === null || user.length === 0) 73 | { 74 | return false; 75 | } 76 | return true; 77 | } 78 | 79 | getAuthenticatedToken() { 80 | return sessionStorage.getItem('TOKEN'); 81 | } 82 | 83 | getAuthenticatedUser() { 84 | return sessionStorage.getItem('USER'); 85 | } 86 | 87 | userType() { 88 | return sessionStorage.getItem('ROLE'); 89 | } 90 | 91 | public adminLoginFromRemote(email: string, password: string) 92 | { 93 | if(email === 'admin@gmail.com' && password === 'admin123') 94 | { 95 | sessionStorage.setItem('user', email); 96 | sessionStorage.setItem('ROLE', "admin"); 97 | return true; 98 | } 99 | return false; 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /src/app/services/professor.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfessorService } from './professor.service'; 4 | 5 | describe('ProfessorService', () => { 6 | let service: ProfessorService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ProfessorService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/services/professor.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Observable } from 'rxjs'; 4 | import { environment } from 'src/environments/environment'; 5 | import { Chapter } from '../models/chapter'; 6 | import { Course } from '../models/course'; 7 | 8 | const NAV_URL = environment.apiURL; 9 | 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class ProfessorService 14 | { 15 | constructor(private _http : HttpClient) { } 16 | 17 | acceptRequestForProfessorApproval(curremail: string): Observable 18 | { 19 | return this._http.get(`${NAV_URL}/acceptstatus/`+curremail); 20 | } 21 | 22 | rejectRequestForProfessorApproval(curremail: string): Observable 23 | { 24 | return this._http.get(`${NAV_URL}/rejectstatus/`+curremail); 25 | } 26 | 27 | getProfessorList() : Observable 28 | { 29 | return this._http.get(`${NAV_URL}/professorlist`); 30 | } 31 | 32 | getYoutubeCourseList() : Observable 33 | { 34 | return this._http.get(`${NAV_URL}/youtubecourselist`); 35 | } 36 | 37 | getWebsiteCourseList() : Observable 38 | { 39 | return this._http.get(`${NAV_URL}/websitecourselist`); 40 | } 41 | 42 | getCourseListByName(coursename : string) : Observable 43 | { 44 | return this._http.get(`${NAV_URL}/courselistbyname/`+coursename); 45 | } 46 | 47 | addCourse(course : Course) : Observable 48 | { 49 | return this._http.post(`${NAV_URL}/addCourse`,course); 50 | } 51 | 52 | getProfessorListByEmail(email : string) : Observable 53 | { 54 | return this._http.get(`${NAV_URL}/professorlistbyemail/`+email); 55 | } 56 | 57 | addNewChapters(chapter : Chapter) : Observable 58 | { 59 | return this._http.post(`${NAV_URL}/addnewchapter`,chapter); 60 | } 61 | 62 | getProfileDetails(loggedUser : string) : Observable 63 | { 64 | return this._http.get(`${NAV_URL}/professorprofileDetails/`+loggedUser); 65 | } 66 | 67 | UpdateUserProfile(professor : any):Observable 68 | { 69 | return this._http.put(`${NAV_URL}/updateprofessor`,professor); 70 | } 71 | 72 | getCourseListNames() : Observable 73 | { 74 | return this._http.get(`${NAV_URL}/getcoursenames/`); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/app/services/registration.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { RegistrationService } from './registration.service'; 4 | 5 | describe('RegistrationService', () => { 6 | let service: RegistrationService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(RegistrationService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/services/registration.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Observable } from 'rxjs'; 4 | import { environment } from 'src/environments/environment'; 5 | import { Professor } from '../models/professor'; 6 | import { User } from '../models/user'; 7 | 8 | const NAV_URL = environment.apiURL; 9 | 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class RegistrationService { 14 | user = new User(); 15 | professor = new Professor(); 16 | 17 | constructor(private _http : HttpClient) { } 18 | 19 | public registerUserFromRemote(user : User):Observable 20 | { 21 | return this._http.post(`${NAV_URL}/registeruser`,user) 22 | } 23 | 24 | public registerProfessorFromRemote(professor : Professor):Observable 25 | { 26 | return this._http.post(`${NAV_URL}/registerprofessor`,professor) 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/app/services/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/services/user.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Observable } from 'rxjs'; 4 | import { environment } from 'src/environments/environment'; 5 | import { Course } from '../models/course'; 6 | import { Enrollment } from '../models/enrollment'; 7 | import { Wishlist } from '../models/wishlist'; 8 | 9 | const NAV_URL = environment.apiURL; 10 | 11 | @Injectable({ 12 | providedIn: 'root' 13 | }) 14 | export class UserService { 15 | 16 | constructor(private _http : HttpClient) { } 17 | 18 | getAllUsers() : Observable 19 | { 20 | return this._http.get(`${NAV_URL}/userlist`); 21 | } 22 | 23 | getYoutubeCourseList() : Observable 24 | { 25 | return this._http.get(`${NAV_URL}/youtubecourselist`); 26 | } 27 | 28 | getWebsiteCourseList() : Observable 29 | { 30 | return this._http.get(`${NAV_URL}/websitecourselist`); 31 | } 32 | 33 | getCourseListByName(coursename : string) : Observable 34 | { 35 | return this._http.get(`${NAV_URL}/courselistbyname/`+coursename); 36 | } 37 | 38 | enrollNewCourse(enrollment : Enrollment, loggedUser : string, currRole : string) : Observable 39 | { 40 | return this._http.post(`${NAV_URL}/enrollnewcourse/`+loggedUser+"/"+currRole,enrollment); 41 | } 42 | 43 | addToWishlist(wishlist : Wishlist) : Observable 44 | { 45 | return this._http.post(`${NAV_URL}/addtowishlist`,wishlist); 46 | } 47 | 48 | getEnrollmentStatus(coursename : string, loggedUser : string, currRole : string) : Observable 49 | { 50 | return this._http.get(`${NAV_URL}/getenrollmentstatus/`+coursename+"/"+loggedUser+"/"+currRole); 51 | } 52 | 53 | getEnrollmentByEmail(loggedUser : string, currRole : string) : Observable 54 | { 55 | return this._http.get(`${NAV_URL}/getenrollmentbyemail/`+loggedUser+"/"+currRole); 56 | } 57 | 58 | getWishlistStatus(coursename : string, loggedUser : string) : Observable 59 | { 60 | return this._http.get(`${NAV_URL}/getwishliststatus/`+coursename+"/"+loggedUser); 61 | } 62 | 63 | getWishlistByEmail(loggedUser : string) : Observable 64 | { 65 | return this._http.get(`${NAV_URL}/getwishlistbyemail/`+loggedUser); 66 | } 67 | 68 | getAllWishlist() : Observable 69 | { 70 | return this._http.get(`${NAV_URL}/getallwishlist`); 71 | } 72 | 73 | getChappterListByCourseName(coursename : string) : Observable 74 | { 75 | return this._http.get(`${NAV_URL}/getchapterlistbycoursename/`+coursename); 76 | } 77 | 78 | getProfileDetails(loggedUser : string) : Observable 79 | { 80 | return this._http.get(`${NAV_URL}/userprofileDetails/`+loggedUser); 81 | } 82 | 83 | UpdateUserProfile(user : any):Observable 84 | { 85 | return this._http.put(`${NAV_URL}/updateuser`,user); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/Introduction to Spring MVC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/Introduction to Spring MVC.pdf -------------------------------------------------------------------------------- /src/assets/img/admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/admin.png -------------------------------------------------------------------------------- /src/assets/img/alert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/alert.gif -------------------------------------------------------------------------------- /src/assets/img/femaleprofessor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/femaleprofessor.png -------------------------------------------------------------------------------- /src/assets/img/femaleuser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/femaleuser.png -------------------------------------------------------------------------------- /src/assets/img/livebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/livebg.png -------------------------------------------------------------------------------- /src/assets/img/lms-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/lms-bg.png -------------------------------------------------------------------------------- /src/assets/img/logout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/logout.gif -------------------------------------------------------------------------------- /src/assets/img/male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/male.png -------------------------------------------------------------------------------- /src/assets/img/maleprofessor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/maleprofessor.png -------------------------------------------------------------------------------- /src/assets/img/maleuser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/maleuser.png -------------------------------------------------------------------------------- /src/assets/img/register-fail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/register-fail.gif -------------------------------------------------------------------------------- /src/assets/img/success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/success.gif -------------------------------------------------------------------------------- /src/assets/img/website.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/website.png -------------------------------------------------------------------------------- /src/assets/img/websitebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/websitebg.png -------------------------------------------------------------------------------- /src/assets/img/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/assets/img/youtube.png -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | apiURL: "http://localhost:8080" 8 | }; 9 | 10 | /* 11 | * For easier debugging in development mode, you can import the following file 12 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 13 | * 14 | * This import should be commented out in production mode because it will have a negative impact 15 | * on performance if an error is thrown. 16 | */ 17 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 18 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gowthamrajk/ElearningManagementSystem/b4185bb44aae78d20f8f1532bbfe78cd31b4b93e/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ElearningManagement 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** 22 | * IE11 requires the following for NgClass support on SVG elements 23 | */ 24 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 25 | 26 | /** 27 | * Web Animations `@angular/platform-browser/animations` 28 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 29 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 30 | */ 31 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 32 | 33 | /** 34 | * By default, zone.js will patch all possible macroTask and DomEvents 35 | * user can disable parts of macroTask/DomEvents patch by setting following flags 36 | * because those flags need to be set before `zone.js` being loaded, and webpack 37 | * will put import in the top of bundle, so user need to create a separate file 38 | * in this directory (for example: zone-flags.ts), and put the following flags 39 | * into that file, and then add the following code before importing zone.js. 40 | * import './zone-flags'; 41 | * 42 | * The flags allowed in zone-flags.ts are listed here. 43 | * 44 | * The following flags will work for all browsers. 45 | * 46 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 47 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 48 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 49 | * 50 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 51 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 52 | * 53 | * (window as any).__Zone_enable_cross_context_check = true; 54 | * 55 | */ 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | import 'zone.js'; // Included with Angular CLI. 61 | 62 | 63 | /*************************************************************************************************** 64 | * APPLICATION IMPORTS 65 | */ 66 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting() 21 | ); 22 | // Then we find all the tests. 23 | const context = require.context('./', true, /\.spec\.ts$/); 24 | // And load the modules. 25 | context.keys().map(context); 26 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "sourceMap": true, 12 | "declaration": false, 13 | "downlevelIteration": true, 14 | "experimentalDecorators": true, 15 | "moduleResolution": "node", 16 | "importHelpers": true, 17 | "target": "es2017", 18 | "module": "es2020", 19 | "lib": [ 20 | "es2018", 21 | "dom" 22 | ] 23 | }, 24 | "angularCompilerOptions": { 25 | "enableI18nLegacyMessageIdFormat": false, 26 | "strictInjectionParameters": true, 27 | "strictInputAccessModifiers": true, 28 | "strictTemplates": true 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | --------------------------------------------------------------------------------