#!/usr/bin/perl
#!c:\perl\bin\perl
use DBI;
use CGI qw/:standard/;
print header."
Photos on a map";
$journey=param('journey');
$photo=param('photo');
$tag=param('tag');
$dbh = DBI->connect("DBI:mysql:hopcr3_gps:localhost","hopcr3_gps","where");
#$dbh = DBI->connect("DBI:mysql:hopcr3_gps:hopcroft.name","hopcr3_gps","where");
$css="";
$header="";
if ($journey)
{
if ($journey =~/all/)
{
print "";
print $css.$header;
$filter="where public = '1' ";
if ($journey =~ /showall/)
{
undef $filter;
}
$sth=$dbh->prepare("select journey,journeyname,public from journeys $filter order by journey desc");
$sth->execute();
while (@row=$sth->fetchrow_array)
{
my $publish;
if (@row[2] == 0)
{
$publish=" Publish";
}
print "".@row[1]."$publish
";
}
print "";
exit;
}
$publish=param('publish');
if (defined $publish)
{
#$sth_update=$dbh->prepare("update images set blog_entry='$link' where photo_id=$photo_id limit 1");
$sth=$dbh->prepare("update journeys set public='1' where journey=$journey");
$sth->execute();
print "Journey published";
print "