Php Dashboard Source Code

The php dashboard source code has been designed to present many functionalities, from the simple php posts or pages manager and the advanced forum thread management (members, replies, etc.) to the online statistics and related useful data such as visitors, visitors countries and languages, online and offline friends.

Never worry again about keeping your private development projects secure. This is the single source code used to create the PhpBooster | PhpDashboard website and it’s 100% GPL license so you can use it with absolutely no restrictions. Put this code on any server you need, modify it to suit your needs and make your own project. The programmers at www.phoboostervision.com have worked hard to make this code clean, easy to read and working with PHP5 and MySQL databases. Any questions or troubles please email me at clevobab@gmail.com

Connect PHP dashboard with MySQL database

  • Run the web folder in your browser. e.g. http://localhost/dashboardbuilder following welcome screen will appear.
  • The screen shows in the above picture is the main panel of the PHP Dashboard. This tool is HTML5 based fully responsive interface built in using the most commonly and widely used PHP, HTML, JavaScript, CSS and a most powerful chart engine. The interface has a minimal design with a drag-and-drop feature that allows users to add multiple unlimited chart panel to customize the dashboard on according to the way they want.
  • Now click the Database icon
  • Following screen will appear. In our PHP dashboard example, we will use a sample MySQL database called Northwind.db to connect with PHP MySQL Dashboard and fetch the data. Now, select database from data source tab. Select MySQL from the drop down list of database, enter your "northwind" in the DB name field and Save changes as mentioned in the screen.
  • When you click the save changes, a green tick mark with database will appear that shows that your database is successfully connected.
PHP Dashboard - Preference screen

This great PHP dashboard tool gives you the freedom to connect to the diversity source of databases using PDO an acronym for Data Objects and the most consistent way to access databases in PHP application. As stated in the overview, this great Dashboard PHP MySQL Open Source supports all major databases such as MySQL, MS SQL, SQLite, PostgreSQL, Sybase, and Cuboid. But this is not the limit, if you have a data in Excel or in CSV file, this great PHP dashboard is also able to fetch data from these sources using the upload sub-tab as shown in the picture above.

PHP Login System with Validation

admin panel template in php

Contents [show]

Simple Admin Panel Template in PHP, Ajax & Bootstrap

Before Creating an admin Panel in PHP, You should know the following information. It will help you to integrate easily into your website.

 Compatible Browsers IE11, Firefox, Safari, Opera, Chrome, Edge
 Files Included HTML, CSS, PHP, jQuery Ajax,MySQL, Bootstrap
 Software Version PHP 7.x, PHP 5.x, PHP 5.0 – 5.2

 Features

You will get the following most attractive & user-friendly features.

  • User-friendly Design
  • Mobile Responsive
  • Shared Hosting Compatible
  • PHP cURL Support
  • Fast & Secure
  • Easy to Integrate
  • Bootstrap4 Framework
  • Fully Ajax Based
  • Dynamic Data Management  without Reloading
  • MySQL Database
  • Admin Dashboard Design Setting

Functionality –

All the following functionality is created using ajax without refreshing the page –

  • Login with security
  • Logout on one click
  • Contact detail management
  • Website theming
  • Admin theming
  • Static Content Management
  • Website Title & description Management
  • Admin Profile Management

Admin Panel Pages

You will get the following default pages with Admin Panel.

  • Admin Login
  • Admin Dashboard
  • Website Setting
  • Theme Setting
  • Admin Logout
  • Contact Details
  • Contact Email
  • Website Menu
  • Contact Us Message
  • Home Content
  • Admin Profile
  • Change Password
  • Admin Theme Setting

Implement User Registration

We will design user registration form in register.php file and handle user registration on form submit.

<div id="signupbox" class="col-md-7">
	<div class="panel panel-info">
		<div class="panel-heading">
			<div class="panel-title">Sign Up</div>				
		</div>  
		<div class="panel-body" >
			<form id="signupform" class="form-horizontal" role="form" method="POST" action="">				
				<?php if ($message != '') { ?>
					<div id="login-alert" class="alert alert-danger col-sm-12"><?php echo $message; ?></div>                            
				<?php } ?>	
				<div class="form-group">
					<label for="firstname" class="col-md-3 control-label">First Name*</label>
					<div class="col-md-9">
						<input type="text" class="form-control" name="firstname" placeholder="First Name" value="<?php if(!empty($_POST["firstname"])) { echo $_POST["firstname"]; } ?>" required>
					</div>
				</div>
				<div class="form-group">
					<label for="lastname" class="col-md-3 control-label">Last Name</label>
					<div class="col-md-9">
						<input type="text" class="form-control" name="lastname" placeholder="Last Name" value="<?php if(!empty($_POST["lastname"])) { echo $_POST["lastname"]; } ?>" >
					</div>
				</div>					
				<div class="form-group">
					<label for="email" class="col-md-3 control-label">Email*</label>
					<div class="col-md-9">
						<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php if(!empty($_POST["email"])) { echo $_POST["email"]; } ?>" required>
					</div>
				</div>					
				<div class="form-group">
					<label for="password" class="col-md-3 control-label">Password*</label>
					<div class="col-md-9">
						<input type="password" class="form-control" name="passwd" placeholder="Password" required>
					</div>
				</div>								
				<div class="form-group">						                                  
					<div class="col-md-offset-3 col-md-9">
						<button id="btn-signup" type="submit" name="register" value="register" class="btn btn-info"><i class="icon-hand-right"></i>   Register</button>			
					</div>
				</div>					
				<div class="form-group">
					<div class="col-md-12 control">
						<div style="border-top: 1px solid#888; padding-top:15px; font-size:85%" >
							If You've already an account! 
						<a href="login.php">
							Log In 
						</a>Here
						</div>
					</div>
				</div>  				
			</form>
		 </div>
	</div>
