Admin Dashboard in Php and Mysql Free Download

Admin Dashboard in Php and Mysql Free Download this is a first launch software by our company FastinSoft.com. Admin dashboard is very useful to manage the website content. If you are running any kind of business and want to view complete information of your customers on a single page then you must use this version of admin dashboard. User can easily get information about their customers. Our Admin Dashboard Software is very easy to use and install. You just need to install the software and access it from any browser. The Admin Dashboard is easily manageable and interactive where user can add or remove their posts, pages, images etc. The Admin Dashboard is free for download at fastinsoft.com

Admin Dashboard for free contains a pdf documentation for beginners and intermediate level, who want to create best admin dashboard using Php and Mysql. Admin Dashboard template is very helpful in redesigning, making custom ipad application development and creating new admin panels.

Create the Forms

The admin panel template comes with a full range of forms UI including registration and login.

For validation purposes, I simply use Html5 Validation and Custom PHP Validation.

PHP Hosting Made Simple

Experience fast performance with 24/7/356 support.START FREE

Registration Form

Forms for user registration is already available. I will just change the fields’ name and update the method and action:

  1. <?php include(‘server.php’) ?>
  2. <!DOCTYPE html>
  3. <html lang=”en”>
  4. <head>
  5. <meta charset=”utf-8″>
  6. <meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
  7. <meta name=”viewport” content=”width=device-width, initial-scale=1, shrink-to-fit=no”>
  8. <meta name=”description” content=””>
  9. <meta name=”author” content=””>
  10. <title>SB Admin – Start Bootstrap Template</title>
  11. <!– Bootstrap core CSS–>
  12. <link href=”vendor/bootstrap/css/bootstrap.min.css” rel=”stylesheet”>
  13. <!– Custom fonts for this template–>
  14. <link href=”vendor/font-awesome/css/font-awesome.min.css” rel=”stylesheet” type=”text/css”>
  15. <!– Custom styles for this template–>
  16. <link href=”css/sb-admin.css” rel=”stylesheet”>
  17. </head>
  18. <body class=”bg-dark”>
  19. <div class=”container”>
  20. <div class=”card card-register mx-auto mt-5″>
  21. <div class=”card-header”>Register an Account</div>
  22. <div class=”card-body”>
  23. <form method=”post” action=”register.php”>
  24. <?php include(‘errors.php’); ?>
  25. <div class=”form-group”>
  26. <div class=”form-row”>
  27. <div class=”col-md-12″>
  28. <label for=”exampleInputName”>Username</label>
  29. <input class=”form-control” id=”exampleInputName” type=”text” name=”username” value=”<?php echo $username; ?>” >
  30. </div>
  31. </div>
  32. </div>
  33. <div class=”form-group”>
  34. <label for=”exampleInputEmail1″>Email address</label>
  35. <input class=”form-control” id=”exampleInputEmail1″ type=”email” aria-describedby=”emailHelp” name=”email” value=”<?php echo $email; ?>” >
  36. </div>
  37. <div class=”form-group”>
  38. <div class=”form-row”>
  39. <div class=”col-md-6″>
  40. <label for=”exampleInputPassword1″>Password</label>
  41. <input class=”form-control” id=”exampleInputPassword1″ type=”password” name=”password_1″ >
  42. </div>
  43. <div class=”col-md-6″>
  44. <label for=”exampleInputPassword1″>Confirm Password</label>
  45. <input class=”form-control” id=”exampleInputPassword2″ type=”password” name=”password_2″ >
  46. </div>
  47. </div>
  48. </div>
  49. <button type=”submit” class=”btn btn-primary btn-block” name=”reg_user”>Register</button>
  50. </form>
  51. <div class=”text-center”>
  52. <a class=”d-block small mt-3″ href=”login.php”>Login Page</a>
  53. <!— <a class=”d-block small” href=”forgot-password.html”>Forgot Password?</a>–>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <!– Bootstrap core JavaScript–>
  59. <script src=”vendor/jquery/jquery.min.js”></script>
  60. <script src=”vendor/bootstrap/js/bootstrap.bundle.min.js”></script>
  61. <!– Core plugin JavaScript–>
  62. <script src=”vendor/jquery-easing/jquery.easing.min.js”></script>
  63. </body>
  64. </html>

