├── .gitignore ├── README.md ├── assets ├── css │ ├── login.css │ └── main.css ├── html │ ├── footer.html │ └── header.html ├── img │ └── MVC.jpeg └── js │ ├── employees.js │ └── index.js ├── index.php ├── package-lock.json ├── package.json ├── resources ├── employees.json ├── images_mock.json └── users.json └── src ├── dashboard.php ├── employee.php ├── imageGallery.php └── library ├── avatarsApi.php ├── employeeController.php ├── employeeManager.php ├── loginController.php ├── loginManager.php └── sessionHelper.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP EMPLOYEE MANAGER 2 | 3 | ## Application register 4 | 5 | -USER: admin. 6 | -PASSWORD: 123456 7 | 8 | 9 | ### Description 10 | 11 | In this project in a simulation of an employee manager, where you can view employee information, delete it and also add a new employee. 12 | 13 | The structure we used in this project was the MVC, where there is a controller and manager, which depending on the user's request will do one function or another. 14 | ![img](assets/img/MVC.jpeg) 15 | 16 | ### Languages and frameworks 17 | 18 | -Html & CSS 19 | -Javascript 20 | -bootstrap 21 | -PHP 22 | -------------------------------------------------------------------------------- /assets/css/login.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaerste/php-employee-management-v1/a8284c2c4905624ecac659f43a28e9d04c95c37e/assets/css/login.css -------------------------------------------------------------------------------- /assets/css/main.css: -------------------------------------------------------------------------------- 1 | .form-control-file { 2 | width: 25%; 3 | } 4 | .row{ 5 | display: flex; 6 | justify-content: space-evenly; 7 | margin:20px 0; 8 | 9 | } 10 | 11 | .form{ 12 | width: 80%; 13 | margin-left: 10%; 14 | padding: 20px 20px; 15 | border: solid rgb(221, 220, 220) 2px; 16 | border-radius: 0px; 17 | } 18 | .title{ 19 | text-align: center; 20 | margin-bottom: 50px; 21 | } 22 | .buttons{ 23 | display: flex; 24 | justify-content: center; 25 | } 26 | button{ 27 | margin: 0 20px; 28 | } 29 | -------------------------------------------------------------------------------- /assets/html/footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaerste/php-employee-management-v1/a8284c2c4905624ecac659f43a28e9d04c95c37e/assets/html/footer.html -------------------------------------------------------------------------------- /assets/html/header.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaerste/php-employee-management-v1/a8284c2c4905624ecac659f43a28e9d04c95c37e/assets/html/header.html -------------------------------------------------------------------------------- /assets/img/MVC.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaerste/php-employee-management-v1/a8284c2c4905624ecac659f43a28e9d04c95c37e/assets/img/MVC.jpeg -------------------------------------------------------------------------------- /assets/js/employees.js: -------------------------------------------------------------------------------- 1 | const url = "../src/library/employeeController.php?action=getDataEmployees&source=js"; 2 | 3 | window.onload = getAllEmployees(); 4 | 5 | async function getAllEmployees() { 6 | await fetch(url) 7 | .then((response) => response.json()) 8 | .then((data) => { 9 | const dataObject = JSON.parse(data); 10 | // console.log(data); 11 | renderDashboard(dataObject); 12 | }); 13 | } 14 | 15 | function renderDashboard(data) { 16 | data.map((employee) => { 17 | const tableBody = document.getElementById("employeeTable"); 18 | let tr = document.createElement("tr"); 19 | let tdId = document.createElement("td"); 20 | tableBody.append(tr); 21 | 22 | // ID EMPLOYEE 23 | tr.append(tdId); 24 | tdId.append(employee.id); 25 | //NAME EMPLOYEE 26 | let tdName = document.createElement("td"); 27 | tr.append(tdName); 28 | tdName.append(employee.name); 29 | //EMAIL EMPLOYEE 30 | let tdEmail = document.createElement("td"); 31 | tr.append(tdEmail); 32 | tdEmail.append(employee.email); 33 | //AGE EMPLOYEE 34 | let tdAge = document.createElement("td"); 35 | tr.append(tdAge); 36 | tdAge.append(employee.age); 37 | // STREET NUMBER EMPLOYEE 38 | let tdStreet = document.createElement("td"); 39 | tr.append(tdStreet); 40 | tdStreet.append(employee.streetAddress); 41 | // CITY EMPLOYEE 42 | let tdCity = document.createElement("td"); 43 | tr.append(tdCity); 44 | tdCity.append(employee.city); 45 | //STATE EMPLOYEE 46 | let tdState = document.createElement("td"); 47 | tr.append(tdState); 48 | tdState.append(employee.state); 49 | //POSTAL CODE EMPLOYEE 50 | let tdPostal = document.createElement("td"); 51 | tr.append(tdPostal); 52 | tdPostal.append(employee.postalCode); 53 | //PHONE NUMBER EMPLOYEE 54 | let tdPhone = document.createElement("td"); 55 | tr.append(tdPhone); 56 | tdPhone.append(employee.phoneNumber); 57 | //BUTTON TO DELETE and modify THE EMPLOYEE 58 | let btnTrash = document.createElement("button"); 59 | btnTrash.classList.add('btn__trash', 'btn', 'btn-light'); 60 | 61 | btnTrash.setAttribute('id','btnDelete'); 62 | btnTrash.textContent="Delete"; 63 | btnTrash.setAttribute('data-id', employee.id); 64 | btnTrash.addEventListener('click', deleteEmployee); 65 | tr.append(btnTrash); 66 | //button modify 67 | let btnModify = document.createElement("button"); 68 | btnModify.classList.add('btn__Modify','btn', 'btn-warning'); 69 | btnModify.setAttribute('id','btnModify'); 70 | btnModify.textContent="Modify"; 71 | btnModify.setAttribute('data-id', employee.id); 72 | btnModify.addEventListener('click', modifyEmployee); 73 | tr.append(btnModify); 74 | }); 75 | } 76 | function deleteEmployee(e) { 77 | const btn = e.currentTarget.getAttribute('data-id'); 78 | 79 | const sendReq = async () => { 80 | const req = await fetch(`.././src/library/employeeController.php`, { 81 | method: 'DELETE', 82 | body: JSON.stringify(+btn) 83 | }); 84 | } 85 | sendReq(); 86 | window.location.reload(); 87 | } 88 | function modifyEmployee(e) { 89 | const userId = e.currentTarget.getAttribute('data-id'); 90 | 91 | const sendReq = async () => { 92 | const req = await fetch(`.././src/library/employeeController.php`, { 93 | method: 'GET', 94 | body: JSON.stringify(+userId) 95 | }); 96 | } 97 | sendReq(); 98 | 99 | } -------------------------------------------------------------------------------- /assets/js/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaerste/php-employee-management-v1/a8284c2c4905624ecac659f43a28e9d04c95c37e/assets/js/index.js -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Document 12 | 13 | 14 | 15 |
16 |
17 |
18 |

