Topic: CSS

Display Image Preview Before Upload Multiple Images using jQuery,Ajax And PHP 0

Display Image Preview Before Upload Multiple Images using jQuery,Ajax And PHP

Display Image Preview Before Upload Multiple Images using jQuery,Ajax And PHP

In this Post We Will Explain About is Display Image Preview Before Upload Multiple Images using jQuery,Ajax And PHP 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 Multiple Images With Image Preview Using jQuery,Ajax And PHPExample

In this post we will show you Best way to implement javascript – Preview an image before it is uploaded, hear for Display preview selected image in input type file using JQuerywith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Generally, live24u share one simple helpfull post about new jquery and bootstrap. in this post I Am show I how to show HTML image preview before upload.

I Am need some time this type functionality in frontend site which I want to show image preview before it upload in server. resently I Am working on one laravel application and I Am need this so I Am make one simple script for it using jquery and bootstrap. and I Am finaly done this with jquery and bootstrap.

Here, I Am always share our source code and example which I Am facing in our devloping mode and when I Am find finaly simple solution about it the I Am also share with I.

You can try this simple example with bootstrap because I Am using bootstrap for fine good code.

Phase : 1 HTML code look like

<!DOCTYPE html>
<html>
<head>
	<title>Pakainfo.com Show Image Preview Before Upload</title>
	<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
	<script src="jquery.min.js"></script>
	<script src="bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
	    <div class="row">    
	        <div class="col-xs-12 col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">  
	            <div class="input-group live-img-prev">
	                <span class="input-group-btn">
	                    <button type="button" class="btn btn-primary live-img-prev-clear" style="display:none;">
	                        <span class="glyphicon glyphicon-remove"></span> Clear
	                    </button>
	                    <div class="btn btn-primary live-img-prev-input">
	                        <span class="glyphicon glyphicon-folder-open"></span>
	                        <span class="live-img-prev-input-title">Browse</span>
	                        <input type="file" accept="image/png, image/jpeg, image/gif" name="input-file-preview"/>
	                    </div>
	                </span>
	            </div>
	        </div>
	    </div>
	</div>
	
	<p>We are Web Technology Experts and Team who provide you very Important information on Web Development information,Examples and Demo, Interview Questions and Answers, live project problem solution and their solution and online free tutorials – “Pakainfo.com”.
	</p>
</body>
</html>

Phase : 2 CSS code look like

Then add simple some css code following copy following source code as well as add in wer simple css file.

.live-img-prev-input {
    position: relative;
	overflow: hidden;
	margin: 0px;    
    color: #333;
    background-color: #fff;
    border-color: #ccc;    
}
.live-img-prev-input input[type=file] {
	top: 0;
	right: 0;
	cursor: pointer;
	opacity: 0;
	filter: alpha(opacity=0);
	margin: 0;
	padding: 0;
	position: absolute;
	font-size: 20px;

}
.live-img-prev-input-title {
    margin-left:2px;
}	

Phase : 3 jQuery code look like

The finaly simple put following source jQuery code in js file.

$(document).on('click', '#close-preview', function(){ 
    $('.live-img-prev').popover('hide');
    // Hover befor close the preview
    $('.live-img-prev').hover(
        function () {
           $('.live-img-prev').popover('show');
        }, 
         function () {
           $('.live-img-prev').popover('hide');
        }
    );    
});

$(function() {
    // Pakainfo.com Create the close button
    var closebtn = $('<button/>', {
        type:"button",
        text: 'x',
        id: 'close-preview',
        style: 'font-size: initial;',
    });
    closebtn.attr("class","close pull-right");
    // Pakainfo.com Set the popover primary content
    $('.live-img-prev').popover({
        trigger:'manual',
        html:true,
        title: "<strong>Preview</strong>"+$(closebtn)[0].outerHTML,
        content: "There's no image",
        placement:'bottom'
    });
    //Pakainfo.com Clear event
    $('.live-img-prev-clear').click(function(){
        $('.live-img-prev').attr("data-content","").popover('hide');
        $('.live-img-prev-filename').val("");
        $('.live-img-prev-clear').hide();
        $('.live-img-prev-input input:file').val("");
        $(".live-img-prev-input-title").text("Browse"); 
    }); 
    //Pakainfo.com Create the preview image
    $(".live-img-prev-input input:file").change(function (){     
        var img = $('<img/>', {
            id: 'dynamic',
            width:250,
            height:200
        });      
        var file = this.files[0];
        var photo_red = new FileReader();
        // here Set preview image into the popover data-content
        photo_red.onload = function (e) {
            $(".live-img-prev-input-title").text("Change");
            $(".live-img-prev-clear").show();
            $(".live-img-prev-filename").val(file.name);            
            img.attr('src', e.target.result);
            $(".live-img-prev").attr("data-content",$(img)[0].outerHTML).popover("show");
        }        
        photo_red.readAsDataURL(file);
    });  
});

