PHP and MySQL-Based Lost and Found Information System – Free Source Code Download
Lost and Found Information System Project Overview
The Lost and Found Information System is a web-based platform that allows users to post and search for lost and found items. Developed using PHP
How the Lost and Found Information System Works
This system consists of two main parts: the Public Site and the Management Site.
- Management Site
The Management Site is for administrators and staff of the organization. To access this site, users must log in with valid credentials. There are two types of users:- Administrators: They have full access to all system features, including managing user accounts, items, categories, and system information.
- Staff: They have limited access to certain features.
The management can also update some of the content on the public site through the front-end of the management site.
- Public Site
The Public Site is accessible to everyone. Visitors can:- View the list of published lost and found items.
- Filter items by category.
- Post items they have found (pending approval).
- Browse pages like “About Us” and “Contact Us”.
- Send messages for inquiries or concerns.
Key Features of the Public Site
- Home Page
Displays the main features and information about the site. - List All Published Lost and Found Items
Users can view all items that have been posted. - Filter by Category
Visitors can filter the list of items based on categories like electronics, clothing, etc. - Post Found Items
Users can post items they have found, which will be subject to approval. - About Us Page
Provides information about the organization. - Contact Information Page
Lists ways to contact the organization. - Send Message
Allows users to send inquiries or feedback.
Technologies Used
The system is developed using the following technologies:
- XAMPP (for local web server setup)
- VS Code (code editor)
- HTML, CSS, JavaScript, PHP (programming languages)
- MySQL Database (for data storage)
- jQuery and Ajax (for dynamic content updates)
- Bootstrap Framework and Icons (for responsive design)
- NiceAdmin Template (for the admin panel interface)
How to Run the Lost and Found Information System
Requirements:
- Download and install a local web server such as XAMPP.
- Download the provided source code zip file (download button is available below this article).
System Setup:
- Enable the GD Library in your
php.ini
file. - Open the XAMPP Control Panel and start Apache and MySQL.
- Extract the downloaded zip file.
- Copy the extracted folder and paste it into the XAMPP “htdocs” directory.
- Open PHPMyAdmin in a browser (e.g., http://localhost/phpmyadmin).
- Create a new database called lfis_db.
- Import the lfis_db.sql file located in the database folder.
- Open the Lost and Found Information System in a browser (e.g., http://localhost/php-lfis/).
Default Admin Access:
- Username: admin
- Password: sourcecodester&123
Conclusion
This Lost and Found Information System is a useful project for anyone looking to build a PHP-based platform with MySQL integration. You can download the complete source code and modify it to fit your own needs. Feel free to explore this system for your current and future PHP projects.
For more tutorials and free source code, continue exploring the website!
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 |
<?php require_once('./config.php'); ?> <!DOCTYPE html> <html lang="en"> <?php require_once('inc/header.php') ?> <body class="toggle-sidebar"> <style> #banner-slider{ height: 400px; } #banner-slider .carousel-inner { height: 100%; } #banner-slider img.d-block.w-100 { object-fit: cover; object-position: center center; } </style> <?php $page = isset($_GET['page']) ? $_GET['page'] : 'home'; ?> <?php $pageSplit = explode("/",$page); if(isset($pageSplit[1])) $pageSplit[1] = (strtolower($pageSplit[1]) == 'list') ? $pageSplit[0].' List' : $pageSplit[1]; ?> <?php require_once('inc/topBarNav.php') ?> <!-- Content Wrapper. Contains page content --> <main id="main" class="main"> <?php if(in_array($page, ['home'])): ?> <div class="col-12"> <div id="site-header" style="--bg: url(<?= validate_image($_settings->info('cover')) ?>)"> <div class="header-content"> <div class="siteTitle"><?= $_settings->info('name') ?></div> <hr class="border-light opacity-100 mx-auto" style="width:100px;border-width:3px"> <a href="<?= base_url.'?page=items' ?>" class="btn btn-lg btn-primary rounded-pill col-lg-3 col-md-5 col-sm-7 col-10 mx-auto d-block">Find Item</a> </div> </div> </div> <?php endif; ?> <div class="container-xl px-4"> <div id="msg-container"> <?php if($_settings->chk_flashdata('success')): ?> <script> alert_toast("<?php echo $_settings->flashdata('success') ?>",'success') </script> <?php endif;?> </div> <?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> </main> <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-teal 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-teal 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> <?php require_once('inc/footer.php') ?> </body> </html> |
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
<?php require_once '../config.php'; class Login extends DBConnection { private $settings; public function __construct(){ global $_settings; $this->settings = $_settings; parent::__construct(); ini_set('display_error', 1); } public function __destruct(){ parent::__destruct(); } public function index(){ echo "<h1>Access Denied</h1> <a href='".base_url."'>Go Back.</a>"; } public function login(){ extract($_POST); $stmt = $this->conn->prepare("SELECT * from users where username = ?"); $stmt->bind_param('s',$username); $stmt->execute(); $result = $stmt->get_result(); if($result->num_rows > 0){ $data = $result->fetch_array(); if(password_verify($password, $data['password'])){ foreach($data as $k => $v){ if(!is_numeric($k) && $k != 'password'){ $this->settings->set_userdata($k,$v); } } $this->settings->set_userdata('login_type',1); return json_encode(array('status'=>'success')); }else{ return json_encode(array('status'=>'incorrect')); } }else{ return json_encode(array('status'=>'incorrect')); } } public function logout(){ if($this->settings->sess_des()){ redirect('admin/login.php'); } } function login_customer(){ extract($_POST); $stmt = $this->conn->prepare("SELECT * from customer_list where email = ? and `password` = ? "); $password = md5($password); $stmt->bind_param('ss',$email,$password); $stmt->execute(); $result = $stmt->get_result(); if($result->num_rows > 0){ $res = $result->fetch_array(); foreach($res as $k => $v){ $this->settings->set_userdata($k,$v); } $this->settings->set_userdata('login_type',2); $resp['status'] = 'success'; }else{ $resp['status'] = 'failed'; $resp['msg'] = 'Incorrect Email or Password'; } if($this->conn->error){ $resp['status'] = 'failed'; $resp['_error'] = $this->conn->error; } return json_encode($resp); } public function logout_customer(){ if($this->settings->sess_des()){ redirect('?'); } } } $action = !isset($_GET['f']) ? 'none' : strtolower($_GET['f']); $auth = new Login(); switch ($action) { case 'login': echo $auth->login(); break; case 'logout': echo $auth->logout(); break; case 'login_customer': echo $auth->login_customer(); break; case 'logout_customer': echo $auth->logout_customer(); break; default: echo $auth->index(); break; } |
lfis_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 |
-- phpMyAdmin SQL Dump -- version 5.1.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 01, 2023 at 08:28 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: `lfis_db` -- -- -------------------------------------------------------- -- -- Table structure for table `category_list` -- CREATE TABLE `category_list` ( `id` bigint(30) NOT NULL, `name` text NOT NULL, `description` text NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 1, `created_at` datetime NOT NULL DEFAULT current_timestamp(), `updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `category_list` -- INSERT INTO `category_list` (`id`, `name`, `description`, `status`, `created_at`, `updated_at`) VALUES (1, 'Mobile Phones', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id est enim. Fusce malesuada dapibus lobortis. Maecenas commodo cursus ante, a efficitur lorem ultrices a. Cras tincidunt, leo at consequat viverra, lacus elit tempus diam, sed scelerisque turpis purus eu ex. Sed placerat, sem vel accumsan maximus, nibh massa rhoncus mi, quis lacinia nisl quam eu purus.</p>', 1, '2023-05-01 10:32:44', NULL), (2, 'Keys', '<p>Nulla at tellus tristique, venenatis mauris a, commodo urna. Integer arcu quam, maximus id nulla vitae, eleifend lacinia tellus. Proin nec consequat risus. Sed et felis justo. Duis quis magna vel felis volutpat consectetur ut et enim. Integer nec auctor felis. Fusce nec mauris luctus, lacinia erat in, porttitor tellus. Nunc quis mauris velit. Sed nec libero vitae leo blandit mattis.</p>', 1, '2023-05-01 10:34:27', NULL), (3, 'Watches', '<p>Etiam volutpat dictum tempor. Nulla rutrum arcu eu volutpat pharetra. Aliquam non luctus ex. Maecenas nibh ipsum, efficitur in dui at, rhoncus convallis orci. Duis bibendum tempor sapien, non sollicitudin massa porttitor sed.</p>', 1, '2023-05-01 10:35:58', '2023-05-01 10:36:15'); -- -------------------------------------------------------- -- -- Table structure for table `inquiry_list` -- CREATE TABLE `inquiry_list` ( `id` bigint(30) NOT NULL, `fullname` text NOT NULL, `contact` text NOT NULL, `email` text NOT NULL, `message` text NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime NOT NULL DEFAULT current_timestamp(), `updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `inquiry_list` -- INSERT INTO `inquiry_list` (`id`, `fullname`, `contact`, `email`, `message`, `status`, `created_at`, `updated_at`) VALUES (1, 'Jane Doe', '09123546788', 'jdoe@mail.com', 'Vestibulum suscipit felis at magna congue gravida. Quisque interdum eu odio sed vulputate.', 1, '2023-05-01 14:11:19', '2023-05-01 14:25:47'); -- -------------------------------------------------------- -- -- Table structure for table `item_list` -- CREATE TABLE `item_list` ( `id` bigint(30) NOT NULL, `category_id` bigint(30) NOT NULL, `fullname` text NOT NULL, `title` text NOT NULL, `description` text NOT NULL, `contact` text NOT NULL, `image_path` text DEFAULT NULL, `status` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime NOT NULL DEFAULT current_timestamp(), `updated` datetime DEFAULT NULL ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `item_list` -- INSERT INTO `item_list` (`id`, `category_id`, `fullname`, `title`, `description`, `contact`, `image_path`, `status`, `created_at`, `updated`) VALUES (1, 2, 'Mark Cooper', 'Found Keys at Central Park', 'Suspendisse nisl diam, pretium ut placerat nec, pellentesque in tortor. Suspendisse vitae arcu a mi dapibus elementum ac dignissim tellus. Duis vitae molestie lacus, porttitor lacinia justo. Ut vulputate, ipsum interdum consequat mollis, odio nisl vulputate est, quis ornare nisi massa a odio.', '09123564789', 'uploads/items/1.png?v=1682912925', 1, '2023-05-01 11:48:45', '2023-05-01 11:48:45'), (3, 1, 'Claire Blake', 'Found an Android Phone @ Restaurant Parking Lot', 'Etiam accumsan quis augue a pulvinar. Etiam pretium sodales ipsum, cursus venenatis urna fringilla vel. Nunc fringilla non magna sit amet pharetra. Nam iaculis rutrum eleifend. Mauris rutrum, urna eget rhoncus consequat, purus mauris luctus orci, at venenatis ex elit sed risus.', '09123654897', 'uploads/items/3.png?v=1682916949', 1, '2023-05-01 12:55:48', '2023-05-01 12:55:49'), (5, 3, 'Samantha Lou', 'Found a Watch left @ Room 101', 'Sed ultricies turpis eget commodo condimentum. Nam ac lorem vitae nulla fringilla imperdiet sit amet a arcu. Maecenas malesuada felis eleifend condimentum porttitor. Cras sed metus nec nibh interdum bibendum sit amet at sem.', '09457778988', 'uploads/items/5.png?v=1682917427', 1, '2023-05-01 13:03:47', '2023-05-01 13:03:47'), (6, 1, 'Wilson Smith', 'Found Something @ The Mall', 'Donec metus sem, volutpat id mi in, fringilla aliquet odio. Donec eleifend sem et ex maximus tristique. Donec porttitor venenatis aliquet. Aliquam tristique est sed nulla fermentum aliquam eget sed ex', '09123564789', NULL, 2, '2023-05-01 13:34:29', '2023-05-01 14:04:10'); -- -------------------------------------------------------- -- -- 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', 'Lost and Found Information System'), (6, 'short_name', 'PHP - LFIS'), (11, 'logo', 'uploads/logo.png?v=1682908055'), (13, 'user_avatar', 'uploads/user_avatar.jpg'), (14, 'cover', 'uploads/cover.png?v=1682908055'), (17, 'phone', '903-436-9356'), (18, 'mobile', '0917-351-8047'), (19, 'email', 'info@simpleorganization.org'), (20, 'address', '4226 Florence Street, Arlington, Texas, 76011'); -- -------------------------------------------------------- -- -- 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', '$2y$10$lu9Lz9d61nsRRq5aXGOrmuik6tzhMif.AIQTmxgj4LTHf3M9hyGtW', 'uploads/avatars/1.png?v=1678760026', NULL, 1, '2021-01-20 14:02:37', '2023-04-26 16:01:02'), (9, 'Claire', '', 'Blake', 'cblake', '$2y$10$DFEet3AmXnsVKls912SbHey87bsXauL7nannya2CjtV7m37dNZhNe', 'uploads/avatars/9.png?v=1682495668', NULL, 2, '2023-04-26 15:54:27', '2023-04-26 16:02:36'); -- -- Indexes for dumped tables -- -- -- Indexes for table `category_list` -- ALTER TABLE `category_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `inquiry_list` -- ALTER TABLE `inquiry_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `item_list` -- ALTER TABLE `item_list` ADD PRIMARY KEY (`id`), ADD KEY `fk_category_id` (`category_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` bigint(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `inquiry_list` -- ALTER TABLE `inquiry_list` MODIFY `id` bigint(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `item_list` -- ALTER TABLE `item_list` MODIFY `id` bigint(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- 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=10; -- -- Constraints for dumped tables -- -- -- Constraints for table `item_list` -- ALTER TABLE `item_list` ADD CONSTRAINT `fk_category_id` FOREIGN KEY (`category_id`) REFERENCES `category_list` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION; COMMIT; |
PHP and MySQL-Based Lost and Found Information System – Free Source Code Download