Here is what the registration form looks like after the above modifications:

registration form

Login Form

Next, for the Login form, use the following code:

  1. <?php include(‘server.php’) ?>
  2. <!DOCTYPE html>
  3. <html lang=”en”>
  4. <head>
  5. <meta charset=”utf-8″>
  6. <meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
  7. <meta name=”viewport” content=”width=device-width, initial-scale=1, shrink-to-fit=no”>
  8. <meta name=”description” content=””>
  9. <meta name=”author” content=””>
  10. <title>SB Admin – Start Bootstrap Template</title>
  11. <!– Bootstrap core CSS–>
  12. <link href=”vendor/bootstrap/css/bootstrap.min.css” rel=”stylesheet”>
  13. <!– Custom fonts for this template–>
  14. <link href=”vendor/font-awesome/css/font-awesome.min.css” rel=”stylesheet” type=”text/css”>
  15. <!– Custom styles for this template–>
  16. <link href=”css/sb-admin.css” rel=”stylesheet”>
  17. </head>
  18. <body class=”bg-dark”>
  19. <div class=”container”>
  20. <div class=”card card-login mx-auto mt-5″>
  21. <div class=”card-header”>Login</div>
  22. <div class=”card-body”>
  23. <form method=”post” action=”login.php”>
  24. <?php include(‘errors.php’); ?>
  25. <div class=”form-group”>
  26. <label for=”exampleInputEmail1″>Username</label>
  27. <input class=”form-control” type=”text” name=”username”>
  28. </div>
  29. <div class=”form-group”>
  30. <label for=”exampleInputPassword1″>Password</label>
  31. <input class=”form-control” type=”password” name=”password”>
  32. </div>
  33. <div class=”form-group”>
  34. <div class=”form-check”>
  35. <label class=”form-check-label”>
  36. <input class=”form-check-input” type=”checkbox”> Remember Password</label>
  37. </div>
  38. </div>
  39. <button type=”submit” class=”btn btn-primary btn-block” name=”login_user”>Login</button>
  40. </form>
  41. <div class=”text-center”>
  42. <a class=”d-block small mt-3″ href=”register.php”>Register an Account</a>
  43. <!– <a class=”d-block small” href=”forgot-password.php”>Forgot Password?</a>–>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <!– Bootstrap core JavaScript–>
  49. <script src=”vendor/jquery/jquery.min.js”></script>
  50. <script src=”vendor/bootstrap/js/bootstrap.bundle.min.js”></script>
  51. <!– Core plugin JavaScript–>
  52. <script src=”vendor/jquery-easing/jquery.easing.min.js”></script>
  53. </body>
  54. </html>

Here is how the login form looks like:

login form

Setting up the Database Connection

Since I am on Cloudways, I could easily access the MySQL database details in the Access Details tab:

database connection

Create three tables in the database, users, products, sales_stats.

Use the following SQL queries to create the tables:

