--- register/prgsrc/updatemap.pl 2001/10/13 21:48:05 1.1 +++ register/prgsrc/updatemap.pl 2001/10/13 23:39:44 1.2 @@ -23,10 +23,86 @@ Boris Veytsman =head1 DATE -$Date: 2001/10/13 21:48:05 $ +$Date: 2001/10/13 23:39:44 $ =head1 REVISION -$Revision: 1.1 $ +$Revision: 1.2 $ =cut + + use strict; +use DBI; +my $dbh; +$dbh = DBI->connect("DBI:mysql:chgk", "piataev", "") or + die ($dbh->errstr); +my $width=640; +my $height=320; +my $offset=160; +####################################################### +# Opening the files +####################################################### +open (INCLUDE, ">regions.html"); +open (GNU, ">regions.gnu"); +open (DAT, ">regions.dat"); + +print GNU < +END + +########################################################## +# Writing clubs coordinates +########################################################## + +my $sth = $dbh->prepare (" +SELECT rid,Name,Lon,Lat from Regions +where NOT ISNULL(Lat) and NOT ISNULL(Lon)"); +$sth->execute; +while (my ($rid,$Name,$Lon,$Lat) = $sth->fetchrow_array) { + print DAT < +END +} + +########################################################## +# Finishing up +########################################################## +print INCLUDE < + Карта клубов +END +print GNU < regions.gif`; +exit 0;