Last step to I Am ready to run our simple example so run simple bellow command ro quick run:

Example

I hope you have Got What is Image Upload Preview Plugin With jQuery And Bootstrap And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

How To Create Contact Form With PHPMailer To Send Mails 0

How To Create Contact Form With PHPMailer To Send Mails

How To Create Contact Form With PHPMailer To Send Mails

In this Post We Will Explain About is How To Create Contact Form With PHPMailer To Send Mails 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 send email from contact form using PHPExample

In this post we will show you Best way to implement Creating a Simple Contact Form with PHP, hear for Contact form with PHP Mailer – PHPwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Introduction

Every web-application or websites have Their Simple own contact page to get feedback and messages from visitor, As well as it will need site owners to improve Their Simple web-application or websites performance And Have idea about user experience. Here I am going to develop a simple contact form using HTML and send mails to Super Admins contacts with need of PHPMailer (A PHP Class).

And Then we need to Make a simple contact form with need of HTML forms and design it with some CSS work based on wer needs.You might save this file as contact.php

HTML Form

<?php 
if(isset($_GET['response']) && $_GET['response'] == 'success') {
      echo '<div class="success_msg" > Thank we for contacting us. We will get back to we soon. </div> ';
} ?>
<style>
     .success_msg {
          background-color: #fed;
          color: green;
          border: 1px solid green; 
     }
</style>
<form name="live-contact-form" method="post" action="live-contact-process.php">
<table width="450px">
</tr>
<tr>
<td valign="center">
<label for="fname">First Name *</label>
</td>
<td valign="center">
<input type="text" name="fname" maxlength="50" size="30">
</td>
</tr>

<tr>
<td valign="center"">
<label for="lname">Last Name *</label>
</td>
<td valign="center">
<input type="text" name="lname" maxlength="50" size="30">
</td>
</tr>
<tr>
<td valign="center">
<label for="email">Email Address *</label>
</td>
<td valign="center">
<input type="text" name="email" maxlength="80" size="30">
</td>

</tr>
<tr>
<td valign="center">
<label for="mobile">Mobile Number</label>
</td>
<td valign="center">
<input type="text" name="mobile" maxlength="30" size="30">
</td>
</tr>
<tr>
<td valign="center">
<label for="subject">Subject</label>
</td>
<td valign="center">
<input type="text" name="subject" maxlength="30" size="30">
</td>
</tr>
<tr>
<td valign="center">
<label for="message">Message *</label>
</td>
<td valign="center">
<textarea name="message" maxlength="1000" cols="25" rows="6"></textarea>
</td>

</tr>
<tr>
<td colspan="2" style="text-align:center">
<!-- We are  simple grateful to we for keeping this link in place. thank we. -->
<input type="submit" value="Submit"> ( <a href="https://pakainfo.com">Get Help from live24ucodes tut.</a> )
</td>
</tr>
</table>
</form>

Than CSS style it with the need of CSS(Cascading Style Sheet).as well as When User simple click on Submit button, and then it will send the data’s to to `live-contact-process.php`.

PHP

Here we are going to simple handle the user step by step entered data’s and simple send it to Super Admin email address at the same time we send a simple acknowledge to the and smple particular user.

<?php
require_once("PHPMailerAutoload.php"); //here this will simple include smtp data and pop files.

