Download code – PHP-Based Open-Source Basic Customer Relationship Management (CRM) System
PHP-Based Simple Customer Relationship Management (CRM) System
Project Overview
The Simple Customer Relationship Management (CRM) System is a web-based application developed using PHP and MySQL Database. It provides businesses with an online platform where customers can request quotations and submit tickets. The system has a user-friendly interface built with the Bootstrap Framework and offers easy-to-use features and functionalities.
System Users
The system has two types of users:
- Administrator – Manages the system and handles customer requests.
- Customer – Submits quotation requests and issues tickets.
Administrator Role
- Accesses the admin panel after logging in with valid credentials.
- Manages customer quotation requests and tickets.
- Views and manages registered customer accounts.
- Monitors user access logs.
Customer Role
- Must sign up and log in to access the system.
- Can submit and track quotation requests and tickets.
- Can update personal profile information.
Features and Functionalities
Administrator Panel
- Login and Logout
- Dashboard with summary data and visitor graph
- Manage Tickets (View, update, and delete)
- Manage Customers’ Quotation Requests
- View and Manage Registered Users
- Monitor Users’ Access Logs
- Update or Change Password
Customer Panel
- Login and Registration
- Dashboard
- Submit Quotation Requests
- Create and View Tickets
- View and Update Profile
- Change Password
Technologies Used
The system is built using the following technologies:
- HTML
- CSS
- PHP
- MySQL Database
- Bootstrap Framework
- JavaScript & jQuery Library
- DataTables
How to Install and Run the System
Requirements
- Install a local web server like XAMPP.
- Download the source code zip file.
Installation Steps
- Start XAMPP and run Apache and MySQL.
- Extract the downloaded zip file.
- Copy the extracted folder to the “htdocs” directory in XAMPP.
- Open phpMyAdmin in a browser (http://localhost/phpmyadmin).
- Create a new database named scrm_db.
- Import the SQL file located inside the database folder (scrm_db.sql).
- Open the system in a browser (http://localhost/php-scrm/).
Admin Login Credentials
- Username: admin
- Password: admin123
Conclusion
This Simple CRM System is a helpful tool for businesses to manage customer requests and tickets efficiently. It is free to download and can be modified to fit specific needs.
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 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>CRM Project using PHP and MySQL</title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom fonts for this template --> <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/one-page-wonder.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> </head> <body> <!-- Navigation --> <nav class="navbar navbar-expand-lg navbar-dark navbar-custom fixed-top"> <div class="container"> <a class="navbar-brand" href="#">SCRM - PHP</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarResponsive"> <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a class="nav-link" href="registration.php">Signup</a> </li> <li class="nav-item"> <a class="nav-link" href="login.php">Login</a> </li> <li class="nav-item"> <a class="nav-link" href="admin/">Admin Panel</a> </li> </ul> </div> </div> </nav> <header class="masthead text-center text-white"> <div class="masthead-content"> <div class="container"> <h1 class="masthead-heading mb-0">Simple Customer Relationship Management System</h1> <h2 class="masthead-subheading mb-0">Using PHP and MySQL Database</h2> <a href="registration.php" class="btn btn-primary btn-xl rounded-pill mt-5">User Signup</a> </div> </div> </header> <!-- Footer --> <footer class="py-5"> <div class="container"> <p class="m-0 text-center text-white small">Copyright © PHP - SCRMS <?= date("Y-m-d") ?></p> </div> <!-- /.container --> </footer> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </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 98 99 100 101 |
<?php session_start(); error_reporting(0); include("dbconnection.php"); if(isset($_POST['login'])) { $ret=mysqli_query($con,"SELECT * FROM user WHERE email='".$_POST['email']."' and password='".$_POST['password']."'"); $num=mysqli_fetch_array($ret); if($num>0) { $_SESSION['login']=$_POST['email']; $_SESSION['id']=$num['id']; $_SESSION['name']=$num['name']; $val3 =date("Y/m/d"); date_default_timezone_set("Asia/Calcutta"); $time=date("h:i:sa"); $tim = $time; $ip_address=$_SERVER['REMOTE_ADDR']; $geopluginURL='http://www.geoplugin.net/php.gp?ip='.$ip_address; $addrDetailsArr = unserialize(file_get_contents($geopluginURL)); $city = $addrDetailsArr['geoplugin_city']; $country = $addrDetailsArr['geoplugin_countryName']; ob_start(); system('ipconfig /all'); $mycom=ob_get_contents(); ob_clean(); $findme = "Physical"; $pmac = strpos($mycom, $findme); $mac=substr($mycom,($pmac+36),17); $ret=mysqli_query($con,"insert into usercheck(logindate,logintime,user_id,username,email,ip,mac,city,country)values('".$val3."','".$tim."','".$_SESSION['id']."','".$_SESSION['name']."','".$_SESSION['login']."','$ip_address','$mac','$city','$country')"); $extra="dashboard.php"; echo "<script>window.location.href='".$extra."'</script>"; exit(); } else { $_SESSION['action1']="Invalid username or password"; $extra="login.php"; echo "<script>window.location.href='".$extra."'</script>"; exit(); } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta charset="utf-8" /> <title>CRM | Login</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta content="" name="description" /> <meta content="" name="author" /> <link href="assets/plugins/pace/pace-theme-flash.css" rel="stylesheet" type="text/css" media="screen"/> <link href="assets/plugins/boostrapv3/css/bootstrap.min.css" rel="stylesheet" type="text/css"/> <link href="assets/plugins/boostrapv3/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css"/> <link href="assets/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css"/> <link href="assets/css/animate.min.css" rel="stylesheet" type="text/css"/> <link href="assets/css/style.css" rel="stylesheet" type="text/css"/> <link href="assets/css/responsive.css" rel="stylesheet" type="text/css"/> <link href="assets/css/custom-icon-set.css" rel="stylesheet" type="text/css"/> </head> <body class="error-body no-top"> <div class="container"> <div class="row login-container"> <div class="col-md-5"> <h2 class="text-center text-white"><strong>Sign in to CRM</strong></h2> <hr style="border-color:#ebe7e7"> <p class="text-center"> <a href="registration.php">Signup here</a> to create you account.</p> </div> <div class="col-md-5 "> <br> <p style="color:#F00"><?php echo $_SESSION['action1'];?><?php echo $_SESSION['action1']="";?></p> <form id="login-form" class="login-form" action="" method="post"> <p style="color: #F00"><?php echo $_SESSION['action1'];?><?php echo $_SESSION['action1']="";?></p> <div class="form-group"> <label for="email" class="control-label">Email</label> <input type="text" class="form-control rounded-0" id="email" name="email" required="required"> </div> <div class="form-group"> <label for="password" class="control-label">Password</label> <input type="password" class="form-control rounded-0" id="password" name="password" required="required"> </div> <div class="form-group text-center"> <button class="btn btn-primary btn-cons pull-right" name="login" type="submit">Login</button> </div> </form> </div> </div> </div> <script src="assets/plugins/jquery-1.8.3.min.js" type="text/javascript"></script> <script src="assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="assets/plugins/pace/pace.min.js" type="text/javascript"></script> <script src="assets/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script> <script src="assets/js/login.js" type="text/javascript"></script> </body> </html> |
scrm_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 |
-- phpMyAdmin SQL Dump -- version 5.1.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 29, 2022 at 07:02 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: `scrm_db` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL DEFAULT '', `password` varchar(255) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `name`, `password`) VALUES (1, 'admin', 'admin123'); -- -------------------------------------------------------- -- -- Table structure for table `prequest` -- CREATE TABLE `prequest` ( `id` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `contactno` varchar(11) DEFAULT NULL, `company` varchar(255) DEFAULT NULL, `services` text DEFAULT NULL, `others` varchar(255) DEFAULT NULL, `query` longtext DEFAULT NULL, `status` tinyint(1) NOT NULL DEFAULT 0, `posting_date` date DEFAULT NULL, `remark` longtext DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `prequest` -- INSERT INTO `prequest` (`id`, `name`, `email`, `contactno`, `company`, `services`, `others`, `query`, `status`, `posting_date`, `remark`) VALUES (1, 'Mark Cooper', 'mcooper@mail.com', '09123654789', 'Test Only', '[\\\"Service\\\\/Support Needed 101\\\",\\\"Service\\\\/Support Needed 102\\\",\\\"Service\\\\/Support Needed 103\\\",\\\"Service\\\\/Support Needed 106\\\",\\\"Service\\\\/Support Needed 108\\\"]', '', 'Sample only', 0, '2022-11-29', 'Sample remarks'); -- -------------------------------------------------------- -- -- Table structure for table `ticket` -- CREATE TABLE `ticket` ( `id` int(11) NOT NULL, `ticket_id` varchar(11) DEFAULT NULL, `email_id` varchar(300) DEFAULT NULL, `subject` varchar(300) DEFAULT NULL, `task_type` varchar(300) DEFAULT NULL, `prioprity` varchar(300) DEFAULT NULL, `ticket` longtext DEFAULT NULL, `attachment` varchar(300) DEFAULT NULL, `status` varchar(300) DEFAULT NULL, `admin_remark` longtext DEFAULT NULL, `posting_date` date DEFAULT NULL, `admin_remark_date` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `ticket` -- INSERT INTO `ticket` (`id`, `ticket_id`, `email_id`, `subject`, `task_type`, `prioprity`, `ticket`, `attachment`, `status`, `admin_remark`, `posting_date`, `admin_remark_date`) VALUES (13, '6', 'mcooper@mail.com', 'My Samplle Ticket', 'Option 3', 'urgent(functional problem)', 'Sample Description of the ticket', NULL, 'closed', 'test', '2022-11-29', '2022-11-29 05:53:10'), (14, '7', 'mcooper@mail.com', 'Sample ticket 102', 'Option 4', 'non-urgent', 'Sample only', NULL, 'closed', 'done', '2022-11-29', '2022-11-29 05:53:52'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `alt_email` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `mobile` varchar(255) DEFAULT NULL, `gender` varchar(255) DEFAULT NULL, `address` varchar(500) DEFAULT NULL, `status` int(11) DEFAULT NULL, `posting_date` timestamp NULL DEFAULT current_timestamp() ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `name`, `email`, `alt_email`, `password`, `mobile`, `gender`, `address`, `status`, `posting_date`) VALUES (1, 'Admin Administrator', 'info@mail.com', 'admin@mail.com', 'admin123', '1234567890', 'male', 'Block 6, Lot 14, 23 St., Here City, Down There, 2306 ', NULL, '2021-04-22 12:25:19'), (2, 'Mark Cooper', 'mcooper@mail.com', 'mcoop123@mail.com', 'mcooper1234', '09123654789', 'm', 'Sample Address only', NULL, '2022-11-29 03:28:28'); -- -------------------------------------------------------- -- -- Table structure for table `usercheck` -- CREATE TABLE `usercheck` ( `id` int(11) NOT NULL, `logindate` varchar(255) DEFAULT '', `logintime` varchar(255) DEFAULT '', `user_id` int(11) DEFAULT NULL, `username` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT '', `ip` varbinary(16) DEFAULT NULL, `mac` varbinary(16) DEFAULT NULL, `city` varchar(255) DEFAULT NULL, `country` varchar(255) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `usercheck` -- INSERT INTO `usercheck` (`id`, `logindate`, `logintime`, `user_id`, `username`, `email`, `ip`, `mac`, `city`, `country`) VALUES (4, '2022/11/29', '09:36:21am', 2, 'Mark Cooper', 'mcooper@mail.com', 0x3a3a31, 0x30302d30422d32422d30322d36352d44, '', ''), (3, '2022/11/29', '09:01:36am', 2, 'Mark Cooper', 'mcooper@mail.com', 0x3a3a31, 0x30302d30422d32422d30322d36352d44, '', ''); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `prequest` -- ALTER TABLE `prequest` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ticket` -- ALTER TABLE `ticket` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- Indexes for table `usercheck` -- ALTER TABLE `usercheck` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `prequest` -- ALTER TABLE `prequest` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `ticket` -- ALTER TABLE `ticket` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `usercheck` -- ALTER TABLE `usercheck` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; COMMIT; |