Topic: jQuery

Laravel Autocomplete Textbox with Multiple values using jQuery and MySQL 0

Laravel Autocomplete Textbox with Multiple values using jQuery and MySQL

Laravel Autocomplete Textbox with Multiple values using jQuery and MySQL

In this Post We Will Explain About is Laravel Autocomplete Textbox with Multiple values using jQuery and MySQL With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Laravel – Input multiple tags with dynamic autocomplete Example

In this post we will show you Best way to implement Laravel – Autocomplete Multiple Fields, hear for Laravel 5 – Simple Autocomplete Multiple values Using jQuery, Ajax and MySQL with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Step 1: Make Sample Table

In first Phase, We will create some sample table Like as a “students” to test this spource code.

CREATE TABLE `students` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `stud_sname` varchar(3) NOT NULL,
 `name` varchar(150) NOT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=247 DEFAULT CHARSET=utf8

Step 2: Add routes

In this Simple Phase, We will add the simple following two Laravel routes :

Route::get('autocomplete', '[email protected]');

Route::get('searchajax', ['as'=>'searchajax','uses'=>'[email protected]']);

Step 3: Create Controller

In this Phase, We will Make studentNameListController.php in following path Laravel web-application like as a app/Http/Controllers.

app/Http/Controllers/studentNameListController.php

<?php

//include Name Space
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class studentNameListController extends Controller
{
    public function index(){        
        return view('autocomplete');
    }
    public function searchResponse(Request $request){
        $query = $request->get('term','');
        $students=\DB::table('students');
        if($request->type=='studentname'){
            $students->where('name','LIKE','%'.$query.'%');
        }
        if($request->type=='student_code'){
            $students->where('stud_sname','LIKE','%'.$query.'%');
        }
           $students=$students->get();        
        $data=array();
        foreach ($students as $student) {
                $data[]=array('name'=>$student->name,'stud_sname'=>$student->stud_sname);
        }
        if(count($data))
             return $data;
        else
            return ['name'=>'','stud_sname'=>''];
    }
}

Step 4: Create View File

Last Phase We will make a simple file like as a autocomplete.blade.php in following path Laravel web-application resources/views/.

<!DOCTYPE html>
<html>
<head>
    <title>Laravel Autocomplete Textbox with Mutiple values using jQuery and MySQL</title>
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="1.12.1/jquery-ui.min.css">
    <script src="jquery-3.2.1.min.js"></script>
  <script src="1.12.1/jquery-ui.min.js"></script>
</head>
<body>
<!-- Devloped by Pakainfo.com free download examples -->
<div class="container">
  <h1>Laravel Autocomplete Textbox with Mutiple values using jQuery and MySQL</h1>
  {!! Form::open() !!}
<!-- Devloped by Pakainfo.com free download examples -->      
    <table class="table table-bordered">
      <tr>
          <th><input class='check_all' type='checkbox' onclick="all_student()"/></th>
          <th>S. No</th>
          <th>Student Name</th>
          <th>Student code</th>
      </tr>
      <tr>
          <td><input type='checkbox' class='chkbox'/></td>
          <td><span id='sn'>1.</span></td>
          <td><input class="form-control liveAuto_txt" type='text' data-type="studentname" id='studentname_1' name='studentname[]'/></td>
          <td><input class="form-control liveAuto_txt" type='text' data-type="student_code" id='student_code_1' name='student_code[]'/> </td>
        </tr>
      </table>
      <button type="button" class='btn btn-danger delete'>- Delete</button>
      <button type="button" class='btn btn-success addbtn'>+ Add More</button>
  {!! Form::close() !!}
</div>
<script type="text/javascript">
          
 $(".delete").on('click', function() {
  $('.chkbox:checkbox:checked').parents("tr").remove();
  $('.check_all').prop("checked", false); 
  studentUpdateId();
});
var i=$('table tr').length;
$(".addbtn").on('click',function(){
  count=$('table tr').length;
  
    var data="<tr><td><input type='checkbox' class='chkbox'/></td>";
      data+="<td><span id='sn"+i+"'>"+count+".</span></td>";
      data+="<td><input class='form-control liveAuto_txt' type='text' data-type='studentname' id='studentname_"+i+"' name='studentname[]'/></td>";
      data+="<td><input class='form-control liveAuto_txt' type='text' data-type='student_code' id='student_code_"+i+"' name='student_code[]'/></td></tr>";
  $('table').append(data);
  i++;
});
        