Login

19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 34 |
35 |
36 |
37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assemblerschool", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "assemblerschool", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "bootstrap": "^5.2.0-beta1", 13 | "bootstrap-icons": "^1.0.0-alpha4", 14 | "jquery": "^3.5.1", 15 | "jsgrid": "^1.5.3" 16 | } 17 | }, 18 | "node_modules/@popperjs/core": { 19 | "version": "2.11.5", 20 | "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", 21 | "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", 22 | "peer": true, 23 | "funding": { 24 | "type": "opencollective", 25 | "url": "https://opencollective.com/popperjs" 26 | } 27 | }, 28 | "node_modules/bootstrap": { 29 | "version": "5.2.0-beta1", 30 | "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.0-beta1.tgz", 31 | "integrity": "sha512-6qbgs177WZEFY4SLQUq3tEHayYG80nfDmyTpdKi0MJqRMdS+HAoq24+YKfx6wf+nHY0rx8zrh477J1lFu4WzOA==", 32 | "funding": [ 33 | { 34 | "type": "github", 35 | "url": "https://github.com/sponsors/twbs" 36 | }, 37 | { 38 | "type": "opencollective", 39 | "url": "https://opencollective.com/bootstrap" 40 | } 41 | ], 42 | "peerDependencies": { 43 | "@popperjs/core": "^2.11.5" 44 | } 45 | }, 46 | "node_modules/bootstrap-icons": { 47 | "version": "1.8.3", 48 | "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.8.3.tgz", 49 | "integrity": "sha512-s5kmttnbq4BXbx3Bwnj39y+t7Vc3blTtyD77W3aYQ1LlNoS3lNbbGvSYhIbg26Im8KmjScyFpHEevlPOBcIDdA==" 50 | }, 51 | "node_modules/jquery": { 52 | "version": "3.6.0", 53 | "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", 54 | "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" 55 | }, 56 | "node_modules/jsgrid": { 57 | "version": "1.5.3", 58 | "resolved": "https://registry.npmjs.org/jsgrid/-/jsgrid-1.5.3.tgz", 59 | "integrity": "sha512-/BJgQp7gZe8o/VgNelwXc21jHc9HN+l7WPOkBhC9b9jPXFtOrU9ftNLPVBmKYCNlIulAbGTW8SDJI0mpw7uWxQ==" 60 | } 61 | }, 62 | "dependencies": { 63 | "@popperjs/core": { 64 | "version": "2.11.5", 65 | "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", 66 | "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", 67 | "peer": true 68 | }, 69 | "bootstrap": { 70 | "version": "5.2.0-beta1", 71 | "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.0-beta1.tgz", 72 | "integrity": "sha512-6qbgs177WZEFY4SLQUq3tEHayYG80nfDmyTpdKi0MJqRMdS+HAoq24+YKfx6wf+nHY0rx8zrh477J1lFu4WzOA==", 73 | "requires": {} 74 | }, 75 | "bootstrap-icons": { 76 | "version": "1.8.3", 77 | "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.8.3.tgz", 78 | "integrity": "sha512-s5kmttnbq4BXbx3Bwnj39y+t7Vc3blTtyD77W3aYQ1LlNoS3lNbbGvSYhIbg26Im8KmjScyFpHEevlPOBcIDdA==" 79 | }, 80 | "jquery": { 81 | "version": "3.6.0", 82 | "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", 83 | "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" 84 | }, 85 | "jsgrid": { 86 | "version": "1.5.3", 87 | "resolved": "https://registry.npmjs.org/jsgrid/-/jsgrid-1.5.3.tgz", 88 | "integrity": "sha512-/BJgQp7gZe8o/VgNelwXc21jHc9HN+l7WPOkBhC9b9jPXFtOrU9ftNLPVBmKYCNlIulAbGTW8SDJI0mpw7uWxQ==" 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assemblerschool", 3 | "version": "1.0.0", 4 | "description": "Part of basic web application project for Assembler School students", 5 | "main": "index.php", 6 | "scripts": { 7 | "test": "jest" 8 | }, 9 | "author": "Jose Manuel Orts", 10 | "license": "ISC", 11 | "dependencies": { 12 | "bootstrap": "^5.2.0-beta1", 13 | "bootstrap-icons": "^1.0.0-alpha4", 14 | "jquery": "^3.5.1", 15 | "jsgrid": "^1.5.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /resources/employees.json: -------------------------------------------------------------------------------- 1 | [{"id":2,"name":"John","lastName":"Doe","email":"jhondoe@foo.com","gender":"man","city":"New York","streetAddress":"89","state":"WA","age":"34","postalCode":"09889","phoneNumber":"1283645645"},{"id":3,"name":"Leila","lastName":"Mills","email":"mills@leila.com","gender":"woman","city":"San Diego","streetAddress":"55","state":"CA","age":"29","postalCode":"098765","phoneNumber":"9983632461"},{"id":4,"name":"Richard","lastName":"Desmond","email":"dismond@foo.com","gender":"man","age":30,"streetAddress":"90","city":"Salt lake city","state":"UT","postalCode":"457320","phoneNumber":"90876987654"},{"id":5,"name":"Susan","lastName":"Smith","email":"susanmith@baz.com","gender":"woman","age":28,"streetAddress":"43","city":"Louisville","state":"KNT","postalCode":"445321","phoneNumber":"224355488976"},{"id":6,"name":"Brad","lastName":"Simpson","email":"brad@foo.com","gender":"man","age":40,"streetAddress":"128","city":"Atlanta","state":"GEO","postalCode":"394221","phoneNumber":"6854634522"},{"id":7,"name":"Neil","lastName":"Walker","email":"walkerneil@baz.com","gender":"man","age":42,"streetAddress":"1","city":"Nashville","state":"TN","postalCode":90143,"phoneNumber":"45372788192"},{"id":7,"name":"Alejandro ","lastname":null,"email":"alejandrogaerste411@gmail.com","gender":"man","city":"Baienfurt","streetAddress":"Jahnstra\u00dfe","state":"Deutschland","age":"22","postalCode":"88255","phoneNumber":"0751 05574990"}] -------------------------------------------------------------------------------- /resources/images_mock.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Yvonne Strahovski", 4 | "email": "yvonne.strahovski@gmail.com", 5 | "position": "Software Engineer", 6 | "photo": "https:\/\/m.media-amazon.com\/images\/M\/MV5BMzI5NDIzNTQ1Nl5BMl5BanBnXkFtZTgwMjQ0Mzc1MTE@._V1_UY256_CR4,0,172,256_AL_.jpg" 7 | }, 8 | { 9 | "name": "Mario Palmer", 10 | "email": "mario.palmer@gmail.com", 11 | "position": "Senior Developer", 12 | "photo": "https:\/\/randomuser.me\/api\/portraits\/men\/33.jpg" 13 | }, 14 | { 15 | "name": "Ali Anari", 16 | "email": "ali.anari@gmail.com", 17 | "position": "Customer Service", 18 | "photo": "https:\/\/pbs.twimg.com\/profile_images\/647526574120529920\/T5rm0m7W.jpg" 19 | }, 20 | { 21 | "name": "Ariyanna Hicks", 22 | "email": "ariyanna.hicks@gmail.com", 23 | "position": "Product Designer", 24 | "photo": "https:\/\/i.imgur.com\/Qz5CrD0.jpg" 25 | }, 26 | { 27 | "name": "Jonathan Hung", 28 | "email": "jonathan.hung@gmail.com", 29 | "position": "Call Center Representative", 30 | "photo": "https:\/\/pbs.twimg.com\/profile_images\/869994638110736385\/CVYUarcq.jpg" 31 | }, 32 | { 33 | "name": "Andr\u00c3\u00a9 B\u00c3\u00a1rtolo", 34 | "email": "andr\u00c3\u00a9.b\u00c3\u00a1rtolo@gmail.com", 35 | "position": "Clerical", 36 | "photo": "https:\/\/pbs.twimg.com\/profile_images\/1094979667143069696\/QrD0ovrh.jpg" 37 | }, 38 | { 39 | "name": "Jennifer Aniston", 40 | "email": "jennifer.aniston@gmail.com", 41 | "position": "Customer Service", 42 | "photo": "https:\/\/images-na.ssl-images-amazon.com\/images\/M\/MV5BNjk1MjIxNjUxNF5BMl5BanBnXkFtZTcwODk2NzM4Mg@@._V1_UY256_CR3,0,172,256_AL_.jpg" 43 | }, 44 | { 45 | "name": "Temperance Norwood", 46 | "email": "temperance.norwood@gmail.com", 47 | "position": "Software Engineer", 48 | "photo": "https:\/\/images.generated.photos\/eL-OqIIteJK_ORyTXpJ96fDVgV_vY5PCvb0CfFGXMxs\/rs:fit:512:512\/Z3M6Ly9nZW5lcmF0\/ZWQtcGhvdG9zLzAx\/Njk3NTcuanBn.jpg" 49 | }, 50 | { 51 | "name": "", 52 | "email": "@gmail.com", 53 | "position": "Manager", 54 | "photo": "https:\/\/images.pexels.com\/photos\/38554\/girl-people-landscape-sun-38554.jpeg?auto=compress&cs=tinysrgb&h=350" 55 | }, 56 | { 57 | "name": "Jessica Barden", 58 | "email": "jessica.barden@gmail.com", 59 | "position": "Software Engineer", 60 | "photo": "https:\/\/images-na.ssl-images-amazon.com\/images\/M\/MV5BNzUwMjgxNTMyOF5BMl5BanBnXkFtZTcwMTIwNzU0NA@@._V1_UX172_CR0,0,172,256_AL_.jpg" 61 | } 62 | ] 63 | -------------------------------------------------------------------------------- /resources/users.json: -------------------------------------------------------------------------------- 1 | { 2 | "users": [ 3 | { 4 | "userId": 1, 5 | "name": "admin", 6 | "password": "$2y$10$nuh1LEwFt7Q2/wz9/CmTJO91stTBS4cRjiJYBY3sVCARnllI.wzBC", 7 | "email": "admin@assemblerschool.com" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/dashboard.php: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Dashboard 21 | 22 | 23 | 24 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 52 | 53 | 54 | 55 | 56 |
IdNameEmailAgeStreet No.CityStatePostal codePhone Number
57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/employee.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Employee Page 11 | 12 | 13 |

