Download code _ PHP and MySQL-Based Human Resource Management System ProjectÂ
Human Resource Management System in PHP and MySQL (Free Source Code)
Introduction
The Human Resource Management System (HRMS) is a simple web-based application developed using PHP and MySQL. It provides an automated platform for company employees to manage and submit their leave applications. The system features a user-friendly interface with a modern design, using Bootstrap and the Responsee Framework for page layouts.
Technologies Used
This project was developed using the following technologies:
- HTML
- CSS
- JavaScript (JS)
- PHP
- MySQL Database
- XAMPP (Local Server)
- VS Code Editor
- Bootstrap Framework
- Responsee Framework
Features and Functionalities
Admin Panel (For HR or System Administrators)
- Login and Logout
- Dashboard Page
- Manage Employee Records
- Manage Leave Applications (Approve or Reject)
- Update Password
Employee Side
- Login and Logout
- Dashboard Page
- Apply for Leave
- View and Manage Leave Applications (Pending, Approved, or Rejected)
- Update Password
How Does the System Work?
The HR Management System has two main sections: the Admin Panel and the Employee Side. Each section has different functions based on the user’s role.
Admin Panel
The Admin Panel is accessible only to system administrators. It allows HR staff to:
- Manage the list of employees
- Approve or reject leave applications
- Add, edit, or delete data related to job positions, countries, states, and cities
Employee Side
Employees can only access the Employee Side of the system. Here, they can:
- Submit leave applications
- View their leave application status (pending, approved, or rejected)
- Check leave summaries on the dashboard
- Update their password
How to Install and Run the Project
Requirements
To run this system, you need:
- A local web server such as XAMPP installed on your computer
- The downloaded source code (provided in a ZIP file)
Installation and Setup
- Open XAMPP Control Panel and start Apache and MySQL
- Extract the downloaded ZIP file
- Copy the extracted folder and paste it inside the htdocs directory of XAMPP
- Open a web browser and go to PHPMyAdmin (http://localhost/phpmyadmin)
- Create a new database named hrm_db
- Import the provided SQL file (hrm_db.sql) from the db folder
- Open a browser and visit http://localhost/hrm/ to access the system
Default Login Credentials
Admin Access:
- Email: admin@gmail.com
- Password: admin#123
Employee Access:
- Email: mcooper@gmail.com
- Password: mcooper#123
Conclusion
This Human Resource Management System is a useful tool for managing employee leave applications efficiently. It is free to download and can be customized to fit specific needs. Feel free to modify it as per your requirements.
index PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
<?php $result =""; if(isset($_GET['msg'])) { $result=$_GET['msg']; } ?> <!DOCTYPE HTML> <html> <head> <title>Login Page - HRM</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="Pooled Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" /> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' /> <!-- Custom CSS --> <link href="css/style.css" rel='stylesheet' type='text/css' /> <link rel="stylesheet" href="css/morris.css" type="text/css"/> <!-- Graph CSS --> <link href="css/font-awesome.css" rel="stylesheet"> <link rel="stylesheet" href="css/jquery-ui.css"> <!-- jQuery --> <script src="js/jquery-2.1.4.min.js"></script> <!-- //jQuery --> <link href='//fonts.googleapis.com/css?family=Roboto:700,500,300,100italic,100,400' rel='stylesheet' type='text/css'/> <link href='//fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'> <!-- lined-icons --> <link rel="stylesheet" href="css/icon-font.min.css" type='text/css' /> <!-- //lined-icons --> <style> html{ min-height: calc(100%); width:calc(100%); } body, .main-wthree{ width:calc(100%); min-height: 100vh; } .main-wthree{ padding-bottom:2em; display:flex; flex-direction: column; align-items:center; justify-content:center; } .footer{ width:100%; position:fixed; bottom:0; left:0 } .sin-w3-agile{ padding:0; } .login{ background-color: #010101; background-image: linear-gradient(160deg, #010101 0%, #4e6865 100%); } .login-w3 { width: 100%; float: unset; text-align: center; } .main-wthree input[type="submit"]:hover { background: #3e5250; } </style> </head> <body> <div class="main-wthree"> <div class="container"> <h1 class="text-center text-white">Human Resource Management System</h1> <div class="sin-w3-agile"> <h2>Login In</h2> <form action="controller/login.php" method="post"> <div class="email"> <span class="email">Email:</span> <input type="Email" name="name" class="name" placeholder="Enter Email Address"> <div class="clearfix"></div> </div> <div class="password-agileits"> <span class="username">Password: <i class="fa fa-eye-slash" aria-hidden="false" style="padding-left: 20px;" onclick="passwordeyes(this);"></i></span> <input type="password" name="password" id="Psw" class="password" placeholder="Enter Password"> <div class="clearfix"></div> </div> <h4 style="color: #F1C40F;"><?php echo $result; ?></h4> <div class="login-w3"> <input type="submit" name="submit" class="login" value="Sign In"> </div> <div class="clearfix"></div> <h5 class="text-center"><a href="./user" class="text-white" >Login as an Employee</a></h5> <div class="clearfix"></div> </form> <!-- <div class="back"> <a href="index.php">Back to home</a> </div> --> <div class="footer"> <p>Human Resource Managemant System. All Rights Reserved © <?= date("Y") ?> </p> </div> </div> </div> </div> <script> function passwordeyes(_this) { var x = document.getElementById("Psw").type; if(x=="password"){ document.getElementById("Psw").type="text"; _this.setAttribute('class', "fa fa-eye") }else{ document.getElementById("Psw").type="password"; _this.setAttribute('class', "fa fa-eye-slash") } } </script> </body> </html> <?php /*current computer name get */ //$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); //echo $hostname; /*check to which op system*/ /*if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo 'This is a server using Windows!'; } else { echo 'This is a server not using Windows!'; }*/ /*get to mac Address in windows system*/ //--ob_start(); //Get the ipconfig details using system commond //--system('ipconfig /all'); // Capture the output into a variable //--$mycom=ob_get_contents(); // Clean (erase) the output buffer //--ob_clean(); //--$findme = "Physical"; //Search the "Physical" | Find the position of Physical text //--$pmac = strpos($mycom, $findme); // Get Physical Address //--$mac=substr($mycom,($pmac+36),17); //Display Mac Address //--echo $mac; /* End mac system code*/ /* get current computer mac address */ //echo substr(exec('getmac'),0,17); //echo substr("<br>40-8D-5C-B1-B7-7D \Device\Tcpip_{BF6495D7-04E6-4599-99B0-FA6656B57D35}", 0,17) ?> |
hrm_db SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
-- phpMyAdmin SQL Dump -- version 5.1.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 10, 2022 at 05:45 AM -- Server version: 10.4.24-MariaDB -- PHP Version: 8.1.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; -- -- Database: `hrm_db` -- -- -------------------------------------------------------- -- -- Table structure for table `city` -- CREATE TABLE `city` ( `CityId` int(11) NOT NULL, `StateId` int(11) NOT NULL, `Name` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `city` -- INSERT INTO `city` (`CityId`, `StateId`, `Name`) VALUES (1, 1, 'Sample 101'), (2, 1, 'Sample 102'), (21, 1, 'Manila'), (22, 1, 'Muntinlupa'), (23, 4, 'Los Angeles'), (24, 3, 'Washington'); -- -------------------------------------------------------- -- -- Table structure for table `country` -- CREATE TABLE `country` ( `CountryId` int(11) NOT NULL, `Name` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `country` -- INSERT INTO `country` (`CountryId`, `Name`) VALUES (1, 'Philippines'), (9, 'USA'); -- -------------------------------------------------------- -- -- Table structure for table `dailyworkload` -- CREATE TABLE `dailyworkload` ( `DailyWorkLoadId` bigint(20) NOT NULL, `EmpId` varchar(50) NOT NULL, `LoginDate` datetime DEFAULT NULL, `LogoutDate` datetime DEFAULT NULL, `DailyWorkingminutes` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `employee` -- CREATE TABLE `employee` ( `EmpId` bigint(20) NOT NULL, `EmployeeId` varchar(11) NOT NULL, `FirstName` varchar(200) NOT NULL, `MiddleName` varchar(200) NOT NULL, `LastName` varchar(200) NOT NULL, `Birthdate` date NOT NULL, `Gender` int(10) NOT NULL, `Address1` varchar(500) NOT NULL, `Address2` varchar(500) NOT NULL, `Address3` varchar(500) NOT NULL, `CityId` int(11) NOT NULL, `Mobile` decimal(10,0) NOT NULL, `Email` varchar(200) NOT NULL, `Password` varchar(25) NOT NULL, `AadharNumber` varchar(25) NOT NULL, `MaritalStatus` int(11) NOT NULL, `PositionId` int(11) NOT NULL, `CreatedBy` bigint(20) NOT NULL, `CreatedDate` datetime NOT NULL, `ModifiedBy` bigint(20) DEFAULT NULL, `ModifiedDate` datetime DEFAULT NULL, `JoinDate` date NOT NULL, `LeaveDate` date DEFAULT NULL, `LastLogin` datetime DEFAULT NULL, `LastLogout` datetime DEFAULT NULL, `StatusId` int(11) NOT NULL, `RoleId` int(11) NOT NULL, `ImageName` varchar(1000) DEFAULT NULL, `MacAddress` varchar(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`EmpId`, `EmployeeId`, `FirstName`, `MiddleName`, `LastName`, `Birthdate`, `Gender`, `Address1`, `Address2`, `Address3`, `CityId`, `Mobile`, `Email`, `Password`, `AadharNumber`, `MaritalStatus`, `PositionId`, `CreatedBy`, `CreatedDate`, `ModifiedBy`, `ModifiedDate`, `JoinDate`, `LeaveDate`, `LastLogin`, `LastLogout`, `StatusId`, `RoleId`, `ImageName`, `MacAddress`) VALUES (1, '1', 'admin', 'admin', 'admin', '1994-10-09', 1, 'address1', 'address2', 'address3', 1, '9999999999', 'admin@gmail.com', 'admin#123', '12354658496', 2, 1, 1, '2017-01-01 00:00:00', 1, '2017-01-31 10:33:33', '2017-01-11', '2017-01-18', '2022-10-10 09:10:42', '2017-02-09 15:12:09', 1, 1, 'images (2).jpg', ''), (2, '6231415', 'Mark', 'D', 'Cooper', '2022-10-10', 1, 'Sample Address 101', 'Sample Address 102', '', 22, '912345678', 'mcooper@mail.com', 'mcooper#123', '', 1, 2, 1, '2022-10-10 08:01:43', 1, '2022-10-10 08:05:39', '2022-10-10', '0000-00-00', '2022-10-10 08:55:27', '2022-10-10 08:55:05', 1, 3, '33615user.png', ''); -- -------------------------------------------------------- -- -- Table structure for table `gender` -- CREATE TABLE `gender` ( `GenderId` int(11) NOT NULL, `Name` varchar(15) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `gender` -- INSERT INTO `gender` (`GenderId`, `Name`) VALUES (1, 'male'), (2, 'female'); -- -------------------------------------------------------- -- -- Table structure for table `leavedays` -- CREATE TABLE `leavedays` ( `LeaveDayId` bigint(20) NOT NULL, `LeaveDay` int(3) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `leavedays` -- INSERT INTO `leavedays` (`LeaveDayId`, `LeaveDay`) VALUES (1, 12); -- -------------------------------------------------------- -- -- Table structure for table `leavedetails` -- CREATE TABLE `leavedetails` ( `Detail_Id` bigint(20) NOT NULL, `EmpId` bigint(20) NOT NULL, `TypesLeaveId` int(10) NOT NULL, `Reason` varchar(500) NOT NULL, `StateDate` date NOT NULL, `EndDate` date NOT NULL, `LeaveStatus` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `leavedetails` -- INSERT INTO `leavedetails` (`Detail_Id`, `EmpId`, `TypesLeaveId`, `Reason`, `StateDate`, `EndDate`, `LeaveStatus`) VALUES (1, 6231415, 3, 'Sample Reason', '2022-10-12', '2022-10-14', 'Accept'); -- -------------------------------------------------------- -- -- Table structure for table `maritalstatus` -- CREATE TABLE `maritalstatus` ( `MaritalId` int(11) NOT NULL, `Name` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `maritalstatus` -- INSERT INTO `maritalstatus` (`MaritalId`, `Name`) VALUES (1, 'Married'), (2, 'Unmarried'); -- -------------------------------------------------------- -- -- Table structure for table `position` -- CREATE TABLE `position` ( `PositinId` int(11) NOT NULL, `Name` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `position` -- INSERT INTO `position` (`PositinId`, `Name`) VALUES (1, 'HR'), (2, 'Web Developer'), (3, 'Fullstack PHP Developer'); -- -------------------------------------------------------- -- -- Table structure for table `role` -- CREATE TABLE `role` ( `RoleId` int(11) NOT NULL, `Name` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `role` -- INSERT INTO `role` (`RoleId`, `Name`) VALUES (1, 'admin'), (2, 'admin-hr'), (3, 'employee'); -- -------------------------------------------------------- -- -- Table structure for table `state` -- CREATE TABLE `state` ( `StateId` int(11) NOT NULL, `CountryId` int(11) NOT NULL, `Name` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `state` -- INSERT INTO `state` (`StateId`, `CountryId`, `Name`) VALUES (1, 1, 'Metro Manila'), (2, 1, 'Negros Oriental'), (3, 9, 'DC'), (4, 9, 'California'); -- -------------------------------------------------------- -- -- Table structure for table `status` -- CREATE TABLE `status` ( `StatusId` int(11) NOT NULL, `Name` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `status` -- INSERT INTO `status` (`StatusId`, `Name`) VALUES (1, 'active'), (2, 'inactive'); -- -------------------------------------------------------- -- -- Table structure for table `type_of_leave` -- CREATE TABLE `type_of_leave` ( `LeaveId` bigint(20) NOT NULL, `Type_of_Name` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `type_of_leave` -- INSERT INTO `type_of_leave` (`LeaveId`, `Type_of_Name`) VALUES (1, 'sick leave'), (3, 'casual leave'), (4, 'privilege leave'), (5, 'half day leave'); -- -- Indexes for dumped tables -- -- -- Indexes for table `city` -- ALTER TABLE `city` ADD PRIMARY KEY (`CityId`); -- -- Indexes for table `country` -- ALTER TABLE `country` ADD PRIMARY KEY (`CountryId`); -- -- Indexes for table `dailyworkload` -- ALTER TABLE `dailyworkload` ADD PRIMARY KEY (`DailyWorkLoadId`); -- -- Indexes for table `employee` -- ALTER TABLE `employee` ADD PRIMARY KEY (`EmpId`), ADD UNIQUE KEY `Email` (`Email`), ADD UNIQUE KEY `EmployeeId` (`EmployeeId`); -- -- Indexes for table `gender` -- ALTER TABLE `gender` ADD PRIMARY KEY (`GenderId`); -- -- Indexes for table `leavedays` -- ALTER TABLE `leavedays` ADD PRIMARY KEY (`LeaveDayId`); -- -- Indexes for table `leavedetails` -- ALTER TABLE `leavedetails` ADD PRIMARY KEY (`Detail_Id`); -- -- Indexes for table `maritalstatus` -- ALTER TABLE `maritalstatus` ADD PRIMARY KEY (`MaritalId`); -- -- Indexes for table `position` -- ALTER TABLE `position` ADD PRIMARY KEY (`PositinId`); -- -- Indexes for table `role` -- ALTER TABLE `role` ADD PRIMARY KEY (`RoleId`); -- -- Indexes for table `state` -- ALTER TABLE `state` ADD PRIMARY KEY (`StateId`); -- -- Indexes for table `status` -- ALTER TABLE `status` ADD PRIMARY KEY (`StatusId`); -- -- Indexes for table `type_of_leave` -- ALTER TABLE `type_of_leave` ADD PRIMARY KEY (`LeaveId`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `city` -- ALTER TABLE `city` MODIFY `CityId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT for table `country` -- ALTER TABLE `country` MODIFY `CountryId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `dailyworkload` -- ALTER TABLE `dailyworkload` MODIFY `DailyWorkLoadId` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `employee` -- ALTER TABLE `employee` MODIFY `EmpId` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `gender` -- ALTER TABLE `gender` MODIFY `GenderId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `leavedays` -- ALTER TABLE `leavedays` MODIFY `LeaveDayId` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `leavedetails` -- ALTER TABLE `leavedetails` MODIFY `Detail_Id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `position` -- ALTER TABLE `position` MODIFY `PositinId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `state` -- ALTER TABLE `state` MODIFY `StateId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `type_of_leave` -- ALTER TABLE `type_of_leave` MODIFY `LeaveId` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; COMMIT; |