function all_student() {
  $('input[class=chkbox]:checkbox').each(function(){ 
    if($('input[class=check_all]:checkbox:checked').length == 0){ 
      $(this).prop("checked", false); 
    } else {
      $(this).prop("checked", true); 
    } 
  });
}
function studentUpdateId(){
  obj=$('table tr').find('span');
  $.each( obj, function( key, value ) {
    id=value.id;
    $('#'+id).html(key+1);
  });
}
//Live autocomplete script
$(document).on('focus','.liveAuto_txt',function(){
  type = $(this).data('type');
  
  if(type =='studentname' )autoType='name'; 
  if(type =='student_code' )autoType='stud_sname'; 
  
   $(this).autocomplete({
       minLength: 0,
       source: function( request, response ) {
            $.ajax({
                url: "{{ route('searchajax') }}",
                dataType: "json",
                data: {
                    term : request.term,
                    type : type,
                },
                success: function(data) {
                    var array = $.map(data, function (stud) {
                       return {
                           label: stud[autoType],
                           value: stud[autoType],
                           data : stud
                       }
                   });
                    response(array)
                }
            });
       },
       select: function( event, ui ) {
           var data = ui.stud.data;           
           id_arr = $(this).attr('id');
           id = id_arr.split("_");
           paramId = id[id.length-1];
           $('#studentname_'+paramId).val(data.name);
           $('#student_code_'+paramId).val(data.stud_sname);
       }
   });
   
   
});
</script>
<!-- Devloped by Pakainfo.com free download examples -->
</body>
</html>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Laravel autocomplete multiple fields with single auto-select request And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Ajax Image Upload using PHP and jQuery 0

Ajax Image Upload using PHP and jQuery

Ajax Image Upload using PHP and jQuery

In this Post We Will Explain About is Ajax Image Upload using PHP and jQuery With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to upload image ajax jquery php mysql Example

In this post we will show you Best way to implement ajax image upload jquery php , hear for ajax image upload without refreshing page using jquery with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Step 1 : Create Image From

first of all simple create the HTML form to simple select and upload the any format image.Basic Note : For here in this example, Design we are using simple version of bootstrap.css

Create file upload-ajax-image.php

<div class="col-md-12"><div id="uploadedimage"></div>
<form role="form"  id="liveUploadImgFunForm" enctype= "multipart/form-data"  action="javascript:void(0)" onsubmit="liveUploadImgFun(this);">
	<div class="form-group">
		<label for="file">Select Image</label>
		<input type="file" name="liveUploadImgFun" class="form-control" id="liveUploadImgFun"
		placeholder="select file">
	</div>
	<button type="submit" class="btn btn-primary">Upload</button>
</form>
</div>

Step 2: Create Js File

here simple Create imageupload.js

function liveUploadImgFun(this){
	$.ajax({
		url: "liveUploadImgFunajax.php",
		type: "POST",
		data: new FormData(this),
		contentType: false,
		cache: false,
		processData:false,
		success: function(data){
		$("#uploadedimage").html(data);
		}
	});
}

Step 3 : Create upload php file

Which will all the image upload the posted any format image by the simple using jquery and ajax and will upload or move in a Directory ie. target Directory in which We want to upload or store all the images on the any server side.Create liveUploadImgFun.php

$des_path = "imagesupload/";// upload directory
$upload = 1;
$des_file = $des_path . basename($_FILES["liveUploadImgFun"]["name"]);
$uploadOk = 1;
 // get uploaded file's extension
$check_img_FileTp = pathinfo($des_file,PATHINFO_EXTENSION);

 // check's valid format

if($check_img_FileTp != "jpg" && $check_img_FileTp != "png" && $check_img_FileTp != "jpeg"
&& $check_img_FileTp != "gif" ) {
	echo "Invalid images Format.Only simple JPG, or JPEG, or PNG or GIF files are data allowed.";
	$upload = 0;
	exit;


}if ($_FILES["liveUploadImgFun"]["size"] > 200000) {
	echo "Sorry, your file is very large.";
	$upload = 0;

	exit;
}
	if($upload == '1'){
	$data_str = '';
	if (move_uploaded_file($_FILES["liveUploadImgFun"]["tmp_name"], $des_file)) {
	$data_str .= "The file ". basename( $_FILES["liveUploadImgFun"]["name"]). " has been uploaded. Good Luck!!";
	$data_str .= "<img src='imagesupload/".$_FILES["liveUploadImgFun"]["name"]."'>";
} else {
	echo "Sorry,Your file not uploaded. there was some an error uploading your this file.";
}
}

