Friday 24 June 2016

SHOW PHP UTC DATE TIME TO USER SPECIFIC LOCAL TIME

function userspecifictime($added_date, $id, $return=true) {
        $p_added_date= $added_date;    
        $scripttag = '<script type="text/javascript">                    
            var dateSR = new Date();
            var offsetms = dateSR.getTimezoneOffset() * 60 * 1000;
            var serverDate = new Date("'.$p_added_date.'");
            serverDate = new Date(serverDate.valueOf() - offsetms);    
            var hrs = serverDate.getHours();
            var mi = serverDate.getMinutes();
            var merd = "am";
            if(hrs >= 12) {
                if(hrs > 12) {
                    hrs = hrs - 12;
                }
                merd = "pm";
            }
            hrs = (hrs < 10) ? "0"+hrs : hrs;
            mi = (mi < 10) ? "0"+mi : mi;
            ft=hrs+":"+mi+" "+merd;
            document.getElementById("'.$id.'").innerHTML = ft;
        </script>';
        if($return) {
            return $scripttag;
        } else {
            echo $scripttag;
        }
    }

<?php
<p id="timeid"></p>
$dateInUTC_Format = '2016-06-24 11:43:30';
userspecifictime($dateInUTC_Format,'timeid',false);
?>

Thursday 21 April 2016

Google Places: Limit Autocomplete Results to Cities Only


If you ever used Google Places API, you’re probably familiar with types option,
which allows you to restrict auto-complete results in different ways.
I had a requirement to show only cities in UK.

If you want to all the cities than you can try below code.

<!DOCTYPE html>
<html>
        <head>
            <title>Google Maps JavaScript API v3 Example: Places Autocomplete</title>
            <script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
            <script type="text/javascript">
function initialize() {
   var input = document.getElementById('searchTextField');
   var options = {
    language: 'en-GB',
      types: ['(cities)'],
      //componentRestrictions: { country: "uk" }
};                
   new google.maps.places.Autocomplete(input, options);
}            
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<style type="text/css">
.pac-icon {width: 0;background-image: none;}
</style>
        </head>
        <body>
            <label for="searchTextField">Please insert an address:</label>
            <input id="searchTextField" type="text" size="50">
        </body>
</html>

List OF BANK PAN Numbers

List OF BANK PAN Numbers Bank/Home Loan Providers PAN Number Allahabad Bank AACCA8464F Andhra Bank AABCA7375C Axis Bank...