Tagged: html

PHP AJAX Live Search Box Autocomplete Using MySQL Database 0

PHP AJAX Live Search Box Autocomplete Using MySQL Database

Today, We want to share with you PHP AJAX Live Search Box Autocomplete Using MySQL Database.In this post we will show you PHP Jquery AJAX Live Search Box Using MySQL, hear for PHP MySQL Live Search Box using Jquery Ajax Example we will give you demo and example for implement.In this post, we will learn about Jquery Ajax Live Search Box using PHP MySql with an example.

PHP AJAX Live Search Box Autocomplete Using MySQL Database

There are the Following The simple About PHP AJAX Live Search Box Autocomplete Using MySQL Database Full Information With Example and source code.

As I will cover this Post with live Working example to develop ajax live data search using jquery php mysql, so the some major files and Directory structures for this example is following below.

  • index.php
  • fetch.php

Step 1: Creating the Database Table

— Database: `member_list` >> — Table structure for table `member_tbl`

CREATE TABLE IF NOT EXISTS `member_tbl` (
  `MemberID` int(11) NOT NULL AUTO_INCREMENT,
  `MemberName` varchar(250) NOT NULL,
  `member_addr` text NOT NULL,
  `member_city` varchar(250) NOT NULL,
  `member_pcode` varchar(30) NOT NULL,
  `member_country` varchar(100) NOT NULL,
  PRIMARY KEY (`MemberID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

Step 2: Dumping data On Table

Dumping data for table `member_tbl`

//ajax live data search using jquery php mysql
INSERT INTO `member_tbl` (`MemberID`, `MemberName`, `member_addr`, `member_city`, `member_pcode`, `member_country`) VALUES
(1, 'Jaydeep Gondaliya', 'sejal Str. 57', 'Berlin', '12209', 'Germany'),
(2, 'Ankit Kathiriya', 'Avda. de la Ram park 2222', 'USA D.F.', '5021', 'USA'),
(3, 'Krunal Sisodiya', 'sardha 2312', 'USA D.F.', '5475', 'USA'),
(4, 'chirag dethariya', '120 dsp salon Sq.', 'London', 'WA1 1DP', 'UK'),
(5, 'Dhaval dave', 'Rua do Ganesh, 12', 'Resende', '56458-363', 'UEA'),
(6, 'Pooja solanki', 'ul. astha 68', 'Walla', '01-658', 'Poland'),
(7, 'Bhakti Banugariya', 'kavya 45', 'Helsinki', '2853', 'India'),
(8, 'Nilesh chandvadiya', '305 - 14th Ave. S. Suite 3B', 'Seattle', '98128', 'USA'),
(9, 'Hitesh Ajani', 'Rua do Ganesh, 12', 'Resende', '098952-363', 'UEA'),
(10, 'Mayur Dhameliya', 'bhakti 38', 'Oulu', '321452', 'India'),
(11, 'Stavan Patel', '2, rue du chandni', 'Reims', '350024', 'France'),
(12, 'Parag shukla', '722 Titupati Blvd.', 'Kirkland', '360002', 'USA'),
(13, 'Vijay bhanderi', 'Bhavanath. 48', 'Butte', '225010', 'USA');

Step 3: Creating the Search Form

index.php

This is where I will make a simple HTML form and PHP server side source code for our web application. To make the forms simply all souce code copy and write it into your any text editor Like Notepad++, then save file it as index.php.

 
  
  <title>PHP AJAX Live Search Box Autocomplete Using MySQL Database</title>
  
  
  
 
 
  <div class="pakainfo container">
   <br />
   <h2 align="center">PHP AJAX Live Search Box Autocomplete Using MySQL Database</h2>
   
   <b>Simple ajax live data search using jquery php mysql</b><br />
   <div class="pakainfo form-group">
    <div class="input-group pakainfo">
     <span class="input-group-addon pakainfo">Search</span>
     
    </div>
   </div>
   <br />
   <div id="result"></div>
  </div>
 


$(document).ready(function(){

 ajax_data_load();

 function ajax_data_load(query)
 {
  $.ajax({
   url:"fetch.php",
   method:"POST",
   data:{query:query},
   success:function(data)
   {
    $('#result').html(data);
   }
  });
 }
 $('#query_search').keyup(function(){
  var search = $(this).val();
  if(search != '')
  {
   ajax_data_load(search);
  }
  else
  {
   ajax_data_load();
  }
 });
});

Step 4 : Processing Search Query in Backend

fetch.php for PHP AJAX Live Search Box Autocomplete server side source code

 0)
{
 $output .= '
  <div class="pakainfo table-responsive">
   <table class="table table bordered">
    <tr>
     <th>Member Name</th>
     <th>member Address</th>
     <th>member_city</th>
     <th>Member Post Code</th>
     <th>member_country</th>
    </tr>
 ';
 while($memres = mysqli_fetch_array($result))
 {
  $output .= '
   <tr>
    <td>'.$memres["MemberName"].'</td>
    <td>'.$memres["member_addr"].'</td>
    <td>'.$memres["member_city"].'</td>
    <td>'.$memres["member_pcode"].'</td>
    <td>'.$memres["member_country"].'</td>
   </tr>
  ';
 }
 echo $output;
}
else
{
 echo 'Data Not Found';
}

?>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP AJAX Live Search Box Autocomplete Using MySQL Database.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

PHP Laravel 5 Class Form HTML not found Resolve Error 0

PHP Laravel 5 Class Form HTML not found Resolve Error

Today, We want to share with you PHP Laravel 5 Class Form HTML not found Resolve Error.In this post we will show you Laravel Collective – Class ‘Form’ not found, hear for class ‘collective\html\htmlserviceprovider’ not found we will give you demo and example for implement.In this post, we will learn about class ‘illuminate\html\htmlserviceprovider’ not found with an example.

PHP Laravel 5 Class Form HTML not found Resolve Error

There are the Following The simple About PHP Laravel 5 Class Form HTML not found Resolve Error Full Information With Example and source code.

As I will cover this Post with live Working example to develop Class FORM or HTML not found in Laravel, so the some major files and Directory structures for this example is following below.

  • Changes in composer.json
  • Include service providers
  • Include Laravel 5 aliases array

HTML/FORM not found in Laravel 5?

If We are Find simple `HTML` as well as `FORM` Laravel 5 Class ‘form’ not found the Good Solution this Source code. You have “Html, Form class not found in Laravel 5” error (will get error like `HTML` or `FORM` class not found) because Laravel 5 Latest version made changes some more in their Laravel 5 library. Therefor We can Resolve this error by using new main Laravel library Like “laravelcollective/html” Laravel package. laravelcollective/html package will supported We HTML and FORM class helper.

Error – PHP Laravel 5 Class Form HTML not found Resolve Error

Class FORM or HTML not found in Laravel

Class FORM or HTML not found in Laravel

Step 1 : Changes in composer.json.

Put The following source code in your main root File Like name as composer.json file.

"require": {
"laravel/framework": "5.0.*",
"laravelcollective/html": "~5.0"
},

OR – Class FORM or HTML not found in Laravel

Alternative Way, You simple run bellow command on terminal

composer require laravelcollective/html

Step 2 : Include service providers array in Laravel

config/app.php

'Collective\Html\HtmlServiceProvider',

Step 3 : Include Laravel 5 aliases array

And then, put following 2 some line of source code to last aliases array.

//PHP Laravel 5 Class Form HTML not found Resolve Error
'Form' => 'Collective\Html\FormFacade',

'HTML' => 'Collective\Html\HtmlFacade',

config/app.php

return [
    .....
	//Laravel 5 providers
    'providers' => [
    	//some providers....
    	'Collective\Html\HtmlServiceProvider',

    ],

	//Include Laravel 5 aliases array	
    'aliases' => [
    	//some aliases....
		'Form' => 'Collective\Html\FormFacade',
		'HTML' => 'Collective\Html\HtmlFacade',

    ]

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Laravel 5 Class Form HTML not found Resolve Error.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel 5.6 PDF Generation using Dompdf Example 0

Laravel 5.6 PDF Generation using Dompdf Example

Today, We want to share with you Laravel 5.6 PDF Generation using Dompdf Example.In this post we will show you PHP Laravel 5.6 PDF Generation using FPDF, hear for Best open source PDF generation libraries for Laravel 5.6 we will give you demo and example for implement.In this post, we will learn about Laravel 5.6 generate PDF from html view file and download using dompdf with an example.

Laravel 5.6 PDF Generation using Dompdf Example

There are the Following The simple About Laravel 5.6 PDF Generation using Dompdf Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop , so the some major files and Directory structures for this example is following below.

Laravel 5.6 PDF Generate Tutorial

  • Setup Laravel Project
  • Settings SQL Database
  • Setup Latest package in laravel-dompdf
  • Include Model and Migration File
  • Make a View File
  • Make one controller
  • Laravel 5.6 Route
  • Save All data to the database
  • Laravel 5.6 show the data.
  • Simple design Laravel 5.6 pdf blade file
  • Laravel 5.6 controller to simple download the PDF

Laravel 5.6 PDF Generation using Dompdf Tutorial With Example

I am Gonna to Configure step by step laravel 5.6 tutorial pdf Project.

Step #1: Setup Laravel 5.6 Project

composer create-project --prefer-dist laravel/laravel pdfgenerate

Sytep #2: Settings SQL Database

setup database credentials >> .env file

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=topdevlopers
DB_USERNAME=atmiya25
[email protected]

Step #3: Setup laravel-dompdf package

install The laravel-dompdf – laravel 5.6 tutorial pdf

composer require barryvdh/laravel-dompdf

Include Laravel 5.6 ServiceProviders in config/app.php

//laravel 5.6 tutorial pdf providers
'providers' => [
    ....
    Barryvdh\DomPDF\ServiceProvider::class,
],

Include Laravel 5.6 config/app.php

//some laravel 5.6 tutorial pdf aliases
'aliases' => [
    ....
    'PDF' => Barryvdh\DomPDF\Facade::class,
],

Step #4: Setup Laravel Model and Migration File

php artisan make:model TopDevloperInfo -m

Laravel Project Save as well as run.

php artisan migrate

Step #5: Make a Html View File

resources/views/topdevloperinfo.blade.php

<!-- topdevloperinfo.blade.php -->

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Laravel 5.6 PDF Generation using Dompdf Example</title>
    <link rel="stylesheet" href="{{asset('css/app.css')}}">
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">  
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>  
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>    </head>
  <body>
    <div class="container">
      <h2>Laravel 5.6 PDF Generation using Dompdf Example</h2><br/>
	  <p>laravel 5.6 tutorial pdf </p>
      <form method="post" action="{{url('/topdevloperinfo/store')}}">
        @csrf
        <div class="form-group row">
            <label for="name" class="col-md-4 col-form-label text-md-right">Name:</label>
            <div class="col-md-2">
                <input id="name" type="text" class="form-control" name="name">
            </div>
        </div>
        <div class="form-group row">
            <label for="language" class="col-md-4 col-form-label text-md-right">Language:</label>
            <div class="col-md-2">
                <input id="language" type="text" class="form-control" name="language">
            </div>
        </div>
        <div class="form-group row">
            <label for="position" class="col-md-4 col-form-label pakainfo text-md-right">Position:</label>
            <div class="col-md-2">
                <input id="position" type="text" class="form-control" name="position">
            </div>
        </div>
        <div class="form-group row">
            <label for="devpoint" class="col-md-4 col-form-label text-md-right">Dev Point:</label>
            <div class="col-md-2">
                <input id="devpoint" type="text" class="form-control" name="devpoint">
            </div>
        </div>
      <div class=" form-group row">
          <div class="col-md-4"></div>
          <div class="col-md-2">
            <button type="submit" class="btn btn-success">Submit</button>
          </div>
        </div>
      </form>
    </div>
  </body>
</html>

Step #6: Make Laravel 5.6 controller

php artisan make:controller  TopDevloperInfoController

Create TopDevloperInfoController.php

//TopDevloperInfoController.php

public function create()
    {
        return view('topdevloperinfo');
    }

Step #7: Laravel 5.6 Route

Laravel 5.6 web.php file

Route::get('/topdevloperinfo','[email protected]');
Route::post('/topdevloperinfo/store','[email protected]');
Route::get('/topdevloperinfo/index','[email protected]');
Route::get('/topdevloperinfo/downloadPDF/{id}','[email protected]');

Step #8: Save data to the Mysql database

TopDevloperInfoController.php

//TopDevloperInfoController.php

use App\TopDevloperInfo;

public function store(Request $request)
    {
        $devloper = new TopDevloperInfo();
        $devloper->name = $request->get('name');
        $devloper->language = $request->get('language');
        $devloper->position = $request->get('position');
        $devloper->devpoint = $request->get('devpoint');
        $devloper->save();
        return redirect('/topdevloperinfo/index');
    }

TopDevloperInfoController.php

//TopDevloperInfoController.php

public function index()
    {
        $devlopers = TopDevloperInfo::all();
        return view('index', compact('devlopers'));
      }

Step # 9: Make a HTML file for the Display the All data.

resources/views/index.blade.php

<!-- Laravel 5.6 index.blade.php -->
<!DOCTYPE html>
<html>
  <head>
  <title>laravel 5.6 tutorial pdf</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="{{asset('css/app.css')}}">
  </head>
  <body>
      <div class="container">
      <table class="table table-striped">
  <thead>
    <th>ID</th>
    <th>Name</th>
    <th>Language</th>
    <th>Position</th>
    <th>Dev Point</th>
    <th>Action</th>
  </thead>
  <tbody>
    @foreach($devlopers as $devloper)
    <tr>
      <td>{{$devloper->id}}</td>
      <td>{{$devloper->name}}</td>
      <td>{{$devloper->language}}</td>
      <td>{{$devloper->position}}</td>
      <td>{{$devloper->devpoint}}</td>
      <td><a href="{{action('[email protected]', $devloper->id)}}">PDF</a></td>
    </tr>
    @endforeach
  </tbody>
</table>
      </div>
  </body>
</html>

Step #10: Make a HTML file to design Simple pdf blade

resources/views/pdf.blade.php

<!-- pdf.blade.php -->

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Generate PDF from HTML in PHP Laravel 5.6 using Dompdf Library</title>
  </head>
  <body>
    <table class="table table-bordered">
      <tr>
        <td>
          {{$devloper->name}}
        </td>
        <td>
          {{$devloper->language}}
        </td>
        <td>
          {{$devloper->position}}
        </td>
        <td>
          {{$devloper->devpoint}}
        </td>
      </tr>
    </table>
  </body>
</html>

Step #11: Laravel 5.6 function in the controller to PDF download

TopDevloperInfoController.php

//TopDevloperInfoController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\TopDevloperInfo;
use PDF;

class TopDevloperInfoController extends Controller
{
    public function create()
    {
        return view('topdevloperinfo');
    }

    public function store(Request $request)
    {
        $devloper = new TopDevloperInfo();
        $devloper->name = $request->get('name');
        $devloper->language = $request->get('language');
        $devloper->position = $request->get('position');
        $devloper->devpoint = $request->get('devpoint');
        $devloper->save();
        return redirect('/topdevloperinfo/index');
    }

    public function index()
    {
        $devlopers = TopDevloperInfo::all();
        return view('index', compact('devlopers'));
      }

      public function downloadPDF($id)
      {
        $devloper = TopDevloperInfo::find($id);
        $pdf = PDF::loadView('pdf', compact('devloper'));
        return $pdf->download('topdevloperinfo.pdf');
      }
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about create Simple Generate PDF file in Laravel 5.6.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.