Ignore:
Timestamp:
May 14, 2021, 2:00:23 PM (3 years ago)
Author:
roby
Message:

Aggiornamento per compatibilità con php7.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/inc/javascript.php

    r247 r347  
    4242# googlemaps per sezioni
    4343# variabili nel config.php
    44 # gkey= chiave google reperibile per il proprio sito qui
    45 # http://code.google.com/intl/it/apis/maps/signup.html
     44# gkey= chiave google informazioni su come reperirla per il proprio sito qui
     45# https://cloud.google.com/maps-platform/user-guide/account-changes/#no-plan
    4646# googlemaps 1=attivo 2: disattivo
    4747# funzione by eleonline.it
     
    5858# recupera gli inidirizzi
    5959    $id_sede=$_GET['id_sede'];
    60     $sql = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
    61     list($comune) = mysql_fetch_row($sql);
    62     $sql = mysql_query("select indirizzo from ".$prefix."_ele_sede where id_sede='$id_sede'", $dbi);
    63     list($indirizzo)=mysql_fetch_row($sql);
     60        $sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
     61        $res = $dbi->prepare("$sql");
     62        $res->execute();
     63        list($comune) = $res->fetch(PDO::FETCH_NUM);
     64        $sql="SELECT indirizzo from ".$prefix."_ele_sede where id_sede='$id_sede' ";
     65        $res = $dbi->prepare("$sql");
     66        $res->execute();
     67        list($indirizzo) = $res->fetch(PDO::FETCH_NUM);
     68
    6469    $address=rawurlencode("$indirizzo,$comune,58047");
    6570
    6671        $resultGeoCode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$address.'&sensor=false');
    67 
    6872        $output= json_decode($resultGeoCode);
    6973       
     
    7276                $longitude      = $output->results[0]->geometry->location->lng; // Returns Longitude
    7377                $location       = $output->results[0]->formatted_address;
     78        }else{
     79                $latitude=0;
     80                $longitude=0;
     81                $location='';
    7482        }
    7583
     
    108116
    109117
    110 
     118# type="text/javascript"
    111119
    112120
    113121echo '
    114 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=it"></script>
    115    <script type="text/javascript">
     122<script src="http://maps.google.com/maps/api/js?sensor=true&language=it"></script>
     123   <script>
    116124      function maps() {
    117125         var latlng = new google.maps.LatLng('.$coords['lat'].','.$coords['long'].'); // centro della mappa
Note: See TracChangeset for help on using the changeset viewer.