if(isset($_POST['email'])) {

   $to_email = "[email protected]";

   function mydedc($error) {// wer error code can go here
        echo "We're sorry, here but there's errors data simples found with theas simple  well as form we submitted.<hr /><hr />";
        echo $error."<hr /><hr />";
        echo "here Please go back and simple fix these errors.<hr /><hr />";
        die();
   }

   //Devlopend by livu.com e validation expected data exists
   if(!isset($_POST['fname']) ||!isset($_POST['lname']) ||!isset($_POST['email']) ||!isset($_POST['mobile']) ||!isset($_POST['subject']) || !isset($_POST['message'])) {
       mydedc('We are sorry, but there simple appears to be a some problem with the form we submitted.'); 
   }

   $fname = $_POST['fname']; //Data required
   $lname = $_POST['lname']; //Data required
   $form_email = $_POST['email']; //Data required
   $mobile = $_POST['mobile']; //Data not required
   $subject = $_POST['subject']; //Data required
   $message = $_POST['message']; //Data required

   $msg_err = "";
   $email_exp = '/^[A-Za-z0-9._%-][email protected][A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
   if(!preg_match($email_exp,$form_email)) {
       $msg_err .= 'The Email Address we entered does not appear to be valid.<hr />';
   }
   $msg_string_exp = "/^[A-Za-z .'-]+$/";
   if(!preg_match($msg_string_exp,$fname)) {
      $msg_err .= 'The USER First Name we entered does not appear to be valid.<hr />';
   }
   if(!preg_match($msg_string_exp,$lname)) {
       $msg_err .= 'The USER Last Name we entered does not appear to be valid.<hr />';
   }
   if(!preg_match($msg_string_exp,$subject)) {
      $msg_err .= 'The Last Name we entered does not simple appear to be valid.<hr />';
   }
   if(strlen($message) < 2) {
       $msg_err .= 'The Live Message we entered do not simple appear to be valid.<hr />';
   }
   if(strlen($msg_err) > 0) {
       mydedc($msg_err);
   }
   $msgbody_email = "\n\n";

   $msgbody_email .= "First Name: ".clean_string($fname)."\n";
   $msgbody_email .= "Last Name: ".clean_string($lname)."\n";
   $msgbody_email .= "Email: ".clean_string($form_email)."\n";
   $msgbody_email .= "Mobile: ".clean_string($mobile)."\n";
   $msgbody_email .= "Subject: ".clean_string($subject)."\n";
   $msgbody_email .= "Message: ".clean_string($message)."\n";

   $mail = new PHPMailer();
   $mail->isSendmail();
   $mail->setFrom($form_email, $fname.$lname);
   $mail->addAddress($to_email, 'live24u Varadha);
   $mail->Subject = $subject;
   $mail->msgHTML(file_get_contents('path/to/file/attachment-file.extension'), dirname(__FILE__));

   if (!$mail->send()) { //send the message, check for errors
      echo "Mailer Error: " . mydedc($error);
   } else {
       header('Location: contact.php?response=success'); 
   }
?>

<!--Devlopend by livu.com place wer own success html simple below -->

<?php
}
die();
?>

PHPMailer Class :

It have some extended latest features, just take simple look at here to use it effective way With Like as a CC, BCC as well as Reply-To . This is simple how we can some design a contact form with using PHP phpmailer to send emails. If We have any some queries and some doubts drop wer Message here.

Example

I hope you have Got What is php – how to send on contact form using phpmailer And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Create dynamic calendar using jQuery, Ajax and PHP 0

Create dynamic calendar using jQuery, Ajax and PHP

Create dynamic calendar using jQuery, Ajax and PHP

In this Post We Will Explain About is Create dynamic calendar using jQuery, Ajax and PHP 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 Create a jQuery calendar with AJAX, PHP, and MySQL Example

In this post we will show you Best way to implement Create Simple Dynamic Calendar Using Jquery and HTML, hear for Build an event calendar using jQuery, Ajax and PHPwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

how to Create dynamic calendar using jQuery, Ajax and PHP

The simple event calendar is a very most useful element for a simple scedules web project as well as web-application. Using it we can put the all the event to the calendar and reminder along with the some respective date. Today we’ll some discuss how can we create a PHP simple Event Calendar easily using jQuery and Ajax.

Now we are going to simple creating an All the event calendar using Ajax jQuery, Ajax, PHP and MySQL db.

index.php

<?php
 
//Pakainfo.com require class
require_once 'class.calendar.php';
//Pakainfo.com object of class
$phpCalendar = new PHPCalendar ();
?>
<html>
<head>
<link href="style.css" type="text/css" rel="stylesheet" />
<title>Live24u Create dynamic calendar using jQuery, Ajax and PHP</title>
</head>
<body>
<h2>Step by step Create dynamic calendar in jQuery, Ajax and PHP</h2><hr><hr><hr>
<div id="body-overlay"><div><img src="loading.gif" width="64px" height="64px"/></div></div>
<div id="res-calc-html">
<?php
$CalcHTMLData = $phpCalendar->LiveCalcHtml();
echo $CalcHTMLData;
?>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(document).on("click", '.last', function(event) { 
        var month =  $(this).data("last-month");
        var year =  $(this).data("last-year");
        getCalendar(month,year);
    });
    $(document).on("click", '.next', function(event) { 
        var month =  $(this).data("next-month");
        var year =  $(this).data("next-year");
        getCalendar(month,year);
    });
    $(document).on("blur", '#liveCyear', function(event) { 
        var month =  $('#liveCmonth').text();
        var year = $('#liveCyear').text();
        getCalendar(month,year);
    });
});
function getCalendar(month,year){
    $("#body-overlay").show();
    $.ajax({
        url: "calendar-ajax.php",
        type: "POST",
        data:'month='+month+'&year='+year,
        success: function(response){
            setInterval(function() {$("#body-overlay").hide(); },500);
            $("#res-calc-html").html(response);  
        },
        error: function(){} 
    });
     
}
</script>
</body>
</html>

