Topic: Uncategorized

VueJS Disable enable Selector Examples 0

VueJS Disable enable Selector Examples

Today, We want to share with you VueJS Disable enable Selector Examples.In this post we will show you How to enable/disable an element using vuejs Example, hear for How to enable/disable text field using Vue.js? we will give you demo and example for implement.In this post, we will learn about How to Disable All Input Controls Inside a Form Using Vue JS with an example.

VueJS Disable enable Selector Examples

There are the Following The simple About VueJS Disable enable Selector Examples Full Information With Example and source code.

As I will cover this Post with live Working example to develop Enabling and Disabling text field using VueJS, so the vue.js disable input conditionally for this example is following below.

Example 1 Vue.JS Disable Selector Example

Here is the sample HTML file with Vue JS solution:

//Include vuejs CDN
https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.25/vue.js
<div id="mylive_app">
<h2>vue.js disable input conditionally</h2>
  <button>Click To 2 Time Enable</button>
  
    
  <pre>{{ $data | json }}</pre>
</div>

var app = new Vue({
  el: '#mylive_app',

  data: {
    disabled: 0,
  },
}); 

Vue JS button enable / disable with Demo
Angular 6 CRUD Operations Application Tutorials

Read :

Relavnt Keywords:vue :disabled not working, vue.js disable button after click, vue disable div, jquery disable button, html disabled using Vuejs, css disabled, vue select, vuejs disable component, Creating Custom Inputs With Vue.js, How to enable/disable an element using vuejs Example, Enabling and Disabling text field using VueJS, How to Disable All Input Controls Inside a Form Using Vue JS

Summary

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

I hope you get an idea about VueJS Disable enable Selector Examples.
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 connect Azure SQL Server Databases 0

PHP connect Azure SQL Server Source Code

Today, We want to share with you PHP connect Azure SQL Server Databases.In this post we will show you Create PHP apps using SQL Server on Windows, hear for Connect to Azure Database for MySQL from PHP we will give you demo and example for implement.In this post, we will learn about Connecting to MS SQL Server and SQL Azure databases with an example.

PHP connect Azure SQL Server Databases

There are the Following The simple About PHP connect Azure SQL Server Databases Full Information With Example and source code.

As I will cover this Post with live Working example to develop Integrate Azure SQL Database With PHP Website , so the PHP connect Azure SQL Server for this example is following below.

Integrate Azure SQL Database With PHP Website

azure-docs/sql-database-connect-query-php

In this Below Source code We will Understanding PHP script, which We can use it to simple source code connect to your Live Azure SQL server.

<?php
try {    
    $live_hostname = 'your_host_name.database.windows.net';
    $live_dbname = 'Mydb_name';
    $live_username = 'root(username)';
    $pwd = 'pass([email protected]#$5hjdf5)';
 
    $pdo = new PDO ("dblib:version=8.0;charset=UTF-8;host={$live_hostname};dbname={$live_dbname}", $live_username, $pwd);
    $sql_query = "SELECT * FROM location";
    $sql_statement = $pdo->prepare($sql_query);
    $sql_statement->execute();
    
    $response = $sql_statement->fetchAll(PDO::FETCH_ASSOC);
    var_dump($response);
 
} catch (PDOException $e) {
    echo "Sorry, Failed to get DB handle: " . $e->getMessage() . "\n";
    exit;
}

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 connect To Azure SQL Server Databases.
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 MySQL Dynamic Treeview using jQuery Ajax Example 0

PHP MySQL Dynamic Treeview using jQuery Ajax Example

Today, We want to share with you PHP MySQL Dynamic Treeview using jQuery Ajax Example.In this post we will show you Dynamic Tree with JSTree, PHP and MySQL, hear for PHP Dynamic Tree View Plugin With jQuery And Bootstrap we will give you demo and example for implement.In this post, we will learn about Create Dynamic Treeview Example using JQuery Ajax in PHP MySQL with an example.

PHP MySQL Dynamic Treeview using jQuery Ajax Example

There are the Following The simple About PHP MySQL Dynamic Treeview using jQuery Ajax Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop how to create Ajax treeview in php MySQL, so the some jQuery Ajax tree structure in php with mysql for this example is following below.

Step 1: Create student table

SQL query student table:

