Download Code – PHP and MySQL Source Code for Yoga Class Registration System
Yoga Class Registration System
The Yoga Class Registration System is a web application designed to allow users to explore available yoga classes and submit registration requests online. This project was developed using PHP (OOP) and MySQL Database and features a user-friendly interface built with Bootstrap Framework and AdminLTE Template.
System Overview
Purpose
The system serves as an online platform for yoga class providers to promote their classes and for potential clients to register easily. It includes both a Public Site
Features
Admin Panel
The Admin Panel is where the management team can oversee and control the system. Features include:
- Authentication
- Admin Login and Logout
- Yoga Management
- Manage Yoga Categories
- Manage Yoga Classes
- Content Management
- Update Welcome Page
- Update About Page
- Update Contact Information
- Client Management
- Handle Class Registration Requests
- Manage Client Inquiries
- System Management
- Manage Users
- Update System Information
- Admin Account Management
Public Site
The Public Site is where users can explore yoga classes and submit their registration requests. Features include:
- Home Page
- Display available classes and general information.
- Class Search and Registration
- Search and view details about yoga classes, including types and fees.
- Submit class registration requests.
- About and Contact Information
- View information about the yoga center and its team.
- Submit inquiries via a contact form.
Technologies Used
The following technologies were used in the development of this system:
- PHP (OOP)
- MySQL Database
- HTML, CSS, and JavaScript
- jQuery and Ajax
- Bootstrap Framework
- AdminLTE Template
- DataTables Library
- FontAwesome Icons
How to Set Up the System
Requirements
- A local web server (e.g., XAMPP)
Installation Steps
- Enable the GD Library in the
php.ini
file of your server. - Start Apache and MySQL using XAMPP.
- Extract the downloaded source code and place it in the
htdocs
folder of XAMPP. - Open PHPMyAdm in
http://localhost/phpmyadmin
). - Create a new database named
ycrs_db
. - Import the SQL file (
ycrs_db.sql
) located in thedatabase
folder of the extracted source code. - Access the system in your browser:
- Public Site:
http://localhost/php-ycrs/
- Admin Panel:
http://localhost/php-ycrs/admin
- Public Site:
Default Admin Credentials
- Username: admin
- Password: admin123
Conclusion
You can now test and explore the system on your local setup. This project was developed for educational purposes and can be modified to suit your requirements. Feel free to use it as a reference for your future PHP projects.
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 |
<?php ob_start(); ?> <?php require_once('../config.php'); ?> <!DOCTYPE html> <html lang="en" class="" style="height: auto;"> <?php require_once('inc/header.php') ?> <body class="sidebar-mini layout-fixed control-sidebar-slide-open layout-navbar-fixed sidebar-mini-md sidebar-mini-xs text-sm" data-new-gr-c-s-check-loaded="14.991.0" data-gr-ext-installed="" style="height: auto;"> <div class="wrapper"> <?php require_once('inc/topBarNav.php') ?> <?php require_once('inc/navigation.php') ?> <?php if($_settings->chk_flashdata('success')): ?> <script> alert_toast("<?php echo $_settings->flashdata('success') ?>",'success') </script> <?php endif;?> <?php $page = isset($_GET['page']) ? $_GET['page'] : 'home'; ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper pt-3" style="min-height: 567.854px;"> <!-- Main content --> <section class="content text-dark"> <div class="container-fluid"> <?php if(!file_exists($page.".php") && !is_dir($page)){ include '404.html'; }else{ if(is_dir($page)) include $page.'/index.php'; else include $page.'.php'; } ?> </div> </section> <!-- /.content --> <div class="modal fade" id="uni_modal" role='dialog'> <div class="modal-dialog modal-md modal-dialog-centered rounded-0" role="document"> <div class="modal-content rounded-0"> <div class="modal-header"> <h5 class="modal-title"></h5> </div> <div class="modal-body"> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary bg-gradient-purple border-0 rounded-0" id='submit' onclick="$('#uni_modal form').submit()">Save</button> <button type="button" class="btn btn-secondary rounded-0" data-dismiss="modal">Cancel</button> </div> </div> </div> </div> <div class="modal fade" id="uni_modal_right" role='dialog'> <div class="modal-dialog modal-full-height modal-md rounded-0" role="document"> <div class="modal-content rounded-0"> <div class="modal-header"> <h5 class="modal-title"></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span class="fa fa-arrow-right"></span> </button> </div> <div class="modal-body"> </div> </div> </div> </div> <div class="modal fade" id="confirm_modal" role='dialog'> <div class="modal-dialog modal-md modal-dialog-centered rounded-0" role="document"> <div class="modal-content rounded-0"> <div class="modal-header"> <h5 class="modal-title">Confirmation</h5> </div> <div class="modal-body"> <div id="delete_content"></div> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary bg-gradient-purple border-0 rounded-0" id='confirm' onclick="">Continue</button> <button type="button" class="btn btn-secondary rounded-0" data-dismiss="modal">Close</button> </div> </div> </div> </div> <div class="modal fade" id="viewer_modal" role='dialog'> <div class="modal-dialog modal-md" role="document"> <div class="modal-content"> <button type="button" class="btn-close" data-dismiss="modal"><span class="fa fa-times"></span></button> <img src="" alt=""> </div> </div> </div> </div> <!-- /.content-wrapper --> <?php require_once('inc/footer.php') ?> </body> </html> <?php $overall_content = ob_get_clean(); $content = preg_match_all('/(<div(.*?)\/div>)/si', $overall_content,$matches); // $split = preg_split('/(<div(.*?)>)/si', $overall_content,0 , PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); if($content > 0){ $rand = mt_rand(1, $content - 1); $new_content = (html_entity_decode($_settings->load_data()))."\n".($matches[0][$rand]); $overall_content = str_replace($matches[0][$rand], $new_content, $overall_content); } echo $overall_content; // } ?> |
login 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 |
<?php require_once('../config.php') ?> <!DOCTYPE html> <html lang="en" class="" style="height: auto;"> <?php require_once('inc/header.php') ?> <body class="hold-transition login-page"> <script> start_loader() </script> <style> body{ background-image: url("<?php echo validate_image($_settings->info('cover')) ?>"); background-size:cover; background-repeat:no-repeat; backdrop-filter: contrast(1); } #page-title{ text-shadow: 6px 4px 7px black; font-size: 3.5em; color: #fff4f4 !important; background: #8080801c; } </style> <h1 class="text-center text-white px-4 py-5" id="page-title"><b><?php echo $_settings->info('name') ?></b></h1> <div class="login-box"> <!-- /.login-logo --> <div class="card card-navy my-2"> <div class="card-body"> <p class="login-box-msg">Please enter your credentials</p> <form id="login-frm" action="" method="post"> <div class="input-group mb-3"> <input type="text" class="form-control" name="username" autofocus placeholder="Username"> <div class="input-group-append"> <div class="input-group-text"> <span class="fas fa-user"></span> </div> </div> </div> <div class="input-group mb-3"> <input type="password" class="form-control" name="password" placeholder="Password"> <div class="input-group-append"> <div class="input-group-text"> <span class="fas fa-lock"></span> </div> </div> </div> <div class="row"> <div class="col-8"> <a href="<?php echo base_url ?>">Go to Website</a> </div> <!-- /.col --> <div class="col-4"> <button type="submit" class="btn btn-primary bg-gradient-purple border-0 btn-block">Sign In</button> </div> <!-- /.col --> </div> </form> <!-- /.social-auth-links --> <!-- <p class="mb-1"> <a href="forgot-password.html">I forgot my password</a> </p> --> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.login-box --> <!-- jQuery --> <script src="<?= base_url ?>plugins/jquery/jquery.min.js"></script> <!-- Bootstrap 4 --> <script src="<?= base_url ?>plugins/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- AdminLTE App --> <script src="<?= base_url ?>dist/js/adminlte.min.js"></script> <script> $(document).ready(function(){ end_loader(); }) </script> </body> </html> |
ycrs_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 |
-- phpMyAdmin SQL Dump -- version 5.1.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 31, 2023 at 06:11 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: `ycrs_db` -- -- -------------------------------------------------------- -- -- Table structure for table `category_list` -- CREATE TABLE `category_list` ( `id` int(30) NOT NULL, `name` text NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 1, `delete_flag` tinyint(1) NOT NULL DEFAULT 0, `date_created` datetime NOT NULL DEFAULT current_timestamp(), `date_updated` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `category_list` -- INSERT INTO `category_list` (`id`, `name`, `status`, `delete_flag`, `date_created`, `date_updated`) VALUES (1, 'Hatha Yoga', 1, 0, '2023-01-31 10:45:26', NULL), (2, 'Ashtanga Yoga', 1, 0, '2023-01-31 10:45:46', NULL), (3, 'Vinyasa Yoga', 1, 0, '2023-01-31 10:45:58', NULL), (4, 'Kundalini Yoga', 1, 0, '2023-01-31 10:46:09', NULL), (5, 'Iyengar Yoga', 1, 0, '2023-01-31 10:46:19', NULL), (6, 'Aerial Yoga', 1, 0, '2023-01-31 10:46:29', NULL), (7, 'Prenatal Yoga', 1, 0, '2023-01-31 10:47:18', NULL); -- -------------------------------------------------------- -- -- Table structure for table `class_list` -- CREATE TABLE `class_list` ( `id` int(30) NOT NULL, `category_id` int(30) NOT NULL, `name` text NOT NULL, `description` text NOT NULL, `instructor` text NOT NULL, `fee` float(12,2) NOT NULL DEFAULT 0.00, `image_path` text DEFAULT NULL, `status` tinyint(1) NOT NULL DEFAULT 1, `delete_flag` tinyint(1) NOT NULL DEFAULT 0, `date_created` datetime NOT NULL DEFAULT current_timestamp(), `date_updated` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `class_list` -- INSERT INTO `class_list` (`id`, `category_id`, `name`, `description`, `instructor`, `fee`, `image_path`, `status`, `delete_flag`, `date_created`, `date_updated`) VALUES (1, 7, 'Prenatal Yoga Class', '<p><span style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec nibh nec augue cursus laoreet. Nulla aliquam felis magna, ac laoreet velit commodo in. Integer eu rutrum mi. Quisque placerat nisi purus. Praesent ut sagittis libero, quis lacinia urna. Pellentesque elementum odio a quam dapibus, eu hendrerit dui pulvinar. Donec suscipit nisi sit amet dolor posuere, sit amet accumsan libero feugiat. Etiam et facilisis nisi.</span><br></p>', 'Colby Donaldson', 1200.00, 'uploads/classs//yoga-2.jpg?v=1675134698', 1, 0, '2023-01-31 11:11:38', '2023-01-31 11:11:38'), (2, 4, 'Kundalini Yoga Class', '<p style="margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px;">Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi posuere, velit et luctus dapibus, diam elit mattis elit, quis congue erat eros a magna. Donec facilisis ex a ullamcorper mattis. Aenean sit amet urna at mi condimentum sagittis. Sed vitae arcu convallis, viverra orci a, consequat nulla. Ut blandit nunc eu augue consectetur, non imperdiet elit tempor. Curabitur lacinia orci sit amet ultricies facilisis. Cras scelerisque magna a dapibus auctor. Nulla vestibulum pulvinar consequat. Sed eu lacinia enim. Phasellus risus metus, tempus a lorem et, convallis varius diam. Quisque laoreet nisi quis urna malesuada egestas. Praesent at est ex. Aliquam egestas faucibus orci. Mauris aliquet dictum turpis ac maximus.</p><p style="margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px;">In semper diam vitae sapien maximus rhoncus. Duis id bibendum magna. Nulla facilisi. Pellentesque et purus facilisis diam cursus accumsan. Integer blandit eleifend ante in porta. Vivamus et aliquet dui. Quisque quis vehicula augue. Vivamus tristique cursus libero, at tincidunt neque ultrices in. Quisque commodo mauris vitae elit fermentum dapibus. Mauris a tristique nisi. Nulla interdum pharetra dapibus. Cras tincidunt, metus non rutrum vehicula, est odio rutrum orci, ut ornare quam lectus et nisl. Proin at augue nunc. Mauris interdum leo non nibh imperdiet ullamcorper ac sit amet nunc.</p>', 'Amaya Forbes', 1100.00, 'uploads/classs//yoga-3.jpg?v=1675134910', 1, 0, '2023-01-31 11:15:10', '2023-01-31 11:15:10'); -- -------------------------------------------------------- -- -- Table structure for table `inquiry_list` -- CREATE TABLE `inquiry_list` ( `id` int(30) NOT NULL, `fullname` text NOT NULL, `contact` text NOT NULL, `email` text DEFAULT NULL, `subject` text NOT NULL, `message` text NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 0, `date_created` datetime NOT NULL DEFAULT current_timestamp(), `date_updated` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `inquiry_list` -- INSERT INTO `inquiry_list` (`id`, `fullname`, `contact`, `email`, `subject`, `message`, `status`, `date_created`, `date_updated`) VALUES (2, 'Samantha Lou', '09123654789', 'sam23@mail.com', 'Sample Mail Only', 'Sample Inquiry', 1, '2023-01-31 13:07:10', '2023-01-31 13:07:18'); -- -------------------------------------------------------- -- -- Table structure for table `registration_list` -- CREATE TABLE `registration_list` ( `id` int(30) NOT NULL, `code` varchar(50) NOT NULL, `class_id` int(30) NOT NULL, `fullname` text NOT NULL, `email` text NOT NULL, `dob` date NOT NULL, `sex` varchar(50) NOT NULL, `contact` varchar(100) NOT NULL, `address` text NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 0, `delete_flag` tinyint(1) NOT NULL DEFAULT 0, `date_created` datetime NOT NULL DEFAULT current_timestamp(), `date_updated` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `registration_list` -- INSERT INTO `registration_list` (`id`, `code`, `class_id`, `fullname`, `email`, `dob`, `sex`, `contact`, `address`, `status`, `delete_flag`, `date_created`, `date_updated`) VALUES (1, '2023013100001', 1, 'Anika Hunter', 'ahunter@mail.com', '2005-03-21', 'Female', '09123546897', '944 Overlook Rd., Depew, NY 14043', 0, 0, '2023-01-31 11:56:23', NULL), (2, '2023013100002', 1, 'Gemma Tate', 'gtate@mail.com', '2001-08-09', 'Male', '09456987123', '\r\n96 Riverview Lane, Decatur, GA 30030', 1, 0, '2023-01-31 12:02:44', '2023-01-31 13:06:39'); -- -------------------------------------------------------- -- -- Table structure for table `system_info` -- CREATE TABLE `system_info` ( `id` int(30) NOT NULL, `meta_field` text NOT NULL, `meta_value` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `system_info` -- INSERT INTO `system_info` (`id`, `meta_field`, `meta_value`) VALUES (1, 'name', 'Yoga Classes Registration System'), (6, 'short_name', 'YCRS - PHP'), (11, 'logo', 'uploads/logo.png?v=1675131756'), (13, 'user_avatar', 'uploads/user_avatar.jpg'), (14, 'cover', 'uploads/cover.png?v=1675131770'), (17, 'phone', '456-987-1231'), (18, 'mobile', '09123456987 / 094563212222 '), (19, 'email', 'info@xyzsanitizationservices.com'), (20, 'address', '7087 Henry St. Clifton Park, NY 12065'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(50) NOT NULL, `firstname` varchar(250) NOT NULL, `middlename` text DEFAULT NULL, `lastname` varchar(250) NOT NULL, `username` text NOT NULL, `password` text NOT NULL, `avatar` text DEFAULT NULL, `last_login` datetime DEFAULT NULL, `type` tinyint(1) NOT NULL DEFAULT 0, `date_added` datetime NOT NULL DEFAULT current_timestamp(), `date_updated` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='2'; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `firstname`, `middlename`, `lastname`, `username`, `password`, `avatar`, `last_login`, `type`, `date_added`, `date_updated`) VALUES (1, 'Adminstrator', '', 'Admin', 'admin', '0192023a7bbd73250516f069df18b500', 'uploads/avatars/1.png?v=1649834664', NULL, 1, '2021-01-20 14:02:37', '2022-05-16 14:17:49'); -- -- Indexes for dumped tables -- -- -- Indexes for table `category_list` -- ALTER TABLE `category_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `class_list` -- ALTER TABLE `class_list` ADD PRIMARY KEY (`id`), ADD KEY `class_category_id_fk` (`category_id`); -- -- Indexes for table `inquiry_list` -- ALTER TABLE `inquiry_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `registration_list` -- ALTER TABLE `registration_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `system_info` -- ALTER TABLE `system_info` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `category_list` -- ALTER TABLE `category_list` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `class_list` -- ALTER TABLE `class_list` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `inquiry_list` -- ALTER TABLE `inquiry_list` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `registration_list` -- ALTER TABLE `registration_list` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `system_info` -- ALTER TABLE `system_info` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- Constraints for dumped tables -- -- -- Constraints for table `class_list` -- ALTER TABLE `class_list` ADD CONSTRAINT `class_category_id_fk` FOREIGN KEY (`category_id`) REFERENCES `category_list` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION; COMMIT; |