You are Most welcome in my you tube Channel Please subscribe my channel. and give me Feed Back.
More Details……
Angularjs Example

Example

I hope you have Got What is ajax image upload without refreshing page using jquery And how it works.I would Like to have Feed Back From My Blog(Pakainfo.com) readers.Your Valuable Feed Back,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

jQuery Datatable Server Side Processing with codeigniter 0

jQuery Datatable Server Side Processing with codeigniter

jQuery Datatable Server Side Processing with codeigniter

In this Post We Will Explain About is jQuery Datatable Server Side Processing with codeigniter With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Data table Server Side Processing with codeigniter Example

In this post we will show you Best way to implement Datatable demo (Server side) in codeigniter,Mysql and Ajax, hear for DataTables – Development – server-side processing using codeigniter with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Controllers – crud.php

<?php  
 defined('BASEPATH') OR exit('No direct script access allowed');  
 class Crud extends CI_Controller {  
      //Codeigniter functions  
      function index(){  
           $data["title"] = "codeigniter c.r.u.d. with modals & ajax free download";  
           $this->load->view('crud_view', $data);  
      }  
      function get_student(){  
           $this->load->model("ci_crud_model");  
           $getStud_data = $this->ci_crud_model->make_datatables();  
           $data = array();  
           foreach($getStud_data as $data_row)  
           {  
                $stud_arr = array();  
                $stud_arr[] = '<img src="'.base_url().'upload/'.$data_row->image.'" class="img-thumbnail" width="100" height="30" />';  
                $stud_arr[] = $data_row->student_fname;  
                $stud_arr[] = $data_row->student_lname;  
                $stud_arr[] = '<button type="button" name="update" id="'.$data_row->id.'" class="btn btn-warning btn-xs">Update</button>';  
                $stud_arr[] = '<button type="button" name="delete" id="'.$data_row->id.'" class="btn btn-danger btn-xs">Delete</button>';  
                $data[] = $stud_arr;  
           }  
           $output = array(  
                "draw"                    =>     intval($_POST["draw"]),  
                "recordsTotal"          =>      $this->ci_crud_model->get_student_list(),  
                "recordsFiltered"     =>     $this->ci_crud_model->get_stud_filterData(),  
                "data"                    =>     $data  
           );  
           echo json_encode($output);  
      }  
 }  

Models – ci_crud_model.php

 <?php  
 class Crud_model extends CI_Model  
 {  
      var $table = "students";  
      var $select_column = array("id", "student_fname", "student_lname", "image");  
      var $order_column = array(null, "student_fname", "student_lname", null, null);  
      function student_query()  
      {  
           $this->db->select($this->select_column);  
           $this->db->from($this->table);  
           if(isset($_POST["search"]["value"]))  
           {  
                $this->db->like("student_fname", $_POST["search"]["value"]);  
                $this->db->or_like("student_lname", $_POST["search"]["value"]);  
           }  
           if(isset($_POST["order"]))  
           {  
                $this->db->order_by($this->order_column[$_POST['order']['0']['column']], $_POST['order']['0']['dir']);  
           }  
           else  
           {  
                $this->db->order_by('id', 'DESC');  
           }  
      }  
      function make_datatables(){  
           $this->student_query();  
           if($_POST["length"] != -1)  
           {  
                $this->db->limit($_POST['length'], $_POST['start']);  
           }  
           $get_query = $this->db->get();  
           return $get_query->result();  
      }  
      function get_stud_filterData(){  
           $this->student_query();  
           $get_query = $this->db->get();  
           return $get_query->num_data_rows();  
      }       
      function get_student_list()  
      {  
           $this->db->select("*");  
           $this->db->from($this->table);  
           return $this->db->count_all_results();  
      }  
 }  

Include External Script

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<!-- Devloped by Pakainfo.com free download examples -->  
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>  
<!-- Devloped by Pakainfo.com free download examples -->
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>            
<!-- Devloped by Pakainfo.com free download examples -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />  

Views – crud_view.php