calendar-ajax.php

<?php
//Pakainfo.com require class
require_once 'class.calendar.php';
$phpCalendar = new PHPCalendar ();
//Pakainfo.com object of class
$CalcHTMLData = $phpCalendar->LiveCalcHtml();
echo $CalcHTMLData;
?>

class.calendar.php

<?php
//Pakainfo.com class
class PHPCalendar {
    private $weekDayName = array ("MON","TUE","WED","THU","FRI","SAT","SUN");
    private $liveCday = 0;
    private $liveCmonth = 0;
    private $liveCyear = 0;
    private $liveCmonthstart = null;
    private $liveCmonthDaysLength = null; 
    //Pakainfo.com construct function
    function __construct() {
        $this->liveCyear = date ( "Y", time () );
        $this->liveCmonth = date ( "m", time () );
         
        if (! empty ( $_POST ['year'] )) {
            $this->liveCyear = $_POST ['year'];
        }
        if (! empty ( $_POST ['month'] )) {
            $this->liveCmonth = $_POST ['month'];
        }
        $this->liveCmonthstart = $this->liveCyear . '-' . $this->liveCmonth . '-01';
        $this->liveCmonthDaysLength = date ( 't', strtotime ( $this->liveCmonthstart ) );
    }
    //Pakainfo.com LiveCalcHtml function
    function LiveCalcHtml() {
        $CalcHTMLData = '<div id="calc-outer">'; 
        $CalcHTMLData .= '<div class="calendar-nav">' . $this->LiveCalcNav() . '</div>'; 
        $CalcHTMLData .= '<ul class="week-name-title">' . $this->getWeekDayName () . '</ul>';
        $CalcHTMLData .= '<ul class="week-day-cell">' . $this->getWeekDays () . '</ul>';     
        $CalcHTMLData .= '</div>';
        return $CalcHTMLData;
    }
     
    //Pakainfo.com LiveCalcNav function
    function LiveCalcNav() {
        $lastMonthYear = date ( 'm,Y', strtotime ( $this->liveCmonthstart. ' -1 Month'  ) );
        $lastMonthYearArray = explode(",",$lastMonthYear);
         
        $nextMonthYear = date ( 'm,Y', strtotime ( $this->liveCmonthstart . ' +1 Month'  ) );
        $getnextMyear = explode(",",$nextMonthYear);
         
        $navigationHTML = '<div class="last" data-last-month="' . $lastMonthYearArray[0] . '" data-last-year = "' . $lastMonthYearArray[1]. '"><</div>'; 
        $navigationHTML .= '<span id="liveCmonth">' . date ( 'M', strtotime ( $this->liveCmonthstart ) ) . '</span>';
        $navigationHTML .= '<span contenteditable="true" id="liveCyear" style="margin-left:5px">'.  date ( 'Y', strtotime ( $this->liveCmonthstart ) ) . '</span>';
        $navigationHTML .= '<div class="next" data-next-month="' . $getnextMyear[0] . '" data-next-year = "' . $getnextMyear[1]. '">></div>';
        return $navigationHTML;
    }
     
    //Pakainfo.com getWeekDayName function
    function getWeekDayName() {
        $WeekDayName= '';       
        foreach ( $this->weekDayName as $dayname ) {         
            $WeekDayName.= '<li>' . $dayname . '</li>';
        }       
        return $WeekDayName;
    }
     
