X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=koha.pl;h=831032945dfefb9eb9ed96cb14bb91960b5b2e3b;hb=dbe5a4dd987687fc251cef4975098463bb35932c;hp=3970c5ed1be0300964d633b449128136f388f6ed;hpb=4b66ac3af6062b1900825d14e6aba6810b0e944b;p=google-map-tiles.git diff --git a/koha.pl b/koha.pl index 3970c5e..8310329 100755 --- a/koha.pl +++ b/koha.pl @@ -25,7 +25,6 @@ my $vlngpix = 0 ; my $value = '' ; my $maxpix = 15 ; # Maximum pixels between click and point -my $name = '' ; my $descript = '' ; my $x = '' ; my $i = 0 ; @@ -51,9 +50,9 @@ if ( $point =~ /(.*),(.*)/ ) ($latpix,$lngpix) = &Google_Coord_to_Pix( $value, $lat, $lng ) ; # Convert coordinate to pixel location - $x = "select city,count,point,point'($lat,$lng)' <-> point as distance from geo_count order by distance limit 1" ; + $x = "select city,country,count,point,point'($lat,$lng)' <-> point as distance from geo_count order by distance limit 1" ; - if ( ($name,$descript,$volpnt,$i) = $dbh->selectrow_array($x) ) # Got one + if ( my ($city,$country,$count,$volpnt,$i) = $dbh->selectrow_array($x) ) # Got one { $volpnt =~ /\((.*),(.*)\)/ ; $vlat = $1 ; @@ -74,13 +73,13 @@ select from geo_city c join geo_biblioitems bi on bi.city = c.city_koha join biblio b on b.biblionumber = bi.biblionumber -where c.city = ? +where c.city = ? and country = ? order by timestamp limit 100 }); - $sth->execute( $name ); + $sth->execute( $city, $country ); - $descript = "$name $descript items\n
    "; + my $descript = "$city $country $count items\n
      "; while ( my $row = $sth->fetchrow_hashref ) { $descript .= sprintf qq|
    1. %s %s\n|, @@ -90,7 +89,7 @@ limit 100 $descript .= "\n
    \n"; - print qq!\n! ; + print qq!\n! ; print qq! <\![CDATA[$descript]]>\n! ; print qq!\n! ; }