package Karte_osm; # # SPDX-License-Identifier: AGPL-3.0-or-later # Copyright (c) Rainer Gümpelein, TeilRad GmbH # use strict; use warnings; use CGI ':standard'; use Lib::Config; use Mod::Buttons; use Mod::DBtank; use Mod::APIfunc; sub new { my $class = shift; my $self = {}; bless($self,$class); return $self; } #Template sub tpl(){ my $node_meta = shift; my $users_dms = shift || ""; my $mode = shift || ""; my $varenv = shift; my $users_sharee = shift || { c_id => 0 }; my $feedb = shift || ""; my $q = new CGI; my $but = new Buttons; my $dbt = new DBtank; my $apif = new APIfunc; my $api_file = "/var/www/copri4/shareeconf/apikeys.cfg"; my $aconf = Config::General->new($api_file); my %apikeyconf = $aconf->getall; my $api_return = { authcookie => '' }; my $coo = $q->cookie(-name=>'domcookie') || $R::sessionid; ($api_return,$users_sharee) = $apif->auth_verify($q,$coo,""); my $man_gps = $q->escapeHTML($R::man_gps) || ""; my $initMap = $dbt->{website}->{$varenv->{syshost}}->{initMap}; my $map_zoom = $dbt->{website}->{$varenv->{syshost}}->{map_zoom} || "10"; my $project = "all"; my $uri_request = $dbt->{primary}->{sharee_primary}->{primaryApp}; if($dbt->{website}->{$varenv->{syshost}}->{merchant_id}){ $api_return->{authcookie} = $dbt->{website}->{$varenv->{syshost}}->{merchant_id} if(!$api_return->{authcookie}); $project = $dbt->{website}->{$varenv->{syshost}}->{project} if($dbt->{website}->{$varenv->{syshost}}->{project}); $uri_request = $dbt->{website}->{$varenv->{syshost}}->{operatorWeb}; print $q->div({-class=>"content2_contact"},"Hier können Lastenfahrräder gemietet werden:"),"\n"; }elsif($dbt->{operator}->{$varenv->{dbname}}->{merchant_id}){ $api_return->{authcookie} = $dbt->{operator}->{$varenv->{dbname}}->{merchant_id} if(!$api_return->{authcookie}); $initMap = $dbt->{operator}->{$varenv->{dbname}}->{initMap} if($dbt->{operator}->{$varenv->{dbname}}->{initMap}); $map_zoom = $dbt->{operator}->{$varenv->{dbname}}->{map_zoom} if($dbt->{operator}->{$varenv->{dbname}}->{map_zoom}); $project = $dbt->{operator}->{$varenv->{dbname}}->{project} if($dbt->{operator}->{$varenv->{dbname}}->{project}); $uri_request = $dbt->{operator}->{$varenv->{dbname}}->{operatorDMS}; print $q->div({-style=>'padding-top:40px;'},""),"\n"; print $q->start_form(),"\n"; print $q->div({-style=>'text-align:left;'},$but->singlesubmit1("set_gps","set_gps","",""),$q->textfield(-name=>'man_gps', -value=>"$man_gps", -override=>1, -placeholder=>'latitude, longitude',-size=>30)),"\n"; print $q->end_form,"\n"; }elsif($dbt->{primary}->{$varenv->{dbname}}->{merchant_id}){ $api_return->{authcookie} = $dbt->{primary}->{$varenv->{dbname}}->{merchant_id} if(!$api_return->{authcookie}); $initMap = $dbt->{primary}->{$varenv->{dbname}}->{initMap} if($dbt->{primary}->{$varenv->{dbname}}->{initMap}); $uri_request = $dbt->{primary}->{$varenv->{dbname}}->{primaryDMS}; print $q->div({-style=>'padding-top:40px;'},""),"\n"; print $q->start_form(),"\n"; print $q->div({-style=>'text-align:left;'},$but->singlesubmit1("set_gps","set_gps","",""),$q->textfield(-name=>'man_gps', -value=>"$man_gps", -override=>1, -placeholder=>'latitude, longitude',-size=>30)),"\n"; print $q->end_form,"\n"; } my $manlat = ""; my $manlng = ""; $manlat = $1 if($man_gps =~ /^(\d+\.\d+)/); $manlng = $1 if($man_gps =~ /(\d+\.\d+)$/); my $icon_green = "Open_Green.png"; my $icon_red = "Open_Red.png"; my $icon_blue = "Open_Blue.png"; my $mapheight = "800px;"; if($project eq "Bayern"){ $icon_green = "LastenradBay_Standortpfeil_gruen_03a.png"; $icon_red = "LastenradBay_Standortpfeil_rot_03a.png"; $icon_blue = "LastenradBay_Standortpfeil_blau_03a.png"; $mapheight = "800px;" if($varenv->{syshost} !~ /shareedms-/); } $users_sharee->{c_id} = "0" if(!$users_sharee->{c_id}); $initMap =~ s/\s//g; my ($lat,$lng) = split(/,/,$initMap); print "