    //Pakainfo.com getWeekDays function
    function getWeekDays() {
        $calWeekLan = $this->getWeekLengthByMonth ();
        $firstDayOfTheWeek = date ( 'N', strtotime ( $this->liveCmonthstart ) );
        $totalWkday = "";
        for($i = 0; $i < $calWeekLan; $i ++) {
            for($j = 1; $j <= 7; $j ++) {
                $cellIndex = $i * 7 + $j;
                $cellValue = null;
                if ($cellIndex == $firstDayOfTheWeek) {
                    $this->liveCday = 1;
                }
                if (! empty ( $this->liveCday ) && $this->liveCday <= $this->liveCmonthDaysLength) {
                    $cellValue = $this->liveCday;
                    $this->liveCday ++;
                }
                $totalWkday .= '<li>' . $cellValue . '</li>';
            }
        }
        return $totalWkday;
    }
     
    //Pakainfo.com getWeekLengthByMonth function
    function getWeekLengthByMonth() {
        $calWeekLan =  intval ( $this->liveCmonthDaysLength / 7 ); 
        if($this->liveCmonthDaysLength % 7 > 0) {
            $calWeekLan++;
        }
        $getmonthSdate= date ( 'N', strtotime ( $this->liveCmonthstart) );     
        $monthEndingDay= date ( 'N', strtotime ( $this->liveCyear . '-' . $this->liveCmonth . '-' . $this->liveCmonthDaysLength) );
        if ($monthEndingDay < $getmonthSdate) {          
            $calWeekLan++;
        }
         
        return $calWeekLan;
    }
}
?>

style.css

.next,.last{cursor:pointer;display:inline-block}.next,.last,.week-day-cell li{display:inline-block}body{font-family:calihri}#calc-outer{width:574px}#calc-outer ul{margin:0;padding:0}#calc-outer ul li{margin:0;padding:0;list-style-type:none}.last{float:left}.next{float:right}:focus{outline:0;background:#ff8e8e}div.calendar-nav{background-color:#ff8e8e;border-radius:4px;text-align:center;padding:10px;color:#FFF;box-sizing:border-box;font-weight:700}#calc-outer .week-name-title li{display:inline-block;padding:10px 27px;color:#90918b;font-size:.95em;font-weight:600}.week-day-cell li{width:80px;height:80px;text-align:center;line-height:80px;vertical-align:middle;background-color:#f6ffc6;color:#ff8e8e;border:1px solid #f1f0f0;border-radius:4px;font-size:1.2em}#body-overlay{background-color:rgba(0,0,0,.6);z-index:999;position:absolute;left:0;top:0;width:100%;height:100%;display:none}#body-overlay div{position:absolute;left:50%;top:50%;margin-top:-32px;margin-left:-32px}

Example

I hope you have Got What is Add Event to Calendar using jQuery Ajax and PHP And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Autocomplete Address Search Module Using Google API and PHP 0

Autocomplete Address Search Module Using Google API and PHP

Autocomplete Address Search Module Using Google API and PHP

In this Post We Will Explain About is Autocomplete Address Search Module Using Google API and PHP 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 An autocomplete address search module Example

In this post we will show you Best way to implement Autocomplete for Addresses and Search Terms, hear for Autocomplete Address Search Module Using Google API and PHP with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Autocomplete Address Search Module Using Google API and PHP

Today We are going to Display We how you can create simple an autocomplete text box to address search module as well as all the place find on your need to website using simple steps by step Google Place API web service.

In our simple google autocomplete address or place search module we have simple used a autocomplete text box HTML using Jquery plugin named Like as a Select2 jquery plugin, for simple get key type and search all the palces some feature to our this demo google autocomplete module.

Steps to implement an autocomplete address search module

The first of all this first step is to simple grab a get a simple google’s API Key, We can find it here. Get API Key using Google

index.php

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Place Autocomplete Example</title>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

        <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />

        <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
    </head>
    <body>
		<h1>Autocomplete Address Search Module Using Google API and PHP</h1>
        <select id="get_address" style="width:800px;"></select>

        <script type="text/javascript">
            $(document).ready(function(){

                $("#submit").click(function(){
                    var val_data = $("#get_address").val();
                    console.log(val_data);
                });

                $('select').select2({
                    placeholder: "Live write Search for your city",
                    ajax: {
                        url: function(dataparam){
                            return 'api.php?data='+dataparam.term; 
                        },
                        dataType: 'json', 
                        processResults: function (data) {
                            return {
                                results: $.map(data, function (liveitem) {
                                    return {
                                        text: liveitem.text,
                                        id: liveitem.text
                                    }
                                })
                            };
                        }
                    }

                });
            });
        </script>

    </body>