Users table

  1. CREATE TABLE `users` (
  2. `id` int(11) NOT NULL,
  3. `username` varchar(100) NOT NULL,
  4. `email` varchar(100) NOT NULL,
  5. `password` varchar(100) NOT NULL
  6. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Products table

  1. CREATE TABLE `products` (
  2. `product_id` int(22) NOT NULL,
  3. `product_name` varchar(22) NOT NULL,
  4. `product_price` int(22) NOT NULL,
  5. `product_cat` varchar(22) NOT NULL,
  6. `product_details` varchar(22) NOT NULL
  7. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Sales table

  1. CREATE TABLE `sales_stats` (
  2. `id` int(22) NOT NULL,
  3. `sales` int(22) NOT NULL,
  4. `month` varchar(25) NOT NULL,
  5. `pending_orders` int(55) NOT NULL,
  6. `revenue` int(55) NOT NULL,
  7. `Vistors` int(55) NOT NULL
  8. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Click the Database Manager on the Cloudways Platform and check the dbname and other credentials. Next, create the file server.php and paste the following code in it:

  1. <?php
  2. session_start();
  3. // initializing variables
  4. $username = “”;
  5. $email = “”;
  6. $errors = array();
  7. // connect to the database
  8. $db = mysqli_connect(‘localhost’, ‘root’, ”, ‘registration’);

Registration

  1. // REGISTER USER
  2. if (isset($_POST[‘reg_user’])) {
  3. // receive all input values from the form
  4. $username = mysqli_real_escape_string($db, $_POST[‘username’]);
  5. $email = mysqli_real_escape_string($db, $_POST[’email’]);
  6. $password_1 = mysqli_real_escape_string($db, $_POST[‘password_1’]);
  7. $password_2 = mysqli_real_escape_string($db, $_POST[‘password_2’]);
  8. // form validation: ensure that the form is correctly filled …
  9. // by adding (array_push()) corresponding error unto $errors array
  10. if (empty($username)) { array_push($errors, “Username is required”); }
  11. if (empty($email)) { array_push($errors, “Email is required”); }
  12. if (empty($password_1)) { array_push($errors, “Password is required”); }
  13. if ($password_1 != $password_2) {
  14. array_push($errors, “The two passwords do not match”);
  15. }
  16. // first check the database to make sure
  17. // a user does not already exist with the same username and/or email
  18. $user_check_query = “SELECT * FROM users WHERE username=’$username’ OR email=’$email’ LIMIT 1”;
  19. $result = mysqli_query($db, $user_check_query);
  20. $user = mysqli_fetch_assoc($result);
  21. if ($user) { // if user exists
  22. if ($user[‘username’] === $username) {
  23. array_push($errors, “Username already exists”);
  24. }
  25. if ($user[’email’] === $email) {
  26. array_push($errors, “email already exists”);
  27. }
  28. }
  29. ins
  30. // Finally, register user if there are no errors in the form
  31. if (count($errors) == 0) {
  32. $password = md5($password_1);//encrypt the password before saving in the database
  33. echo $password ;
  34. $query = “INSERT INTO users(username, email, password)
  35. VALUES(‘$username’, ‘$email’, ‘$password’)”;
  36. mysqli_query($db, $query);
  37. $_SESSION[‘username’] = $username;
  38. $_SESSION[‘success’] = “You are now logged in”;
  39. header(‘location: login.php’);
  40. }
  41. }
  42. // …

Login

  1. // LOGIN USER
  2. if (isset($_POST[‘login_user’])) {
  3. $username = mysqli_real_escape_string($db, $_POST[‘username’]);
  4. $password = mysqli_real_escape_string($db, $_POST[‘password’]);
  5. if (empty($username)) {
  6. array_push($errors, “Username is required”);
  7. }
  8. if (empty($password)) {
  9. array_push($errors, “Password is required”);
  10. }
  11. if (count($errors) == 0) {
  12. $password = md5($password);
  13. $query = “SELECT * FROM users WHERE username=’$username’ AND password=’$password'”;
  14. $results = mysqli_query($db, $query);
  15. if (mysqli_num_rows($results) == 1) {
  16. $_SESSION[‘username’] = $username;
  17. $_SESSION[‘success’] = “You are now logged in”;
  18. header(‘location: index.php’);
  19. }else {
  20. array_push($errors, “Wrong username/password combination”);
  21. }
  22. }
  23. }?>

For Errors, create the new file with the name of errors.php and paste the following code in it:

  1. <?php if (count($errors) > 0) : ?>
  2. <div class=”error”>
  3. <?php foreach ($errors as $error) : ?>
  4. <p><?php echo $error ?></p>
  5. <?php endforeach ?>
  6. </div>
  7. <?php endif ?>

Create the Product Page

Next, create the product.php page and paste the following code in it:

  1. <?php
  2. include(‘pserver.php’);
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang=”en”>
  6. <head>
  7. <meta charset=”utf-8″>
  8. <meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
  9. <meta name=”viewport” content=”width=device-width, initial-scale=1, shrink-to-fit=no”>
  10. <meta name=”description” content=””>
  11. <meta name=”author” content=””>
  12. <title>SB Admin – Start Bootstrap Template</title>
  13. <!– Bootstrap core CSS–>
  14. <link href=”vendor/bootstrap/css/bootstrap.min.css” rel=”stylesheet”>
  15. <!– Custom fonts for this template–>
  16. <link href=”vendor/font-awesome/css/font-awesome.min.css” rel=”stylesheet” type=”text/css”>
  17. <!– Custom styles for this template–>
  18. <link href=”css/sb-admin.css” rel=”stylesheet”>
  19. </head>
  20. <body class=”fixed-nav sticky-footer bg-dark” id=”page-top”>
  21. <!– Navigation–>
  22. <nav class=”navbar navbar-expand-lg navbar-dark bg-dark fixed-top” id=”mainNav”>
  23. <a class=”navbar-brand” href=”index.php”>Start Bootstrap</a>
  24. <button class=”navbar-toggler navbar-toggler-right” type=”button” data-toggle=”collapse” data-target=”#navbarResponsive” aria-controls=”navbarResponsive” aria-expanded=”false” aria-label=”Toggle navigation”>
  25. <span class=”navbar-toggler-icon”></span>
  26. </button>
  27. <div class=”collapse navbar-collapse” id=”navbarResponsive”>
  28. <ul class=”navbar-nav navbar-sidenav” id=”exampleAccordion”>
  29. <li class=”nav-item” data-toggle=”tooltip” data-placement=”right” title=”Dashboard”>
  30. <a class=”nav-link” href=”index.php”>
  31. <i class=”fa fa-fw fa-dashboard”></i>
  32. <span class=”nav-link-text”>Dashboard</span>
  33. </a>
  34. </li>
  35. <li class=”nav-item” data-toggle=”tooltip” data-placement=”right” title=”Charts”>
  36. <a class=”nav-link” href=”charts.html”>
  37. <i class=”fa fa-check-square”></i>
  38. <span class=”nav-link-text”>Create Products</span>
  39. </a>
  40. </li>
  41. <li class=”nav-item” data-toggle=”tooltip” data-placement=”right” title=”Charts”>
  42. <a class=”nav-link” href=”register.php”>
  43. <i class=”fa fas fa-user”></i>
  44. <span class=”nav-link-text”>Register Users</span>
  45. </a>
  46. </li>
  47. </ul>
  48. <ul class=”navbar-nav sidenav-toggler”>
  49. <li class=”nav-item”>
  50. <a class=”nav-link text-center” id=”sidenavToggler”>
  51. <i class=”fa fa-fw fa-angle-left”></i>
  52. </a>
  53. </li>
  54. </ul>
  55. <ul class=”navbar-nav ml-auto”>
  56. <li class=”nav-item dropdown”>
  57. <a class=”nav-link dropdown-toggle mr-lg-2″ id=”messagesDropdown” href=”#” data-toggle=”dropdown” aria-haspopup=”true” aria-expanded=”false”>
  58. <i class=”fa fa-fw fa-envelope”></i>
  59. <span class=”d-lg-none”>Messages
  60. <span class=”badge badge-pill badge-primary”>12 New</span>
  61. </span>
  62. <span class=”indicator text-primary d-none d-lg-block”>
  63. <i class=”fa fa-fw fa-circle”></i>
  64. </span>
  65. </a>
  66. <div class=”dropdown-menu” aria-labelledby=”messagesDropdown”>
  67. <h6 class=”dropdown-header”>New Messages:</h6>
  68. <div class=”dropdown-divider”></div>
  69. <a class=”dropdown-item” href=”#”>
  70. <strong>David Miller</strong>
  71. <span class=”small float-right text-muted”>11:21 AM</span>
  72. <div class=”dropdown-message small”>Hey there! This new version of SB Admin is pretty awesome! These messages clip off when they reach the end of the box so they don’t overflow over to the sides!</div>
  73. </a>
  74. <div class=”dropdown-divider”></div>
  75. <a class=”dropdown-item” href=”#”>
  76. <strong>Jane Smith</strong>
  77. <span class=”small float-right text-muted”>11:21 AM</span>
  78. <div class=”dropdown-message small”>I was wondering if you could meet for an appointment at 3:00 instead of 4:00. Thanks!</div>
  79. </a>
  80. <div class=”dropdown-divider”></div>
  81. <a class=”dropdown-item” href=”#”>
  82. <strong>John Doe</strong>
  83. <span class=”small float-right text-muted”>11:21 AM</span>
  84. <div class=”dropdown-message small”>I’ve sent the final files over to you for review. When you’re able to sign off of them let me know and we can discuss distribution.</div>
  85. </a>
  86. <div class=”dropdown-divider”></div>
  87. <a class=”dropdown-item small” href=”#”>View all messages</a>
  88. </div>
  89. </li>
  90. <li class=”nav-item dropdown”>
  91. <a class=”nav-link dropdown-toggle mr-lg-2″ id=”alertsDropdown” href=”#” data-toggle=”dropdown” aria-haspopup=”true” aria-expanded=”false”>
  92. <i class=”fa fa-fw fa-bell”></i>
  93. <span class=”d-lg-none”>Alerts
  94. <span class=”badge badge-pill badge-warning”>6 New</span>
  95. </span>
  96. <span class=”indicator text-warning d-none d-lg-block”>
  97. <i class=”fa fa-fw fa-circle”></i>
  98. </span>
  99. </a>
  100. <div class=”dropdown-menu” aria-labelledby=”alertsDropdown”>
  101. <h6 class=”dropdown-header”>New Alerts:</h6>
  102. <div class=”dropdown-divider”></div>
  103. <a class=”dropdown-item” href=”#”>
  104. <span class=”text-success”>
  105. <strong>
  106. <i class=”fa fa-long-arrow-up fa-fw”></i>Status Update</strong>
  107. </span>
  108. <span class=”small float-right text-muted”>11:21 AM</span>
  109. <div class=”dropdown-message small”>This is an automated server response message. All systems are online.</div>
  110. </a>
  111. <div class=”dropdown-divider”></div>
  112. <a class=”dropdown-item” href=”#”>
  113. <span class=”text-danger”>
  114. <strong>
  115. <i class=”fa fa-long-arrow-down fa-fw”></i>Status Update</strong>
  116. </span>
  117. <span class=”small float-right text-muted”>11:21 AM</span>
  118. <div class=”dropdown-message small”>This is an automated server response message. All systems are online.</div>
  119. </a>
  120. <div class=”dropdown-divider”></div>
  121. <a class=”dropdown-item” href=”#”>
  122. <span class=”text-success”>
  123. <strong>
  124. <i class=”fa fa-long-arrow-up fa-fw”></i>Status Update</strong>
  125. </span>
  126. <span class=”small float-right text-muted”>11:21 AM</span>
  127. <div class=”dropdown-message small”>This is an automated server response message. All systems are online.</div>
  128. </a>
  129. <div class=”dropdown-divider”></div>
  130. <a class=”dropdown-item small” href=”#”>View all alerts</a>
  131. </div>
  132. </li>
  133. <li class=”nav-item”>
  134. <form class=”form-inline my-2 my-lg-0 mr-lg-2″>
  135. <div class=”input-group”>
  136. <input class=”form-control” type=”text” placeholder=”Search for…”>
  137. <span class=”input-group-append”>
  138. <button class=”btn btn-primary” type=”button”>
  139. <i class=”fa fa-search”></i>
  140. </button>
  141. </span>
  142. </div>
  143. </form>
  144. </li>
  145. <li class=”nav-item”>
  146. <a class=”nav-link” data-toggle=”modal” data-target=”#exampleModal”>
  147. <i class=”fa fa-fw fa-sign-out”></i>Logout</a>
  148. </li>
  149. </ul>
  150. </div>
  151. </nav>
  152. <div class=”content-wrapper”>
  153. <div class=”container-fluid”>
  154. <!– Breadcrumbs–>
  155. <ol class=”breadcrumb”>
  156. <li class=”breadcrumb-item”>
  157. <a href=”index.html”>Dashboard</a>
  158. </li>
  159. <li class=”breadcrumb-item active”>Product Page</li>
  160. </ol>
  161. <div class=”row”>
  162. <div class=”col-12″>
  163. <h1>Create Product </h1>
  164. </div>
  165. <div class=”col-md-8″>
  166. <form method=”post” action=”product.php”>
  167. <div class=”form-group”>
  168. <label>Product Name</label>
  169. <input type=”text” class=”form-control” name=”pname” required>
  170. </div>
  171. <div class=”form-group”>
  172. <label>Product Price</label>
  173. <input type=”text” class=”form-control” name=”pirce” required>
  174. </div>
  175. <div class=”form-group”>
  176. <label>Product Catgory</label>
  177. <input type=”text” class=”form-control” name=”pcat” required>
  178. </div>
  179. <div class=”form-group”>
  180. <label>Product Details</label>
  181. <textarea class=”form-control” name=”pdetails” required></textarea>
  182. </div>
  183. <button type=”submit” class=”btn btn-primary” name=”reg_p”>Submit</button>
  184. </form>
  185. </div>
  186. </div>
  187. </div>
  188. <!– /.container-fluid–>
  189. <!– /.content-wrapper–>
  190. <footer class=”sticky-footer”>
  191. <div class=”container”>
  192. <div class=”text-center”>
  193. <small>Copyright © Your Website 2018</small>
  194. </div>
  195. </div>
  196. </footer>
  197. <!– Scroll to Top Button–>
  198. <a class=”scroll-to-top rounded” href=”#page-top”>
  199. <i class=”fa fa-angle-up”></i>
  200. </a>
  201. <!– Logout Modal–>
  202. <div class=”modal fade” id=”exampleModal” tabindex=”-1″ role=”dialog” aria-labelledby=”exampleModalLabel” aria-hidden=”true”>
  203. <div class=”modal-dialog” role=”document”>
  204. <div class=”modal-content”>
  205. <div class=”modal-header”>
  206. <h5 class=”modal-title” id=”exampleModalLabel”>Ready to Leave?</h5>
  207. <button class=”close” type=”button” data-dismiss=”modal” aria-label=”Close”>
  208. <span aria-hidden=”true”>×</span>
  209. </button>
  210. </div>
  211. <div class=”modal-body”>Select “Logout” below if you are ready to end your current session.</div>
  212. <div class=”modal-footer”>
  213. <button class=”btn btn-secondary” type=”button” data-dismiss=”modal”>Cancel</button>
  214. <a class=”btn btn-primary” href=”login.php”>Logout</a>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. <!– Bootstrap core JavaScript–>
  220. <script src=”vendor/jquery/jquery.min.js”></script>
  221. <script src=”vendor/bootstrap/js/bootstrap.bundle.min.js”></script>
  222. <!– Core plugin JavaScript–>
  223. <script src=”vendor/jquery-easing/jquery.easing.min.js”></script>
  224. <!– Custom scripts for all pages–>
  225. <script src=”js/sb-admin.min.js”></script>
  226. </div>
  227. </body>
  228. </html>

Conclusion

This is a perfect dashboard application for your website or blog. You can customize this app yourself. It is easy to update and maintain and anyone should be able to edit it.

0 Comments

No Comment.