Employee Page

14 |
15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 | 29 | 30 | 35 |
36 |
37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | 48 | 49 |
50 |
51 | 52 | 53 | 54 | 55 | 56 |
57 |
58 | 59 | 60 |
61 |
62 | 63 | -------------------------------------------------------------------------------- /src/imageGallery.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/library/avatarsApi.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaerste/php-employee-management-v1/a8284c2c4905624ecac659f43a28e9d04c95c37e/src/library/avatarsApi.php -------------------------------------------------------------------------------- /src/library/employeeController.php: -------------------------------------------------------------------------------- 1 | 2 | $sizeArray, 22 | "name" => $_POST['name'], 23 | "lastname" => $_POST['lastname'], 24 | "email" => $_POST['email'], 25 | "gender" => $_POST['gender'], 26 | "city" => $_POST['city'], 27 | "streetAddress" => $_POST['streetAdress'], 28 | "state" => $_POST['state'], 29 | "age" => $_POST['age'], 30 | "postalCode" => $_POST['postalCode'], 31 | "phoneNumber" => $_POST['phoneNumber'], 32 | ]; 33 | print_r($new_user); 34 | $dataJson[] = $new_user; 35 | $sizeArray= sizeof($dataJson)+1; 36 | echo $sizeArray; 37 | $newArray =json_encode($dataJson ,JSON_PRETTY_PRINT); 38 | file_put_contents('../../resources/employees.json', $newArray); 39 | }; 40 | 41 | 42 | function deleteEmployee($dataId) 43 | { 44 | // read json file 45 | $data = file_get_contents("../../resources/employees.json"); 46 | 47 | // decode json to associative array 48 | $jsonArray = json_decode($data, true); 49 | $indexArray = array(); 50 | 51 | foreach($jsonArray as $key => $value){ 52 | if ($value['id'] == $dataId) { 53 | unset($jsonArray[$key]); 54 | } 55 | } 56 | $indexArray = array_values($jsonArray); 57 | 58 | // encode array to json and save to file 59 | file_put_contents("../../resources/employees.json", json_encode($indexArray)); 60 | return $indexArray; 61 | header("location:dashboard.php"); 62 | } 63 | 64 | function getEmployee() 65 | { 66 | $url = "../../resources/employees.json"; 67 | $employeesData = json_encode(file_get_contents($url), true); 68 | return $employeesData; 69 | } 70 | 71 | function updateEmployee(array $updateEmployee) 72 | { 73 | // TODO implement it 74 | } 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | function removeAvatar($id) 83 | { 84 | // TODO implement it 85 | } 86 | 87 | 88 | function getQueryStringParameters(): array 89 | { 90 | // TODO implement it 91 | } 92 | 93 | function getNextIdentifier(array $employeesCollection): int 94 | { 95 | // TODO implement it 96 | } -------------------------------------------------------------------------------- /src/library/loginController.php: -------------------------------------------------------------------------------- 1 | $value){ 23 | echo $value["name"]; 24 | $encPassword = $value['password']; 25 | echo "$encPassword"; 26 | if ($value['name']== $userinput){ 27 | echo "usercorrect"; 28 | if(password_verify($passinput, $encPassword)){ 29 | echo "password correct"; 30 | session_start(); 31 | $_SESSION['name'] = $userinput; 32 | header("location: ../dashboard.php"); 33 | }else{ 34 | header("location:../../index.php"); 35 | $errPassMsg = "Wrong password"; 36 | } 37 | }else{ 38 | header("location:../../index.php"); 39 | $errUserMsg= "Wrong username"; 40 | } 41 | } 42 | 43 | 44 | 45 | if($_SERVER['REQUEST_METHOD']==='GET') 46 | logout(); 47 | 48 | function logout(){ 49 | session_start(); 50 | unset($_SESSION); 51 | session_destroy(); 52 | header("location:../../index.php"); 53 | } 54 | 55 | -------------------------------------------------------------------------------- /src/library/sessionHelper.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaerste/php-employee-management-v1/a8284c2c4905624ecac659f43a28e9d04c95c37e/src/library/sessionHelper.php --------------------------------------------------------------------------------