</html>

api.php

<?php

 $query_terms = $_GET['data'];

 $data_places = file_get_contents("https://maps.googleapis.com/maps/api/place/autocomplete/json?input=".$query_terms."&types=geocode&key={LIVE_YOUR_API_KEY}");

 $data_arr = array();
 $i=0;
 foreach(json_decode($data_places)->predictions as $item_place){
 $data_arr[$i] = array(
 'id' => $i,
 'text' => $item_place->description
 );
 $i++;
 }

 echo json_encode($data_arr);

?>

We just have to simple put above in this index.html and here api.php in the same your directory, and We replace here Live key like as a {YOUR_API_KEY} with your’s source code one.

Google Important Note

By using latest api google all location place API google very simple needs some google policy to following links (read this policy here),and then Google wants simple text their Like as a “powered by Google” logo to be your simple shown in the HTML drop-down.

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 Autocomplete search address form using Google map and get data into form 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.

Bootstrap Toggle switch with ajax update to mysql in Laravel 0

Bootstrap Toggle switch with ajax update to mysql in Laravel

Bootstrap Toggle switch with ajax update to mysql in Laravel

In this Post We Will Explain About is Bootstrap Toggle switch with ajax update to mysql in Laravel 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 Bootstrap Toggle Inside jQuery DataTable in Laravel Example

In this post we will show you Best way to implement Laravel Bootstrap Toggle switch Update DB field using Ajax, hear for Create Radio Button Toggle Switch with Bootstrap, jQuery & Laravel with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Laravel – Toggle value in database with checkbox and ajax

I have a very easy task.but some devloper is stuck so here Update a value in mysql table when button is on click using Laravel with MYSQL and Jquery Means simple meaningCreate Checkbox Toggle Switch with Bootstrap, jQuery & Laravel.

public function activation(Request $request)
{

    $Product = Product::findOrFail($request->product_id);

    if($Product->active == 1){
        $Product->active = 0;
    } else {
        $Product->active = 1;
    }

    return response()->json([
      'data' => [
        'success' => $Product->save(),
      ]
    ]);
}

And then in the front-end part:

$(document).ready(function(){
  $("input:checkbox").change(function() {
    var product_id = $(this).closest('tr').attr('id');

    $.ajax({
            type:'POST',
            url:'https://pakainfo.com/admin/activation',
            headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}' },
            data: { "product_id" : product_id },
            success: function(data){
              if(data.data.success){
                //here some source code - do something
              }
            }
        });
    });
});

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 Submit Laravel Bootstrap Form without Page Refresh 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 Tooltip Component with CSS and Vuejs 0

Simple Tooltip Component with CSS and Vuejs

Simple Tooltip Component with CSS and Vuejs

In this Post We Will Explain About is Simple Tooltip Component with CSS and Vuejs 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 Vuejs Simple Tooltip Example

In this post we will show you Best way to implement Easy Vue Tooltip Component, hear for Vuejs v-tooltip Tooltip with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Include External Libs

<script src="https://unpkg.com/popper.js"></script>
<script src="https://unpkg.com/tooltip.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/v-tooltip"></script>  

index.html

<div id="freeApp">
  <p><input v-model="thankumsg" class="form-control" placeholder="Please Eneter your Good Comments"></p>
  <hr>
  <p><span v-tooltip="thankumsg">{{ thankumsg }}</span></p>
</div>  

index.js

console.clear()
new Vue({
  el: '#freeApp',
  data: {
    thankumsg: 'Wel-come to Download Example Pakainfo.com!!'
  }
});  

style.css

.tooltip {
  display: block !important;
  pointer-events: none;
  padding: 5px;
  z-index: 10000;
}
.tooltip .tooltip-inner {
  background: green;
  color: red;
  border-radius: 17px;
  padding: 6px 12px 5px;
}
.tooltip tooltip-arrow{
  display: none;
}
.tooltip[aria-hidden='true'] {
  visibility: hidden;
  opacity: 0;
  transition: opacity .16s, visibility .16s;
}
.tooltip[aria-hidden='false'] {
  visibility: visible;
  opacity: 1;
  transition: opacity .16s;
} 

