├── backend ├── HR │ ├── __init__.py │ ├── views │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-311.pyc │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── major_view.cpython-312.pyc │ │ │ ├── address_view.cpython-311.pyc │ │ │ ├── address_view.cpython-312.pyc │ │ │ ├── course_view.cpython-311.pyc │ │ │ ├── course_view.cpython-312.pyc │ │ │ ├── degree_view.cpython-312.pyc │ │ │ ├── employee_view.cpython-311.pyc │ │ │ ├── employee_view.cpython-312.pyc │ │ │ ├── faculty_view.cpython-312.pyc │ │ │ ├── health_view.cpython-311.pyc │ │ │ ├── health_view.cpython-312.pyc │ │ │ ├── student_view.cpython-311.pyc │ │ │ ├── student_view.cpython-312.pyc │ │ │ ├── department_view.cpython-312.pyc │ │ │ ├── education_view.cpython-311.pyc │ │ │ ├── education_view.cpython-312.pyc │ │ │ ├── experience_view.cpython-311.pyc │ │ │ ├── experience_view.cpython-312.pyc │ │ │ ├── university_view.cpython-312.pyc │ │ │ ├── hr_employee_view.cpython-312.pyc │ │ │ ├── organization_view.cpython-311.pyc │ │ │ └── organization_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 │ ├── migrations │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-311.pyc │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── 0003_major.cpython-312.pyc │ │ │ ├── 0001_initial.cpython-311.pyc │ │ │ ├── 0001_initial.cpython-312.pyc │ │ │ ├── 0002_employee.cpython-312.pyc │ │ │ ├── 0004_health.cpython-312.pyc │ │ │ ├── 0002_hr_employee.cpython-312.pyc │ │ │ ├── 0002_remove_province_test.cpython-311.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 │ │ │ ├── 0003_rename_title_degree_name.cpython-311.pyc │ │ │ ├── 0003_rename_title_degree_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 │ │ └── 0003_rename_title_degree_name.py │ ├── tests.py │ ├── __pycache__ │ │ ├── apps.cpython-311.pyc │ │ ├── apps.cpython-312.pyc │ │ ├── admin.cpython-311.pyc │ │ ├── admin.cpython-312.pyc │ │ ├── __init__.cpython-311.pyc │ │ ├── __init__.cpython-312.pyc │ │ ├── serializer.cpython-311.pyc │ │ └── serializer.cpython-312.pyc │ ├── models │ │ ├── __pycache__ │ │ │ ├── exam.cpython-312.pyc │ │ │ ├── Health.cpython-311.pyc │ │ │ ├── Student.cpython-311.pyc │ │ │ ├── address.cpython-311.pyc │ │ │ ├── address.cpython-312.pyc │ │ │ ├── country.cpython-312.pyc │ │ │ ├── course.cpython-311.pyc │ │ │ ├── course.cpython-312.pyc │ │ │ ├── health.cpython-312.pyc │ │ │ ├── reward.cpython-312.pyc │ │ │ ├── student.cpython-312.pyc │ │ │ ├── __init__.cpython-311.pyc │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── district.cpython-312.pyc │ │ │ ├── document.cpython-312.pyc │ │ │ ├── education.cpython-311.pyc │ │ │ ├── education.cpython-312.pyc │ │ │ ├── employee.cpython-311.pyc │ │ │ ├── employee.cpython-312.pyc │ │ │ ├── property.cpython-312.pyc │ │ │ ├── province.cpython-312.pyc │ │ │ ├── training.cpython-312.pyc │ │ │ ├── department.cpython-311.pyc │ │ │ ├── department.cpython-312.pyc │ │ │ ├── experience.cpython-311.pyc │ │ │ ├── experience.cpython-312.pyc │ │ │ ├── hr_employee.cpython-312.pyc │ │ │ ├── organization.cpython-311.pyc │ │ │ ├── organization.cpython-312.pyc │ │ │ └── publication.cpython-312.pyc │ │ ├── department.py │ │ ├── course.py │ │ ├── organization.py │ │ ├── Health.py │ │ ├── abc.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 │ │ ├── punishment.py │ │ ├── appraisal.py │ │ ├── document.py │ │ ├── employee.py │ │ ├── guarantee.py │ │ ├── relative.py │ │ ├── retirement.py │ │ └── experience.py │ ├── apps.py │ ├── admin.py │ └── serializer.py ├── config │ ├── __init__.py │ ├── __pycache__ │ │ ├── urls.cpython-311.pyc │ │ ├── urls.cpython-312.pyc │ │ ├── wsgi.cpython-311.pyc │ │ ├── wsgi.cpython-312.pyc │ │ ├── __init__.cpython-311.pyc │ │ ├── __init__.cpython-312.pyc │ │ ├── settings.cpython-311.pyc │ │ └── settings.cpython-312.pyc │ ├── asgi.py │ ├── wsgi.py │ ├── settings.py │ └── urls.py ├── db.sqlite3 └── manage.py ├── frontend ├── src │ ├── pages │ │ ├── OOP-Code.jsx │ │ ├── Contact.jsx │ │ ├── About.jsx │ │ ├── Home.jsx │ │ ├── Translation.jsx │ │ ├── Step.jsx │ │ ├── Grade.jsx │ │ ├── Major.jsx │ │ ├── Status.jsx │ │ ├── Department.jsx │ │ ├── OrganizationType.jsx │ │ ├── Faculty.jsx │ │ ├── Health.jsx │ │ ├── JobPosition.jsx │ │ ├── University.jsx │ │ └── Course.jsx │ ├── locals │ │ ├── fr │ │ │ └── translation.json │ │ └── en │ │ │ └── translation.json │ ├── setupTests.js │ ├── App.test.js │ ├── components │ │ ├── Employeeinfo.jsx │ │ ├── import.jsx │ │ ├── Titlebar.jsx │ │ └── Sidebar.css │ ├── index.css │ ├── reportWebVitals.js │ ├── functions │ │ ├── store.jsx │ │ ├── excel.jsx │ │ ├── dataLoader.jsx │ │ ├── dataLoaders.jsx │ │ └── crudService.jsx │ ├── index.js │ ├── Dashboard.css │ ├── App.css │ ├── i18n │ │ └── i18n.js │ ├── stable_index.js │ ├── logo.svg │ └── router │ │ └── index.js ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── index.html ├── .gitignore ├── package.json └── README.md ├── README.md ├── Pipfile └── Pipfile.lock /backend/HR/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/HR/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/HR/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/pages/OOP-Code.jsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/HR/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /frontend/src/locals/fr/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome_message": "به برنامه خوش آمدید!" 3 | } -------------------------------------------------------------------------------- /backend/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/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/HRMS-Project/HEAD/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/frontend/public/logo192.png -------------------------------------------------------------------------------- /frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/frontend/public/logo512.png -------------------------------------------------------------------------------- /frontend/src/locals/en/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome_message": "Welcome to the application!" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HRMS Project in React js. Django using API. this project is for storing all detailed data about an employee in an organization 2 | -------------------------------------------------------------------------------- /backend/HR/__pycache__/apps.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/apps.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/__pycache__/apps.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/apps.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/__pycache__/admin.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/admin.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/__pycache__/admin.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/admin.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/urls.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/urls.cpython-311.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/urls.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/urls.cpython-312.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/wsgi.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/wsgi.cpython-311.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/wsgi.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/wsgi.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/__pycache__/serializer.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/serializer.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/__pycache__/serializer.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/__pycache__/serializer.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/exam.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/exam.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/Health.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/Health.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/Student.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/Student.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/address.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/address.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/address.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/address.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/country.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/country.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/course.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/course.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/course.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/course.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/health.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/health.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/reward.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/reward.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/student.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/student.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/settings.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/settings.cpython-311.pyc -------------------------------------------------------------------------------- /backend/config/__pycache__/settings.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/config/__pycache__/settings.cpython-312.pyc -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/district.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/district.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/document.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/document.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/education.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/education.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/education.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/education.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/employee.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/employee.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/employee.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/employee.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/property.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/property.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/province.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/province.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/training.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/training.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/major_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/major_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/__init__.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/__init__.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/department.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/department.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/department.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/department.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/experience.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/experience.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/experience.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/experience.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/hr_employee.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/hr_employee.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/organization.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/organization.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/organization.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/organization.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/models/__pycache__/publication.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/models/__pycache__/publication.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/address_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/address_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/address_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/address_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/course_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/course_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/course_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/course_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/degree_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/degree_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/employee_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/employee_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/employee_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/employee_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/faculty_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/faculty_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/health_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/health_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/health_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/health_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/student_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/student_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/student_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/student_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0003_major.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0003_major.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/department_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/department_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/education_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/education_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/education_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/education_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/experience_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/experience_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/experience_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/experience_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/university_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/university_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0001_initial.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0001_initial.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0001_initial.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0001_initial.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0002_employee.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0002_employee.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0004_health.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0004_health.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/hr_employee_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/hr_employee_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/organization_view.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/organization_view.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/views/__pycache__/organization_view.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/views/__pycache__/organization_view.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0002_hr_employee.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0002_hr_employee.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0002_remove_province_test.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0002_remove_province_test.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0002_remove_province_test.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0002_remove_province_test.cpython-312.pyc -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0004_alter_education_major.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0004_alter_education_major.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0008_alter_district_province.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0008_alter_district_province.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0002_rename_course_course_name.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0002_rename_course_course_name.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0003_rename_title_degree_name.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0003_rename_title_degree_name.cpython-311.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0003_rename_title_degree_name.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0003_rename_title_degree_name.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0004_rename_hr_employee_employee.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0004_rename_hr_employee_employee.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0007_district_province_province_country.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0007_district_province_province_country.cpython-312.pyc -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0003_remove_hr_employee_blood_group_and_more.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0003_remove_hr_employee_blood_group_and_more.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0006_rename_organizationtpye_organizationtype.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/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; -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0006_delete_experience_remove_course_fee_and_more.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0006_delete_experience_remove_course_fee_and_more.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0009_alter_district_province_alter_province_country.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0009_alter_district_province_alter_province_country.cpython-312.pyc -------------------------------------------------------------------------------- /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 | 11 | export default About; 12 | -------------------------------------------------------------------------------- /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; -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0005_country_degree_experience_faculty_university_and_more.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0005_country_degree_experience_faculty_university_and_more.cpython-312.pyc -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0003_alter_employee_degree_alter_employee_directorate_and_more.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/HR/migrations/__pycache__/0003_alter_employee_degree_alter_employee_directorate_and_more.cpython-312.pyc -------------------------------------------------------------------------------- /backend/HR/migrations/__pycache__/0005_department_district_grade_jobposition_organization_and_more.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nasratullah-Shafiq/HRMS-Project/HEAD/backend/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 | -------------------------------------------------------------------------------- /frontend/src/components/Employeeinfo.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | function EmployeeInfo() { 4 | return ( 5 |
6 |

Employee Information

7 |

This is the Employee Information page.

8 |
9 | ); 10 | } 11 | 12 | export default EmployeeInfo; -------------------------------------------------------------------------------- /backend/HR/models/abc.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | # Create your models here. 3 | 4 | 5 | 6 | class abc(models.Model): 7 | name = models.CharField(max_length=10) 8 | fees = models.CharField(max_length=10) 9 | 10 | def __str__(self): 11 | return self.name 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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) -------------------------------------------------------------------------------- /backend/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) -------------------------------------------------------------------------------- /backend/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/.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /backend/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) -------------------------------------------------------------------------------- /backend/config/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', 'config.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /backend/HR/migrations/0003_rename_title_degree_name.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.1 on 2024-09-17 07:32 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('HR', '0002_remove_province_test'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='degree', 15 | old_name='title', 16 | new_name='name', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /backend/config/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 | -------------------------------------------------------------------------------- /frontend/src/functions/store.jsx: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | // Generic save function 4 | export async function saveData(event, endpoint, data, load, toast, reset) { 5 | event.preventDefault(); 6 | try { 7 | await axios.post(`http://127.0.0.1:8000/${endpoint}/`, data); 8 | toast.success(`${endpoint} registered successfully`); 9 | reset(); // Clear form 10 | load(); // Reload data 11 | } catch (err) { 12 | toast.error(`Failed to register ${endpoint}`); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /backend/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) -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import { BrowserRouter } from 'react-router-dom'; // Import BrowserRouter 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | import './Dashboard.css'; // Ensure this is imported if needed 7 | 8 | const root = ReactDOM.createRoot(document.getElementById('root')); 9 | 10 | root.render( 11 | // 12 | 13 | 14 | 15 | // 16 | ); 17 | 18 | // If you want to measure performance, pass a function to log results 19 | reportWebVitals(); -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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', 'config.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 | -------------------------------------------------------------------------------- /backend/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/src/Dashboard.css: -------------------------------------------------------------------------------- 1 | /* General Styles */ 2 | .dashboard { 3 | padding: 20px; 4 | text-align: center; 5 | } 6 | 7 | h1 { 8 | margin-bottom: 20px; 9 | } 10 | 11 | /* Grid Container */ 12 | .grid-container { 13 | display: grid; 14 | grid-template-columns: repeat(4, 1fr); /* 4 columns */ 15 | gap: 20px; /* Space between grid items */ 16 | } 17 | 18 | /* Grid Items */ 19 | .grid-item { 20 | border: 1px solid #ccc; 21 | border-radius: 8px; 22 | padding: 15px; 23 | background-color: #f9f9f9; 24 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 25 | cursor: pointer; 26 | transition: transform 0.2s, box-shadow 0.2s; 27 | } 28 | 29 | .grid-item:hover { 30 | transform: translateY(-5px); 31 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 32 | } 33 | 34 | /* Icon Styles */ 35 | h2 svg { 36 | margin-right: 10px; 37 | } -------------------------------------------------------------------------------- /frontend/src/functions/excel.jsx: -------------------------------------------------------------------------------- 1 | 2 | function exportToExcel(event) { 3 | event.preventDefault(); // Prevent default behavior 4 | 5 | // Filter the selected degrees 6 | const selectedDegrees = degrees.filter((degree) => 7 | checkedDegrees.includes(degree.id) 8 | ); 9 | 10 | if (selectedDegrees.length === 0) { 11 | toast.error("No degrees selected for export."); 12 | return; 13 | } 14 | 15 | // Prepare the data for Excel 16 | const excelData = selectedDegrees.map((degree) => ({ 17 | ID: degree.id, 18 | Name: degree.name, 19 | })); 20 | 21 | // Create a new workbook and worksheet 22 | const worksheet = XLSX.utils.json_to_sheet(excelData); 23 | const workbook = XLSX.utils.book_new(); 24 | XLSX.utils.book_append_sheet(workbook, worksheet, "Degrees"); 25 | 26 | // Generate Excel file and trigger download 27 | XLSX.writeFile(workbook, "Selected_Degrees.xlsx"); 28 | } 29 | export default exportToExcel; -------------------------------------------------------------------------------- /frontend/src/functions/dataLoader.jsx: -------------------------------------------------------------------------------- 1 | // dataLoader.jsx 2 | 3 | import axios from 'axios'; 4 | 5 | export async function loadData(endpoint, toast) { 6 | try { 7 | const result = await axios.get(`http://127.0.0.1:8000/${endpoint}/`); 8 | return result.data; 9 | } catch (err) { 10 | toast.error('Error fetching Data:', err); 11 | throw err; // Rethrow to handle it in the component 12 | } 13 | } 14 | 15 | 16 | // Save all data via this function 17 | // async function saveData(event, endpoint) { 18 | // event.preventDefault(); 19 | // try { 20 | // await axios.post(`http://127.0.0.1:8000/${endpoint}/`, { 21 | // id: id, 22 | // // name: name 23 | // }); 24 | // toastr.success("Record Registered Successfully"); 25 | // setId(""); 26 | // setName(""); 27 | // loadData(); 28 | // } catch (err) { 29 | // toastr.error("Faculty Registration Failed"); 30 | // } 31 | // } 32 | -------------------------------------------------------------------------------- /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 | 40 | 41 | 42 | 43 | 44 | .App { 45 | text-align: center; 46 | padding: 20px; 47 | } 48 | 49 | h1 { 50 | margin-bottom: 20px; 51 | } 52 | 53 | div { 54 | margin-bottom: 15px; 55 | padding: 10px; 56 | border: 1px solid #ccc; 57 | border-radius: 5px; 58 | } -------------------------------------------------------------------------------- /frontend/src/components/import.jsx: -------------------------------------------------------------------------------- 1 | // imports.js - Centralized imports 2 | 3 | // React imports 4 | import React, { useEffect, useState } from 'react'; 5 | 6 | // React Router imports 7 | import { Link } from 'react-router-dom'; 8 | 9 | // Axios for API calls 10 | import axios from 'axios'; 11 | 12 | // Toast notifications 13 | import { ToastContainer, toast } from 'react-toastify'; 14 | import 'react-toastify/dist/ReactToastify.css'; 15 | 16 | // PDF generation 17 | import jsPDF from 'jspdf'; 18 | 19 | //Import the xlsx library 20 | import * as XLSX from 'xlsx'; 21 | 22 | //Import toast message 23 | import toastr from 'toastr'; 24 | import 'toastr/build/toastr.min.css'; 25 | 26 | // import html2canvas from 'html2canvas'; 27 | import html2canvas from 'html2canvas'; 28 | 29 | // Import jsPDF's autoTable plugin 30 | import 'jspdf-autotable'; 31 | 32 | // Export everything as named exports 33 | export { 34 | React, 35 | useEffect, 36 | useState, 37 | Link, 38 | axios, 39 | toast, 40 | toastr, 41 | ToastContainer, 42 | jsPDF, 43 | XLSX, 44 | html2canvas 45 | }; 46 | -------------------------------------------------------------------------------- /backend/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/i18n/i18n.js: -------------------------------------------------------------------------------- 1 | // // src/i18n.js 2 | // import i18n from 'i18next'; 3 | // import { initReactI18next } from 'react-i18next'; 4 | // import enTranslation from '../locals/en/english.json'; 5 | // import frTranslation from '../locals/fr/dari.json'; 6 | // i18n.use(initReactI18next).init({ 7 | // resources: { 8 | // en: { translation: enTranslation }, 9 | // fr: { translation: frTranslation }, 10 | // }, 11 | // lng: 'en', // default language 12 | // fallbackLng: 'en', // fallback language if the selected language doesn't have translations 13 | // interpolation: { 14 | // escapeValue: false, // React already escapes by default 15 | // }, 16 | // }); 17 | 18 | // export default i18n; 19 | 20 | 21 | // src/i18n/i18n.js 22 | // import i18n from 'i18next'; 23 | // import { initReactI18next } from 'react-i18next'; 24 | // import en from '../locals/en/translation.json'; // Correct path 25 | // import fr from '../locals/fr/translation.json'; // Correct path 26 | 27 | // i18n.use(initReactI18next).init({ 28 | // resources: { 29 | // en: { translation: en }, 30 | // fr: { translation: fr }, 31 | // }, 32 | // // lng: localStorage.getItem('language') || 'en', // Default to saved language or English 33 | // fallbackLng: 'en', 34 | // interpolation: { 35 | // escapeValue: false, // React already escapes by default 36 | // }, 37 | // }); 38 | // export default i18n; 39 | -------------------------------------------------------------------------------- /backend/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 | name = models.CharField(max_length=50) 7 | 8 | def __str__(self): 9 | return self.name 10 | 11 | class University(models.Model): 12 | name = models.CharField(max_length=8) 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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | 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 | -------------------------------------------------------------------------------- /frontend/src/pages/Translation.jsx: -------------------------------------------------------------------------------- 1 | // // src/App.js 2 | // import React from 'react'; 3 | // import '../i18n/i18n'; // Import the i18n configuration 4 | 5 | // import { useTranslation } from 'react-i18next'; 6 | 7 | // export default function Translation() { 8 | // const { t, i18n } = useTranslation() 9 | 10 | // // Function to handle language change 11 | // const changeLanguage = (lng) => { 12 | // i18n.changeLanguage(lng); 13 | // }; 14 | 15 | // return ( 16 | //
17 | // 21 | //
{t('welcome_message')}
22 | //
23 | // ); 24 | // } 25 | 26 | 27 | 28 | // // // src/App.jsx 29 | // // import React, { useState, useEffect } from "react"; 30 | // // import { getTranslations } from '../i18n/i18n'; 31 | 32 | // // const App = () => { 33 | // // const [language, setLanguage] = useState("en"); // Default language 34 | // // const [translations, setTranslations] = useState(getTranslations(language)); 35 | 36 | // // // Update translations when the language changes 37 | // // useEffect(() => { 38 | // // setTranslations(getTranslations(language)); 39 | // // }, [language]); 40 | 41 | // // const handleLanguageChange = (event) => { 42 | // // setLanguage(event.target.value); // Update language state 43 | // // }; 44 | 45 | 46 | // // }; 47 | 48 | // // export default App; 49 | 50 | 51 | 52 | 53 | 54 | // // export default Translation; 55 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /frontend/src/components/Titlebar.jsx: -------------------------------------------------------------------------------- 1 | 2 | import { Link } from "react-router-dom"; 3 | 4 | function Titlebar(){ 5 | return( 6 | // 7 | // 8 | // {/* {isChecked && ( */} 9 | // 11 | // {isChecked && ( 12 | // 28 | // )} 29 | ) 30 | } 31 | export default Titlebar; -------------------------------------------------------------------------------- /frontend/src/functions/dataLoaders.jsx: -------------------------------------------------------------------------------- 1 | import { ToastContainer, toast } from 'react-toastify'; 2 | import 'react-toastify/dist/ReactToastify.css'; 3 | import toastr from 'toastr'; 4 | import 'toastr/build/toastr.min.css'; 5 | 6 | // dataLoaders.js 7 | import axios from 'axios'; 8 | 9 | 10 | // Function to save education data 11 | export async function saveEducation(data, stateSetters) { 12 | const { 13 | id, country, degree, university, faculty, major, education_start_date, education_end_date, batch_no,education_remarks 14 | } = data; // Destructure data object 15 | 16 | const { 17 | setId, setCountryId, setUniversityId, setFacultyId, setStartDate, setEndDate, setBatchNo, setRemarks,loadFunction 18 | } = stateSetters; // Destructure state setters 19 | 20 | try { 21 | await axios.post("http://127.0.0.1:8000/education/", { 22 | id, 23 | country, 24 | degree, 25 | university, 26 | faculty, 27 | major, 28 | education_start_date, 29 | education_end_date, 30 | batch_no, 31 | education_remarks 32 | }); 33 | 34 | toastr.success("Data Added Successfully"); 35 | 36 | // Reset the fields 37 | setId(""); 38 | setCountryId(""); 39 | setUniversityId(""); 40 | setFacultyId(""); 41 | setStartDate(""); 42 | setEndDate(""); 43 | setBatchNo(""); 44 | setRemarks(""); 45 | 46 | // Load updated data 47 | loadFunction(); 48 | } catch (err) { 49 | toastr.error("Course Registration Failed"); 50 | } 51 | } 52 | 53 | // Function to load Education data 54 | export async function loadEducation(setEducation) { 55 | try { 56 | const result = await axios.get("http://127.0.0.1:8000/education/"); 57 | setEducation(result.data); 58 | } catch (error) { 59 | console.error("Error loading Education:", error); 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@ant-design/icons": "^6.0.0", 7 | "@emotion/react": "^11.14.0", 8 | "@emotion/styled": "^11.14.0", 9 | "@fortawesome/free-regular-svg-icons": "^6.7.2", 10 | "@fortawesome/free-solid-svg-icons": "^6.7.2", 11 | "@fortawesome/react-fontawesome": "^0.2.2", 12 | "@mui/icons-material": "^7.0.2", 13 | "@mui/material": "^7.0.2", 14 | "@testing-library/jest-dom": "^5.17.0", 15 | "@testing-library/react": "^13.4.0", 16 | "@testing-library/user-event": "^13.5.0", 17 | "axios": "^1.7.4", 18 | "bootstrap-icons": "^1.11.3", 19 | "font-awesome": "^4.7.0", 20 | "html2canvas": "^1.4.1", 21 | "jspdf": "^2.5.2", 22 | "jspdf-autotable": "^3.8.3", 23 | "react": "^18.3.1", 24 | "react-dom": "^18.3.1", 25 | "react-icons": "^5.5.0", 26 | "react-router-dom": "^6.26.1", 27 | "react-scripts": "5.0.1", 28 | "react-toastify": "^10.0.5", 29 | "sweetalert2": "^11.17.2", 30 | "toastr": "^2.1.4", 31 | "web-vitals": "^2.1.4", 32 | "xlsx": "^0.18.5" 33 | }, 34 | "scripts": { 35 | "start": "react-scripts start", 36 | "build": "react-scripts build", 37 | "test": "react-scripts test", 38 | "eject": "react-scripts eject" 39 | }, 40 | "eslintConfig": { 41 | "extends": [ 42 | "react-app", 43 | "react-app/jest" 44 | ] 45 | }, 46 | "browserslist": { 47 | "production": [ 48 | ">0.2%", 49 | "not dead", 50 | "not op_mini all" 51 | ], 52 | "development": [ 53 | "last 1 chrome version", 54 | "last 1 firefox version", 55 | "last 1 safari version" 56 | ] 57 | }, 58 | "devDependencies": { 59 | "autoprefixer": "^10.4.21", 60 | "postcss": "^8.5.3", 61 | "tailwindcss": "^4.1.3" 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /backend/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}" -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /frontend/src/functions/crudService.jsx: -------------------------------------------------------------------------------- 1 | // services/crudService.js 2 | import axios from "axios"; 3 | import { toast } from "react-toastify"; 4 | 5 | const API_BASE = "http://127.0.0.1:8000"; 6 | // Load Records 7 | // export const loadRecords = async (endpoint, setData) => { 8 | // try { 9 | // const response = await axios.get(`${API_BASE}/${endpoint}/`); 10 | // setData(response.data); 11 | // } catch (err) { 12 | // toast.error("Failed to Load Records"); 13 | // } 14 | // }; 15 | 16 | export const loadRecord = async (endpoint) => { 17 | try { 18 | const response = await axios.get(`${API_BASE}/${endpoint}/`); 19 | return response.data; 20 | } catch (err) { 21 | toast.error("Failed to Load Records"); 22 | throw err; 23 | } 24 | }; 25 | 26 | 27 | export const saveRecord = async (endpoint, data, resetForm, toast) => { 28 | try { 29 | await axios.post(`${API_BASE}/${endpoint}/`, data); 30 | toast.success(`${endpoint} saved successfully`); 31 | resetForm(); 32 | // loadData(); 33 | } catch (err) { 34 | toast.error("Failed to Save Record"); 35 | } 36 | }; 37 | 38 | export const updateRecord = async (endpoint, id, data, resetForm, loadData) => { 39 | try { 40 | await axios.put(`${API_BASE}/${endpoint}/${id}`, data); 41 | toast.info(`${endpoint} Updated successfully`); 42 | resetForm(); 43 | loadData(); 44 | } catch (err) { 45 | toast.error("Failed to Update Record"); 46 | } 47 | }; 48 | 49 | export async function deleteRecord(endpoint, id, loadRecord, toast) { 50 | try { 51 | await axios.delete(`${API_BASE}/${endpoint}/${id}`); 52 | toast.warn(`${endpoint} deleted successfully`); 53 | loadRecord(); // Refresh data 54 | } catch (err) { 55 | toast.error(err?.response?.data?.message || `Failed to delete ${endpoint}`); 56 | } 57 | } 58 | 59 | // export const deleteRecord = async (endpoint, id, loadData) => { 60 | // try { 61 | // await axios.delete(`${API_BASE}/${endpoint}/${id}`); 62 | // toast.warn(`${endpoint} Deleted successfully`); 63 | // loadData(); 64 | // } catch (err) { 65 | // toast.error("Failed to Delete Record"); 66 | // } 67 | // }; 68 | -------------------------------------------------------------------------------- /backend/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 | -------------------------------------------------------------------------------- /frontend/src/stable_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 | import './i18n/i18n'; // Ensure i18n is initialized here 26 | // import { I18nextProvider } from 'react-i18next'; 27 | import i18n from './i18n/i18n'; // Import initialized i18n instance 28 | 29 | const root = ReactDOM.createRoot(document.getElementById('root')); 30 | root.render( 31 | // 32 | // 33 | 34 | // 35 | 36 | // 37 | ); 38 | 39 | 40 | // src/index.js 41 | // import React from 'react'; 42 | // import ReactDOM from 'react-dom/client'; 43 | // import reportWebVitals from './reportWebVitals'; 44 | // import App from './App'; 45 | // import './i18n/i18n'; // Initialize i18n 46 | // import { I18nextProvider } from 'react-i18next'; 47 | // import i18n from './i18n/i18n'; // Import i18n instance 48 | 49 | // const root = ReactDOM.createRoot(document.getElementById('root')); 50 | // root.render( 51 | // 52 | // 53 | // 54 | // 55 | // 56 | // ); 57 | 58 | // If you want to start measuring performance in your app, pass a function 59 | // to log results (for example: reportWebVitals(console.log)) 60 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 61 | // reportWebVitals(); 62 | 63 | -------------------------------------------------------------------------------- /backend/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/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 18 | 19 | 20 | 29 | 30 | 31 | React App 32 | 33 | 34 | 35 |
36 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /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/src/components/Sidebar.css: -------------------------------------------------------------------------------- 1 | /* .sidebar { 2 | width: 250px; 3 | height: 100vh; 4 | background-color: #f8f9fa; 5 | border-right: 1px solid #dee2e6; 6 | padding: 20px; 7 | box-sizing: border-box; 8 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 9 | } 10 | 11 | .sidebar-header { 12 | padding: 10px 0; 13 | margin-bottom: 20px; 14 | border-bottom: 1px solid #dee2e6; 15 | } 16 | 17 | .sidebar-header h2 { 18 | margin: 0; 19 | font-size: 1.5rem; 20 | color: #333; 21 | } 22 | 23 | .sidebar-section { 24 | margin-bottom: 25px; 25 | } 26 | 27 | .sidebar-subheader { 28 | margin: 15px 0 10px 0; 29 | font-size: 0.9rem; 30 | color: #6c757d; 31 | padding-left: 10px; 32 | font-weight: 600; 33 | } 34 | 35 | .sidebar-item { 36 | display: flex; 37 | align-items: center; 38 | padding: 10px; 39 | border-radius: 5px; 40 | cursor: pointer; 41 | transition: all 0.2s; 42 | margin-bottom: 5px; 43 | } 44 | 45 | .sidebar-item:hover { 46 | background-color: #e9ecef; 47 | } 48 | 49 | .sidebar-icon { 50 | margin-right: 10px; 51 | font-size: 16px; 52 | min-width: 24px; 53 | } 54 | 55 | 56 | .home-icon { color: #4e73df; } 57 | .education-icon { color: #1cc88a; } 58 | .experience-icon { color: #36b9cc; } 59 | .travel-icon { color: #f6c23e; } 60 | .exam-icon { color: #e74a3b; } 61 | .language-icon { color: #5a5c69; } 62 | .property-icon { color: #2e59d9; } 63 | .guarantee-icon { color: #17a673; } 64 | .documents-icon { color: #6f42c1; } 65 | .dashboard-icon { color: #fd7e14; } 66 | .orders-icon { color: #e83e8c; } 67 | .products-icon { color: #20c997; } 68 | .customers-icon { color: #6610f2; } 69 | 70 | .sidebar-item span { 71 | font-size: 0.95rem; 72 | color: #212529; 73 | } */ 74 | 75 | .sidebar { 76 | width: 280px; 77 | height: 100vh; 78 | position: fixed; 79 | left: 0; 80 | top: 0; 81 | box-shadow: 2px 0 5px rgba(0,0,0,0.1); 82 | } 83 | 84 | .nav-link { 85 | border-radius: 4px; 86 | margin-bottom: 2px; 87 | } 88 | 89 | .nav-link:hover { 90 | background-color: #e9ecef; 91 | } 92 | 93 | .nav-link.active { 94 | background-color: #0d6efd; 95 | color: white !important; 96 | } 97 | 98 | .bi { 99 | font-size: 1.1rem; 100 | } 101 | 102 | /* Active link styling */ 103 | .nav-link.active { 104 | background-color: #0d6efd; /* Bootstrap primary blue */ 105 | color: white !important; /* Force white text */ 106 | } 107 | 108 | /* Hover effect for all links */ 109 | .nav-link:hover:not(.active) { 110 | background-color: #e9ecef; /* Light gray */ 111 | } 112 | 113 | /* Icon color for active links */ 114 | .nav-link.active .bi { 115 | color: white !important; 116 | } -------------------------------------------------------------------------------- /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 TranslationData from '../pages/Translation.jsx'; 24 | 25 | // import OrganizationData from '../pages/Organization.jsx'; 26 | // import PropertyData from '../pages/Property.jsx'; 27 | // import PublicationData from '../pages/Publication.jsx'; 28 | // import PunishmentData from '../pages/Punishment.jsx'; 29 | // import RelativeData from '../pages/Relative.jsx'; 30 | // import TrainingData from '../pages/Training.jsx'; 31 | // import TravelData from '../pages/Travel.jsx'; 32 | // import RewardData from '../pages/Reward.jsx'; 33 | 34 | 35 | 36 | function MyRouter(){ 37 | return( 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 | } 73 | 74 | 75 | export default MyRouter; -------------------------------------------------------------------------------- /backend/config/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 = 'config.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 = 'config.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 | -------------------------------------------------------------------------------- /backend/config/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('major/', majorApi), # This handles requests to Major/" 43 | re_path(r'^major/([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 | ] -------------------------------------------------------------------------------- /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 |
78 |
79 | 80 | 81 | 82 | 83 |
84 | {setId(event.target.value); }}/> 87 | 88 |
89 | 90 |
91 | 92 | 93 |
94 | {setName(event.target.value);}}/> 96 |
97 |
98 |
99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | {steps.map((step) => ( 111 | 112 | 113 | 114 | 115 | 118 | 121 | 122 | ))} 123 | 124 |
ID Step Edit Delete
{step.id}{step.name} 116 | 117 | 119 | 120 |
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 |
78 |
79 | 80 | 81 | 82 | 83 |
84 | {setId(event.target.value); }}/> 87 | 88 |
89 | 90 |
91 | 92 | 93 |
94 | {setName(event.target.value);}}/> 96 |
97 |
98 |
99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | {majors.map((major) => ( 111 | 112 | 113 | 114 | 115 | 118 | 121 | 122 | ))} 123 | 124 |
ID Major Edit Delete
{major.id}{major.name} 116 | 117 | 119 | 120 |
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 |
78 |
79 | 80 | 81 | 82 | 83 |
84 | {setId(event.target.value); }}/> 87 | 88 |
89 | 90 |
91 | 92 | 93 |
94 | {setName(event.target.value);}}/> 96 |
97 |
98 |
99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | {majors.map((major) => ( 111 | 112 | 113 | 114 | 115 | 118 | 121 | 122 | ))} 123 | 124 |
ID Major Edit Delete
{major.id}{major.name} 116 | 117 | 119 | 120 |
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 |
78 |
79 | 80 | 81 | 82 | 83 |
84 | {setId(event.target.value); }}/> 87 | 88 |
89 | 90 |
91 | 92 | 93 |
94 | {setName(event.target.value);}}/> 96 |
97 |
98 |
99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | {statuss.map((status) => ( 111 | 112 | 113 | 114 | 115 | 118 | 121 | 122 | ))} 123 | 124 |
ID Status Edit Delete
{status.id}{status.name} 116 | 117 | 119 | 120 |
125 |
126 |
127 | ); 128 | } 129 | 130 | export default Status; 131 | -------------------------------------------------------------------------------- /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 | return ( 72 |
73 |
74 |
75 |
76 | 77 | 78 | 79 | 80 |
81 | {setId(event.target.value); }}/> 84 | 85 |
86 | 87 |
88 | 89 | 90 |
91 | {setName(event.target.value);}}/> 93 |
94 |
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | {departments.map((department) => ( 108 | 109 | 110 | 111 | 112 | 115 | 118 | 119 | ))} 120 | 121 |
ID Department Edit Delete
{department.id}{department.name} 113 | 114 | 116 | 117 |
122 |
123 |
124 | 125 | 126 | ); 127 | } 128 | 129 | export default Department; 130 | -------------------------------------------------------------------------------- /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 |
78 |
79 | 80 | 81 | 82 | 83 |
84 | {setId(event.target.value); }}/> 87 | 88 |
89 | 90 |
91 | 92 | 93 |
94 | {setName(event.target.value);}}/> 96 |
97 |
98 |
99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | {organization_types.map((organization_type) => ( 111 | 112 | 113 | 114 | 115 | 118 | 121 | 122 | ))} 123 | 124 |
ID Organization Type Edit Delete
{organization_type.id}{organization_type.name} 116 | 117 | 119 | 120 |
125 |
126 |
127 | 128 | 129 | ); 130 | } 131 | 132 | export default OrganizationType; 133 | -------------------------------------------------------------------------------- /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 | import { React, useEffect, useState, Link, axios, toast, toastr, jsPDF, XLSX } from '../components/import'; // Adjust path as needed 8 | import { loadData } from '../functions/dataLoader'; // Adjust path if necessary 9 | function Faculty() { 10 | const [id, setId] = useState(''); 11 | const [name, setName] = useState(''); 12 | const [facultys, setFaculty] = useState([]); 13 | 14 | const [degrees, setDegrees] = useState([]); 15 | const [error, setError] = useState(null); 16 | 17 | useEffect(() => { 18 | async function fetchDegrees() { 19 | try { 20 | const data = await loadData('faculty'); // Use the appropriate endpoint 21 | setFaculty(data); 22 | } catch (err) { 23 | setError('Failed to fetch degrees'); 24 | } 25 | } 26 | 27 | fetchDegrees(); // Call the function inside useEffect 28 | }, []); // Runs once on component mount 29 | 30 | async function save(event){ 31 | event.preventDefault(); 32 | try{ 33 | await axios.post("http://127.0.0.1:8000/faculty/",{ 34 | id: id, 35 | name: name 36 | }); 37 | toastr.success("Record Registered Successfully"); 38 | setId(""); 39 | setName(""); 40 | loadData(); 41 | } 42 | catch(err){ 43 | toast.error("Faculty Registration Failed"); 44 | } 45 | } 46 | 47 | async function editFaculty(facultys){ 48 | setName(facultys.name); 49 | setId(facultys.id); 50 | } 51 | 52 | async function DeleteFaculty(id){ 53 | await axios.delete("http://127.0.0.1:8000/faculty/"+id); 54 | toastr.error("Data Deleted Successfully"); 55 | loadData(); 56 | } 57 | 58 | async function update(event){ 59 | event.preventDefault(); 60 | try{ 61 | await axios.put("http://127.0.0.1:8000/faculty/" + facultys.find(u => u.id === id).id || id,{ 62 | id: id, 63 | name: name 64 | }); 65 | toastr.success("Record updated Successfully"); 66 | 67 | setId(""); 68 | setName(""); 69 | loadData(); 70 | } 71 | catch(err){ 72 | 73 | toast.error("Faculty Registration Failed"); 74 | } 75 | } 76 | 77 | // if(degrees.length <= 0) return null; 78 | 79 | return ( 80 |
81 |
82 |
83 |
84 | 85 | 86 | 87 | 88 |
89 | {setId(event.target.value); }}/> 92 | 93 |
94 | 95 |
96 | 97 | 98 |
99 | {setName(event.target.value);}}/> 101 |
102 |
103 |
104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | {facultys.map((faculty) => ( 117 | 118 | 119 | 120 | 121 | 124 | 127 | 128 | ))} 129 | 130 |
ID Faculty Edit Delete
{faculty.id}{faculty.name} 122 | 123 | 125 | 126 |
131 |
132 |
133 | 134 | 135 | ); 136 | } 137 | 138 | export default Faculty; 139 | -------------------------------------------------------------------------------- /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 |
88 |
89 | 90 | { 93 | setId(event.target.value); 94 | }}/> 95 | 96 |
97 | 98 |
99 | 100 |
101 | {setStatus(event.target.value);}}/> 103 |
104 |
105 | 106 |
107 | 108 |
109 | {setReport(event.target.value);}}/> 111 |
112 |
113 | 114 |
115 | 116 |
117 | {setRemark(event.target.value);}}/> 119 |
120 |
121 | 122 | 123 |
124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | {healths.map((health) => ( 139 | 140 | 141 | 142 | 143 | 144 | 145 | 154 | 163 | 164 | ))} 165 | 166 |
IDStatusReportRemarkEditDelete
{health.id}{health.status}{health.report}{health.remark} 146 | 153 | 155 | 162 |
167 |
168 |
169 | 170 | 171 | ); 172 | } 173 | 174 | export default Health; 175 | -------------------------------------------------------------------------------- /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 save(event) { 43 | event.preventDefault(); 44 | try { 45 | // Check if the name already exists in the database 46 | const response = await axios.get("http://127.0.0.1:8000/job-position/"); 47 | const existingData = response.data; 48 | 49 | // Check if the name already exists 50 | const isDuplicate = existingData.some((item) => item.name === name); 51 | 52 | if (isDuplicate) { 53 | toastr.warning("Duplicate Entry! This record already exists."); 54 | return; 55 | } 56 | 57 | // Proceed with saving if unique 58 | await axios.post("http://127.0.0.1:8000/job-position/", { 59 | id: id, 60 | name: name 61 | }); 62 | 63 | toastr.success("Record Registered Successfully"); 64 | 65 | setId(""); 66 | setName(""); 67 | Load(); 68 | } catch (err) { 69 | toastr.error("Registration Failed"); 70 | } 71 | } 72 | 73 | 74 | async function editJobPosition(job_positions){ 75 | setName(job_positions.name); 76 | setId(job_positions.id); 77 | } 78 | 79 | async function DeleteJobPosition(id){ 80 | await axios.delete("http://127.0.0.1:8000/job-position/"+id); 81 | toastr.error("Data Deleted Successfully"); 82 | Load(); 83 | } 84 | 85 | async function update(event){ 86 | event.preventDefault(); 87 | try{ 88 | await axios.put("http://127.0.0.1:8000/job-position/" + job_positions.find(u => u.id === id).id || id,{ 89 | id: id, 90 | name: name 91 | }); 92 | toastr.info("Record updated Successfully"); 93 | 94 | setId(""); 95 | setName(""); 96 | Load(); 97 | } 98 | catch(err){ 99 | 100 | toastr.error("Registration Failed"); 101 | } 102 | } 103 | return ( 104 |
105 |
106 |
107 |
108 | 109 | 110 | 111 | 112 |
113 | {setId(event.target.value); }}/> 116 | 117 |
118 | 119 |
120 | 121 | 122 |
123 | {setName(event.target.value);}}/> 125 |
126 |
127 |
128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | {job_positions.map((job_position) => ( 140 | 141 | 142 | 143 | 144 | 147 | 150 | 151 | ))} 152 | 153 |
ID Job Position Edit Delete
{job_position.id}{job_position.name} 145 | 146 | 148 | 149 |
154 |
155 |
156 | 157 | ); 158 | } 159 | 160 | export default JobPosition; 161 | -------------------------------------------------------------------------------- /backend/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) -------------------------------------------------------------------------------- /frontend/src/pages/University.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 Titlebar from '../components/Titlebar'; 9 | // import { deleteItem } from "../functions/delete"; 10 | // import { loadData } from '../functions/dataLoader'; 11 | import { loadRecord, saveRecord, deleteRecord } from "../functions/crudService"; 12 | import Titlebar from '../components/Titlebar'; 13 | 14 | 15 | function University() { 16 | const [id, setId] = useState(''); 17 | const [name, setName] = useState(''); 18 | const [universitys, setUniversity] = useState([]); 19 | const [isChecked, setIsChecked] = useState(false); // State to control visibility 20 | 21 | const resetForm = () => { 22 | setId(""); 23 | setName(""); 24 | }; 25 | 26 | // Function to handle checkbox change 27 | const handleCheckboxChange = (e) => { 28 | setIsChecked(e.target.checked); 29 | }; 30 | 31 | // useEffect(() => { 32 | // async function fetchUniversity() { 33 | // try { 34 | // const data = await loadRecord('university', toast); // Use the appropriate endpoint 35 | // setUniversity(data); 36 | // } catch (err) { 37 | // // setError('Failed to fetch degrees'); 38 | // } 39 | // } 40 | 41 | // fetchUniversity(); // Call the function inside useEffect 42 | // }, []); 43 | 44 | useEffect(() => { 45 | async function fetchUniversity() { 46 | // try { 47 | const data = await loadRecord('university', toast); 48 | setUniversity(data); 49 | // } catch (err) { 50 | // handle error if needed 51 | // } 52 | } 53 | 54 | fetchUniversity(); 55 | }, []); 56 | 57 | // useEffect(() =>{ 58 | // (async()=>await Load())(); 59 | // }, []); 60 | 61 | // async function Load(){ 62 | // const result = await axios.get( 63 | // "http://127.0.0.1:8000/university/"); 64 | // setUniversity(result.data); 65 | 66 | // } 67 | useEffect(() => { 68 | loadRecord('university'); 69 | }, []); 70 | 71 | const handleSave = (e) => { 72 | e.preventDefault(); 73 | saveRecord("university", { id, name }, resetForm, toast); 74 | }; 75 | 76 | 77 | async function editUniversity(universitys){ 78 | setName(universitys.name); 79 | setId(universitys.id); 80 | } 81 | 82 | // async function DeleteUniversity(id){ 83 | // await axios.delete("http://127.0.0.1:8000/university/"+id); 84 | // toastr.error("Data Deleted Successfully"); 85 | // Load(); 86 | // } 87 | const handleDelete = (id) => { 88 | if (window.confirm("Are you sure you want to delete this ?")) { 89 | deleteRecord("university", id, loadRecord, toast); 90 | } 91 | }; 92 | 93 | async function update(event){ 94 | event.preventDefault(); 95 | try{ 96 | await axios.put("http://127.0.0.1:8000/university/" + universitys.find(u => u.id === id).id || id,{ 97 | id: id, 98 | name: name 99 | }); 100 | toastr.info("Record updated Successfully"); 101 | 102 | setId(""); 103 | setName(""); 104 | // loadData(); 105 | } 106 | catch(err){ 107 | 108 | toast.error("University Registration Failed"); 109 | } 110 | } 111 | 112 | // if(degrees.length <= 0) return null; 113 | 114 | return ( 115 |
116 |
117 |
118 |
119 | 120 | 121 |
122 | {setId(event.target.value); }}/> 125 | 126 |
127 | 128 |
129 | 130 | 131 |
132 | {setName(event.target.value);}}/> 134 |
135 |
136 |
137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | {universitys.map((university) => ( 149 | 150 | {/* */} 151 | 152 | 153 | 154 | 159 | 160 | ))} 161 | 162 |
University Action
{university.id} {university.name} 155 | editUniversity(university)}> 156 | {/* // DeleteUniversity(university.id)}> */} 157 | handleDelete(university.id)}> 158 |
163 |
164 |
165 | 166 | 167 | ); 168 | } 169 | 170 | export default University; 171 | -------------------------------------------------------------------------------- /backend/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 | 27 | async function save(event){ 28 | event.preventDefault(); 29 | try{ 30 | await axios.post("http://127.0.0.1:8000/course/",{ 31 | id: id, 32 | course: course, 33 | fee: fee 34 | }); 35 | 36 | 37 | // alert("This is not enogh"); 38 | // Swal.fire('Success!', 'Record Updated Successfully', 'success'); 39 | // toast.success("Course Added Successfully"); 40 | toastr.success("Course Added Successfully"); 41 | 42 | 43 | setId(""); 44 | setCourse(""); 45 | setFee(""); 46 | Load(); 47 | } 48 | catch(err){ 49 | // alert("Course Registration Failed"); 50 | // toast.error("Record Registered failed"); 51 | toastr.error("Course Registration Failed"); 52 | } 53 | } 54 | 55 | async function editStudent(courses){ 56 | setCourse(courses.course); 57 | setFee(courses.fee); 58 | setId(courses.id); 59 | } 60 | 61 | async function DeleteStudent(id){ 62 | await axios.delete("http://127.0.0.1:8000/course/"+id); 63 | // alert("Course Deleted Successfully"); 64 | toast.error("Course Deleted Successfully"); 65 | 66 | Load(); 67 | } 68 | 69 | async function update(event){ 70 | event.preventDefault(); 71 | try{ 72 | await axios.put("http://127.0.0.1:8000/course/" + courses.find(u => u.id === id).id || id,{ 73 | id: id, 74 | course: course 75 | }); 76 | toastr.success("Course Added Successfully"); 77 | // alert("Course Updated Successfully"); 78 | setId(""); 79 | setCourse(""); 80 | 81 | Load(); 82 | } 83 | catch(err){ 84 | alert("Course Registration Failed"); 85 | } 86 | } 87 | 88 | if(courses.length <= 0) return null; 89 | 90 | return ( 91 |
92 |
93 |
94 |
95 | 96 | { 99 | setId(event.target.value); 100 | }}/> 101 | 102 |
103 | 104 |
105 | 106 |
107 | {setCourse(event.target.value);}}/> 109 |
110 |
111 | 112 | 113 | 114 |
115 | 116 |
117 |
118 |
119 |
120 |
121 |

Courses 122 | {/* Add Student */} 123 | New 124 |

125 |
126 |
127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | {courses.map((course) => ( 138 | 139 | 140 | 141 | 142 | 151 | 160 | 161 | ))} 162 | 163 |
IDCourseEditDelete
{course.id}{course.course} 143 | 150 | 152 | 159 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 | ); 172 | } 173 | 174 | export default Course; 175 | --------------------------------------------------------------------------------