├── .gitignore ├── todo.txt ├── screenshots └── image.png ├── assets ├── fonts │ ├── fa-brands-400.eot │ ├── fa-brands-400.ttf │ ├── fa-brands-400.woff │ ├── fa-regular-400.eot │ ├── fa-regular-400.ttf │ ├── fa-solid-900.eot │ ├── fa-solid-900.ttf │ ├── fa-solid-900.woff │ ├── fa-solid-900.woff2 │ ├── fa-brands-400.woff2 │ ├── fa-regular-400.woff │ ├── fa-regular-400.woff2 │ ├── Nunito-31cb3cc7f0a41186c0be5225caa408c3.woff2 │ ├── Nunito-49507be8926ed86b54f246864dfb2b91.woff2 │ ├── Nunito-4c5c6c8d60cf38c7a442b766dfd3ac9f.woff2 │ ├── Nunito-56f97c8310e9868d5e4f649ff0cc0536.woff2 │ ├── Nunito-58050dbecc5a1ef8ffb017fb99b15294.woff2 │ ├── Nunito-61492c245979f8a0f42bffcedfa474e6.woff2 │ ├── Nunito-6c46e979458f0c7829f6f041688f5621.woff2 │ ├── Nunito-7cdc9c521e8cbc9c2263ff91673131a3.woff2 │ ├── Nunito-a0bd6b56ae8ca0f4f4b94d0767c38ac6.woff2 │ └── Nunito-a1952f5f0721495404bb0f6f7eed5a72.woff2 ├── img │ └── avatars │ │ └── avatar1.jpeg ├── js │ ├── bs-init.js │ ├── main.js │ ├── listTable.js │ ├── togglepassword.js │ ├── dataTables.bootstrap5.min.js │ ├── theme.js │ └── buttons.print.min.js └── css │ └── Navbar-Right-Links-icons.css ├── html ├── assets │ ├── fonts │ │ ├── fa-brands-400.eot │ │ ├── fa-brands-400.ttf │ │ ├── fa-brands-400.woff │ │ ├── fa-regular-400.eot │ │ ├── fa-regular-400.ttf │ │ ├── fa-solid-900.eot │ │ ├── fa-solid-900.ttf │ │ ├── fa-solid-900.woff │ │ ├── fa-solid-900.woff2 │ │ ├── fa-brands-400.woff2 │ │ ├── fa-regular-400.woff │ │ ├── fa-regular-400.woff2 │ │ ├── Nunito-31cb3cc7f0a41186c0be5225caa408c3.woff2 │ │ ├── Nunito-49507be8926ed86b54f246864dfb2b91.woff2 │ │ ├── Nunito-4c5c6c8d60cf38c7a442b766dfd3ac9f.woff2 │ │ ├── Nunito-56f97c8310e9868d5e4f649ff0cc0536.woff2 │ │ ├── Nunito-58050dbecc5a1ef8ffb017fb99b15294.woff2 │ │ ├── Nunito-61492c245979f8a0f42bffcedfa474e6.woff2 │ │ ├── Nunito-6c46e979458f0c7829f6f041688f5621.woff2 │ │ ├── Nunito-7cdc9c521e8cbc9c2263ff91673131a3.woff2 │ │ ├── Nunito-a0bd6b56ae8ca0f4f4b94d0767c38ac6.woff2 │ │ └── Nunito-a1952f5f0721495404bb0f6f7eed5a72.woff2 │ ├── img │ │ └── avatars │ │ │ ├── avatar1.jpeg │ │ │ ├── avatar2.jpeg │ │ │ ├── avatar3.jpeg │ │ │ ├── avatar4.jpeg │ │ │ └── avatar5.jpeg │ ├── js │ │ ├── bs-init.js │ │ └── theme.js │ └── css │ │ └── Navbar-Right-Links-icons.css ├── payments.html ├── logs.html ├── index.html ├── reports.html ├── login.html ├── status.html ├── staff.html └── dashboard.html ├── functions ├── authentication.php ├── logout.php ├── remove-staff.php ├── remove-member.php ├── connection.php ├── views │ ├── member-profile.php │ ├── reports.php │ ├── rooms.php │ ├── activity.php │ ├── get-data.php │ ├── staff.php │ ├── dashboard-count.php │ ├── members.php │ ├── members-status.php │ └── dashboard-chart.php ├── login.php ├── add-staff.php ├── payment.php ├── update-staff.php ├── updat-staff.php ├── update-member.php ├── add-member.php └── setup.php ├── LICENSE ├── .github └── workflows │ └── static.yml ├── README.MD ├── reciept.php ├── reports.php ├── logs.php ├── index.php ├── status.php ├── dashboard.php └── staff.php /.gitignore: -------------------------------------------------------------------------------- 1 | functions/img/* -------------------------------------------------------------------------------- /todo.txt: -------------------------------------------------------------------------------- 1 | membership status & reciept ASAP -------------------------------------------------------------------------------- /screenshots/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/screenshots/image.png -------------------------------------------------------------------------------- /assets/fonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-brands-400.eot -------------------------------------------------------------------------------- /assets/fonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /assets/fonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-brands-400.woff -------------------------------------------------------------------------------- /assets/fonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-regular-400.eot -------------------------------------------------------------------------------- /assets/fonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /assets/fonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-solid-900.eot -------------------------------------------------------------------------------- /assets/fonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /assets/fonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-solid-900.woff -------------------------------------------------------------------------------- /assets/fonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /assets/img/avatars/avatar1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/img/avatars/avatar1.jpeg -------------------------------------------------------------------------------- /assets/fonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /assets/fonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-regular-400.woff -------------------------------------------------------------------------------- /assets/fonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-brands-400.eot -------------------------------------------------------------------------------- /html/assets/fonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /html/assets/fonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-brands-400.woff -------------------------------------------------------------------------------- /html/assets/fonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-regular-400.eot -------------------------------------------------------------------------------- /html/assets/fonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /html/assets/fonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-solid-900.eot -------------------------------------------------------------------------------- /html/assets/fonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /html/assets/fonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-solid-900.woff -------------------------------------------------------------------------------- /html/assets/fonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /html/assets/img/avatars/avatar1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/img/avatars/avatar1.jpeg -------------------------------------------------------------------------------- /html/assets/img/avatars/avatar2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/img/avatars/avatar2.jpeg -------------------------------------------------------------------------------- /html/assets/img/avatars/avatar3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/img/avatars/avatar3.jpeg -------------------------------------------------------------------------------- /html/assets/img/avatars/avatar4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/img/avatars/avatar4.jpeg -------------------------------------------------------------------------------- /html/assets/img/avatars/avatar5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/img/avatars/avatar5.jpeg -------------------------------------------------------------------------------- /html/assets/fonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-regular-400.woff -------------------------------------------------------------------------------- /html/assets/fonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-31cb3cc7f0a41186c0be5225caa408c3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-31cb3cc7f0a41186c0be5225caa408c3.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-49507be8926ed86b54f246864dfb2b91.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-49507be8926ed86b54f246864dfb2b91.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-4c5c6c8d60cf38c7a442b766dfd3ac9f.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-4c5c6c8d60cf38c7a442b766dfd3ac9f.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-56f97c8310e9868d5e4f649ff0cc0536.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-56f97c8310e9868d5e4f649ff0cc0536.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-58050dbecc5a1ef8ffb017fb99b15294.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-58050dbecc5a1ef8ffb017fb99b15294.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-61492c245979f8a0f42bffcedfa474e6.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-61492c245979f8a0f42bffcedfa474e6.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-6c46e979458f0c7829f6f041688f5621.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-6c46e979458f0c7829f6f041688f5621.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-7cdc9c521e8cbc9c2263ff91673131a3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-7cdc9c521e8cbc9c2263ff91673131a3.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-a0bd6b56ae8ca0f4f4b94d0767c38ac6.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-a0bd6b56ae8ca0f4f4b94d0767c38ac6.woff2 -------------------------------------------------------------------------------- /assets/fonts/Nunito-a1952f5f0721495404bb0f6f7eed5a72.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/assets/fonts/Nunito-a1952f5f0721495404bb0f6f7eed5a72.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-31cb3cc7f0a41186c0be5225caa408c3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-31cb3cc7f0a41186c0be5225caa408c3.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-49507be8926ed86b54f246864dfb2b91.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-49507be8926ed86b54f246864dfb2b91.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-4c5c6c8d60cf38c7a442b766dfd3ac9f.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-4c5c6c8d60cf38c7a442b766dfd3ac9f.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-56f97c8310e9868d5e4f649ff0cc0536.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-56f97c8310e9868d5e4f649ff0cc0536.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-58050dbecc5a1ef8ffb017fb99b15294.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-58050dbecc5a1ef8ffb017fb99b15294.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-61492c245979f8a0f42bffcedfa474e6.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-61492c245979f8a0f42bffcedfa474e6.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-6c46e979458f0c7829f6f041688f5621.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-6c46e979458f0c7829f6f041688f5621.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-7cdc9c521e8cbc9c2263ff91673131a3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-7cdc9c521e8cbc9c2263ff91673131a3.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-a0bd6b56ae8ca0f4f4b94d0767c38ac6.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-a0bd6b56ae8ca0f4f4b94d0767c38ac6.woff2 -------------------------------------------------------------------------------- /html/assets/fonts/Nunito-a1952f5f0721495404bb0f6f7eed5a72.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashJProgramming/GMS/HEAD/html/assets/fonts/Nunito-a1952f5f0721495404bb0f6f7eed5a72.woff2 -------------------------------------------------------------------------------- /functions/authentication.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /assets/js/bs-init.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | 3 | var charts = document.querySelectorAll('[data-bss-chart]'); 4 | 5 | for (var chart of charts) { 6 | chart.chart = new Chart(chart, JSON.parse(chart.dataset.bssChart)); 7 | } 8 | }, false); -------------------------------------------------------------------------------- /functions/logout.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 8 | $stmt->bindParam(':id', $id); 9 | $stmt->execute(); 10 | 11 | generate_logs('Remove staff', $id . '| Boarder details were removed'); 12 | header('Location: ../staff.php?type=success&message=Staff details were removed successfully'); 13 | exit; 14 | -------------------------------------------------------------------------------- /functions/remove-member.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 8 | $stmt->bindParam(':id', $id); 9 | $stmt->execute(); 10 | 11 | generate_logs('Remove member', $id . '| Boarder details were removed'); 12 | header('Location: ../members.php?type=success&message=Member details were removed successfully'); 13 | exit; 14 | -------------------------------------------------------------------------------- /functions/connection.php: -------------------------------------------------------------------------------- 1 | connect_error); 6 | } 7 | 8 | function generate_logs($type, $logs) 9 | { 10 | if (session_status() == PHP_SESSION_NONE) { 11 | session_start(); 12 | } 13 | global $db; 14 | $sql = "INSERT INTO logs (user_id, logs, type) VALUES (:user_id, :logs, :type)"; 15 | $stmt = $db->prepare($sql); 16 | $stmt->bindParam(':user_id', $_SESSION['id']); 17 | $stmt->bindParam(':logs', $logs); 18 | $stmt->bindParam(':type', $type); 19 | $stmt->execute(); 20 | } 21 | -------------------------------------------------------------------------------- /functions/views/member-profile.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 8 | $stmt->execute(); 9 | $results = $stmt->fetch(); 10 | 11 | $fullname = $results['fullname']; 12 | $phone = $results['phone']; 13 | $address = $results['address']; 14 | $room = $results['room']; 15 | $rent = $results['rent']; 16 | $type = $results['type']; 17 | $profile_picture = $results['profile_picture']; 18 | $proof_of_identity = $results['proof_of_identity']; -------------------------------------------------------------------------------- /functions/views/reports.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 8 | $stmt->execute(); 9 | $results = $stmt->fetchAll(); 10 | 11 | foreach ($results as $row) { 12 | ?> 13 | 14 | 15 | 16 | 17 | 18 | ₱ 19 | ₱ 20 | 21 | 22 | -------------------------------------------------------------------------------- /functions/views/rooms.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 6 | $stmt->execute(); 7 | $results = $stmt->fetchAll(); 8 | 9 | 10 | foreach ($results as $row) { 11 | 12 | ?> 13 | 14 | 15 | 16 | ₱ 17 | 18 | 19 | 20 | 21 | 22 | 23 | prepare($sql); 6 | $stmt->execute(); 7 | $results = $stmt->fetchAll(); 8 | 9 | 10 | foreach ($results as $row) { 11 | 12 | $sql = 'SELECT username FROM users WHERE id = :id'; 13 | $stmt = $db->prepare($sql); 14 | $stmt->bindParam(':id', $row['user_id']); 15 | $stmt->execute(); 16 | $user = $stmt->fetch(); 17 | ?> 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | prepare($sql); 8 | $stmt->execute(); 9 | $results = $stmt->fetchAll(); 10 | 11 | foreach ($results as $row) { 12 | $roomId = $row['id']; 13 | $roomPax = $row['pax']; 14 | $roomRent = $row['rent']; 15 | $sql = 'SELECT COUNT(*) AS boarders_count FROM boarders WHERE room = :roomId'; 16 | $stmt = $db->prepare($sql); 17 | $stmt->bindParam(':roomId', $roomId); 18 | $stmt->execute(); 19 | $boardersCount = $stmt->fetchColumn(); 20 | $available = $roomPax - $boardersCount; 21 | if ($roomPax > $boardersCount) { 22 | ?> 23 | 24 | prepare($sql); 11 | $stmt->execute([$username]); 12 | $user = $stmt->fetch(PDO::FETCH_ASSOC); 13 | 14 | if ($user && password_verify($password, $user['password'])) { 15 | 16 | session_start(); 17 | $_SESSION['username'] = $username; 18 | $_SESSION['level'] = $user['level']; 19 | $_SESSION['id'] = $user['id']; 20 | if (isset($_POST['remember'])) { 21 | setcookie('username', $username, time() + (86400 * 30), "/"); 22 | setcookie('password', $password, time() + (86400 * 30), "/"); 23 | } else { 24 | setcookie('username', '', time() - 3600, "/"); 25 | setcookie('password', '', time() - 3600, "/"); 26 | } 27 | generate_logs('Login', $username.'| Logged in'); 28 | header('location: ../dashboard.php'); 29 | } else { 30 | // Show an error message 31 | header('location: ../index.php?type=error&message=Wrong username or password'); 32 | } 33 | -------------------------------------------------------------------------------- /functions/add-staff.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 12 | $stmt->bindParam(':username', $username); 13 | $stmt->bindParam(':phone', $phone); 14 | $stmt->execute(); 15 | $count = $stmt->rowCount(); 16 | 17 | if ($count > 0) { 18 | header('Location: ../staff.php?type=error&message=Staff already exists'); 19 | exit; 20 | } 21 | 22 | $sql = "INSERT INTO `users` (`fullname`, `phone`, `address`, `username`, `password`, `level`) VALUES (:fullname, :phone, :address, :username, :password, 1)"; 23 | $stmt = $db->prepare($sql); 24 | $stmt->bindParam(':fullname', $fullname); 25 | $stmt->bindParam(':phone', $phone); 26 | $stmt->bindParam(':address', $address); 27 | $stmt->bindParam(':username', $username); 28 | $stmt->bindParam(':password', password_hash($password, PASSWORD_DEFAULT)); 29 | $stmt->execute(); 30 | 31 | header('Location: ../staff.php?type=success&message=Staff details were added successfully'); -------------------------------------------------------------------------------- /functions/payment.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 24 | $stmt->bindParam(':member', $id); 25 | $stmt->bindParam(':type', $type); 26 | $stmt->bindParam(':amount', $amount); 27 | $stmt->bindParam(':total', $total); 28 | $stmt->execute(); 29 | 30 | $paymentId = $db->lastInsertId(); 31 | 32 | $sql = "UPDATE members SET start_date = CURDATE() WHERE id = :id"; 33 | $stmt = $db->prepare($sql); 34 | $stmt->bindParam(':id', $id); 35 | $stmt->execute(); 36 | 37 | generate_logs('Payment', $id . '| Payment was made'); 38 | header('Location: ../reciept.php?id=' . $paymentId); 39 | // header('Location: ../rentals.php?type=success&message=Payment was made successfully'); 40 | ?> -------------------------------------------------------------------------------- /assets/css/Navbar-Right-Links-icons.css: -------------------------------------------------------------------------------- 1 | .bs-icon { 2 | --bs-icon-size: .75rem; 3 | display: flex; 4 | flex-shrink: 0; 5 | justify-content: center; 6 | align-items: center; 7 | font-size: var(--bs-icon-size); 8 | width: calc(var(--bs-icon-size) * 2); 9 | height: calc(var(--bs-icon-size) * 2); 10 | color: var(--bs-primary); 11 | } 12 | 13 | .bs-icon-xs { 14 | --bs-icon-size: 1rem; 15 | width: calc(var(--bs-icon-size) * 1.5); 16 | height: calc(var(--bs-icon-size) * 1.5); 17 | } 18 | 19 | .bs-icon-sm { 20 | --bs-icon-size: 1rem; 21 | } 22 | 23 | .bs-icon-md { 24 | --bs-icon-size: 1.5rem; 25 | } 26 | 27 | .bs-icon-lg { 28 | --bs-icon-size: 2rem; 29 | } 30 | 31 | .bs-icon-xl { 32 | --bs-icon-size: 2.5rem; 33 | } 34 | 35 | .bs-icon.bs-icon-primary { 36 | color: var(--bs-white); 37 | background: var(--bs-primary); 38 | } 39 | 40 | .bs-icon.bs-icon-primary-light { 41 | color: var(--bs-primary); 42 | background: rgba(var(--bs-primary-rgb), .2); 43 | } 44 | 45 | .bs-icon.bs-icon-semi-white { 46 | color: var(--bs-primary); 47 | background: rgba(255, 255, 255, .5); 48 | } 49 | 50 | .bs-icon.bs-icon-rounded { 51 | border-radius: .5rem; 52 | } 53 | 54 | .bs-icon.bs-icon-circle { 55 | border-radius: 50%; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /html/assets/css/Navbar-Right-Links-icons.css: -------------------------------------------------------------------------------- 1 | .bs-icon { 2 | --bs-icon-size: .75rem; 3 | display: flex; 4 | flex-shrink: 0; 5 | justify-content: center; 6 | align-items: center; 7 | font-size: var(--bs-icon-size); 8 | width: calc(var(--bs-icon-size) * 2); 9 | height: calc(var(--bs-icon-size) * 2); 10 | color: var(--bs-primary); 11 | } 12 | 13 | .bs-icon-xs { 14 | --bs-icon-size: 1rem; 15 | width: calc(var(--bs-icon-size) * 1.5); 16 | height: calc(var(--bs-icon-size) * 1.5); 17 | } 18 | 19 | .bs-icon-sm { 20 | --bs-icon-size: 1rem; 21 | } 22 | 23 | .bs-icon-md { 24 | --bs-icon-size: 1.5rem; 25 | } 26 | 27 | .bs-icon-lg { 28 | --bs-icon-size: 2rem; 29 | } 30 | 31 | .bs-icon-xl { 32 | --bs-icon-size: 2.5rem; 33 | } 34 | 35 | .bs-icon.bs-icon-primary { 36 | color: var(--bs-white); 37 | background: var(--bs-primary); 38 | } 39 | 40 | .bs-icon.bs-icon-primary-light { 41 | color: var(--bs-primary); 42 | background: rgba(var(--bs-primary-rgb), .2); 43 | } 44 | 45 | .bs-icon.bs-icon-semi-white { 46 | color: var(--bs-primary); 47 | background: rgba(255, 255, 255, .5); 48 | } 49 | 50 | .bs-icon.bs-icon-rounded { 51 | border-radius: .5rem; 52 | } 53 | 54 | .bs-icon.bs-icon-circle { 55 | border-radius: 50%; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /functions/update-staff.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 13 | $stmt->bindParam(':username', $username); 14 | $stmt->bindParam(':phone', $phone); 15 | $stmt->bindParam(':id', $id); 16 | $stmt->execute(); 17 | $count = $stmt->rowCount(); 18 | 19 | if ($count > 0) { 20 | header('Location: ../staff.php?type=error&message=Staff already exists'); 21 | exit; 22 | } 23 | 24 | $sql = "UPDATE `users` SET `fullname` = :fullname, `phone` = :phone, `address` = :address, `username` = :username, `password` = :password WHERE `id` = :id"; 25 | $stmt = $db->prepare($sql); 26 | $stmt->bindParam(':id', $id); 27 | $stmt->bindParam(':fullname', $fullname); 28 | $stmt->bindParam(':phone', $phone); 29 | $stmt->bindParam(':address', $address); 30 | $stmt->bindParam(':username', $username); 31 | $stmt->bindParam(':password', password_hash($password, PASSWORD_DEFAULT)); 32 | $stmt->execute(); 33 | 34 | header('Location: ../staff.php?type=success&message=Staff details were updated successfully'); -------------------------------------------------------------------------------- /functions/views/staff.php: -------------------------------------------------------------------------------- 1 | 0'; 5 | $stmt = $db->prepare($sql); 6 | $stmt->execute(); 7 | $results = $stmt->fetchAll(); 8 | 9 | foreach ($results as $row) { 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | prepare($sql); 15 | $stmt->bindParam(':id', $id); 16 | $stmt->bindParam(':fullname', $fullname); 17 | $stmt->bindParam(':phone', $phone); 18 | $stmt->execute(); 19 | $count = $stmt->rowCount(); 20 | 21 | if ($count > 0) { 22 | header('Location: ../members.php?type=error&message=Member already exists'); 23 | exit; 24 | } 25 | 26 | $sql = "UPDATE `members` SET `fullname` = :fullname , `sex` = :sex , `phone` = :phone , `address` = :address , `type` = :type , `start_date` = :start_date , `birthdate` = :birthdate WHERE `id` = :id"; 27 | $stmt = $db->prepare($sql); 28 | $stmt->bindParam(':id', $id); 29 | $stmt->bindParam(':fullname', $fullname); 30 | $stmt->bindParam(':sex', $sex); 31 | $stmt->bindParam(':phone', $phone); 32 | $stmt->bindParam(':address', $address); 33 | $stmt->bindParam(':type', $type); 34 | $stmt->bindParam(':start_date', $start_date); 35 | $stmt->bindParam(':birthdate', $birthdate); 36 | $stmt->execute(); 37 | 38 | header('Location: ../members.php?type=success&message=Member was updated successfully'); 39 | -------------------------------------------------------------------------------- /functions/update-member.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 15 | $stmt->bindParam(':id', $id); 16 | $stmt->bindParam(':fullname', $fullname); 17 | $stmt->bindParam(':phone', $phone); 18 | $stmt->execute(); 19 | $count = $stmt->rowCount(); 20 | 21 | if ($count > 0) { 22 | header('Location: ../members.php?type=error&message=Member already exists'); 23 | exit; 24 | } 25 | 26 | $sql = "UPDATE `members` SET `fullname` = :fullname , `sex` = :sex , `phone` = :phone , `address` = :address , `type` = :type , `start_date` = :start_date , `birthdate` = :birthdate WHERE `id` = :id"; 27 | $stmt = $db->prepare($sql); 28 | $stmt->bindParam(':id', $id); 29 | $stmt->bindParam(':fullname', $fullname); 30 | $stmt->bindParam(':sex', $sex); 31 | $stmt->bindParam(':phone', $phone); 32 | $stmt->bindParam(':address', $address); 33 | $stmt->bindParam(':type', $type); 34 | $stmt->bindParam(':start_date', $start_date); 35 | $stmt->bindParam(':birthdate', $birthdate); 36 | $stmt->execute(); 37 | 38 | header('Location: ../members.php?type=success&message=Member was updated successfully'); 39 | -------------------------------------------------------------------------------- /functions/views/dashboard-count.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 8 | $stmt->execute(); 9 | $result = $stmt->fetch(); 10 | $monthlyEarnings = $result['monthlyEarnings']; 11 | return $monthlyEarnings; 12 | } 13 | 14 | function calculateYearlyEarnings() { 15 | global $db; 16 | $sql = 'SELECT SUM(total) AS yearlyEarnings FROM payments WHERE YEAR(created_at) = YEAR(CURRENT_DATE())'; 17 | $stmt = $db->prepare($sql); 18 | $stmt->execute(); 19 | $result = $stmt->fetch(); 20 | $yearlyEarnings = $result['yearlyEarnings']; 21 | return $yearlyEarnings; 22 | } 23 | 24 | function countTotalActiveMembers() { 25 | global $db; 26 | $sql = 'SELECT COUNT(*) AS totalActiveMembers FROM `members` WHERE DATE_ADD(start_date, INTERVAL 1 MONTH) > CURDATE()'; 27 | $stmt = $db->prepare($sql); 28 | $stmt->execute(); 29 | $result = $stmt->fetch(); 30 | $totalActiveMembers = $result['totalActiveMembers']; 31 | return $totalActiveMembers; 32 | } 33 | 34 | function countTotalMembers() { 35 | global $db; 36 | $sql = 'SELECT COUNT(*) AS totalMembers FROM members'; 37 | $stmt = $db->prepare($sql); 38 | $stmt->execute(); 39 | $result = $stmt->fetch(); 40 | $totalMembers = $result['totalMembers']; 41 | return $totalMembers; 42 | } -------------------------------------------------------------------------------- /functions/views/members.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 6 | $stmt->execute(); 7 | $results = $stmt->fetchAll(); 8 | 9 | foreach ($results as $row) { 10 | $age = date_diff(date_create($row['birthdate']), date_create('now'))->y; 11 | ?> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | '; 11 | let title = 'Show password'; 12 | btnclass = btnclass ?? ''; 13 | return $(this).replaceWith( 14 | $('
') 15 | .append($('')) 16 | .append('') 17 | ); 18 | }); 19 | }; 20 | 21 | })(jQuery); 22 | 23 | $(() => { 24 | 25 | $(document).on('click', '[data-role="togglepassword"]', function () { 26 | let target = $(this).data('target'); 27 | let is_password = $(target).attr('type') === 'password'; 28 | $(target).attr('type', (is_password ? 'text' : 'password')); 29 | $(this).html(''); 30 | $(this).attr('title', is_password ? 'Show password' : 'Hide password'); 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /functions/views/members-status.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 7 | $stmt->execute(); 8 | $results = $stmt->fetchAll(); 9 | 10 | foreach ($results as $row) { 11 | $age = date_diff(date_create($row['birthdate']), date_create('now'))->y; 12 | $daysDue = $row['days_due']; 13 | $class = ''; 14 | $text = ''; 15 | if ($daysDue > 0) { 16 | $class = 'badge bg-success'; 17 | $text = 'Expire in ' . $daysDue . ' days'; 18 | } elseif ($daysDue == 0) { 19 | $class = 'badge bg-warning'; 20 | $text = 'Expire Today'; 21 | } else { 22 | $class = 'badge bg-danger'; 23 | $text = 'Expired'; 24 | } 25 | 26 | if ($row['type'] == 'Regular') { 27 | $text_type =$row['type'].' - ₱300'; 28 | } elseif ($row['type'] == 'Premium') { 29 | $text_type =$row['type'].' - ₱500'; 30 | } else { 31 | $text_type =$row['type'].' - ₱800'; 32 | } 33 | ?> 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 52 | -------------------------------------------------------------------------------- /functions/add-member.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 16 | $stmt->bindParam(':fullname', $fullname); 17 | $stmt->bindParam(':phone', $phone); 18 | $stmt->execute(); 19 | $count = $stmt->rowCount(); 20 | 21 | if ($count > 0) { 22 | header('Location: ../members.php?type=error&message=Member already exists'); 23 | exit; 24 | } 25 | 26 | if ($type == 'Regular'){ 27 | $total = 300; 28 | } elseif ($type == 'Premium'){ 29 | $total = 500; 30 | } else { 31 | $total = 800; 32 | } 33 | 34 | $change = $amount - $total; 35 | 36 | if ($change < 0) { 37 | header('Location: ../members.php?type=error&message=Amount is not enough'); 38 | exit; 39 | } 40 | 41 | $sql = "INSERT INTO `members` (`fullname`, `sex`, `phone`, `address`, `type`, `start_date`, `birthdate`) 42 | VALUES (:fullname, :sex, :phone, :address, :type, :start_date, :birthdate)"; 43 | $stmt = $db->prepare($sql); 44 | $stmt->bindParam(':fullname', $fullname); 45 | $stmt->bindParam(':sex', $sex); 46 | $stmt->bindParam(':phone', $phone); 47 | $stmt->bindParam(':address', $address); 48 | $stmt->bindParam(':type', $type); 49 | $stmt->bindParam(':start_date', $start_date); 50 | $stmt->bindParam(':birthdate', $birthdate); 51 | $stmt->execute(); 52 | 53 | $id = $db->lastInsertId(); 54 | 55 | $sql = "INSERT INTO payments (member, type, amount, total) VALUES (:member, :type, :amount, :total)"; 56 | $stmt = $db->prepare($sql); 57 | $stmt->bindParam(':member', $id); 58 | $stmt->bindParam(':type', $type); 59 | $stmt->bindParam(':amount', $amount); 60 | $stmt->bindParam(':total', $total); 61 | $stmt->execute(); 62 | 63 | $paymentId = $db->lastInsertId(); 64 | 65 | $sql = "UPDATE members SET start_date = CURDATE() WHERE id = :id"; 66 | $stmt = $db->prepare($sql); 67 | $stmt->bindParam(':id', $id); 68 | $stmt->execute(); 69 | 70 | generate_logs('Payment', $id . '| Payment was made'); 71 | header('Location: ../reciept.php?id=' . $paymentId); 72 | -------------------------------------------------------------------------------- /assets/js/dataTables.bootstrap5.min.js: -------------------------------------------------------------------------------- 1 | /*! DataTables Bootstrap 5 integration 2 | * 2020 SpryMedia Ltd - datatables.net/license 3 | */ 4 | !function(t){var n,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(n=require("jquery"),r=function(e,a){a.fn.dataTable||require("datatables.net")(e,a)},"undefined"!=typeof window?module.exports=function(e,a){return e=e||window,a=a||n(e),r(e,a),t(a,0,e.document)}:(r(window,n),module.exports=t(n,window,window.document))):t(jQuery,window,document)}(function(x,e,r,i){"use strict";var o=x.fn.dataTable;return x.extend(!0,o.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row dt-row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",renderer:"bootstrap"}),x.extend(o.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap5",sFilterInput:"form-control form-control-sm",sLengthSelect:"form-select form-select-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"}),o.ext.renderer.pageButton.bootstrap=function(d,e,s,a,l,c){function u(e,a){for(var t,n,r=function(e){e.preventDefault(),x(e.currentTarget).hasClass("disabled")||b.page()==e.data.action||b.page(e.data.action).draw("page")},i=0,o=a.length;i",{class:m.sPageButton+" "+f,id:0===s&&"string"==typeof t?d.sTableId+"_"+t:null}).append(x("",{href:n?null:"#","aria-controls":d.sTableId,"aria-disabled":n?"true":null,"aria-label":w[t],"aria-role":"link","aria-current":"active"===f?"page":null,"data-dt-idx":t,tabindex:d.iTabIndex,class:"page-link"}).html(p)).appendTo(e),d.oApi._fnBindAction(n,{action:t},r))}}var p,f,t,b=new o.Api(d),m=d.oClasses,g=d.oLanguage.oPaginate,w=d.oLanguage.oAria.paginate||{},e=x(e);try{t=e.find(r.activeElement).data("dt-idx")}catch(e){}var n=e.children("ul.pagination");n.length?n.empty():n=e.html("