CREATE TABLE IF NOT EXISTS `student` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `std_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2

Step 2: Create HTML Interface

index.php

<!DOCTYPE html>
<html>
<head>
  <title>PHP Dynamic Tree View Plugin With jQuery And Bootstrap - PHP MySQLi Example</title>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-treeview/1.2.0/bootstrap-treeview.min.css" />
  <script type="text/javascript" charset="utf8" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-treeview/1.2.0/bootstrap-treeview.min.js"></script>
</head>
<body>
<h1>Create Treeview using Bootstrap Treeview Ajax JQuery with PHP</h1>  
<div class="container">
  <div class="panel panel-default">
    <div class="panel-heading">
      <b>Ajax Dynamic Tree with jquery, PHP and MySQL - pakainfo.com</b>
    </div>
    <div class="panel-body">
      <div class="col-md-8" id="studentiew_treejson">
      </div>
    </div>
  </div>
</div>
  
<script type="text/javascript">
$(document).ready(function(){
  
   var treestudData;
   
   $.ajax({
        type: "GET",  
        url: "/getstudents.php",
        dataType: "json",       
        success: function(results)  
        {
          studentsTreeData(results)
        }   
  });
   
  function studentsTreeData(treestudData) {
    $('#studentiew_treejson').treeview({data: treestudData});
  }
   
});
</script>
   
</body>
</html>

Step 3: Database configuration

config.php

<?php
  
    $hostName = "localhost";
    $username = "root";
    $password = "[email protected]";
    $dbname = "students_master";
   
    $mysqli = new mysqli($hostName, $username, $password, $dbname);
  
?> 

Step 4: Create Ajax File Call on Server side

getstudents.php

<?php
    
    require 'config.php';
  
    $parentKey = '0';
    $sql = "SELECT * FROM student";
  
    $studresult = $mysqli->query($sql);
   
      if(mysqli_num_rows($studresult) > 0)
      {
          $data = studentsTree($parentKey);
      }else{
          $data=["id"=>"0","name"=>"No Students present in list","text"=>"No Students is present in list","nodes"=>[]];
      }
   
      function studentsTree($parentKey)
      {
          require 'config.php';
  
          $sql = 'SELECT id, name from student WHERE std_id="'.$parentKey.'"';
  
          $studresult = $mysqli->query($sql);
  
          while($datavalue = mysqli_fetch_assoc($studresult)){
             $id = $datavalue['id'];
             $allstudData[$id]['id'] = $datavalue['id'];
             $allstudData[$id]['name'] = $datavalue['name'];
             $allstudData[$id]['text'] = $datavalue['name'];
             $allstudData[$id]['nodes'] = array_values(studentsTree($datavalue['id']));
          }
  
          return $allstudData;
      }
  
      echo json_encode(array_values($data));
  
?>

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 MySQL Dynamic Treeview using jQuery Ajax Example.
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 AJAX Insert Update Delete (CRUD) Example Tutorial 0

Laravel AJAX Insert Update Delete (CRUD) Example Tutorial From Scratch

Today, We want to share with you Laravel AJAX Insert Update Delete (CRUD) Example Tutorial From Scratch.In this post we will show you Laravel 5 Ajax CRUD example for web application without page refresh, hear for Simple PHP Jquery Ajax CRUD(insert update delete) tutorial example with source code we will give you demo and example for implement.In this post, we will learn about Laravel Jquery Ajax CRUD (insert update delete) Tutorial From Scratch with an example.

Laravel AJAX Insert Update Delete (CRUD) Example Tutorial From Scratch

There are the Following The simple About Laravel AJAX Insert Update Delete (CRUD) Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Ajax CRUD operations in laravel, so the some Insert Update and Delete record with AJAX in Laravel for this example is following below.

Step 1: Install Laravel

first of all simple Install Laravel Application

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

Step 2: Create a Member Table and Model

Laravel simple create_members_table to Generated Migration

php artisan make:migration create_members_table

path : store file -> database/migrations

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMembersTable extends Migration
{
    public function up()
    {
        Schema::create('members', function (Blueprint $table) {
            $table->increments('id');
            $table->string('member_name');
            $table->text('member_address');
            $table->timestamps();
        });
    }
    public function down()
    {
        Schema::drop("members");
    }
}

Now run below command to create a member table.

php artisan migrate

Member Model

namespace App;
use Illuminate\Database\Eloquent\Model;
class Member extends Model
{
    public $fillable = ['member_name','member_address'];
}

Step 3: Create Laravel blade View files

resources/views/ajax/index.blade.php

<html>
  <head>
   <title>Laravel Jquery Ajax CRUD (insert update delete) Example Tutorial From Scratch</title>
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
  </head>
<body>
<div class="container">
<h1>Insert Update and Delete record with AJAX in Laravel</h1>
<div class="panel panel-primary">
 <div class="panel-heading">Laravel Jquery Ajax CRUD (insert update delete) Example Tutorial From Scratch
 <button id="btn_add" name="btn_add" class="btn btn-default pull-right">Add New Member</button>
    </div>
      <div class="panel-body">
       <table class="table">
        <thead>
          <tr>
            <th>ID</th>
            <th>Member Name</th>
            <th>Member Address</th>
            <th>Actions</th>
          </tr>
         </thead>
         <tbody id="members-list" name="members-list">
           @foreach ($members as $member)
            <tr id="member{{$member->id}}">
             <td>{{$member->id}}</td>
             <td>{{$member->member_name}}</td>
             <td>{{$member->member_address}}</td>
              <td>
              <button class="btn btn-warning btn-detail open_modal" value="{{$member->id}}">Edit</button>
              <button class="btn btn-danger btn-delete delete-member" value="{{$member->id}}">Delete</button>
              </td>
            </tr>
            @endforeach
        </tbody>
        </table>
       </div>
       </div>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
           <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="modal-title" id="myModalLabel">Member</h4>
            </div>
            <div class="modal-body">
            <form id="frmMembers" name="frmMembers" class="form-horizontal" novalidate="">
                <div class="form-group error">
                 <label for="inputName" class="col-sm-3 control-label">Member Name</label>
                   <div class="col-sm-9">
                    <input type="text" class="form-control has-error" id="member_name" name="member_name" placeholder="Member Name" value="">
                   </div>
                   </div>
                 <div class="form-group">
                 <label for="inputDetail" class="col-sm-3 control-label">Member Address</label>
                    <div class="col-sm-9">
                    <input type="text" class="form-control" id="member_address" name="member_address" placeholder="member_address" value="">
                    </div>
                </div>
            </form>
            </div>
            <div class="modal-footer">
            <button type="button" class="btn btn-primary" id="btn-save" value="add">Save changes</button>
            <input type="hidden" id="member_id" name="member_id" value="0">
            </div>
        </div>
      </div>
  </div>
</div>
    <meta name="_token" content="{!! csrf_token() !!}" />
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script src="{{asset('js/ajaxscript.js')}}"></script>
</body>
</html>

Step4: Include JS file

public/js/ajaxscript.js

var url = "http://localhost:8080/membersapp/public/memberajaxCRUD";
    //display modal form for member editing
    $(document).on('click','.open_modal',function(){
        var member_id = $(this).val();

        $.get(url + '/' + member_id, function (data) {
            //success data
            console.log(data);
            $('#member_id').val(data.id);
            $('#member_name').val(data.member_name);
            $('#member_address').val(data.member_address);
            $('#btn-save').val("update");
            $('#myModal').modal('show');
        })
    });
    //display modal form for creating new member
    $('#btn_add').click(function(){
        $('#btn-save').val("add");
        $('#frmMembers').trigger("reset");
        $('#myModal').modal('show');
    });
    //delete member and remove it from list
    $(document).on('click','.delete-member',function(){
        var member_id = $(this).val();
         $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
            }
        })
        $.ajax({
            type: "DELETE",
            url: url + '/' + member_id,
            success: function (data) {
                console.log(data);
                $("#member" + member_id).remove();
            },
            error: function (data) {
                console.log('Error:', data);
            }
        });
    });
    //create new member / update existing member
    $("#btn-save").click(function (e) {
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
            }
        })
        e.preventDefault();
        var formData = {
            name: $('#member_name').val(),
            details: $('#member_address').val(),
        }
        //used to determine the http verb to use [add=POST], [update=PUT]
        var state = $('#btn-save').val();
        var type = "POST"; //for creating new resource
        var member_id = $('#member_id').val();;
        var my_url = url;
        if (state == "update"){
            type = "PUT"; //for updating existing resource
            my_url += '/' + member_id;
        }
        console.log(formData);
        $.ajax({
            type: type,
            url: my_url,
            data: formData,
            dataType: 'json',
            success: function (data) {
                console.log(data);
                var member = '<tr id="member' + data.id + '"><td>' + data.id + '</td><td>' + data.member_name + '</td><td>' + data.member_address + '</td>';
                member += '<td><button class="btn btn-warning btn-detail open_modal" value="' + data.id + '">Edit</button>';
                member += ' <button class="btn btn-danger btn-delete delete-member" value="' + data.id + '">Delete</button></td></tr>';
                if (state == "add"){ //if user added a new record
                    $('#members-list').append(member);
                }else{ //if user updated an existing record
                    $("#member" + member_id).replaceWith( member );
                }
                $('#frmMembers').trigger("reset");
                $('#myModal').modal('hide')
            },
            error: function (data) {
                console.log('Error:', data);
            }
        });
    });

Step 5: Add Laravel Routes

Laravel Member Crud Ajax Methods with Routing

use Illuminate\Http\Request;
Route::get('memberajaxCRUD', function () {
    $members = App\Member::all();
    return view('ajax.index')->with('members',$members);
});
Route::get('memberajaxCRUD/{member_id?}',function($member_id){
    $member = App\Member::find($member_id);
    return response()->json($member);
});
Route::post('memberajaxCRUD',function(Request $request){
    $member = App\Member::create($request->input());
    return response()->json($member);
});
Route::put('memberajaxCRUD/{member_id?}',function(Request $request,$member_id){
    $member = App\Member::find($member_id);
    $member->name = $request->name;
    $member->details = $request->details;
    $member->save();
    return response()->json($member);
});
Route::delete('memberajaxCRUD/{member_id?}',function($member_id){
    $member = App\Member::destroy($member_id);
    return response()->json($member);
});

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 Laravel AJAX Insert Update Delete (CRUD) Example Tutorial From Scratch.
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.