<html>  
 <head>  
   <title><?php echo $title; ?> Pakainfo.com</title>   
 </head>  
 <body>  
 <!-- Devloped by Pakainfo.com free download examples -->
      <div class="container box">  
           <h3 align="center"><?php echo $title; ?></h3><br />  
           <div class="table-responsive">  
                <hr />  
                <table id="student_data" class="table">  
                     <thead>  
                          <tr>  
                               <th width="20%">Student Image</th>  
                               <th width="20%">Student First Name</th>  
                               <th width="20%">Student Last Name</th>  
                               <th width="15%">Student Edit</th>  
                               <th width="20%">Student Delete</th>  
                          </tr>  
                     </thead>  
                </table>  
           </div>  
      </div>  
 </body>  
 </html>  
 

script.js

 $(document).ready(function(){  
      var dataTable = $('#student_data').DataTable({  
           "processing":true,  
           "serverSide":true,  
           "order":[],  
           "ajax":{  
                url:"<?php echo base_url() . 'crud/get_student'; ?>",  
                type:"POST"  
           },  
           "columnDefs":[  
                {  
                     "targets":[0, 3, 4],  
                     "orderable":false,  
                },  
           ],  
      });  
 });  

style.css

body  
{  
	margin:0;  
	padding:0;  
	background-color:#3a3d3b;  
}  
.box  
{  
	width:850px;  
	padding:30px;  
	background-color:#3d3d3d;  
	border:1px solid #4d4ds4;  
	border-radius:8px;  
	margin-top:12px;  
}  

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Server-side DataTables in Codeigniter using jQuery And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Create Nested List From JSON using javascript 0

Create Nested List From JSON using javascript

Create Nested List From JSON using javascript

In this Post We Will Explain About is Create Nested List From JSON using javascript With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Nested List from JSON Example

In this post we will show you Best way to implement generate nested li list using Javascript, hear for Create a nested array recursively in Javascript with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

index.html

<div id="list"></div>

index.js

var allMenu = {
    "Home": {
        "Home_Sub": ["Service", "product", "statictics"]
    },
        "About": ["student", "team", "branch"],
        "Contact": ["users", "clients", "people"]
};
var exArr = ["<ul>"];
function displayList(menus) {
    switch ($.type(menus)) {
        case "object":
            getSubData(menus);
            break;
        case "string":
            exArr.push("<li>" + menus + "</li>");
            //console.log(menus);
            break;
        case "exArr":
            printArray(menus);
            break;
       
    }
    
}

function getSubData(parent) {
    for (var subch in parent) {
        //console.log(subch);
         exArr.push("<li>" + subch + "<ul>");
        displayList(parent[subch]);
        exArr.push("</ul></li>");
    }
}
function printArray(liveArray){
    for(var i = 0; i < liveArray.length; i++){
        //console.log(liveArray[i]);
         exArr.push("<li>" + liveArray[i] + "</li>");
        }
}
displayList(allMenu);
exArr.push("<ul>");
$("#list").html(exArr.join(""));
//displayList("string");
console.log(exArr);

Nested List from JSON

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is javascript – Create a nested list from a object And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

jQuery AJAX Loading Overlay Example 0

jQuery AJAX Loading Overlay Example

jQuery AJAX Loading Overlay Example

In this Post We Will Explain About is jQuery AJAX Loading Overlay Example With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to css loading overlay entire page Example

In this post we will show you Best way to implement jQuery Ajax Loading Overlay , hear for Overlay div block with the image while AJAX loading with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Include External jQuery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

Ajax Source Code(index.js)

$(document).ready(function(){
	$("#loading").hide();
		 $('.mynodeurl').on('click', function(e){
			 var rowid = $(this).attr('data-id');
			// alert(rowid)
			$("#myModal").show();
			$("#loading").show();
			$('.fetched-data').html('');
			 $.ajax({
				type : 'post',
				url : 'fetch_node_details.php', //Here you will fetch records 
				data :  'rowid='+ rowid, //Pass $id
				success : function(data){
			    $("#loading").hide();
				$('.fetched-data').html(data);//Show fetched data from database
				
				}
			});			
        });
});

index.html

<div class="modal-body">
	<div style="position: relative;" align="center">
		<img id="loading" src="img/3.gif" /> </div><!-- Loading Image -->
		<div class="fetched-data"></div>
    </div>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is loading overlay bootstrap And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Get PHP Session Value using AJAX/Jquery 0

Get PHP Session Value using AJAX/Jquery

Get PHP Session Value using AJAX/Jquery

In this Post We Will Explain About is Get PHP Session Value using AJAX/Jquery With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to how to get session value in jquery ajax Example

