├── README.md
├── project
├── HR
│ ├── __init__.py
│ ├── views
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-312.pyc
│ │ │ ├── address_view.cpython-312.pyc
│ │ │ ├── course_view.cpython-312.pyc
│ │ │ ├── degree_view.cpython-312.pyc
│ │ │ ├── faculty_view.cpython-312.pyc
│ │ │ ├── health_view.cpython-312.pyc
│ │ │ ├── major_view.cpython-312.pyc
│ │ │ ├── student_view.cpython-312.pyc
│ │ │ ├── education_view.cpython-312.pyc
│ │ │ ├── employee_view.cpython-312.pyc
│ │ │ ├── department_view.cpython-312.pyc
│ │ │ ├── experience_view.cpython-312.pyc
│ │ │ ├── hr_employee_view.cpython-312.pyc
│ │ │ ├── organization_view.cpython-312.pyc
│ │ │ └── university_view.cpython-312.pyc
│ │ ├── course_view.py
│ │ ├── student_view.py
│ │ ├── health_view.py
│ │ ├── exam_view.py
│ │ ├── fire_view.py
│ │ ├── appraisal_view.py
│ │ ├── document_view.py
│ │ ├── employee_view.py
│ │ ├── guarantee_view.py
│ │ ├── language_view.py
│ │ ├── property_view.py
│ │ ├── relative_view.py
│ │ ├── reward_view.py
│ │ ├── training_view.py
│ │ ├── travel_view.py
│ │ ├── publication_view.py
│ │ ├── punishment_view.py
│ │ ├── retirement_view.py
│ │ ├── department_view.py
│ │ ├── organization_view.py
│ │ ├── address_view.py
│ │ └── education_view.py
│ ├── migrations
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-312.pyc
│ │ │ ├── 0001_initial.cpython-312.pyc
│ │ │ ├── 0003_major.cpython-312.pyc
│ │ │ ├── 0004_health.cpython-312.pyc
│ │ │ ├── 0002_employee.cpython-312.pyc
│ │ │ ├── 0002_hr_employee.cpython-312.pyc
│ │ │ ├── 0002_remove_province_test.cpython-312.pyc
│ │ │ ├── 0004_alter_education_major.cpython-312.pyc
│ │ │ ├── 0008_alter_district_province.cpython-312.pyc
│ │ │ ├── 0002_rename_course_course_name.cpython-312.pyc
│ │ │ ├── 0004_rename_hr_employee_employee.cpython-312.pyc
│ │ │ ├── 0007_district_province_province_country.cpython-312.pyc
│ │ │ ├── 0003_remove_hr_employee_blood_group_and_more.cpython-312.pyc
│ │ │ ├── 0006_rename_organizationtpye_organizationtype.cpython-312.pyc
│ │ │ ├── 0006_delete_experience_remove_course_fee_and_more.cpython-312.pyc
│ │ │ ├── 0009_alter_district_province_alter_province_country.cpython-312.pyc
│ │ │ ├── 0005_country_degree_experience_faculty_university_and_more.cpython-312.pyc
│ │ │ ├── 0003_alter_employee_degree_alter_employee_directorate_and_more.cpython-312.pyc
│ │ │ └── 0005_department_district_grade_jobposition_organization_and_more.cpython-312.pyc
│ │ └── 0002_remove_province_test.py
│ ├── tests.py
│ ├── __pycache__
│ │ ├── admin.cpython-312.pyc
│ │ ├── apps.cpython-312.pyc
│ │ ├── __init__.cpython-312.pyc
│ │ └── serializer.cpython-312.pyc
│ ├── models
│ │ ├── __pycache__
│ │ │ ├── course.cpython-312.pyc
│ │ │ ├── exam.cpython-312.pyc
│ │ │ ├── health.cpython-312.pyc
│ │ │ ├── reward.cpython-312.pyc
│ │ │ ├── __init__.cpython-312.pyc
│ │ │ ├── address.cpython-312.pyc
│ │ │ ├── country.cpython-312.pyc
│ │ │ ├── district.cpython-312.pyc
│ │ │ ├── document.cpython-312.pyc
│ │ │ ├── employee.cpython-312.pyc
│ │ │ ├── property.cpython-312.pyc
│ │ │ ├── province.cpython-312.pyc
│ │ │ ├── student.cpython-312.pyc
│ │ │ ├── training.cpython-312.pyc
│ │ │ ├── department.cpython-312.pyc
│ │ │ ├── education.cpython-312.pyc
│ │ │ ├── experience.cpython-312.pyc
│ │ │ ├── hr_employee.cpython-312.pyc
│ │ │ ├── publication.cpython-312.pyc
│ │ │ └── organization.cpython-312.pyc
│ │ ├── department.py
│ │ ├── course.py
│ │ ├── organization.py
│ │ ├── Health.py
│ │ ├── travel.py
│ │ ├── language.py
│ │ ├── Student.py
│ │ ├── property.py
│ │ ├── training.py
│ │ ├── address.py
│ │ ├── publication.py
│ │ ├── exam.py
│ │ ├── reward.py
│ │ ├── fire.py
│ │ ├── __init__.py
│ │ ├── education.py
│ │ ├── appraisal.py
│ │ ├── document.py
│ │ ├── employee.py
│ │ ├── guarantee.py
│ │ ├── punishment.py
│ │ ├── relative.py
│ │ ├── retirement.py
│ │ └── experience.py
│ ├── apps.py
│ ├── admin.py
│ └── serializer.py
├── project
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── urls.cpython-312.pyc
│ │ ├── wsgi.cpython-312.pyc
│ │ ├── __init__.cpython-312.pyc
│ │ └── settings.cpython-312.pyc
│ ├── asgi.py
│ ├── wsgi.py
│ ├── settings.py
│ └── urls.py
├── db.sqlite3
└── manage.py
├── frontend
├── public
│ ├── robots.txt
│ ├── favicon.ico
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── index.html
├── src
│ ├── pages
│ │ ├── Home.jsx
│ │ ├── About.jsx
│ │ ├── Contact.jsx
│ │ ├── Degree.jsx
│ │ ├── Faculty.jsx
│ │ ├── Organization.jsx
│ │ ├── Step.jsx
│ │ ├── Grade.jsx
│ │ ├── Major.jsx
│ │ ├── Status.jsx
│ │ ├── JobPosition.jsx
│ │ ├── Department.jsx
│ │ ├── University.jsx
│ │ ├── OrganizationType.jsx
│ │ ├── Health.jsx
│ │ ├── Course.jsx
│ │ ├── Student.jsx
│ │ └── Exam.jsx
│ ├── setupTests.js
│ ├── App.test.js
│ ├── index.css
│ ├── reportWebVitals.js
│ ├── App.js
│ ├── App.css
│ ├── index.js
│ ├── logo.svg
│ ├── components
│ │ └── Sidebar.jsx
│ └── router
│ │ └── index.js
├── .gitignore
├── package.json
└── README.md
├── package.json
├── Pipfile
└── Pipfile.lock
/README.md:
--------------------------------------------------------------------------------
1 | # Flight-MS
--------------------------------------------------------------------------------
/project/HR/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/project/HR/views/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/project/project/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/project/HR/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/project/HR/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/project/db.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/db.sqlite3
--------------------------------------------------------------------------------
/frontend/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/frontend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/frontend/public/favicon.ico
--------------------------------------------------------------------------------
/frontend/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/frontend/public/logo192.png
--------------------------------------------------------------------------------
/frontend/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/frontend/public/logo512.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "axios": "^1.7.4",
4 | "sweetalert2": "^11.12.4",
5 | "toastr": "^2.1.4"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/project/HR/__pycache__/admin.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/__pycache__/admin.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/__pycache__/apps.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/__pycache__/apps.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/__pycache__/serializer.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/__pycache__/serializer.cpython-312.pyc
--------------------------------------------------------------------------------
/project/project/__pycache__/urls.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/project/__pycache__/urls.cpython-312.pyc
--------------------------------------------------------------------------------
/project/project/__pycache__/wsgi.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/project/__pycache__/wsgi.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/course.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/course.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/exam.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/exam.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/health.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/health.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/reward.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/reward.cpython-312.pyc
--------------------------------------------------------------------------------
/project/project/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/project/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/project/project/__pycache__/settings.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/project/__pycache__/settings.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/address.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/address.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/country.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/country.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/district.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/district.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/document.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/document.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/employee.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/employee.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/property.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/property.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/province.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/province.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/student.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/student.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/training.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/training.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class HrConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'HR'
7 |
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/department.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/department.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/education.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/education.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/experience.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/experience.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/hr_employee.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/hr_employee.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/publication.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/publication.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/address_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/address_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/course_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/course_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/degree_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/degree_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/faculty_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/faculty_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/health_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/health_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/major_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/major_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/student_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/student_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/__pycache__/organization.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/models/__pycache__/organization.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/education_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/education_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/employee_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/employee_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0001_initial.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0001_initial.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0003_major.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0003_major.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0004_health.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0004_health.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/department_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/department_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/experience_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/experience_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/hr_employee_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/hr_employee_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/organization_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/organization_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/views/__pycache__/university_view.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/views/__pycache__/university_view.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0002_employee.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0002_employee.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0002_hr_employee.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0002_hr_employee.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0002_remove_province_test.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0002_remove_province_test.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0004_alter_education_major.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0004_alter_education_major.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/department.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | class Department(models.Model):
4 | name = models.CharField(max_length=50)
5 |
6 | def __str__(self):
7 | return self.name
8 |
9 |
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0008_alter_district_province.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0008_alter_district_province.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0002_rename_course_course_name.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0002_rename_course_course_name.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0004_rename_hr_employee_employee.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0004_rename_hr_employee_employee.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0007_district_province_province_country.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0007_district_province_province_country.cpython-312.pyc
--------------------------------------------------------------------------------
/frontend/src/pages/Home.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | function Home(){
3 | return(
4 |
5 |
Home Page
6 |
7 | )
8 | }
9 |
10 | export default Home;
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0003_remove_hr_employee_blood_group_and_more.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0003_remove_hr_employee_blood_group_and_more.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/course.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
5 | class Course(models.Model):
6 | name = models.CharField(max_length=50)
7 |
8 | def __str__(self):
9 | return self.name
10 |
--------------------------------------------------------------------------------
/project/HR/models/organization.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Organization(models.Model):
5 | name = models.CharField(max_length=100)
6 |
7 | def __str__(self):
8 | return self.name
9 |
--------------------------------------------------------------------------------
/frontend/src/pages/About.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | function About(){
3 | return(
4 |
5 |
This is About Page
6 |
7 | )
8 | }
9 |
10 | export default About;
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0006_rename_organizationtpye_organizationtype.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0006_rename_organizationtpye_organizationtype.cpython-312.pyc
--------------------------------------------------------------------------------
/frontend/src/pages/Contact.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | function Contact(){
3 | return(
4 |
5 |
This is Contact Page
6 |
7 | )
8 | }
9 |
10 | export default Contact;
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0006_delete_experience_remove_course_fee_and_more.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0006_delete_experience_remove_course_fee_and_more.cpython-312.pyc
--------------------------------------------------------------------------------
/Pipfile:
--------------------------------------------------------------------------------
1 | [[source]]
2 | url = "https://pypi.org/simple"
3 | verify_ssl = true
4 | name = "pypi"
5 |
6 | [packages]
7 | djangorestframework = "*"
8 | django-cors-headers = "*"
9 |
10 | [dev-packages]
11 |
12 | [requires]
13 | python_version = "3.12"
14 |
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0009_alter_district_province_alter_province_country.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0009_alter_district_province_alter_province_country.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0005_country_degree_experience_faculty_university_and_more.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0005_country_degree_experience_faculty_university_and_more.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/models/Health.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Health(models.Model):
5 | status = models.CharField(max_length=255)
6 | report = models.CharField(max_length=255)
7 | remarks = models.CharField(max_length=255)
8 |
--------------------------------------------------------------------------------
/frontend/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0003_alter_employee_degree_alter_employee_directorate_and_more.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0003_alter_employee_degree_alter_employee_directorate_and_more.cpython-312.pyc
--------------------------------------------------------------------------------
/project/HR/migrations/__pycache__/0005_department_district_grade_jobposition_organization_and_more.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nasratullah-Shafiq/Flight-MS/HEAD/project/HR/migrations/__pycache__/0005_department_district_grade_jobposition_organization_and_more.cpython-312.pyc
--------------------------------------------------------------------------------
/frontend/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/project/HR/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 | from django.contrib import admin
5 | from .models import Student, Course, Health
6 |
7 | admin.site.register(Student)
8 | admin.site.register(Course)
9 | admin.site.register(Health)
10 | # admin.site.register(employee)
11 |
--------------------------------------------------------------------------------
/project/HR/models/travel.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from HR.models import country
3 | # Create your models here.
4 | class Travel(models.Model):
5 |
6 | country = models.ForeignKey(country, on_delete=models.CASCADE)
7 | travel_start_date = models.DateField()
8 | travel_end_date = models.DateField()
9 | remarks = models.CharField(max_length=255)
10 |
--------------------------------------------------------------------------------
/project/HR/models/language.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Language(models.Model):
5 |
6 | language = models.CharField(max_length=50)
7 | reading = models.CharField(max_length=50)
8 | speaking = models.CharField(max_length=50)
9 | listening = models.CharField(max_length=50)
10 | writing = models.CharField(max_length=50)
--------------------------------------------------------------------------------
/project/HR/models/Student.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Student(models.Model):
5 | name = models.CharField(max_length=255)
6 | last_name = models.CharField(max_length=255)
7 | father_name = models.CharField(max_length=255)
8 | course = models.CharField(max_length=255)
9 | fee = models.IntegerField()
10 | address = models.CharField(max_length=255)
--------------------------------------------------------------------------------
/frontend/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/project/HR/migrations/0002_remove_province_test.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 5.1 on 2024-09-15 07:50
2 |
3 | from django.db import migrations
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('HR', '0001_initial'),
10 | ]
11 |
12 | operations = [
13 | migrations.RemoveField(
14 | model_name='province',
15 | name='test',
16 | ),
17 | ]
18 |
--------------------------------------------------------------------------------
/frontend/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/frontend/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/project/HR/models/property.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class PropertyType(models.Model):
5 | name = models.CharField(max_length=100)
6 |
7 | def __str__(self):
8 | return self.name
9 |
10 | class Property(models.Model):
11 |
12 | property_type = models.ForeignKey(PropertyType, on_delete=models.CASCADE)
13 | price = models.CharField(max_length=50)
14 | remarks = models.CharField(max_length=255)
--------------------------------------------------------------------------------
/project/project/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for project project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/project/project/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for project project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/project/HR/models/training.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from HR.models import course
3 | # Create your models here.
4 |
5 | class Training(models.Model):
6 | course_id = models.ForeignKey(course, on_delete=models.CASCADE)
7 | training_location = models.CharField(max_length=50)
8 | training_start_date = models.DateField()
9 | training_end_date = models.DateField()
10 | training_certification = models.CharField(max_length=50)
11 | training_remarks = models.CharField(max_length=255)
--------------------------------------------------------------------------------
/project/HR/models/address.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | # Create your models here.
3 |
4 | class Country(models.Model):
5 | name = models.CharField(max_length=50)
6 |
7 |
8 | class Province(models.Model):
9 | name = models.CharField(max_length=50)
10 | country = models.ForeignKey(Country, on_delete=models.CASCADE)
11 |
12 |
13 | class District(models.Model):
14 | name = models.CharField(max_length=100)
15 | province = models.ForeignKey(Province, on_delete=models.CASCADE)
16 |
17 | def __str__(self):
18 | return self.name
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/project/HR/models/publication.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class PublicationType(models.Model):
5 | name = models.CharField(max_length=100)
6 |
7 | def __str__(self):
8 | return self.name
9 |
10 | class Publication(models.Model):
11 |
12 | publication_type = models.ForeignKey(PublicationType, on_delete=models.CASCADE)
13 | subject = models.CharField(max_length=50)
14 | publication_date = models.CharField(max_length=50)
15 | no_of_pages = models.CharField(max_length=50)
16 | isbn = models.CharField(max_length=50)
17 |
--------------------------------------------------------------------------------
/frontend/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/project/HR/models/exam.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Exam(models.Model):
5 |
6 | subject = models.CharField(max_length=50)
7 | exam_date = models.CharField(max_length=50)
8 | exam_result = models.CharField(max_length=50)
9 | exam_score = models.CharField(max_length=50)
10 | exam_remarks = models.CharField(max_length=50)
11 | exam_type = models.CharField(max_length=1, choices=[
12 | ('W', 'Written Test'),
13 | ('I', 'Interview'),
14 | ('T', 'Technical'),
15 | ('C', 'Computerized Exam'),
16 | ('E', 'English'),
17 | ], default = 'I')
18 |
19 |
--------------------------------------------------------------------------------
/project/HR/models/reward.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from HR.models.organization import Organization
3 | # Create your models here.
4 | class RewardType(models.Model):
5 | name = models.CharField(max_length=100)
6 |
7 | def __str__(self):
8 | return self.name
9 |
10 | class Reward(models.Model):
11 |
12 | reward_type = models.ForeignKey(RewardType, on_delete=models.CASCADE)
13 | amount_of_cash_for_reward = models.IntegerField(max_length=50)
14 | order_no = models.IntegerField(max_length=50)
15 | order_date = models.DateField()
16 | organization_id = models.ForeignKey(Organization, on_delete=models.CASCADE)
17 | reason = models.CharField(max_length=50)
18 |
--------------------------------------------------------------------------------
/frontend/src/App.js:
--------------------------------------------------------------------------------
1 | import Navbar from './components/Navbar.jsx';
2 | import Sidebar from './components/Sidebar.jsx';
3 | import MyRouter from './router/index.js';
4 | import { ToastContainer, toast } from 'react-toastify';
5 |
6 | function App() {
7 | return (
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | );
24 | }
25 |
26 | export default App;
27 |
--------------------------------------------------------------------------------
/frontend/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/project/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | """Run administrative tasks."""
9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
10 | try:
11 | from django.core.management import execute_from_command_line
12 | except ImportError as exc:
13 | raise ImportError(
14 | "Couldn't import Django. Are you sure it's installed and "
15 | "available on your PYTHONPATH environment variable? Did you "
16 | "forget to activate a virtual environment?"
17 | ) from exc
18 | execute_from_command_line(sys.argv)
19 |
20 |
21 | if __name__ == '__main__':
22 | main()
23 |
--------------------------------------------------------------------------------
/project/HR/models/fire.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class LeaveReason(models.Model):
5 | name = models.CharField(max_length=100)
6 |
7 | def __str__(self):
8 | return self.name
9 |
10 | class FireType(models.Model):
11 | name = models.CharField(max_length=100)
12 |
13 | def __str__(self):
14 | return self.name
15 |
16 | class Fire(models.Model):
17 |
18 | fire_type_id = models.ForeignKey(FireType, on_delete=models.CASCADE)
19 | leave_reason = models.ForeignKey(LeaveReason, on_delete=models.CASCADE)
20 | order_date = models.DateField()
21 | order_no = models.CharField(max_length=50)
22 | date_approved = models.DateField()
23 | fire_remarks = models.CharField(max_length=255)
24 |
--------------------------------------------------------------------------------
/frontend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "frontend",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.17.0",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "axios": "^1.7.4",
10 | "react": "^18.3.1",
11 | "react-dom": "^18.3.1",
12 | "react-router-dom": "^6.26.1",
13 | "react-scripts": "5.0.1",
14 | "react-toastify": "^10.0.5",
15 | "web-vitals": "^2.1.4"
16 | },
17 | "scripts": {
18 | "start": "react-scripts start",
19 | "build": "react-scripts build",
20 | "test": "react-scripts test",
21 | "eject": "react-scripts eject"
22 | },
23 | "eslintConfig": {
24 | "extends": [
25 | "react-app",
26 | "react-app/jest"
27 | ]
28 | },
29 | "browserslist": {
30 | "production": [
31 | ">0.2%",
32 | "not dead",
33 | "not op_mini all"
34 | ],
35 | "development": [
36 | "last 1 chrome version",
37 | "last 1 firefox version",
38 | "last 1 safari version"
39 | ]
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/project/HR/models/__init__.py:
--------------------------------------------------------------------------------
1 | from .course import Course
2 | from .Student import Student
3 | from .employee import Employee
4 | from .Health import Health
5 | from .education import Education, University, Faculty, Degree, Major
6 | # from .experience import Experience, Status, Grade, OrganizationTpye, Step, JobPosition
7 | # from .department import Department
8 | # from .province import Province
9 | # from .district import District
10 | # from .publication import Publication, PublicationType
11 | # from .reward import Reward, RewardType
12 | # from .exam import Exam
13 | # from .fire import Fire, FireType, LeaveReason
14 | # from .language import Language
15 | # from .organization import Organization
16 | # from .property import Property
17 | # from .training import Training
18 | # from .travel import Travel
19 | # __all__ = ['Course', 'Student', 'Employee', 'Health', 'Education', 'Experience', 'Status', 'Grade',
20 | # 'OrganizationTpye', 'Step', 'JobPosition', 'Country', 'Province', 'District', 'University',
21 | # 'Faculty', 'Degree', 'Publication', 'PublicationType', 'Reward', 'RewardType', 'Exam', 'Fire',
22 | # 'FireType', 'LeaveReason', 'Language', 'Organization', 'Property', 'Training', 'Travel']
23 |
24 | __all__ = ['Course', 'Student', 'Employee', 'Health', 'Education', 'University', 'Faculty', 'Degree', 'Major']
--------------------------------------------------------------------------------
/frontend/src/index.js:
--------------------------------------------------------------------------------
1 | // import React from 'react';
2 | // import ReactDOM from 'react-dom/client';
3 | // import './index.css';
4 | // import App from './App';
5 | // import reportWebVitals from './reportWebVitals';
6 |
7 | // const root = ReactDOM.createRoot(document.getElementById('root'));
8 | // root.render(
9 | //
10 | //
11 | //
12 | // );
13 |
14 | // // If you want to start measuring performance in your app, pass a function
15 | // // to log results (for example: reportWebVitals(console.log))
16 | // // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 | // reportWebVitals();
18 |
19 |
20 | import React from 'react';
21 | import ReactDOM from 'react-dom/client';
22 | import App from './App';
23 | import reportWebVitals from './reportWebVitals';
24 | import { BrowserRouter } from 'react-router-dom';
25 | const root = ReactDOM.createRoot(document.getElementById('root'));
26 | root.render(
27 | //
28 |
29 |
30 |
31 |
32 | //
33 | );
34 |
35 | // If you want to start measuring performance in your app, pass a function
36 | // to log results (for example: reportWebVitals(console.log))
37 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
38 | reportWebVitals();
39 |
40 |
--------------------------------------------------------------------------------
/project/HR/views/course_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.models import Course
5 | from HR.serializer import CourseSerializer
6 | # Create your views here.
7 |
8 |
9 | @csrf_exempt
10 | def courseApi(request,id=0):
11 | if request.method=='GET':
12 | course = Course.objects.all()
13 | course_serializer=CourseSerializer(course,many=True)
14 | return JsonResponse(course_serializer.data,safe=False)
15 | elif request.method=='POST':
16 | course_data=JSONParser().parse(request)
17 | course_serializer=CourseSerializer(data=course_data)
18 | if course_serializer.is_valid():
19 | course_serializer.save()
20 | return JsonResponse("Course Added Successfully",safe=False)
21 | return JsonResponse("Failed to Add",safe=False)
22 | elif request.method=="PUT":
23 | course_data=JSONParser().parse(request)
24 | course=Course.objects.get(id=id)
25 | course_serializer=CourseSerializer(course,data=course_data)
26 | if course_serializer.is_valid():
27 | course_serializer.save()
28 | return JsonResponse("Updated Successfully",safe=False)
29 | return JsonResponse("Failed to Update")
30 | elif request.method=="DELETE":
31 | course=Course.objects.get(id=id)
32 | course.delete()
33 | return JsonResponse("Course Data Deleted Successfully",safe=False)
34 |
--------------------------------------------------------------------------------
/project/HR/models/education.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from HR.models.address import Country
3 | # Create your models here.
4 |
5 | class Degree(models.Model):
6 | title = models.CharField(max_length=50)
7 |
8 | def __str__(self):
9 | return self.title
10 |
11 | class University(models.Model):
12 | name = models.CharField(max_length=100)
13 |
14 | def __str__(self):
15 | return self.name
16 |
17 | class Faculty(models.Model):
18 | name = models.CharField(max_length=100)
19 |
20 | def __str__(self):
21 | return self.name
22 |
23 | class Major(models.Model):
24 | name = models.CharField(max_length=100)
25 |
26 | def __str__(self):
27 | return self.name
28 |
29 | class Education(models.Model):
30 |
31 | country = models.ForeignKey(Country, on_delete=models.CASCADE)
32 | degree = models.ForeignKey(Degree, on_delete=models.CASCADE)
33 | university = models.ForeignKey(University, on_delete=models.CASCADE)
34 | faculty = models.ForeignKey(Faculty, on_delete=models.CASCADE)
35 | major = models.ForeignKey(Major, on_delete=models.CASCADE)
36 | education_start_date = models.DateField()
37 | education_end_date = models.DateField()
38 | batch_no = models.CharField(max_length=50)
39 | education_remarks = models.CharField(max_length=500)
40 |
41 | # def __str__(self):
42 | # return f"{self.degree} from {self.university} in {self.country}"
43 |
44 | def __str__(self):
45 | return f"Education in {self.country}"
46 |
47 |
--------------------------------------------------------------------------------
/project/HR/views/student_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import StudentSerializer
5 | from HR.models.Student import Student
6 | # Create your views here.
7 |
8 | @csrf_exempt
9 | def studentApi(request,id=0):
10 | if request.method=='GET':
11 | student = Student.objects.all()
12 | student_serializer=StudentSerializer(student,many=True)
13 | return JsonResponse(student_serializer.data,safe=False)
14 | elif request.method=='POST':
15 | stuent_data=JSONParser().parse(request)
16 | student_serializer=StudentSerializer(data=stuent_data)
17 | if student_serializer.is_valid():
18 | student_serializer.save()
19 | return JsonResponse("Student Added Successfully",safe=False)
20 | return JsonResponse("Failed to Add",safe=False)
21 | elif request.method=="PUT":
22 | student_data=JSONParser().parse(request)
23 | student=Student.objects.get(id=id)
24 | student_serializer=StudentSerializer(student,data=student_data)
25 | if student_serializer.is_valid():
26 | student_serializer.save()
27 | return JsonResponse("Updated Successfully",safe=False)
28 | return JsonResponse("Failed to Update")
29 | elif request.method=="DELETE":
30 | student=Student.objects.get(id=id)
31 | student.delete()
32 | return JsonResponse("Deleted Successfully",safe=False)
33 |
--------------------------------------------------------------------------------
/project/HR/views/health_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import healthSerializer
5 | from HR.models.Health import Health
6 | # Create your views here.
7 |
8 | @csrf_exempt
9 | def healthApi(request,id=0):
10 | if request.method=='GET':
11 | health = Health.objects.all()
12 | health_serializer=healthSerializer(health,many=True)
13 | return JsonResponse(health_serializer.data,safe=False)
14 |
15 | elif request.method=='POST':
16 | health_data=JSONParser().parse(request)
17 | health_serializer=healthSerializer(data=health_data)
18 | if health_serializer.is_valid():
19 | health_serializer.save()
20 | return JsonResponse("Student Added Successfully",safe=False)
21 | return JsonResponse("Failed to Add",safe=False)
22 |
23 | elif request.method=="PUT":
24 | health_data=JSONParser().parse(request)
25 | health=Health.objects.get(id=id)
26 | health_serializer=healthSerializer(health,data=health_data)
27 | if health_serializer.is_valid():
28 | health_serializer.save()
29 | return JsonResponse("Updated Successfully",safe=False)
30 | return JsonResponse("Failed to Update")
31 |
32 | elif request.method=="DELETE":
33 | health=Health.objects.get(id=id)
34 | health.delete()
35 | return JsonResponse("Deleted Successfully",safe=False)
36 |
--------------------------------------------------------------------------------
/project/HR/models/appraisal.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Appraisal(models.Model):
5 | full_name = models.CharField(max_length=50)
6 | last_name = models.CharField(max_length=50)
7 | father_name = models.CharField(max_length=50)
8 | grand_father_name = models.CharField(max_length=50)
9 | date_of_birth = models.DateField()
10 | place_of_birth = models.CharField(max_length=50)
11 | nationality = models.CharField(max_length=50)
12 | general_directorate = models.CharField(max_length=50)
13 | directorate = models.CharField(max_length=50)
14 | head = models.CharField(max_length=50)
15 | job_position = models.CharField(max_length=50)
16 | remarks = models.CharField(max_length=255)
17 | staus = models.CharField(max_length=50)
18 | religion = models.CharField(max_length=50)
19 | degree = models.CharField(max_length=1, choices=[
20 | ('H', 'High School'),
21 | ('B', 'Bachelor'),
22 | ('M', 'Master'),
23 | ('P', 'Phd'),
24 | ('A', 'Associate Professor'),
25 | ], default = 'B')
26 | mraital_status = models.CharField(max_length=1, choices=[
27 | ('S', 'SingleM'),
28 | ('M', 'Married'),
29 | ('W', 'Widdow'),
30 | ])
31 | gender = models.CharField(max_length=1, choices=[
32 | ('M', 'Male'),
33 | ('F', 'Female'),
34 | ('O', 'Other'),
35 | ])
36 | gender = models.CharField(max_length=2, choices=[
37 | ('A', 'A'),
38 | ('B', 'B'),
39 | ('AB', 'AB'),
40 | ('O', 'O'),
41 | ])
42 |
43 | # Define gender field with choices
44 |
--------------------------------------------------------------------------------
/project/HR/models/document.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Document(models.Model):
5 | full_name = models.CharField(max_length=50)
6 | last_name = models.CharField(max_length=50)
7 | father_name = models.CharField(max_length=50)
8 | grand_father_name = models.CharField(max_length=50)
9 | date_of_birth = models.DateField()
10 | place_of_birth = models.CharField(max_length=50)
11 | nationality = models.CharField(max_length=50)
12 | general_directorate = models.CharField(max_length=50)
13 | directorate = models.CharField(max_length=50)
14 | head = models.CharField(max_length=50)
15 | job_position = models.CharField(max_length=50)
16 | remarks = models.CharField(max_length=255)
17 | staus = models.CharField(max_length=50)
18 | religion = models.CharField(max_length=50)
19 | degree = models.CharField(max_length=1, choices=[
20 | ('H', 'High School'),
21 | ('B', 'Bachelor'),
22 | ('M', 'Master'),
23 | ('P', 'Phd'),
24 | ('A', 'Associate Professor'),
25 | ], default = 'B')
26 | mraital_status = models.CharField(max_length=1, choices=[
27 | ('S', 'SingleM'),
28 | ('M', 'Married'),
29 | ('W', 'Widdow'),
30 | ])
31 | gender = models.CharField(max_length=1, choices=[
32 | ('M', 'Male'),
33 | ('F', 'Female'),
34 | ('O', 'Other'),
35 | ])
36 | gender = models.CharField(max_length=2, choices=[
37 | ('A', 'A'),
38 | ('B', 'B'),
39 | ('AB', 'AB'),
40 | ('O', 'O'),
41 | ])
42 |
43 | # Define gender field with choices
44 |
--------------------------------------------------------------------------------
/project/HR/models/employee.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Employee(models.Model):
5 | full_name = models.CharField(max_length=50)
6 | last_name = models.CharField(max_length=50)
7 | father_name = models.CharField(max_length=50)
8 | grand_father_name = models.CharField(max_length=50)
9 | date_of_birth = models.DateField()
10 | place_of_birth = models.CharField(max_length=50)
11 | nationality = models.CharField(max_length=50)
12 | general_directorate = models.CharField(max_length=50)
13 | directorate = models.CharField(max_length=50)
14 | head = models.CharField(max_length=50)
15 | job_position = models.CharField(max_length=50)
16 | remarks = models.CharField(max_length=255)
17 | staus = models.CharField(max_length=50)
18 | religion = models.CharField(max_length=50)
19 | degree = models.CharField(max_length=1, choices=[
20 | ('H', 'High School'),
21 | ('B', 'Bachelor'),
22 | ('M', 'Master'),
23 | ('P', 'Phd'),
24 | ('A', 'Associate Professor'),
25 | ], default = 'B')
26 | mraital_status = models.CharField(max_length=1, choices=[
27 | ('S', 'SingleM'),
28 | ('M', 'Married'),
29 | ('W', 'Widdow'),
30 | ])
31 | gender = models.CharField(max_length=1, choices=[
32 | ('M', 'Male'),
33 | ('F', 'Female'),
34 | ('O', 'Other'),
35 | ])
36 | gender = models.CharField(max_length=2, choices=[
37 | ('A', 'A'),
38 | ('B', 'B'),
39 | ('AB', 'AB'),
40 | ('O', 'O'),
41 | ])
42 |
43 | # Define gender field with choices
44 |
--------------------------------------------------------------------------------
/project/HR/models/guarantee.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Employee(models.Model):
5 | full_name = models.CharField(max_length=50)
6 | last_name = models.CharField(max_length=50)
7 | father_name = models.CharField(max_length=50)
8 | grand_father_name = models.CharField(max_length=50)
9 | date_of_birth = models.DateField()
10 | place_of_birth = models.CharField(max_length=50)
11 | nationality = models.CharField(max_length=50)
12 | general_directorate = models.CharField(max_length=50)
13 | directorate = models.CharField(max_length=50)
14 | head = models.CharField(max_length=50)
15 | job_position = models.CharField(max_length=50)
16 | remarks = models.CharField(max_length=255)
17 | staus = models.CharField(max_length=50)
18 | religion = models.CharField(max_length=50)
19 | degree = models.CharField(max_length=1, choices=[
20 | ('H', 'High School'),
21 | ('B', 'Bachelor'),
22 | ('M', 'Master'),
23 | ('P', 'Phd'),
24 | ('A', 'Associate Professor'),
25 | ], default = 'B')
26 | mraital_status = models.CharField(max_length=1, choices=[
27 | ('S', 'SingleM'),
28 | ('M', 'Married'),
29 | ('W', 'Widdow'),
30 | ])
31 | gender = models.CharField(max_length=1, choices=[
32 | ('M', 'Male'),
33 | ('F', 'Female'),
34 | ('O', 'Other'),
35 | ])
36 | gender = models.CharField(max_length=2, choices=[
37 | ('A', 'A'),
38 | ('B', 'B'),
39 | ('AB', 'AB'),
40 | ('O', 'O'),
41 | ])
42 |
43 | # Define gender field with choices
44 |
--------------------------------------------------------------------------------
/project/HR/models/punishment.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Employee(models.Model):
5 | full_name = models.CharField(max_length=50)
6 | last_name = models.CharField(max_length=50)
7 | father_name = models.CharField(max_length=50)
8 | grand_father_name = models.CharField(max_length=50)
9 | date_of_birth = models.DateField()
10 | place_of_birth = models.CharField(max_length=50)
11 | nationality = models.CharField(max_length=50)
12 | general_directorate = models.CharField(max_length=50)
13 | directorate = models.CharField(max_length=50)
14 | head = models.CharField(max_length=50)
15 | job_position = models.CharField(max_length=50)
16 | remarks = models.CharField(max_length=255)
17 | staus = models.CharField(max_length=50)
18 | religion = models.CharField(max_length=50)
19 | degree = models.CharField(max_length=1, choices=[
20 | ('H', 'High School'),
21 | ('B', 'Bachelor'),
22 | ('M', 'Master'),
23 | ('P', 'Phd'),
24 | ('A', 'Associate Professor'),
25 | ], default = 'B')
26 | mraital_status = models.CharField(max_length=1, choices=[
27 | ('S', 'SingleM'),
28 | ('M', 'Married'),
29 | ('W', 'Widdow'),
30 | ])
31 | gender = models.CharField(max_length=1, choices=[
32 | ('M', 'Male'),
33 | ('F', 'Female'),
34 | ('O', 'Other'),
35 | ])
36 | gender = models.CharField(max_length=2, choices=[
37 | ('A', 'A'),
38 | ('B', 'B'),
39 | ('AB', 'AB'),
40 | ('O', 'O'),
41 | ])
42 |
43 | # Define gender field with choices
44 |
--------------------------------------------------------------------------------
/project/HR/models/relative.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Relative(models.Model):
5 | full_name = models.CharField(max_length=50)
6 | last_name = models.CharField(max_length=50)
7 | father_name = models.CharField(max_length=50)
8 | grand_father_name = models.CharField(max_length=50)
9 | date_of_birth = models.DateField()
10 | place_of_birth = models.CharField(max_length=50)
11 | nationality = models.CharField(max_length=50)
12 | general_directorate = models.CharField(max_length=50)
13 | directorate = models.CharField(max_length=50)
14 | head = models.CharField(max_length=50)
15 | job_position = models.CharField(max_length=50)
16 | remarks = models.CharField(max_length=255)
17 | staus = models.CharField(max_length=50)
18 | religion = models.CharField(max_length=50)
19 | degree = models.CharField(max_length=1, choices=[
20 | ('H', 'High School'),
21 | ('B', 'Bachelor'),
22 | ('M', 'Master'),
23 | ('P', 'Phd'),
24 | ('A', 'Associate Professor'),
25 | ], default = 'B')
26 | mraital_status = models.CharField(max_length=1, choices=[
27 | ('S', 'SingleM'),
28 | ('M', 'Married'),
29 | ('W', 'Widdow'),
30 | ])
31 | gender = models.CharField(max_length=1, choices=[
32 | ('M', 'Male'),
33 | ('F', 'Female'),
34 | ('O', 'Other'),
35 | ])
36 | gender = models.CharField(max_length=2, choices=[
37 | ('A', 'A'),
38 | ('B', 'B'),
39 | ('AB', 'AB'),
40 | ('O', 'O'),
41 | ])
42 |
43 | # Define gender field with choices
44 |
--------------------------------------------------------------------------------
/project/HR/models/retirement.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Employee(models.Model):
5 | full_name = models.CharField(max_length=50)
6 | last_name = models.CharField(max_length=50)
7 | father_name = models.CharField(max_length=50)
8 | grand_father_name = models.CharField(max_length=50)
9 | date_of_birth = models.DateField()
10 | place_of_birth = models.CharField(max_length=50)
11 | nationality = models.CharField(max_length=50)
12 | general_directorate = models.CharField(max_length=50)
13 | directorate = models.CharField(max_length=50)
14 | head = models.CharField(max_length=50)
15 | job_position = models.CharField(max_length=50)
16 | remarks = models.CharField(max_length=255)
17 | staus = models.CharField(max_length=50)
18 | religion = models.CharField(max_length=50)
19 | degree = models.CharField(max_length=1, choices=[
20 | ('H', 'High School'),
21 | ('B', 'Bachelor'),
22 | ('M', 'Master'),
23 | ('P', 'Phd'),
24 | ('A', 'Associate Professor'),
25 | ], default = 'B')
26 | mraital_status = models.CharField(max_length=1, choices=[
27 | ('S', 'SingleM'),
28 | ('M', 'Married'),
29 | ('W', 'Widdow'),
30 | ])
31 | gender = models.CharField(max_length=1, choices=[
32 | ('M', 'Male'),
33 | ('F', 'Female'),
34 | ('O', 'Other'),
35 | ])
36 | gender = models.CharField(max_length=2, choices=[
37 | ('A', 'A'),
38 | ('B', 'B'),
39 | ('AB', 'AB'),
40 | ('O', 'O'),
41 | ])
42 |
43 | # Define gender field with choices
44 |
--------------------------------------------------------------------------------
/project/HR/models/experience.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from HR.models.address import Country, Province
3 | from HR.models.organization import Organization
4 | from HR.models.department import Department
5 |
6 | class Status(models.Model):
7 | name = models.CharField(max_length=50)
8 |
9 | def __str__(self):
10 | return self.name
11 |
12 | class OrganizationType(models.Model):
13 | name = models.CharField(max_length=50)
14 |
15 | def __str__(self):
16 | return self.name
17 |
18 | class JobPosition(models.Model):
19 | name = models.CharField(max_length=50)
20 |
21 | def __str__(self):
22 | return self.name
23 |
24 | class Grade(models.Model):
25 | name = models.CharField(max_length=50)
26 |
27 | def __str__(self):
28 | return self.name
29 |
30 | class Step(models.Model):
31 | name = models.CharField(max_length=50)
32 |
33 | def __str__(self):
34 | return self.name
35 |
36 | class Experience(models.Model):
37 | country = models.ForeignKey(Country, on_delete=models.CASCADE)
38 | province = models.ForeignKey(Province, on_delete=models.CASCADE)
39 | organization = models.ForeignKey(Organization, on_delete=models.CASCADE)
40 | job_position = models.ForeignKey(JobPosition, on_delete=models.CASCADE)
41 | grade = models.ForeignKey(Grade, on_delete=models.CASCADE)
42 | step_id = models.ForeignKey(Step, on_delete=models.CASCADE)
43 | department = models.ForeignKey(Department, on_delete=models.CASCADE)
44 | status_id = models.ForeignKey(Status, on_delete=models.CASCADE)
45 | job_start_data = models.DateField()
46 | job_end_date = models.DateField()
47 | organization_type = models.ForeignKey(OrganizationType, on_delete=models.CASCADE)
48 | remarks = models.CharField(max_length=255)
49 |
50 | def __str__(self):
51 | return f"Education in {self.country}"
52 |
53 | def __str__(self):
54 | return f"Education in {self.province}"
--------------------------------------------------------------------------------
/project/HR/views/exam_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/fire_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/appraisal_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/document_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/employee_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/guarantee_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/language_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/property_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/relative_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/reward_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/training_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/travel_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/publication_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/punishment_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/retirement_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import employeeSerializer
5 | from HR.models.employee import Employee
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def employeeApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all employees
13 | employees = Employee.objects.all()
14 | employee_serializer = employeeSerializer(employees, many=True)
15 | return JsonResponse(employee_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | employee_data = JSONParser().parse(request)
20 | employee_serializer = employeeSerializer(data=employee_data)
21 | if employee_serializer.is_valid():
22 | employee_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing employee
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | employee = Employee.objects.get(id=id)
31 | except Employee.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | employee_serializer = employeeSerializer(employee, data=employee_data)
35 | if employee_serializer.is_valid():
36 | employee_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an employee
42 | try:
43 | employee = Employee.objects.get(id=id)
44 | except Employee.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | employee.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/project/HR/views/department_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import DepartmentSerializer
5 | from HR.models.department import Department
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def departmentApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all Departments
13 | department = Department.objects.all()
14 | department_serializer = DepartmentSerializer(department, many=True)
15 | return JsonResponse(department_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new Departement
19 | department_data = JSONParser().parse(request)
20 | department_serializer = DepartmentSerializer(data=department_data)
21 | if department_serializer.is_valid():
22 | department_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing Deapartment
28 | grade_data = JSONParser().parse(request)
29 | try:
30 | department = Department.objects.get(id=id)
31 | except Department.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | department_serializer = DepartmentSerializer(department, data=department_data)
35 | if department_serializer.is_valid():
36 | department_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an Department
42 | try:
43 | department = Department.objects.get(id=id)
44 | except Department.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | department.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
50 |
51 |
--------------------------------------------------------------------------------
/project/HR/views/organization_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import OrganizationSerializer
5 | from HR.models.organization import Organization
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def organizationApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all Organization
13 | organization = Organization.objects.all()
14 | organization_serializer = OrganizationSerializer(organization, many=True)
15 | return JsonResponse(organization_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | organization_data = JSONParser().parse(request)
20 | organization_serializer = OrganizationSerializer(data=organization_data)
21 | if organization_serializer.is_valid():
22 | organization_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing Organization
28 | employee_data = JSONParser().parse(request)
29 | try:
30 | organization = Organization.objects.get(id=id)
31 | except Organization.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | organization_serializer = OrganizationSerializer(organization, data=organization_data)
35 | if organization_serializer.is_valid():
36 | organization_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an Organization
42 | try:
43 | employee = Organization.objects.get(id=id)
44 | except Organization.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | organization.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
--------------------------------------------------------------------------------
/frontend/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
19 |
28 |
29 | React App
30 |
31 |
32 |
33 |
34 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/frontend/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/components/Sidebar.jsx:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import { Link } from 'react-router-dom';
4 | function Sidebar(){
5 | return(
6 |
7 |
8 |
9 |
Sidebar
10 |
11 |
12 |
13 | -
14 |
15 |
16 | Home
17 |
18 |
19 | -
20 |
21 |
22 | Dashboard
23 |
24 |
25 | -
26 |
27 |
28 | Orders
29 |
30 |
31 | -
32 |
33 |
34 | Products
35 |
36 |
37 | -
38 |
39 |
40 | Customers
41 |
42 |
43 |
44 |
45 |
46 |
47 |

48 |
mdo
49 |
50 |
51 | - New project...
52 | - Settings
53 | - Profile
54 |
55 | - Sign out
56 |
57 |
58 |
59 | )
60 | }
61 |
62 | export default Sidebar;
--------------------------------------------------------------------------------
/Pipfile.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_meta": {
3 | "hash": {
4 | "sha256": "4907f4d3ccd86a9ec08a400008b5aa6267f431133678c7267e7da520ef7c593c"
5 | },
6 | "pipfile-spec": 6,
7 | "requires": {
8 | "python_version": "3.12"
9 | },
10 | "sources": [
11 | {
12 | "name": "pypi",
13 | "url": "https://pypi.org/simple",
14 | "verify_ssl": true
15 | }
16 | ]
17 | },
18 | "default": {
19 | "asgiref": {
20 | "hashes": [
21 | "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47",
22 | "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590"
23 | ],
24 | "markers": "python_version >= '3.8'",
25 | "version": "==3.8.1"
26 | },
27 | "django": {
28 | "hashes": [
29 | "sha256:848a5980e8efb76eea70872fb0e4bc5e371619c70fffbe48e3e1b50b2c09455d",
30 | "sha256:d3b811bf5371a26def053d7ee42a9df1267ef7622323fe70a601936725aa4557"
31 | ],
32 | "markers": "python_version >= '3.10'",
33 | "version": "==5.1"
34 | },
35 | "django-cors-headers": {
36 | "hashes": [
37 | "sha256:5c6e3b7fe870876a1efdfeb4f433782c3524078fa0dc9e0195f6706ce7a242f6",
38 | "sha256:92cf4633e22af67a230a1456cb1b7a02bb213d6536d2dcb2a4a24092ea9cebc2"
39 | ],
40 | "index": "pypi",
41 | "markers": "python_version >= '3.8'",
42 | "version": "==4.4.0"
43 | },
44 | "djangorestframework": {
45 | "hashes": [
46 | "sha256:2b8871b062ba1aefc2de01f773875441a961fefbf79f5eed1e32b2f096944b20",
47 | "sha256:36fe88cd2d6c6bec23dca9804bab2ba5517a8bb9d8f47ebc68981b56840107ad"
48 | ],
49 | "index": "pypi",
50 | "markers": "python_version >= '3.8'",
51 | "version": "==3.15.2"
52 | },
53 | "sqlparse": {
54 | "hashes": [
55 | "sha256:773dcbf9a5ab44a090f3441e2180efe2560220203dc2f8c0b0fa141e18b505e4",
56 | "sha256:bb6b4df465655ef332548e24f08e205afc81b9ab86cb1c45657a7ff173a3a00e"
57 | ],
58 | "markers": "python_version >= '3.8'",
59 | "version": "==0.5.1"
60 | },
61 | "tzdata": {
62 | "hashes": [
63 | "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd",
64 | "sha256:9068bc196136463f5245e51efda838afa15aaeca9903f49050dfa2679db4d252"
65 | ],
66 | "markers": "sys_platform == 'win32'",
67 | "version": "==2024.1"
68 | }
69 | },
70 | "develop": {}
71 | }
72 |
--------------------------------------------------------------------------------
/frontend/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13 |
14 | The page will reload when you make changes.\
15 | You may also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35 |
36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39 |
40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/frontend/src/router/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Routes, Route } from 'react-router-dom';
3 |
4 | import Home from '../pages/Home.jsx';
5 | import About from '../pages/About.jsx';
6 | import Contact from '../pages/Contact.jsx';
7 | import StudentList from '../pages/Student.jsx';
8 | import Employee from '../pages/Employee.jsx';
9 | import HealthInfo from '../pages/Health.jsx';
10 | import Courses from '../pages/Course.jsx';
11 | import EducationData from '../pages/Education.jsx';
12 | import DegreeData from '../pages/Degree.jsx';
13 | import UniversityData from '../pages/University.jsx';
14 | import FacultyData from '../pages/Faculty.jsx';
15 | import MajorData from '../pages/Major.jsx';
16 | import ExperienceData from '../pages/Experience.jsx';
17 | import OrganizationTypeData from '../pages/OrganizationType.jsx';
18 | import StatusData from '../pages/Status.jsx';
19 | import JobPositiontData from '../pages/JobPosition.jsx';
20 | import DepartmentData from '../pages/Department.jsx';
21 | import StepData from '../pages/Step.jsx';
22 | import OrganizationData from '../pages/Organization.jsx';
23 | // import OrganizationData from '../pages/Organization.jsx';
24 | // import PropertyData from '../pages/Property.jsx';
25 | // import PublicationData from '../pages/Publication.jsx';
26 | // import PunishmentData from '../pages/Punishment.jsx';
27 | // import RelativeData from '../pages/Relative.jsx';
28 | // import TrainingData from '../pages/Training.jsx';
29 | // import TravelData from '../pages/Travel.jsx';
30 | // import RewardData from '../pages/Reward.jsx';
31 |
32 |
33 |
34 | function MyRouter(){
35 | return(
36 |
37 | } />
38 | } />
39 | } />
40 | } />
41 | } />
42 | } />
43 | } />
44 | } />
45 | } />
46 | } />
47 | } />
48 | } />
49 | } />
50 | } />
51 | } />
52 | } />
53 | } />
54 | } />
55 | {/* } />
56 | } />
57 | } />
58 | } />
59 | } />
60 | } />
61 | } />
62 | } />
63 | } />
64 | } />
65 | } />
66 | } />
67 | } /> */}
68 |
69 | )
70 | }
71 |
72 | export default MyRouter;
--------------------------------------------------------------------------------
/project/project/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for project project.
3 |
4 | Generated by 'django-admin startproject' using Django 5.1.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.1/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/5.1/ref/settings/
11 | """
12 |
13 | from pathlib import Path
14 |
15 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
16 | BASE_DIR = Path(__file__).resolve().parent.parent
17 |
18 |
19 | # Quick-start development settings - unsuitable for production
20 | # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
21 |
22 | # SECURITY WARNING: keep the secret key used in production secret!
23 | SECRET_KEY = 'django-insecure-41oh61h1qu1ze-lc8@pu@+z#aa!=80z561r*v4ad7ppfd$(jqj'
24 |
25 | # SECURITY WARNING: don't run with debug turned on in production!
26 | DEBUG = True
27 |
28 | ALLOWED_HOSTS = []
29 |
30 |
31 | # Application definition
32 |
33 | INSTALLED_APPS = [
34 | 'django.contrib.admin',
35 | 'django.contrib.auth',
36 | 'django.contrib.contenttypes',
37 | 'django.contrib.sessions',
38 | 'django.contrib.messages',
39 | 'django.contrib.staticfiles',
40 | 'HR.apps.HrConfig',
41 | 'rest_framework',
42 | 'corsheaders',
43 |
44 | ]
45 |
46 | MIDDLEWARE = [
47 | 'django.middleware.security.SecurityMiddleware',
48 | 'django.contrib.sessions.middleware.SessionMiddleware',
49 | 'django.middleware.common.CommonMiddleware',
50 | 'django.middleware.csrf.CsrfViewMiddleware',
51 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
52 | 'django.contrib.messages.middleware.MessageMiddleware',
53 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
54 | 'corsheaders.middleware.CorsMiddleware',
55 | ]
56 |
57 | REST_FRAMEWORK = {'DEFAULT_permission_classess': ['rest_framework.permission.AlloAny']}
58 |
59 | CORS_ORIGIN_ALLOW_ALL = True
60 |
61 | ROOT_URLCONF = 'project.urls'
62 |
63 | TEMPLATES = [
64 | {
65 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
66 | 'DIRS': [],
67 | 'APP_DIRS': True,
68 | 'OPTIONS': {
69 | 'context_processors': [
70 | 'django.template.context_processors.debug',
71 | 'django.template.context_processors.request',
72 | 'django.contrib.auth.context_processors.auth',
73 | 'django.contrib.messages.context_processors.messages',
74 | ],
75 | },
76 | },
77 | ]
78 |
79 | WSGI_APPLICATION = 'project.wsgi.application'
80 |
81 |
82 | # Database
83 | # https://docs.djangoproject.com/en/5.1/ref/settings/#databases
84 |
85 | DATABASES = {
86 | 'default': {
87 | 'ENGINE': 'django.db.backends.postgresql',
88 | 'NAME': 'HRMS',
89 | 'USER': 'postgres',
90 | 'PASSWORD': '_Postgres@1234',
91 | 'HOST': 'localhost',
92 | 'PORT': '5432',
93 | }
94 | }
95 |
96 | # Password validation
97 | # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
98 |
99 | AUTH_PASSWORD_VALIDATORS = [
100 | {
101 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
102 | },
103 | {
104 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
105 | },
106 | {
107 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
108 | },
109 | {
110 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
111 | },
112 | ]
113 |
114 |
115 | # Internationalization
116 | # https://docs.djangoproject.com/en/5.1/topics/i18n/
117 |
118 | LANGUAGE_CODE = 'en-us'
119 |
120 | TIME_ZONE = 'UTC'
121 |
122 | USE_I18N = True
123 |
124 | USE_TZ = True
125 |
126 |
127 | # Static files (CSS, JavaScript, Images)
128 | # https://docs.djangoproject.com/en/5.1/howto/static-files/
129 |
130 | STATIC_URL = 'static/'
131 |
132 | # Default primary key field type
133 | # https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
134 |
135 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
136 |
--------------------------------------------------------------------------------
/frontend/src/pages/Degree.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Degree() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [degrees, setDegree] = useState([]);
12 | useEffect(() =>{
13 | (async()=>await Load())();
14 | }, []);
15 |
16 | async function Load(){
17 | const result = await axios.get(
18 | "http://127.0.0.1:8000/degree/");
19 | setDegree(result.data);
20 | console.log(result.data);
21 | }
22 |
23 | async function save(event){
24 | event.preventDefault();
25 | try{
26 | await axios.post("http://127.0.0.1:8000/degree/",{
27 | id: id,
28 | name: name
29 | });
30 | toastr.success("Record Registered Successfully");
31 |
32 | setId("");
33 | setName("");
34 | Load();
35 | }
36 | catch(err){
37 | // alert("Student Registration Failed");
38 | toast.error("Student Registration Failed");
39 | }
40 | }
41 |
42 | async function editDegree(degrees){
43 | setName(degrees.name);
44 | setId(degrees.id);
45 | }
46 |
47 | async function DeleteDegree(id){
48 | await axios.delete("http://127.0.0.1:8000/degree/"+id);
49 | toast.info("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/degree/" + degrees.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toast.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toast.error("Student Registration Failed");
69 | }
70 | }
71 |
72 | if(degrees.length <= 0) return null;
73 |
74 | return (
75 |
76 |
77 |
99 |
100 |
101 |
102 |
103 |
104 | | ID |
105 | Degree |
106 | Edit |
107 | Delete |
108 |
109 |
110 |
111 | {degrees.map((degree) => (
112 |
113 | | {degree.id} |
114 | {degree.name} |
115 |
116 |
117 |
124 | |
125 |
126 |
127 | |
128 |
129 | ))}
130 |
131 |
132 |
133 |
134 |
135 |
136 | );
137 | }
138 |
139 | export default Degree;
140 |
--------------------------------------------------------------------------------
/frontend/src/pages/Faculty.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Faculty() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [facultys, setFaculty] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/faculty/");
20 | setFaculty(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/faculty/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 | setId("");
33 | setName("");
34 | Load();
35 | }
36 | catch(err){
37 | toast.error("Faculty Registration Failed");
38 | }
39 | }
40 |
41 | async function editFaculty(facultys){
42 | setName(facultys.name);
43 | setId(facultys.id);
44 | }
45 |
46 | async function DeleteFaculty(id){
47 | await axios.delete("http://127.0.0.1:8000/faculty/"+id);
48 | toastr.error("Data Deleted Successfully");
49 | Load();
50 | }
51 |
52 | async function update(event){
53 | event.preventDefault();
54 | try{
55 | await axios.put("http://127.0.0.1:8000/faculty/" + facultys.find(u => u.id === id).id || id,{
56 | id: id,
57 | name: name
58 | });
59 | toastr.success("Record updated Successfully");
60 |
61 | setId("");
62 | setName("");
63 | Load();
64 | }
65 | catch(err){
66 |
67 | toast.error("Faculty Registration Failed");
68 | }
69 | }
70 |
71 | // if(degrees.length <= 0) return null;
72 |
73 | return (
74 |
75 |
76 |
98 |
99 |
100 |
101 |
102 |
103 | | ID |
104 | Faculty |
105 | Edit |
106 | Delete |
107 |
108 |
109 |
110 | {facultys.map((faculty) => (
111 |
112 | | {faculty.id} |
113 | {faculty.name} |
114 |
115 |
116 |
117 | |
118 |
119 |
120 | |
121 |
122 | ))}
123 |
124 |
125 |
126 |
127 |
128 |
129 | );
130 | }
131 |
132 | export default Faculty;
133 |
--------------------------------------------------------------------------------
/frontend/src/pages/Organization.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Faculty() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [organizations, setOrganization] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/organization/");
20 | setOrganization(result.data);
21 | }
22 |
23 | async function save(event){
24 | event.preventDefault();
25 | try{
26 | await axios.post("http://127.0.0.1:8000/organization/",{
27 | id: id,
28 | name: name
29 | });
30 | toastr.success("Record Registered Successfully");
31 | setId("");
32 | setName("");
33 | Load();
34 | }
35 | catch(err){
36 | toast.error("Faculty Registration Failed");
37 | }
38 | }
39 |
40 | async function editOrganization(organizations){
41 | setName(organizations.name);
42 | setId(organizations.id);
43 | }
44 |
45 | async function DeleteOrganization(id){
46 | await axios.delete("http://127.0.0.1:8000/organization/"+id);
47 | toastr.error("Data Deleted Successfully");
48 | Load();
49 | }
50 |
51 | async function update(event){
52 | event.preventDefault();
53 | try{
54 | await axios.put("http://127.0.0.1:8000/organization/" + organizations.find(u => u.id === id).id || id,{
55 | id: id,
56 | name: name
57 | });
58 | toastr.success("Record updated Successfully");
59 |
60 | setId("");
61 | setName("");
62 | Load();
63 | }
64 | catch(err){
65 |
66 | toast.error("Faculty Registration Failed");
67 | }
68 | }
69 | return (
70 |
71 |
72 |
94 |
95 |
96 |
97 |
98 |
99 | | ID |
100 | Organizaiton |
101 | Edit |
102 | Delete |
103 |
104 |
105 |
106 | {organizations.map((organization) => (
107 |
108 | | {organization.id} |
109 | {organization.name} |
110 |
111 |
112 |
113 | |
114 |
115 |
116 | |
117 |
118 | ))}
119 |
120 |
121 |
122 |
123 |
124 |
125 | );
126 | }
127 |
128 | export default Faculty;
129 |
--------------------------------------------------------------------------------
/project/project/urls.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from django.urls import path, re_path
3 | from HR.views.student_view import studentApi # Import from views.student_view
4 | from HR.views.course_view import courseApi # Import from views.course_view
5 | from HR.views.employee_view import employeeApi # Import from views.employee_view
6 | from HR.views.health_view import healthApi # Import from health.view
7 | from HR.views.education_view import educationApi, universityApi, degreeApi, facultyApi, majorApi # Import from education.view
8 | from HR.views.organization_view import organizationApi
9 | from HR.views.address_view import countryApi, provinceApi, districtApi
10 | # from HR.views.department_view import departmentApi # Import from education.view
11 | # from HR.views.university_view import universityApi # Import from university.view
12 | # from HR.views.faculty_view import facultyApi
13 | # from HR.views.major_view import majorApi
14 | from HR.views.experience_view import experienceApi, organizationTypeApi, statusApi, jobPositionApi, stepApi
15 | # from HR.views.experience_view import
16 | urlpatterns = [
17 | path('student/', studentApi), # This handles requests to "Student/"
18 | re_path(r'^student/([0-9]+)$', studentApi), # This handles requests to "Student/"
19 | path('admin/', admin.site.urls), # Admin route
20 |
21 | path('course/', courseApi), # This handles requests to "Course/"
22 | re_path(r'^course/([0-9]+)$', courseApi), # This handles requests to "Course/"
23 |
24 | path('employee/', employeeApi), # This handles requests to "employee"
25 | re_path(r'^employee/([0-9]+)$', employeeApi), # This handles requests to "Employee/"
26 |
27 | path('health/', healthApi), # This handles requests to "Health/"
28 | re_path(r'^health/([0-9]+)$', healthApi), # This handles requests to "Health/"
29 |
30 | path('education/', educationApi), # This handles requests to "Education/"
31 | re_path(r'^education/([0-9]+)$', educationApi), # This handles requests to "Education/"
32 |
33 | path('degree/', degreeApi), # This handles requests to "Education/"
34 | re_path(r'^degree/([0-9]+)$', degreeApi), # This handles requests to "Education/"
35 |
36 | path('university/', universityApi), # This handles requests to "University/"
37 | re_path(r'^university/([0-9]+)$', universityApi), # This handles requests to "University/"
38 |
39 | path('faculty/', facultyApi), # This handles requests to "Faculty/"
40 | re_path(r'^faculty/([0-9]+)$', facultyApi), # This handles requests to "Faculty/"
41 |
42 | path('faculty/', majorApi), # This handles requests to Major/"
43 | re_path(r'^faculty/([0-9]+)$', majorApi), # This handles requests to Major Api /"
44 |
45 | path('experience/', experienceApi), # This handles requests to "Experience/"
46 | re_path(r'^experience/([0-9]+)$', experienceApi), # This handles requests to "Experience Api/"
47 |
48 | path('organization/', organizationApi), # This handles requests to "Organization Type Api/"
49 | re_path(r'^organization/([0-9]+)$', organizationApi), # This handles requests to "Organization Type Api/"
50 |
51 | path('organization-type/', organizationTypeApi), # This handles requests to "Organization Type Api/"
52 | re_path(r'^organization-type/([0-9]+)$', organizationTypeApi), # This handles requests to "Organization Type Api/"
53 |
54 | path('status/', statusApi), # This handles requests to Department/
55 | re_path(r'^status/([0-9]+)$', statusApi), # This handles requests to "Department Api/"
56 |
57 | path('job-position/', jobPositionApi), # This handles requests to Job Postion/"
58 | re_path(r'^job-position/([0-9]+)$', jobPositionApi), # This handles requests to Job Position Api /"
59 |
60 | path('country/', countryApi), # This handles requests to Department/"
61 | re_path(r'^country/([0-9]+)$', countryApi), # This handles requests to Department Api /"
62 |
63 | path('province/', provinceApi), # This handles requests to Grade/"
64 | re_path(r'^province/([0-9]+)$', provinceApi), # This handles requests to Grade Api /"
65 |
66 | path('district/', districtApi), # This handles requests to District/"
67 | re_path(r'^district/([0-9]+)$', districtApi), # This handles requests to District Api /"
68 |
69 | path('step/', stepApi), # This handles requests to Step/
70 | re_path(r'^step/([0-9]+)$', stepApi), # This handles requests to Step Api /"
71 |
72 |
73 |
74 | ]
--------------------------------------------------------------------------------
/frontend/src/pages/Step.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Major() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [steps, setStep] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/step/");
20 | setStep(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/step/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 |
33 | setId("");
34 | setName("");
35 | Load();
36 | }
37 | catch(err){
38 | toast.error("Registration Failed");
39 | }
40 | }
41 |
42 | async function editStep(steps){
43 | setName(steps.name);
44 | setId(steps.id);
45 | }
46 |
47 | async function DeleteStep(id){
48 | await axios.delete("http://127.0.0.1:8000/step/"+id);
49 | toastr.error("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/step/" + steps.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toastr.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toastr.error("Registration Failed");
69 | }
70 | }
71 |
72 | // if(degrees.length <= 0) return null;
73 |
74 | return (
75 |
76 |
77 |
99 |
100 |
101 |
102 |
103 | | ID |
104 | Step |
105 | Edit |
106 | Delete |
107 |
108 |
109 |
110 | {steps.map((step) => (
111 |
112 | | {step.id} |
113 | {step.name} |
114 |
115 |
116 |
117 | |
118 |
119 |
120 | |
121 |
122 | ))}
123 |
124 |
125 |
126 |
127 |
128 |
129 | );
130 | }
131 |
132 | export default Major;
133 |
--------------------------------------------------------------------------------
/frontend/src/pages/Grade.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Major() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [majors, setMajor] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/major/");
20 | setMajor(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/major/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 |
33 | setId("");
34 | setName("");
35 | Load();
36 | }
37 | catch(err){
38 | toast.error("Registration Failed");
39 | }
40 | }
41 |
42 | async function editMajor(majors){
43 | setName(majors.name);
44 | setId(majors.id);
45 | }
46 |
47 | async function DeleteMajor(id){
48 | await axios.delete("http://127.0.0.1:8000/major/"+id);
49 | toastr.danger("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/major/" + majors.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toastr.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toastr.error("Registration Failed");
69 | }
70 | }
71 |
72 | // if(degrees.length <= 0) return null;
73 |
74 | return (
75 |
76 |
77 |
99 |
100 |
101 |
102 |
103 | | ID |
104 | Major |
105 | Edit |
106 | Delete |
107 |
108 |
109 |
110 | {majors.map((major) => (
111 |
112 | | {major.id} |
113 | {major.name} |
114 |
115 |
116 |
117 | |
118 |
119 |
120 | |
121 |
122 | ))}
123 |
124 |
125 |
126 |
127 |
128 |
129 | );
130 | }
131 |
132 | export default Major;
133 |
--------------------------------------------------------------------------------
/frontend/src/pages/Major.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Major() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [majors, setMajor] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/major/");
20 | setMajor(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/major/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 |
33 | setId("");
34 | setName("");
35 | Load();
36 | }
37 | catch(err){
38 | toast.error("Registration Failed");
39 | }
40 | }
41 |
42 | async function editMajor(majors){
43 | setName(majors.name);
44 | setId(majors.id);
45 | }
46 |
47 | async function DeleteMajor(id){
48 | await axios.delete("http://127.0.0.1:8000/major/"+id);
49 | toastr.danger("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/major/" + majors.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toastr.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toastr.error("Registration Failed");
69 | }
70 | }
71 |
72 | // if(degrees.length <= 0) return null;
73 |
74 | return (
75 |
76 |
77 |
99 |
100 |
101 |
102 |
103 | | ID |
104 | Major |
105 | Edit |
106 | Delete |
107 |
108 |
109 |
110 | {majors.map((major) => (
111 |
112 | | {major.id} |
113 | {major.name} |
114 |
115 |
116 |
117 | |
118 |
119 |
120 | |
121 |
122 | ))}
123 |
124 |
125 |
126 |
127 |
128 |
129 | );
130 | }
131 |
132 | export default Major;
133 |
--------------------------------------------------------------------------------
/frontend/src/pages/Status.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Status() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [statuss, setStatus] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/status/");
20 | setStatus(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/status/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 |
33 | setId("");
34 | setName("");
35 | Load();
36 | }
37 | catch(err){
38 | toast.error("Registration Failed");
39 | }
40 | }
41 |
42 | async function editStatus(statuss){
43 | setName(statuss.name);
44 | setId(statuss.id);
45 | }
46 |
47 | async function DeleteStatus(id){
48 | await axios.delete("http://127.0.0.1:8000/status/"+id);
49 | toastr.danger("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/status/" + statuss.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toastr.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toastr.error("Registration Failed");
69 | }
70 | }
71 |
72 | // if(degrees.length <= 0) return null;
73 |
74 | return (
75 |
76 |
77 |
99 |
100 |
101 |
102 |
103 | | ID |
104 | Status |
105 | Edit |
106 | Delete |
107 |
108 |
109 |
110 | {statuss.map((status) => (
111 |
112 | | {status.id} |
113 | {status.name} |
114 |
115 |
116 |
117 | |
118 |
119 |
120 | |
121 |
122 | ))}
123 |
124 |
125 |
126 |
127 | );
128 | }
129 |
130 | export default Status;
131 |
--------------------------------------------------------------------------------
/frontend/src/pages/JobPosition.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function JobPosition() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [job_positions, setJobPosition] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/job-position/");
20 | setJobPosition(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/job-position/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 |
33 | setId("");
34 | setName("");
35 | Load();
36 | }
37 | catch(err){
38 | toast.error("Registration Failed");
39 | }
40 | }
41 |
42 | async function editJobPosition(job_positions){
43 | setName(job_positions.name);
44 | setId(job_positions.id);
45 | }
46 |
47 | async function DeleteJobPosition(id){
48 | await axios.delete("http://127.0.0.1:8000/job-position/"+id);
49 | toastr.error("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/job-position/" + job_positions.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toastr.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toastr.error("Registration Failed");
69 | }
70 | }
71 | return (
72 |
73 |
74 |
96 |
97 |
98 |
99 |
100 | | ID |
101 | Job Position |
102 | Edit |
103 | Delete |
104 |
105 |
106 |
107 | {job_positions.map((job_position) => (
108 |
109 | | {job_position.id} |
110 | {job_position.name} |
111 |
112 |
113 |
114 | |
115 |
116 |
117 | |
118 |
119 | ))}
120 |
121 |
122 |
123 |
124 |
125 | );
126 | }
127 |
128 | export default JobPosition;
129 |
--------------------------------------------------------------------------------
/frontend/src/pages/Department.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function Department() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [departments, setDepartment] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/department/");
20 | setDepartment(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/department/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 |
33 | setId("");
34 | setName("");
35 | Load();
36 | }
37 | catch(err){
38 | toast.error("Registration Failed");
39 | }
40 | }
41 |
42 | async function editDepartment(departments){
43 | setName(departments.name);
44 | setId(departments.id);
45 | }
46 |
47 | async function DeleteDepartment(id){
48 | await axios.delete("http://127.0.0.1:8000/department/"+id);
49 | toastr.danger("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/department/" + departments.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toastr.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toastr.error("Registration Failed");
69 | }
70 | }
71 |
72 | // if(degrees.length <= 0) return null;
73 |
74 | return (
75 |
76 |
77 |
99 |
100 |
101 |
102 |
103 | | ID |
104 | Department |
105 | Edit |
106 | Delete |
107 |
108 |
109 |
110 | {departments.map((department) => (
111 |
112 | | {department.id} |
113 | {department.name} |
114 |
115 |
116 |
117 | |
118 |
119 |
120 | |
121 |
122 | ))}
123 |
124 |
125 |
126 |
127 |
128 |
129 | );
130 | }
131 |
132 | export default Department;
133 |
--------------------------------------------------------------------------------
/frontend/src/pages/University.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function University() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [universitys, setUniversity] = useState([]);
12 |
13 | // const handleInputChange = (e) => {
14 | // setId(e.target.value); // Update state on input change
15 | // };
16 |
17 | useEffect(() =>{
18 | (async()=>await Load())();
19 | }, []);
20 |
21 | async function Load(){
22 | const result = await axios.get(
23 | "http://127.0.0.1:8000/university/");
24 | setUniversity(result.data);
25 | console.log(result.data);
26 | }
27 |
28 | async function save(event){
29 | event.preventDefault();
30 | try{
31 | await axios.post("http://127.0.0.1:8000/university/",{
32 | id: id,
33 | name: name
34 | });
35 | toastr.success("Record Registered Successfully");
36 |
37 | setId("");
38 | setName("");
39 | Load();
40 | }
41 | catch(err){
42 | // alert("Student Registration Failed");
43 | toast.error("Student Registration Failed");
44 | }
45 | }
46 |
47 | async function editUniversity(universitys){
48 | setName(universitys.name);
49 | setId(universitys.id);
50 | }
51 |
52 | async function DeleteUniversity(id){
53 | await axios.delete("http://127.0.0.1:8000/university/"+id);
54 | toastr.danger("Data Deleted Successfully");
55 | Load();
56 | }
57 |
58 | async function update(event){
59 | event.preventDefault();
60 | try{
61 | await axios.put("http://127.0.0.1:8000/university/" + universitys.find(u => u.id === id).id || id,{
62 | id: id,
63 | name: name
64 | });
65 | toastr.info("Record updated Successfully");
66 |
67 | setId("");
68 | setName("");
69 | Load();
70 | }
71 | catch(err){
72 |
73 | toast.error("University Registration Failed");
74 | }
75 | }
76 |
77 | // if(degrees.length <= 0) return null;
78 |
79 | return (
80 |
81 |
82 |
104 |
105 |
106 |
107 |
108 |
109 | | ID |
110 | University |
111 | Edit |
112 | Delete |
113 |
114 |
115 |
116 | {universitys.map((university) => (
117 |
118 | | {university.id} |
119 | {university.name} |
120 |
121 |
122 |
123 | |
124 |
125 |
126 | |
127 |
128 | ))}
129 |
130 |
131 |
132 |
133 |
134 |
135 | );
136 | }
137 |
138 | export default University;
139 |
--------------------------------------------------------------------------------
/frontend/src/pages/OrganizationType.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 | import toastr from 'toastr';
6 | import 'toastr/build/toastr.min.css';
7 |
8 | function OrganizationType() {
9 | const [id, setId] = useState('');
10 | const [name, setName] = useState('');
11 | const [organization_types, setOrganizationType] = useState([]);
12 |
13 | useEffect(() =>{
14 | (async()=>await Load())();
15 | }, []);
16 |
17 | async function Load(){
18 | const result = await axios.get(
19 | "http://127.0.0.1:8000/organization-type/");
20 | setOrganizationType(result.data);
21 | console.log(result.data);
22 | }
23 |
24 | async function save(event){
25 | event.preventDefault();
26 | try{
27 | await axios.post("http://127.0.0.1:8000/organization-type/",{
28 | id: id,
29 | name: name
30 | });
31 | toastr.success("Record Registered Successfully");
32 |
33 | setId("");
34 | setName("");
35 | Load();
36 | }
37 | catch(err){
38 | toast.error("Registration Failed");
39 | }
40 | }
41 |
42 | async function editOrganizationType(organization_types){
43 | setName(organization_types.name);
44 | setId(organization_types.id);
45 | }
46 |
47 | async function DeleteOrganizationType(id){
48 | await axios.delete("http://127.0.0.1:8000/organization-type/"+id);
49 | toastr.danger("Data Deleted Successfully");
50 | Load();
51 | }
52 |
53 | async function update(event){
54 | event.preventDefault();
55 | try{
56 | await axios.put("http://127.0.0.1:8000/organization-type/" + organization_types.find(u => u.id === id).id || id,{
57 | id: id,
58 | name: name
59 | });
60 | toastr.info("Record updated Successfully");
61 |
62 | setId("");
63 | setName("");
64 | Load();
65 | }
66 | catch(err){
67 |
68 | toastr.error("Registration Failed");
69 | }
70 | }
71 |
72 | // if(degrees.length <= 0) return null;
73 |
74 | return (
75 |
76 |
77 |
99 |
100 |
101 |
102 |
103 | | ID |
104 | Organization Type |
105 | Edit |
106 | Delete |
107 |
108 |
109 |
110 | {organization_types.map((organization_type) => (
111 |
112 | | {organization_type.id} |
113 | {organization_type.name} |
114 |
115 |
116 |
117 | |
118 |
119 |
120 | |
121 |
122 | ))}
123 |
124 |
125 |
126 |
127 |
128 |
129 | );
130 | }
131 |
132 | export default OrganizationType;
133 |
--------------------------------------------------------------------------------
/frontend/src/pages/Health.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 |
6 | function Health() {
7 | const [id, setId] = useState('');
8 | const [status, setStatus] = useState('');
9 | const [report, setReport] = useState('');
10 | const [remark, setRemark] = useState('');
11 | const [healths, setUsers] = useState([]);
12 | useEffect(() =>{
13 | (async()=>await Load())();
14 | }, []);
15 |
16 | async function Load(){
17 | const result = await axios.get(
18 | "http://127.0.0.1:8000/health/");
19 | setUsers(result.data);
20 | console.log(result.data);
21 | }
22 |
23 | async function save(event){
24 | event.preventDefault();
25 | try{
26 | await axios.post("http://127.0.0.1:8000/health/",{
27 | id: id,
28 | status: status,
29 | remark: remark,
30 | report: report
31 | });
32 | toast.success("Record Registered Successfully");
33 |
34 | setId("");
35 | setStatus("");
36 | setRemark("");
37 | setReport("");
38 | Load();
39 | }
40 | catch(err){
41 | toast.error("Health Data Registration Failed");
42 | }
43 | }
44 |
45 | async function editStudent(healths){
46 | setStatus(healths.status);
47 | setRemark(healths.remark);
48 | setReport(healths.report);
49 | setId(healths.id);
50 | }
51 |
52 | async function DeleteStudent(id){
53 | await axios.delete("http://127.0.0.1:8000/health/"+id);
54 | toast.info("Health Data Deleted Successfully");
55 | Load();
56 | }
57 |
58 | async function update(event){
59 | event.preventDefault();
60 | try{
61 | await axios.put("http://127.0.0.1:8000/health/" + healths.find(u => u.id === id).id || id,{
62 | id: id,
63 | status: status,
64 | report: report,
65 | remark: remark,
66 |
67 | });
68 | toast.info("Record updated Successfully");
69 |
70 | setId("");
71 | setStatus("");
72 | setRemark("");
73 | setReport("");
74 | Load();
75 | }
76 | catch(err){
77 |
78 | toast.error("Health Data Registration Failed");
79 | }
80 | }
81 |
82 | if(healths.length <= 0) return null;
83 |
84 | return (
85 |
86 |
87 |
124 |
125 |
126 |
127 |
128 |
129 | | ID |
130 | Status |
131 | Report |
132 | Remark |
133 | Edit |
134 | Delete |
135 |
136 |
137 |
138 | {healths.map((health) => (
139 |
140 | | {health.id} |
141 | {health.status} |
142 | {health.report} |
143 | {health.remark} |
144 |
145 |
146 |
153 | |
154 |
155 |
162 | |
163 |
164 | ))}
165 |
166 |
167 |
168 |
169 |
170 |
171 | );
172 | }
173 |
174 | export default Health;
175 |
--------------------------------------------------------------------------------
/project/HR/views/address_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import CountrySerializer, ProvinceSerializer, DistrictSerializer
5 | from HR.models.address import Country, Province, District
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def countryApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all Country
13 | country = Country.objects.all()
14 | country_serializer = CountrySerializer(country, many=True)
15 | return JsonResponse(country_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new employee
19 | country_data = JSONParser().parse(request)
20 | country_serializer = CountrySerializer(data=country_data)
21 | if country_serializer.is_valid():
22 | country_serializer.save()
23 | return JsonResponse("Employee Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing Country
28 | country_data = JSONParser().parse(request)
29 | try:
30 | country = Country.objects.get(id=id)
31 | except Country.DoesNotExist:
32 | return JsonResponse("Employee not found", safe=False, status=404)
33 |
34 | country_serializer = CountrySerializer(country, data=country_data)
35 | if country_serializer.is_valid():
36 | country_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an Country
42 | try:
43 | country = Country.objects.get(id=id)
44 | except Country.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | country.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
50 | @csrf_exempt
51 | def provinceApi(request, id=0):
52 | if request.method == 'GET':
53 | # Get all Provice
54 | province = Province.objects.all()
55 | province_serializer = ProvinceSerializer(province, many=True)
56 | return JsonResponse(province_serializer.data, safe=False)
57 |
58 | elif request.method == 'POST':
59 | # Add a new province
60 | province_data = JSONParser().parse(request)
61 | province_serializer = ProvinceSerializer(data=province_data)
62 | if province_serializer.is_valid():
63 | province_serializer.save()
64 | return JsonResponse("province Added Successfully", safe=False)
65 | return JsonResponse("Failed to Add", safe=False)
66 |
67 | elif request.method == "PUT":
68 | # Update an existing province
69 | province_data = JSONParser().parse(request)
70 | try:
71 | province = Province.objects.get(id=id)
72 | except Province.DoesNotExist:
73 | return JsonResponse("Employee not found", safe=False, status=404)
74 |
75 | province_serializer = ProvinceSerializer(province, data=province_data)
76 | if province_serializer.is_valid():
77 | province_serializer.save()
78 | return JsonResponse("Updated Successfully", safe=False)
79 | return JsonResponse("Failed to Update", safe=False)
80 |
81 | elif request.method == "DELETE":
82 | # Delete an Province
83 | try:
84 | province = Province.objects.get(id=id)
85 | except Province.DoesNotExist:
86 | return JsonResponse("Employee not found", safe=False, status=404)
87 |
88 | province.delete()
89 | return JsonResponse("Deleted Successfully", safe=False)
90 |
91 | @csrf_exempt
92 | def districtApi(request, id=0):
93 | if request.method == 'GET':
94 | # Get all District
95 | district = District.objects.all()
96 | district_serializer = ProvinceSerializer(district, many=True)
97 | return JsonResponse(district_serializer.data, safe=False)
98 |
99 | elif request.method == 'POST':
100 | # Add a new District
101 | district_data = JSONParser().parse(request)
102 | district_serializer = DistrictSerializer(data=district_data)
103 | if district_serializer.is_valid():
104 | district_serializer.save()
105 | return JsonResponse("District Added Successfully", safe=False)
106 | return JsonResponse("Failed to Add", safe=False)
107 |
108 | elif request.method == "PUT":
109 | # Update an existing District
110 | district_data = JSONParser().parse(request)
111 | try:
112 | district = District.objects.get(id=id)
113 | except Province.DoesNotExist:
114 | return JsonResponse("Employee not found", safe=False, status=404)
115 |
116 | district_serializer = DistrictSerializer(district, data=district_data)
117 | if district_serializer.is_valid():
118 | district_serializer.save()
119 | return JsonResponse("Updated Successfully", safe=False)
120 | return JsonResponse("Failed to Update", safe=False)
121 |
122 | elif request.method == "DELETE":
123 | # Delete an District
124 | try:
125 | district = District.objects.get(id=id)
126 | except District.DoesNotExist:
127 | return JsonResponse("Employee not found", safe=False, status=404)
128 |
129 | district.delete()
130 | return JsonResponse("Deleted Successfully", safe=False)
--------------------------------------------------------------------------------
/project/HR/serializer.py:
--------------------------------------------------------------------------------
1 | from rest_framework import serializers
2 | # from .models import Student
3 | # from HR.models import reward, exam, travel, organization
4 | from HR.models.address import Country, Province, District
5 | from HR.models.course import Course
6 | from HR.models.Student import Student # Correct import path
7 | from HR.models.employee import Employee
8 | from HR.models.Health import Health
9 | from HR.models.education import Education, Faculty, University, Degree, Major
10 | from HR.models.experience import Experience, Status, Step, Grade, JobPosition, OrganizationType
11 | from HR.models.organization import Organization
12 | # from HR.models.department import Department
13 | # from HR.models.oexam import Exam
14 | # from HR.models.document import Document
15 | # from HR.models.property import Property, PropertyType
16 | # from HR.models.publication import Publication
17 | # from HR.models.punishment import Punishment
18 | # from HR.models.reward import Reward, RewardType
19 | # from HR.models.training import Training
20 | # from HR.models.travel import Travel
21 | # from HR.models.organization import Organization
22 |
23 |
24 | class StudentSerializer(serializers.ModelSerializer):
25 | class Meta:
26 | model = Student
27 | fields = '__all__' # Include all fields from the Student model
28 | # Alternatively, specify specific fields:
29 | # fields = ['id', 'name', 'age', ...] # Replace with actual field names
30 |
31 | class CourseSerializer(serializers.ModelSerializer):
32 | class Meta:
33 | model = Course
34 | fields = '__all__'
35 |
36 | # class examSerializer(serializers.ModelSerializer):
37 | # class Meta:
38 | # model = Exam
39 | # fields = '__all__'
40 |
41 | class employeeSerializer(serializers.ModelSerializer):
42 | class Meta:
43 | model = Employee
44 | fields = '__all__'
45 |
46 |
47 | class ExperienceSerializer(serializers.ModelSerializer):
48 | class Meta:
49 | model = Experience
50 | fields = '__all__'
51 |
52 | class StepSerializer(serializers.ModelSerializer):
53 | class Meta:
54 | model = Step
55 | fields = '__all__'
56 |
57 | class JobPositionSerializer(serializers.ModelSerializer):
58 | class Meta:
59 | model = JobPosition
60 | fields = '__all__'
61 |
62 | class OrganizationTypeSerializer(serializers.ModelSerializer):
63 | class Meta:
64 | model = OrganizationType
65 | fields = '__all__'
66 |
67 | class OrganizationSerializer(serializers.ModelSerializer):
68 | class Meta:
69 | model = Organization
70 | fields = '__all__'
71 |
72 | # class DepartmentSerializer(serializers.ModelSerializer):
73 | # class Meta:
74 | # model = Department
75 | # fields = '__all__'
76 |
77 | class GradeSerializer(serializers.ModelSerializer):
78 | class Meta:
79 | model = Grade
80 | fields = '__all__'
81 |
82 | class StatusSerializer(serializers.ModelSerializer):
83 | class Meta:
84 | model = Status
85 | fields = '__all__'
86 |
87 | class healthSerializer(serializers.ModelSerializer):
88 | class Meta:
89 | model = Health
90 | fields = '__all__'
91 |
92 |
93 | class educationSerializer(serializers.ModelSerializer):
94 | class Meta:
95 | model = Education
96 | fields = '__all__'
97 |
98 | class UniversitySerializer(serializers.ModelSerializer):
99 | class Meta:
100 | model = University
101 | fields = '__all__'
102 |
103 | class FacultySerializer(serializers.ModelSerializer):
104 | class Meta:
105 | model = Faculty
106 | fields = '__all__'
107 |
108 | class DegreeSerializer(serializers.ModelSerializer):
109 | class Meta:
110 | model = Degree
111 | fields = '__all__'
112 |
113 | class MajorSerializer(serializers.ModelSerializer):
114 | class Meta:
115 | model = Major
116 | fields = '__all__'
117 |
118 | class courseSerializer(serializers.ModelSerializer):
119 | class Meta:
120 | model = Course
121 | fields = '__all__'
122 |
123 | class CountrySerializer(serializers.ModelSerializer):
124 | class Meta:
125 | model = Country
126 | fields = '__all__'
127 |
128 | class ProvinceSerializer(serializers.ModelSerializer):
129 | class Meta:
130 | model = Province
131 | fields = '__all__'
132 |
133 | class DistrictSerializer(serializers.ModelSerializer):
134 | class Meta:
135 | model = District
136 | fields = '__all__'
137 |
138 | # class countrySerializer(serializers.ModelSerializer):
139 | # class Meta:
140 | # model = Country
141 | # fields = '__all__'
142 |
143 | # class districtSerializer(serializers.ModelSerializer):
144 | # class Meta:
145 | # model = District
146 | # fields = '__all__'
147 |
148 | # class provinceSerializer(serializers.ModelSerializer):
149 | # class Meta:
150 | # model = Province
151 | # fields = '__all__'
152 |
153 | # class documentSerializer(serializers.ModelSerializer):
154 | # class Meta:
155 | # model = Document
156 | # fields = '__all__'
157 |
158 | # class propertySerializer(serializers.ModelSerializer):
159 | # class Meta:
160 | # model = Property
161 | # fields = '__all__'
162 |
163 | # class travelSerializer(serializers.ModelSerializer):
164 | # class Meta:
165 | # model = Travel
166 | # fields = '__all__'
167 |
168 | # class trainingSerializer(serializers.ModelSerializer):
169 | # class Meta:
170 | # model = Training
171 | # fields = '__all__'
172 |
173 | # class publicationSerializer(serializers.ModelSerializer):
174 | # class Meta:
175 | # model = Publication
176 | # fields = '__all__'
177 |
178 | # class propertyTypeSerializer(serializers.ModelSerializer):
179 | # class Meta:
180 | # model = PropertyType
181 | # fields = '__all__'
182 |
183 | # class rewardTypeSerializer(serializers.ModelSerializer):
184 | # class Meta:
185 | # model = RewardType
186 | # fields = '__all__'
--------------------------------------------------------------------------------
/frontend/src/pages/Course.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { Link } from 'react-router-dom';
3 | import {useEffect, useState } from "react";
4 | import { ToastContainer, toast } from 'react-toastify';
5 | import 'react-toastify/dist/ReactToastify.css';
6 | import toastr from 'toastr';
7 | import 'toastr/build/toastr.min.css';
8 | import Swal from 'sweetalert2'; // Import SweetAlert2
9 |
10 | function Course() {
11 | const [id, setId] = useState('');
12 | const [course, setCourse] = useState('');
13 | const [fee, setFee] = useState('');
14 | const [courses, setUsers] = useState([]);
15 | useEffect(() =>{
16 | (async()=>await Load())();
17 | }, []);
18 |
19 | async function Load(){
20 | const result = await axios.get(
21 | "http://127.0.0.1:8000/course/");
22 | setUsers(result.data);
23 | console.log(result.data);
24 | }
25 |
26 | async function save(event){
27 | event.preventDefault();
28 | try{
29 | await axios.post("http://127.0.0.1:8000/course/",{
30 | id: id,
31 | course: course,
32 | fee: fee
33 | });
34 | // alert("This is not enogh");
35 | // Swal.fire('Success!', 'Record Updated Successfully', 'success');
36 | // toast.success("Course Added Successfully");
37 | toastr.success("Course Added Successfully");
38 |
39 | setId("");
40 | setCourse("");
41 | setFee("");
42 | Load();
43 | }
44 | catch(err){
45 | // alert("Course Registration Failed");
46 | // toast.error("Record Registered failed");
47 | toastr.error("Course Registration Failed");
48 | }
49 | }
50 |
51 | async function editStudent(courses){
52 | setCourse(courses.course);
53 | setFee(courses.fee);
54 | setId(courses.id);
55 | }
56 |
57 | async function DeleteStudent(id){
58 | await axios.delete("http://127.0.0.1:8000/course/"+id);
59 | // alert("Course Deleted Successfully");
60 | toast.error("Course Deleted Successfully");
61 |
62 | Load();
63 | }
64 |
65 | async function update(event){
66 | event.preventDefault();
67 | try{
68 | await axios.put("http://127.0.0.1:8000/course/" + courses.find(u => u.id === id).id || id,{
69 | id: id,
70 | course: course
71 | });
72 | toastr.success("Course Added Successfully");
73 | // alert("Course Updated Successfully");
74 | setId("");
75 | setCourse("");
76 |
77 | Load();
78 | }
79 | catch(err){
80 | alert("Course Registration Failed");
81 | }
82 | }
83 |
84 | if(courses.length <= 0) return null;
85 |
86 | return (
87 |
88 |
89 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
Courses
118 | {/* Add Student */}
119 | New
120 |
121 |
122 |
123 |
124 |
125 |
126 | | ID |
127 | Course |
128 | Edit |
129 | Delete |
130 |
131 |
132 |
133 | {courses.map((course) => (
134 |
135 | | {course.id} |
136 | {course.course} |
137 |
138 |
139 |
146 | |
147 |
148 |
155 | |
156 |
157 | ))}
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 | );
168 | }
169 |
170 | export default Course;
171 |
--------------------------------------------------------------------------------
/project/HR/views/education_view.py:
--------------------------------------------------------------------------------
1 | from django.views.decorators.csrf import csrf_exempt
2 | from rest_framework.parsers import JSONParser
3 | from django.http.response import JsonResponse
4 | from HR.serializer import educationSerializer, UniversitySerializer, DegreeSerializer, FacultySerializer, MajorSerializer
5 | from HR.models.education import Education, University, Degree, Faculty, Major
6 |
7 | # Create your views here.
8 |
9 | @csrf_exempt
10 | def educationApi(request, id=0):
11 | if request.method == 'GET':
12 | # Get all Education Data
13 | educations = Education.objects.all()
14 | education_serializer = educationSerializer(educations, many=True)
15 | return JsonResponse(education_serializer.data, safe=False)
16 |
17 | elif request.method == 'POST':
18 | # Add a new Education record
19 | education_data = JSONParser().parse(request)
20 | education_serializer = educationSerializer(data=education_data)
21 | if education_serializer.is_valid():
22 | education_serializer.save()
23 | return JsonResponse("Data Added Successfully", safe=False)
24 | return JsonResponse("Failed to Add", safe=False)
25 |
26 | elif request.method == "PUT":
27 | # Update an existing Education record
28 | education_data = JSONParser().parse(request)
29 | try:
30 | education = Education.objects.get(id=id)
31 | except Education.DoesNotExist:
32 | return JsonResponse("Education not found", safe=False, status=404)
33 |
34 | education_serializer = educationSerializer(education, data=education_data)
35 | if education_serializer.is_valid():
36 | education_serializer.save()
37 | return JsonResponse("Updated Successfully", safe=False)
38 | return JsonResponse("Failed to Update", safe=False)
39 |
40 | elif request.method == "DELETE":
41 | # Delete an Education Data
42 | try:
43 | education = Education.objects.get(id=id)
44 | except Education.DoesNotExist:
45 | return JsonResponse("Employee not found", safe=False, status=404)
46 |
47 | education.delete()
48 | return JsonResponse("Deleted Successfully", safe=False)
49 |
50 | @csrf_exempt
51 | def universityApi(request,id=0):
52 | if request.method=='GET':
53 | university = University.objects.all()
54 | university_serializer=UniversitySerializer(university,many=True)
55 | return JsonResponse(university_serializer.data,safe=False)
56 | elif request.method=='POST':
57 | university_data=JSONParser().parse(request)
58 | university_serializer=UniversitySerializer(data=university_data)
59 | if university_serializer.is_valid():
60 | university_serializer.save()
61 | return JsonResponse("Student Added Successfully",safe=False)
62 | return JsonResponse("Failed to Add",safe=False)
63 | elif request.method=="PUT":
64 | university_data=JSONParser().parse(request)
65 | university=University.objects.get(id=id)
66 | university_serializer=UniversitySerializer(university,data=university_data)
67 | if university_serializer.is_valid():
68 | university_serializer.save()
69 | return JsonResponse("Updated Successfully",safe=False)
70 | return JsonResponse("Failed to Update")
71 | elif request.method=="DELETE":
72 | university=university.objects.get(id=id)
73 | university.delete()
74 | return JsonResponse("Deleted Successfully",safe=False)
75 |
76 | @csrf_exempt
77 | def degreeApi(request,id=0):
78 | if request.method=='GET':
79 | degree = Degree.objects.all()
80 | degree_serializer=DegreeSerializer(degree,many=True)
81 | return JsonResponse(degree_serializer.data,safe=False)
82 | elif request.method=='POST':
83 | degree_data=JSONParser().parse(request)
84 | degree_serializer=DegreeSerializer(data=degree_data)
85 | if degree_serializer.is_valid():
86 | degree_serializer.save()
87 | return JsonResponse("Student Added Successfully",safe=False)
88 | return JsonResponse("Failed to Add",safe=False)
89 | elif request.method=="PUT":
90 | degree_data=JSONParser().parse(request)
91 | degree=Degree.objects.get(id=id)
92 | degree_serializer=DegreeSerializer(degree,data=degree_data)
93 | if degree_serializer.is_valid():
94 | degree_serializer.save()
95 | return JsonResponse("Updated Successfully",safe=False)
96 | return JsonResponse("Failed to Update")
97 | elif request.method=="DELETE":
98 | student=Degree.objects.get(id=id)
99 | student.delete()
100 | return JsonResponse("Deleted Successfully",safe=False)
101 | @csrf_exempt
102 | def facultyApi(request,id=0):
103 | if request.method=='GET':
104 | faculty = Faculty.objects.all()
105 | faculty_serializer=FacultySerializer(faculty,many=True)
106 | return JsonResponse(faculty_serializer.data,safe=False)
107 | elif request.method=='POST':
108 | faculty_data=JSONParser().parse(request)
109 | faculty_serializer=FacultySerializer(data=faculty_data)
110 | if faculty_serializer.is_valid():
111 | faculty_serializer.save()
112 | return JsonResponse("Student Added Successfully",safe=False)
113 | return JsonResponse("Failed to Add",safe=False)
114 | elif request.method=="PUT":
115 | faculty_data=JSONParser().parse(request)
116 | faculty=Faculty.objects.get(id=id)
117 | faculty_serializer=FacultySerializer(faculty,data=faculty_data)
118 | if faculty_serializer.is_valid():
119 | faculty_serializer.save()
120 | return JsonResponse("Updated Successfully",safe=False)
121 | return JsonResponse("Failed to Update")
122 | elif request.method=="DELETE":
123 | faculty=Faculty.objects.get(id=id)
124 | faculty.delete()
125 | return JsonResponse("Deleted Successfully",safe=False)
126 |
127 | @csrf_exempt
128 | def majorApi(request,id=0):
129 | if request.method=='GET':
130 | major = Major.objects.all()
131 | major_serializer=MajorSerializer(major,many=True)
132 | return JsonResponse(major_serializer.data,safe=False)
133 | elif request.method=='POST':
134 | major_data=JSONParser().parse(request)
135 | major_serializer=MajorSerializer(data=major_data)
136 | if major_serializer.is_valid():
137 | major_serializer.save()
138 | return JsonResponse("Student Added Successfully",safe=False)
139 | return JsonResponse("Failed to Add",safe=False)
140 | elif request.method=="PUT":
141 | major_data=JSONParser().parse(request)
142 | major=Major.objects.get(id=id)
143 | major_serializer=MajorSerializer(major_data=major_data)
144 | if major_serializer.is_valid():
145 | major_serializer.save()
146 | return JsonResponse("Updated Successfully",safe=False)
147 | return JsonResponse("Failed to Update")
148 | elif request.method=="DELETE":
149 | major=Major.objects.get(id=id)
150 | major.delete()
151 | return JsonResponse("Deleted Successfully",safe=False)
152 |
--------------------------------------------------------------------------------
/frontend/src/pages/Student.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import {useEffect, useState } from "react";
3 | import { ToastContainer, toast } from 'react-toastify';
4 | import 'react-toastify/dist/ReactToastify.css';
5 |
6 | function Student() {
7 | const [id, setId] = useState('');
8 | const [name, setName] = useState('');
9 | const [last_name, setLastName] = useState('');
10 | const [father_name, setFatherName] = useState('');
11 | const [course, setCourse] = useState('');
12 | const [address, setAddress] = useState('');
13 | const [fee, setFee] = useState('');
14 | const [students, setUsers] = useState([]);
15 | useEffect(() =>{
16 | (async()=>await Load())();
17 | }, []);
18 |
19 | async function Load(){
20 | const result = await axios.get(
21 | "http://127.0.0.1:8000/student/");
22 | setUsers(result.data);
23 | console.log(result.data);
24 | }
25 |
26 | async function save(event){
27 | event.preventDefault();
28 | try{
29 | await axios.post("http://127.0.0.1:8000/student/",{
30 | id: id,
31 | name: name,
32 | last_name: last_name,
33 | father_name: father_name,
34 | course: course,
35 | address: address,
36 | fee: fee
37 | });
38 | toast.success("Record Registered Successfully");
39 |
40 | setId("");
41 | setName("");
42 | setLastName("");
43 | setFatherName("");
44 | setCourse("");
45 | setAddress("");
46 | setFee("");
47 | Load();
48 | }
49 | catch(err){
50 | // alert("Student Registration Failed");
51 | toast.error("Student Registration Failed");
52 | }
53 | }
54 |
55 | async function editStudent(students){
56 | setName(students.name);
57 | setLastName(students.last_name);
58 | setFatherName(students.father_name);
59 | setCourse(students.course);
60 | setAddress(students.address);
61 | setFee(students.fee);
62 | setId(students.id);
63 | }
64 |
65 | async function DeleteStudent(id){
66 | await axios.delete("http://127.0.0.1:8000/student/"+id);
67 | toast.info("Student Deleted Successfully");
68 | Load();
69 | }
70 |
71 | async function update(event){
72 | event.preventDefault();
73 | try{
74 | await axios.put("http://127.0.0.1:8000/student/" + students.find(u => u.id === id).id || id,{
75 | id: id,
76 | name: name,
77 | last_name: last_name,
78 | father_name: father_name,
79 | course: course,
80 | address: address,
81 | fee: fee
82 | });
83 | toast.info("Record updated Successfully");
84 |
85 | setId("");
86 | setName("");
87 | setLastName("");
88 | setFatherName("");
89 | setCourse("");
90 | setAddress("");
91 | setFee("");
92 | Load();
93 | }
94 | catch(err){
95 |
96 | toast.error("Student Registration Failed");
97 | }
98 | }
99 |
100 | if(students.length <= 0) return null;
101 |
102 | return (
103 |
104 |
105 |
167 |
168 |
169 |
170 |
171 |
172 | | ID |
173 | Name |
174 | Last Name |
175 | Father Name |
176 | Course |
177 | Address |
178 | Student Fee |
179 | Edit |
180 | Delete |
181 |
182 |
183 |
184 | {students.map((student) => (
185 |
186 | | {student.id} |
187 | {student.name} |
188 | {student.last_name} |
189 | {student.father_name} |
190 | {student.course} |
191 | {student.address} |
192 | {student.fee} |
193 |
194 |
201 | |
202 |
203 |
210 | |
211 |
212 | ))}
213 |
214 |
215 |
216 |
217 |
218 |
219 | );
220 | }
221 |
222 | export default Student;
223 |
--------------------------------------------------------------------------------
/frontend/src/pages/Exam.jsx:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import { Link } from 'react-router-dom';
3 | import {useEffect, useState } from "react";
4 | import { ToastContainer, toast } from 'react-toastify';
5 | import 'react-toastify/dist/ReactToastify.css';
6 | import toastr from 'toastr';
7 | import 'toastr/build/toastr.min.css';
8 | import Swal from 'sweetalert2'; // Import SweetAlert2
9 |
10 | function HR_Employee() {
11 | const [id, setId] = useState('');
12 | const [full_name, setFull_Name] = useState('');
13 | const [last_name, setLast_Name] = useState('');
14 | // const [father_name, setFater_Name] = useState('');
15 | // const [grand_father_name, setGrand_Father_Name] = useState('');
16 | // const [date_of_birth, setDate_Of_Birth] = useState('');
17 | // const [placce_of_birth, setPlace_Of_Birth] = useState('');
18 | // const [gender, setGender] = useState('');
19 | // const [natinality, setNationality] = useState('');
20 | // const [degree, setDegree] = useState('');
21 | // const [gederal_directorate, setGeneral_Directorate] = useState('');
22 | // const [directorate, setDirectorate] = useState('');
23 | // const [head, setHead] = useState('');
24 | // const [job_position, setJob_Position] = useState('');
25 | // const [remarks, setRemarks] = useState([]);
26 | // const [blood_group, setBlood_Group] = useState('');
27 | // const [marital_status, setMarital_Status] = useState('');
28 | // const [religion, setReligion] = useState('');
29 | const [employees, setEmployee] = useState([]);
30 |
31 | useEffect(() =>{
32 | (async()=>await Load())();
33 | }, []);
34 |
35 |
36 | async function Load(){
37 | const result = await axios.get(
38 | "http://127.0.0.1:8000/employee/");
39 | setEmployee(result.data);
40 | console.log(result.data);
41 | }
42 |
43 | async function save(event){
44 | event.preventDefault();
45 | try{
46 | await axios.post("http://127.0.0.1:8000/employee/",{
47 | id: id,
48 | full_name: full_name,
49 | last_name: last_name
50 | });
51 | // alert("This is not enogh");
52 | Swal.fire('Success!', 'Record Updated Successfully', 'success');
53 | toast.success("Course Added Successfully");
54 | toastr.success("Course Added Successfully");
55 |
56 | setId("");
57 | setFull_Name("");
58 | setLast_Name("");
59 | Load();
60 | }
61 | catch(err){
62 | // alert("Course Registration Failed");
63 | // toast.error("Record Registered failed");
64 | toastr.error("Course Registration Failed");
65 | }
66 | }
67 |
68 | async function editStudent(employees){
69 | setFull_Name(employees.full_name);
70 | setLast_Name(employees.last_name);
71 | setId(employees.id);
72 | }
73 |
74 | async function DeleteStudent(id){
75 | await axios.delete("http://127.0.0.1:8000/employee/"+id);
76 | // alert("Course Deleted Successfully");
77 | toast.error("Course Deleted Successfully");
78 |
79 | Load();
80 | }
81 |
82 | async function update(event){
83 | event.preventDefault();
84 | try{
85 | await axios.put("http://127.0.0.1:8000/employee/" + employees.find(u => u.id === id).id || id,{
86 | id: id,
87 | full_name: full_name,
88 | last_name: last_name
89 | });
90 | toast.success("Course Updated Successfully");
91 | setId("");
92 | setFull_Name("");
93 | setLast_Name("");
94 | Load();
95 | }
96 | catch(err){
97 | toast.error("Course Registration Failed");
98 | }
99 | }
100 |
101 | // if(employees.length <= 0) return null;
102 |
103 | return (
104 |
105 |
106 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
Employee
143 | {/* Add Student */}
144 | New
145 |
146 |
147 |
148 |
149 |
150 |
151 | | ID |
152 | Course |
153 | Fee |
154 | Edit |
155 | Delete |
156 |
157 |
158 |
159 | {employees.map((employee) => (
160 |
161 | | {employee.id} |
162 | {employee.full_name} |
163 | {employee.last_name} |
164 |
165 |
172 | |
173 |
174 |
181 | |
182 |
183 | ))}
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | );
194 | }
195 |
196 | export default HR_Employee;
197 |
--------------------------------------------------------------------------------