</div>	

In class User.php, we will create method register() to implement user registration. We will send an email verification email to user’s email address with link to verify and complete registration.

public function register(){		
	$message = '';
	if(!empty($_POST["register"]) && $_POST["email"] !='') {
		$sqlQuery = "SELECT * FROM ".$this->userTable." 
			WHERE email='".$_POST["email"]."'";
		$result = mysqli_query($this->dbConnect, $sqlQuery);
		$isUserExist = mysqli_num_rows($result);
		if($isUserExist) {
			$message = "User already exist with this email address.";
		} else {			
			$authtoken = $this->getAuthtoken($_POST["email"]);
			$insertQuery = "INSERT INTO ".$this->userTable."(first_name, last_name, email, password, authtoken) 
			VALUES ('".$_POST["firstname"]."', '".$_POST["lastname"]."', '".$_POST["email"]."', '".md5($_POST["passwd"])."', '".$authtoken."')";
			$userSaved = mysqli_query($this->dbConnect, $insertQuery);
			if($userSaved) {				
				$link = "<a href='http://example.com/user-management-system/verify.php?authtoken=".$authtoken."'>Verify Email</a>";			
				$toEmail = $_POST["email"];
				$subject = "Verify email to complete registration";
				$msg = "Hi there, click on this ".$link." to verify email to complete registration.";
				$msg = wordwrap($msg,70);
				$headers = "From: info@webdamn.com";
				if(mail($toEmail, $subject, $msg, $headers)) {
					$message = "Verification email send to your email address. Please check email and verify to complete registration.";
				}
			} else {
				$message = "User register request failed.";
			}
		}
	}
	return $message;
}	

We will create a method verifyRegister() in class User.php to verify user email to complete registration.

public function verifyRegister(){
	$verifyStatus = 0;
	if(!empty($_GET["authtoken"]) && $_GET["authtoken"] != '') {			
		$sqlQuery = "SELECT * FROM ".$this->userTable." 
			WHERE authtoken='".$_GET["authtoken"]."'";
		$resultSet = mysqli_query($this->dbConnect, $sqlQuery);
		$isValid = mysqli_num_rows($resultSet);	
		if($isValid){
			$userDetails = mysqli_fetch_assoc($resultSet);
			$authtoken = $this->getAuthtoken($userDetails['email']);
			if($authtoken == $_GET["authtoken"]) {					
				$updateQuery = "UPDATE ".$this->userTable." SET status = 'active'
					WHERE id='".$userDetails['id']."'";
				$isUpdated = mysqli_query($this->dbConnect, $updateQuery);					
				if($isUpdated) {
					$verifyStatus = 1;
				}
			}
		}
	}
	return $verifyStatus;
}	

Enter SQL Query statement

  • After successfully connect to the database, we will retrieve data from Northwind.db in our next step.
  • Select the gear icon.
PHP Dashboard - Database Connection
  • A pop-up screen and a list of the tables from Northwind.db will appear on the table list as shown in the picture below.
PHP Dashboard - Chart Preference

Our PHP dashboards have a powerful Query Builder and a smart SQL statement builder tool for quick and easy writing of complex SQL queries without manual code writing which is designed to simplify the retrieving of data from the database.

  • When you click on the table, a default SQL statement will appear on the SQL statement box, which you may modify as per your need.
  • You can add up to 10 SQL statements simultaneously to retrieve data from different tables.
  • In our example, we will be creating a simple PHP application for our sale’s management. This PHP dashboard will contain a chart where users can find the sales stats and maintain the data about the products.
  • Now, enter the following SQL statement in text box in a following manner

SELECT strftime('%Y-%m',o.shippeddate) as xaxis, sum(d.quantity) as yaxis from `order details` d, orders o where o.orderid = d.orderid group by strftime('%Y-%m',o.orderdate) limit 50

  • Now, we want to execute our query and fetch the data from the tables. Click the Run Query button
PHP Dashboard - SQL Statement

Conclusion

 Download Full php source code for your Php website from us and get life time support.  Our team will help and update the software if you need for free for next year so when any new device or new technology is available we will send you that update free.

0 Comments

No Comment.