In this post we will show you Best way to implement Get variable from PHP file using JQuery/AJAX , hear for javascript variable value stored in php session with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

index.php

<?php
	session_start();
?>
<!DOCTYPE html>
<html>
<head>
	<title>How to Simple get PHP Session Value using jQuery</title>
css/bootstrap.min.css
3.1.0/jquery.min.js
3.3.7/js/bootstrap.min.js
</head>
<body>
<divclass="container">
	<h1 class="page-header text-center">How to get PHP Session Value in jQuery</h1>
	<div class="row">
		<div class="col-xl-6 col-xl-offset-3">
			<h3 class="text-center">Set simple jquery to php Session Value ( $_SESSION['value'] )</h3>
			<form method="POST" action="do_session.php">
				<input type="text" name="set_sessionVal" class="form-control" placeholder="enter simple value" required>
				<div style="margin-top:11px;">
				<button type="submit" class="live btn btn-success">Set Value</button> <a href="logout.php" type="button" class="live btn btn-danger">Remove session Value</a>
				</div>
			</form>
 
			<button type="button" id="checkSession" class="btn btn-success" style="margin-top:30px;">Check Session in jQuery</button>
		</div>
	</div>
 
	<input type="hidden" value="<?php
		if(isset($_SESSION['value'])){
			echo $_SESSION['value'];
		} 
	?>" id="session">
</div>
<script src="session.js"></script>
</body>
</html>

do_session.php

<?php
	session_start();
 
	$set_sessionVal=$_POST['set_sessionVal'];
	$_SESSION['value']=$set_sessionVal;
 
	header('location:index.php');
?>

logout.php

<?php
	session_start();
	unset($_SESSION['value']);
	header('location:index.php');
?>

session.js

$(document).ready(function(){
	//here simple conditions of check session
	$('#checkSession').click(function(){
		var session = $('#session').val();
		if(session == ''){
			alert('Live Session not Set');
			console.log('Live Session not Set');
		}
		else{
			alert('here simple Current Live Session Value: '+session);
			console.log(session);
		}
	});
});

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Get variable from PHP file using JQuery/AJAX And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Simple jQuery Datepicker Example code with demo 0

Simple jQuery Datepicker Example code with demo

Simple jQuery Datepicker Example code with demo

In this Post We Will Explain About is Simple jQuery Datepicker Example code with demo With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to simple date picker in html Example

In this post we will show you Best way to implement simple date picker in jquery, hear for Jquery Datepicker example code with demo using Jquery UI with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Here’s display simple jQuery step by step Datepicker example.

Include External Libs

http://ajax.microsoft.com/ajax/jquery.ui/1.8.6/themes/smoothness/jquery-ui.css
http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
http://ajax.microsoft.com/ajax/jquery.ui/1.8.6/jquery-ui.min.js
</script>

index.html

<html>
<head>
<title>Pakainfo.com -Datepicker example and free download source code</title>
<script type="text/javascript">
$(function () {
$("#date").datepicker();
});
</script>
</head>
<body>
<input id="livedate" type="text" />
</body>
</html>

index.js

In above simple jquery example,option set to date formate id like as a mm/dd/yy but We can change it to simple like as a default format (‘dd-mm-yy’) by changing source code:

<script type="text/javascript">
$(document).ready(function () {
$(function () {
//   $("#mytxtproductDate").date_input();
$("#livedate").datepicker({ dateFormat: 'dd-mm-yy' });
});
});
</script>

OR prevent some users from selecting here weekends ..

<script type="text/javascript">
$(function () {
$("#livedatepicker1").datepicker({
beforeShowDay: $.datepicker.noWeekends
});
});
</script>

OR onther way how to disable all datepicker the future dates.

<script type="text/javascript">
             $(function () {
 
                 var date = new Date();
                 var livecmonth = date.getMonth();
                 var livecdate = date.getDate();
                 var livecYear = date.getFullYear();
 
                 $("#livedatepicker1").datepicker({
                     maxDate: new Date(livecYear, livecmonth, livecdate)
                 });
             });
    </script>

Full Example

<html lang="en">
<head>
    <title>Free Download source code php projects</title>
    <script src="1.9.1/jquery.js"></script> 
    <script src="jqueryui/1.11.4/jquery-ui.js"></script> 
    <link href="4.0.0-alpha/css/bootstrap.css" rel="stylesheet">
    <link href="jqueryui/1.11.4/jquery-ui.css" rel="stylesheet">   