Vuejs v-tooltip Tooltip

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 Simple and Clean Vuejs Tooltip Plugin 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.

Vue.js Alert popup-Dialog Box using PHP and CSS 0

Vue.js Alert popup-Dialog Box using PHP and CSS

Vue.js Alert popup-Dialog Box using PHP and CSS

In this Post We Will Explain About is Vue.js Alert popup-Dialog Box using PHP and CSS 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 Create an Alert Message Box Example

In this post we will show you Best way to implement Vue.js Show JavaScript Alert Message Box on ng-click, hear for Fancy Alert and Confirm Box in Vue.js with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Create an Alert using Vue.js with PHP

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 `students` (
  `studid` INT(11) NOT NULL AUTO_INCREMENT,
  `email` VARCHAR(60) NOT NULL,
  `password` VARCHAR(50) NOT NULL,
PRIMARY KEY(`studid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

style.css

.firstCorn{
	position:absolute;
	top:4px;
	right:6px;
}
.btnClose {
    margin-left: 15px;
    font-size: 18px;
    line-height: 20px;
	color: white;
    font-weight: bold;
    float: right;
    cursor: pointer;
    transition: 0.3s;
}
 
.btnClose:hover {
    color: #c30000;
}
.alert_danger {
    padding: 18px;
    background-color: #3d3d3d;
    color: white;
}
 
.alert_success {
    padding: 15px;
    background-color: #4CAF50;
    color: white;
}

index.php

<!DOCTYPE html>
<html>
<head>
	<title>Make simple an Alert using Vue.js with PHP</title>
3.3.7/css/bootstrap.min.css
2.5.10/vue.min.js
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="alert">
	<div class="firstCorn alert_danger" v-if="liveErr">
		<span class="btnClose" @click="dataclsMsg();">×</span>
		<span class="live glyphicon glyphicon-alert"></span> {{ getresMsg }}
	</div>
	<div class="firstCorn alert_success" v-if="liveSucc">
		<span class="btnClose" @click="dataclsMsg();">×</span>
		<span class="live glyphicon glyphicon-check-square-o"></span> {{ getresMsg }}
	</div>
	<div class="container">
		<h1 class="page-header text-center">Create an Alert using Vue.js with PHP</h1>
		<div class="col-md-4">
			<div class="live form-group">
				<label>Student Email:</label>
				<input type="text" class="form-control live" v-model="studentNew.email" v-on:keyup="checkKeyMonitor">
			</div>
			<div class="live form-group">
				<label>Password:</label>
				<input type="text" class="form-control live" v-model="studentNew.password" v-on:keyup="checkKeyMonitor">
			</div>
			<button class="btn btn-primary" @click="addStudent();"><span class="live glyphicon glyphicon-floppy-disk"></span> Save</button> <button class="btn btn-danger" @click="clearForm();"><span class="live glyphicon glyphicon-refresh"></span> Clear</button>
		</div>
		<div class="col-md-8">
			<table class="table">
				<thead>
					<th>student ID</th>
					<th>Student Email</th>
					<th>Student Password</th>
				</thead>
				<tbody>
					<tr v-for="student in students">
						<td>{{ student.studid }}</td>
						<td>{{ student.email }}</td>
						<td>{{ student.password }}</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>
<script src="main.js"></script>
</body>
</html>

main.js

var main = new Vue({
	el: '#alert',
	data:{
		studentNew: {email: '', password: ''},
		alertMessage: false,
		liveSucc: false,
		liveErr: false,
		getresMsg: "",
		students: []
	},
 
	mounted: function(){
		this.getStudents();
	},
 
	methods:{
		checkKeyMonitor: function(event) {
       		if(event.key == "Enter"){
         		main.addStudent();
        	}
       	},
 
       	getStudents: function(){
			axios.post('do_action.php')
				.then(function(datares){
					main.students = datares.data.students;
				});
       	},
 
		addStudent: function(){
			var memberForm = main.saveFormData(main.studentNew);
			axios.post('do_action.php?do_action=add', memberForm)
				.then(function(datares){
					console.log(datares);
					if(datares.data.error){
						main.alertMessage = true;
						main.liveErr = true;
						main.liveSucc = false;
						main.getresMsg = datares.data.message;
						setTimeout(function(){
							main.dataclsMsg();
						},3000);
					}
					else{
						main.liveSucc = true;
						main.liveErr = false;
						main.alertMessage = true;
						main.getresMsg = datares.data.message;
						main.studentNew = {email: '', password:''};
						main.getStudents();
						setTimeout(function(){
							main.dataclsMsg();
						},3000);
					}
				});
		},
 
		saveFormData: function(obj){
			var form_data = new FormData();
			for(var key in obj){
				form_data.append(key, obj[key]);
			}
			return form_data;
		},
 
		dataclsMsg: function(){
			main.liveErr = false;
			main.liveSucc = false;
		},
 
		clearForm: function(){
			main.studentNew=main.studentNew = {email: '', password:''};
		}
 
 
 
	}
});

do_action.php

<?php
$db_conn = new mysqli("localhost", "username", "Password", "live24u");
 
if ($db_conn->connect_error) {
    die("Your Db Connection failed: " . $db_conn->connect_error);
}
 
$output = array('error' => false);
 
$do_action="show";
 
if(isset($_GET['do_action'])){
	$do_action=$_GET['do_action'];
}
 
if($do_action=='show'){
	$sql = "select * from students";
	$query = $db_conn->query($sql);
	$students = array();
 
	while($row = $query->fetch_array()){
		array_push($students, $row);
	}
 
	$output['students'] = $students;
}
 
if($do_action=='add'){
	$email=$_POST['email'];
	$password=$_POST['password'];
 
	if($email==''){
		$output['error']=true;
		$output['message']='Add student Failed. Student Name Empty.';
	}
	elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){
		$output['error']=true;
		$output['message']='Add student Failed. Invalid Email Format';
	}
	elseif($password==''){
		$output['error']=true;
		$output['message']='Add student Failed. Password Empty.';
	}
	elseif(!preg_match("/^[a-zA-Z_1-9]*$/",$password)){
		$output['error']=true;
		$output['message']='Underscore as well as Special Characters  are not allowed in Password';
	}
	else{
		$sql="insert into students (email, password) values ('$email', '$password')";
		$query=$db_conn->query($sql);
 
		if($query){
			$output['message']='student Successfully Added';
		}
		else{
			$output['error']=true;
			$output['message']='Sorry !! Error in Adding Occured';
		}
 
	}
}
 
$db_conn->close();
header("Content-type: application/json");
echo json_encode($output);
die();
 
?>

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 Vue.js Show JavaScript Alert Message Box on ng-click 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.

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.

FullCalendar – Vuejs Event Calendar Component 0

FullCalendar - Vuejs Event Calendar Component

FullCalendar – Vuejs Event Calendar Component

In this Post We Will Explain About is FullCalendar – Vuejs Event Calendar Component 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 Calendar component made with Vue 2.0 Example

In this post we will show you Best way to implement Simple Vue.js 2 Calendar and Date Picker Plugin, hear for Vue.js 2 Calendar & Datepicker Component with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

How to Create Calendar using Vuejs

In this Example,First of all Add or Inluce 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 priorty set.After that Include your relavant CSS Class.

Include External Libs

jquery-3.2.1.min.js
moment.min.js
fullcalendar.min.css
fullcalendar.js
axios.min.js
[email protected]

index.html

<div id=""liveApp"">
  {{ display_message }}
  <todo></todo>
</div>

index.js

Vue.component('todo', {
	template: '<div id=""live_calendar"">{{check}}</div>',
  data () {
  	return {
    	check: 'www.Pakainfo.com',
      live_calendar: null
    }
  },
  mounted () {
    var self = this
    this.live_calendar = $(self.$el)
    
    var args = {
	    lang: 'en',
		//set header value
      header: {
        left:   'prev,next today',
        center: 'title',
        right:  'month,agendaWeek,agendaDay'
      },
      height: ""auto"",
	  //set boolean value
      allDaySlot: false,
	  
	  //set boolean value
      slotEventOverlap: false,
      timeFormat: 'HH:mm',
      dayClick (date, event, view) {
      	console.log(date, event, view)
        console.log(date.format())
      }
    }
    
    this.live_calendar.fullCalendar(args)
  }
})
var liveApp = new Vue({
  el: '#liveApp',
  data: {
    display_message: 'Welcome to Pakainfo.com - Hello Vue!'
  },
  created () {
  	axios.get(""https://demo9140832.mockable.io/calendar-events"").then(response => {
    	var live_data = JSON.parse(response)
    	console.log('response', live_data)
    })
  }
})

Vue.js 2 Calendar & Datepicker Component

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 Calendar component made with Vue 2.0 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.