</head>
<body>


<div class="container text-center">
     <h2>Simple jQuery Datepicker Example code with demo</h2>
     <strong>Select Any Date:</strong> <input type="text" id="livedatepicker1" class="live from-control">
</div>	

<script type="text/javascript">
    $( "#livedatepicker1" ).datepicker();
</script>

</body>
</html>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is datepicker in jquery code with example And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

PHP – MySQLi Insert Update Delete CRUD Operation using AngularJS 0

PHP - MySQLi Insert Update Delete CRUD Operation using AngularJS

PHP – MySQLi Insert Update Delete CRUD Operation using AngularJS

In this Post We Will Explain About is PHP – MySQLi Insert Update Delete CRUD Operation using AngularJS With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to AngularJS – Insert Update Delete using PHP and MySQL Example

In this post we will show you Best way to implement PHP – OOP CRUD Operation using Angular.js, hear for AngularJS PHP CRUD (Create, Read, Update, Delete) Operations with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

AngularJS CRUD Operation With PHP/MySQLi

In this Example,First of all Add or Include External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priority set.After that Include your relevant CSS Class.

Creating simple Database

CREATE TABLE `student` (
  `studentId` INT(11) NOT NULL AUTO_INCREMENT,
  `studentfname` VARCHAR(50) NOT NULL,
  `studentlname` VARCHAR(50) NOT NULL,
PRIMARY KEY(`studentId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Creating simple Database Connection

<?php
$db_con = new mysqli("localhost", "username", "Your_Database_Password", "livedbname");
 
if ($db_con->connect_error) {
    die("Connection failed: " . $db_con->connect_error);
}
?>

index.php

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8"> 
<title>PHP Insert Update Delete CRUD Operation using AngularJS</title>
<link href="<a href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<body>
<div class="container">
	<h1 class="page-header">PHP Insert Update Delete CRUD Operation using AngularJS</h1>
	<div class="row">
		<div ng-app="liveApp" ng-controller="controller" ng-init="displayData()">
			<div class="col-xl-4">
				<form ng-submit="myFunc()">
					<h3>Student Form</h3>
					<hr>
					<div class="live24u form-group">
				    	<label for="studentfname">Firstname</label>
				    	<input type="text" class="live24u form-control" id="studentfname" name="studentfname" ng-model="studentfname" placeholder="Enter Firstname">
				  	</div>
				  	<div class="live24u form-group">
				    	<label for="studentlname">Lastname</label>
				    	<input type="text" class="live24u form-control" id="studentlname" name="studentlname" ng-model="studentlname" placeholder="Enter Lastname">
				  	</div>
				  	<hr>
				  	<button type="submit" class="live24u {{buttonClass}}" ng-click="insert()"><span class="live24u {{mainico}}"></span> {{buttonName}}</button>
				</form>
			</div>
			<div class="col-xl-8">
				<h3>Student List</h3>
				<table class="live table table-bordered dbn table-striped">
					<thead>
						<th>student Firstname</th>
						<th>student Lastname</th>
						<th>Action</th>
					</thead>
					<tbody>
						<tr ng-repeat="stud in student">
							<input type="hidden" value="{{stud.studentId}}">
							<td>{{stud.studentfname}}</td>
							<td>{{stud.studentlname}}</td>
							<td>
								<button class="live btn btn-success" ng-click="update(stud.studentId, stud.studentfname, stud.studentlname)"><span class="live glyphicon glyphicon-pencil"></span> Edit</button> || <button class="live btn btn-danger" ng-click="delete(stud.studentId)"><span class="live glyphicon glyphicon-trash"></span> Delete</button>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
<script src="main.js"></script>
</body>
</html>

main.js

var app = angular.module("liveApp", []);
app.controller("controller", function($scope, $http) {
    $scope.buttonName = "Save";
    $scope.mainico = "glyphicon glyphicon-floppy-disk";
    $scope.buttonClass = "btn btn-success";
    $scope.insert = function() {
        if ($scope.studentfname == null) {
            alert("Please input Student Firstname");
        } 
        else if ($scope.studentlname == null) {
            alert("Please input Student Lastname");
        }  
        else {
            $http.post(
                "action.php", {
                    'studentfname': $scope.studentfname,
                    'studentlname': $scope.studentlname,
                    'buttonName': $scope.buttonName,
                    'studentId': $scope.studentId,
                }
            ).success(function(data) {
                alert(data);
                $scope.studentfname = null;
                $scope.studentlname = null;
                $scope.buttonName = "Save";
                $scope.mainico = "glyphicon glyphicon-floppy-disk";
                $scope.buttonClass = "btn btn-success";
                $scope.displayData();
            });
        }
    }
    $scope.displayData = function() {
        $http.get("fetch.php")
            .success(function(data) {
                $scope.student = data;
            });
    }
    $scope.update = function(studentId, studentfname, studentlname) {
        $scope.studentId = studentId;
        $scope.studentfname = studentfname;
        $scope.studentlname = studentlname;
        $scope.mainico = "glyphicon glyphicon-check";
        $scope.buttonClass = "btn btn-success";
        $scope.buttonName = "Update";
    }
    $scope.delete= function(studentId) {
        if (confirm("you want to really delete student?")) {
            $http.post("delete.php", {
                    'studentId': studentId
                })
                .success(function(data) {
                    alert(data);
                    $scope.displayData();
                });
        } else {
            return false;
        }
    }
});

fetch.php

<?php
	include('db_con.php');
	$result = array();
	$query = $db_con->query("select * from student"); 
	if ($query->num_rows > 0) {
	    while ($datarow = $query->fetch_array()) {
	        $result[] = $datarow;
	    }
	    echo json_encode($result);
	}
?>

action.php

<?php
    include('db_con.php');
    $get_data = json_decode(file_get_contents("php://input"));
    if (count($get_data) > 0) {
        $studentfname = mysqli_real_escape_string($db_con, $get_data->studentfname);
        $studentlname = mysqli_real_escape_string($db_con, $get_data->studentlname);
        $actBtnName = $get_data->buttonName;
        if ($actBtnName == "Save") {
            if ($db_con->query("insert into student (studentfname, studentlname) values ('$studentfname', '$studentlname')")) {
                echo "Student Added Successfully";
            } else {
                echo 'Failed';
            }
        }
        if ($actBtnName == "Update") {
            $id    = $get_data->studentId;
            if ($db_con->query("update student set studentfname='$studentfname', studentlname='$studentlname' where studentId='$id'")) {
                echo 'Student Updated Successfully';
            } else {
                echo 'Sorry Failed';
            }
        }
    }
?>

delete.php

<?php
	include('db_con.php');
	$data = json_decode(file_get_contents("php://input"));
	if (count($data) > 0) {
	    $id = $data->studentId;
	    if ($db_con->query("delete from student where studentId='$id'")) {
	        echo 'Student Deleted Successfully';
	    } else {
	        echo 'Failed';
	    }
	}
?>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is AngularJS CRUD Operations with PHP and MySQL And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Create Dynamic Image Fancybox Gallery with jQuery, PHP & MySQL 0

Create Dynamic Image Fancybox Gallery with jQuery, PHP & MySQL

Create Dynamic Image Fancybox Gallery with jQuery, PHP & MySQL

In this Post We Will Explain About is Create Dynamic Image Fancybox Gallery with jQuery, PHP & MySQL With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Responsive Photo Gallery with jQuery Example

In this post we will show you Best way to implement Creating dynamic Photo Gallery with jQuery, PHP & MySQL, hear for How to Create Dynamic Image Gallery with jQuery, PHP & MySQL with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Creating simple Database

CREATE TABLE `Gallery_photo` (
  `liveImgId` INT(11) NOT NULL AUTO_INCREMENT,
  `information` text NOT NULL,
  `img_location` VARCHAR(150) NOT NULL,
PRIMARY KEY(`liveImgId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Include External Libs

<link rel="stylesheet" href="css/bootstrap.min.css" rel="nofollow">
<script src="jquery/3.1.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox.css">
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="fancybox/jquery.fancybox.js"></script>

index.php

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>jquery PHP Gallery using Fancybox Example</title>
	<script type="text/javascript">
	    $("[data-fancybox]").fancybox({ });
	</script>
</head>
<body>
	<div class="container">
		<h1 class="page-header text-center">Fancybox - Fancy jQuery lightbox alternative</h1>
		<h2>
			Photo List
			<a href="#liveaddImg" data-toggle="modal" class="pull-right btn btn-success"><span class="live24u glyphicon glyphicon-plus"></span> Photo</a>
		</h2>
		<?php
			session_start();
 
			if(isset($_SESSION['success'])){
				?>
				<div class="alert alert-success text-center">
					<?php echo $_SESSION['success']; ?>
				</div>
				<?php
 
				unset($_SESSION['success']);
			}
 
			if(isset($_SESSION['galleryError'])){
				?>
				<div class="alert alert-danger text-center">
					<?php echo $_SESSION['galleryError']; ?>
				</div>
				<?php
 
				unset($_SESSION['galleryError']);
			}
		?>
		<table class="table">
			<thead>
				<th>Information</th>
				<th>Gallery Location</th>
				<th>Gallery</th>
			</thead>
			<tbody>
				<?php
					$db_con = new mysqli("localhost", "username", "password", "gallery");
 
					if ($db_con->connect_error) {
					    die("Connection failed: " . $db_con->connect_error);
					}
 
					$sql="select * from Gallery_photo";
					$query=$db_con->query($sql);
					while($datarow=$query->fetch_array()){
						?>
						<tr>
							<td><?php echo $datarow['information']; ?></td>
							<td><?php echo $datarow['img_location']; ?></td>
							<td><a href="<?php echo $datarow['img_location']; ?>" data-fancybox="group" data-caption="<?php echo $datarow["information"]; ?>"><img src="<?php echo $datarow['img_location']; ?>" height="30px" width="30px"></a></td>
						</tr>
						<?php
					}
				?>
			</tbody>
		</table>
	</div>
 
	<!--create / Add Photo -->
	<div class="modal fade" id="liveaddImg" tabindex="-1" role="dialog" aria-labelledby="live_createModel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
					<h4 class="live modal-title text-center" id="live_createModel">Add New Photo</h4>
				</div>
				<div class="live modal-body">
					<div class="live24u container-fluid">
					<form method="POST" action="do_upload.php" enctype="multipart/form-data">
				    	<div class="form-group">
							<div class="row">
					    		<div class="col-xl-2" style="margin-top:8px;">
					    			<label>Description:</label>
					    		</div>
					    		<div class="col-xl-10">
					    			<input type="text" class="form-control" name="information" required>
					    		</div>
					    	</div>
				    	</div>
				    	<div class="live form-group">
				    		<div class="row">
					    		<div class="col-xl-2" >
					    			<label>Gallery Photo:</label>
					    		</div>
					    		<div class="col-xl-10">
					    			<input type="file" name="image">
					    		</div>
					    	</div>
				    	</div>
				    </div>
				</div>
				<div class="live modal-footer">
					<button type="button" class="live24u btn btn-default" data-dismiss="modal"><span class="live glyphicon glyphicon-remove"></span> Cancel</button>
					<button type="submit" class="btn btn-success"><span class="live24u glyphicon glyphicon-floppy-disk"></span> Save</button>
					</form>
				</div>
			</div>
		</div>
	</div>
 
</body>
</html>

do_upload.php

<?php
	session_start();
 
	$db_con = new mysqli("localhost", "username", "yourpassword", "gallery");
	if ($db_con->connect_error) {
	    die("Connection failed: " . $db_con->connect_error);
	}
 
	$information=$_POST['information'];
 
	$getDataInfo = PATHINFO($_FILES["image"]["name"]);
	if (empty($_FILES["image"]["name"])){
		$_SESSION['galleryError']="Upload Failed. Sorry File empty!";
		header('img_location:index.php');
	}
	else{
		if ($getDataInfo['extension'] == "jpg" OR $getDataInfo['extension'] == "jpeg" OR $getDataInfo['extension'] == "png") {
			$newdataFile = $getDataInfo['filename'] . "_" . time() . "." . $getDataInfo['extension'];
			move_uploaded_file($_FILES["image"]["tmp_name"], "upload/" . $newdataFile);
			$img_location = "upload/" . $newdataFile;
 
			$sql="insert into Gallery_photo (information, img_location) values ('$information', '$img_location')";
			$query=$db_con->query($sql);
 
			if($query){
				$_SESSION['success']="Gallery Photo uploaded Successfully Good Lick!";
			}
			else{
				$_SESSION['galleryError']="Something went wrong. Please check to Can't upload Photo!";
			}
 
			header('img_location:index.php');
 
		}
		else{
			$_SESSION['galleryError']="Upload Failed. Sorry Please check upload any format JPG or PNG Gallery_photo only!";
			header('img_location:index.php');
		}
	}
 
?>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Fancybox – Fancy jQuery lightbox alternative And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.