From: kilian (ksmachome) Date: Tue, 24 Dec 2019 07:00:38 +0000 (+0100) Subject: v20191223 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=a8d4a8a9efe8377157e4b46065a6e89c585c7f38;p=dksnas.git v20191223 --- diff --git a/CGI/api/app.cgi b/CGI/api/app.cgi old mode 100644 new mode 100755 index 8dfde54..2326284 --- a/CGI/api/app.cgi +++ b/CGI/api/app.cgi @@ -1,9 +1,11 @@ #!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl use strict; -use FindBin qw($Bin); +use FindBin qw($Bin $RealBin); # use lib ('CGI/api/lib/perl5'); # use lib ('CGI/api/lib'); use lib ($Bin.'/CGI/api/lib/perl5'); use lib ($Bin.'/CGI/api/lib'); +use lib ($RealBin.'/api/lib/perl5'); +use lib ($RealBin.'/api/lib'); use CGI; use CGI::Cookie; \ No newline at end of file diff --git a/CGI/api/audio.cgi b/CGI/api/audio.cgi old mode 100644 new mode 100755 index 4ee104e..f22b09e --- a/CGI/api/audio.cgi +++ b/CGI/api/audio.cgi @@ -1,6 +1,6 @@ -#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl +#!/usr/bin/env perl use strict; -use FindBin qw($Bin); +use FindBin qw($RealBin $Bin); use CGI; use CGI::Cookie; @@ -13,6 +13,8 @@ use JSON::PP; use lib ($Bin.'/CGI/api/lib/perl5'); use lib ($Bin.'/CGI/api/lib'); +use lib ($RealBin.'/lib/perl5'); +use lib ($RealBin.'/lib'); use audio; my $cgi = new CGI(); diff --git a/CGI/api/createpdf.cgi b/CGI/api/createpdf.cgi old mode 100644 new mode 100755 index 0336b95..71bb1d9 --- a/CGI/api/createpdf.cgi +++ b/CGI/api/createpdf.cgi @@ -1,8 +1,10 @@ #!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl use strict; -use FindBin qw($Bin); +use FindBin qw($RealBin $Bin); use lib ($Bin.'/CGI/api/lib/perl5'); use lib ($Bin.'/CGI/api/lib'); +use lib ($RealBin.'/api/lib/perl5'); +use lib ($RealBin.'/api/lib'); use CGI; use CGI::Cookie; # use CGI::Carp qw/fatalsToBrowser/; diff --git a/CGI/api/db.cgi b/CGI/api/db.cgi old mode 100644 new mode 100755 index 17ed817..40afbb8 --- a/CGI/api/db.cgi +++ b/CGI/api/db.cgi @@ -1,10 +1,12 @@ #!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl use strict; -use FindBin qw($Bin); +use FindBin qw($RealBin $Bin); # use lib ('CGI/api/lib/perl5'); # use lib ('CGI/api/lib'); use lib ($Bin.'/CGI/api/lib/perl5'); use lib ($Bin.'/CGI/api/lib'); +use lib ($RealBin.'/lib/perl5'); +use lib ($RealBin.'/lib'); use CGI; use CGI::Cookie; # use CGI::Carp qw/fatalsToBrowser/; diff --git a/CGI/api/download.cgi b/CGI/api/download.cgi old mode 100644 new mode 100755 diff --git a/CGI/api/lib/playlistcreator.pm b/CGI/api/lib/playlistcreator.pm new file mode 100644 index 0000000..f5cc38e --- /dev/null +++ b/CGI/api/lib/playlistcreator.pm @@ -0,0 +1,85 @@ +package dksdb; + +use strict; +use FindBin qw($Bin); +use lib ('./lib/perl5'); +use lib ('./lib'); +use lib ('./'); +use dksdb; + +sub new { + my $class = shift; + my $param = shift; + my $self = bless {}, $class; + foreach my $p (keys %{$param}){ + $self->{$p} = $param->{$p}; + } + if ($p->{db} ne ""){ + $self->{db} = dksdb->new({dsn => "DBI:SQLite:dbname=".$sitecfg->{datapath}.'/'.$p->{db}.'.sqlite'}); + } else { + $self->{db} = dksdb->new(); + } + + return $self; +} + +sub createplaylist(){ + my $self = shift; + my $date = shift; + my $limit = shift; + my $idschedule = shift; + my $timetofill = shift; + if ($timetofill == undef){ + $timetofill = 84600; + } + my $ctime = 0; + my $cpos = 0; + my $rdef=$self->getrotation($cschedule); + #print Dumper($ref); + my $musiclists = $self->getallmusiclists(); + #print Dumper($musiclists); + while ($ctime < $timetofill){ + foreach my $vfid (sort {$a <=> $b} keys(%{$rdef})){ + my $data = shift($musiclists->{$vfid}); + + } + } + +} + +sub getrotation(){ + my $self = shift; + my $idschedule = shift; + my $rotdef = (); + my $cnt = 0; + # do we have a schedule? + my $sql = "select id_vfolder from rotations where id_schedule='".$idschedule."' order by rpos;"; + my $rot = &dbquerysorted($sql); + return $rot; +} + +sub getallmusiclists(){ + my $self = shift; + my $idschedule = shift; + my $ldate = shift; + my $limit = shift; + my $vfolders = "select distinct(id_vfolder) as id_vfolder from rotations;"; + my $mcats = (); + my @mxcats = &dbqueryarray($msql); + foreach my $cat (@mxcats){ + $mcats->{$cat} = &getmusiclist($cat,$ldate,$limit); + } + return $mcats; +} + +sub getmusiclist(){ + my $self = shift; + my $idvfolder = shift; + my $ldate = shift; + my $limit = shift; + my $msql = "select random() as rand,id,title,artist,filepath,seconds from music where id_vfolder=".$idvfolder." and id not in +(select id_music from playlists pl join music mu on (pl.id_music=mu.id) where mu.id_vfolder=".$idvfolder." and pl.playdate <= date('".$ldate."') order by pl.id DESC LIMIT ".$limit.") order by rand"; + my @mxdata = &dbqueryarray($msql); + return \@mxdata; +} +1; \ No newline at end of file diff --git a/CGI/api/parsestatement.cgi b/CGI/api/parsestatement.cgi old mode 100644 new mode 100755 index 3b0d0ae..7ba5728 --- a/CGI/api/parsestatement.cgi +++ b/CGI/api/parsestatement.cgi @@ -5,11 +5,13 @@ use CGI::Carp qw/fatalsToBrowser/; use File::Path qw/make_path/; use File::Basename; use JSON::PP; -use FindBin qw($Bin); +use FindBin qw($RealBin $Bin); # use lib ('CGI/api/lib/perl5'); # use lib ('CGI/api/lib'); use lib ($Bin.'/CGI/api/lib/perl5'); use lib ($Bin.'/CGI/api/lib'); +use lib ($RealBin.'/api/lib/perl5'); +use lib ($RealBin.'/api/lib'); use dksconfig qw/$sitecfg/; use dksdb; diff --git a/CGI/api/playlist.cgi b/CGI/api/playlist.cgi old mode 100644 new mode 100755 diff --git a/CGI/api/playlistcreator.cgi b/CGI/api/playlistcreator.cgi new file mode 100755 index 0000000..5e11be9 --- /dev/null +++ b/CGI/api/playlistcreator.cgi @@ -0,0 +1,34 @@ +#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl +use strict; +use FindBin qw($Bin); + +use CGI; +use CGI::Cookie; +use CGI::Carp qw/fatalsToBrowser/; +use File::Basename; +use Data::Dumper; +use File::Basename; + +use lib ($Bin.'/CGI/api/lib/perl5'); +use lib ($Bin.'/CGI/api/lib'); +use lib ($Bin.'/lib/perl5'); +use lib ($Bin.'/lib'); +use dksconfig qw/$sitecfg/; +use dksdb; + +my $cgi = new CGI(); +my $scriptpath = $cgi->url(-absolute => 1); +my $p = (); +my @params = $cgi->param(); +foreach my $pe (@params){ + $p->{$pe} = $cgi->param($pe); +} +my $html->{result} = (); +$html->{params} = $p; +print $cgi->header(-type=> 'text/html', -charset=>"UTF-8"); +print Dumper($html); +#print $cgi->header(-type=> 'application/json', -charset=>"UTF-8"); +# my $js = JSON::PP->new(); +# $js->allow_blessed(1); +# $js->convert_blessed(1); +# print $js->utf8->encode($html); \ No newline at end of file diff --git a/CGI/api/upload.cgi b/CGI/api/upload.cgi old mode 100644 new mode 100755 diff --git a/CGI/index.cgi b/CGI/index.cgi old mode 100644 new mode 100755 index ff00aa5..6c2828b --- a/CGI/index.cgi +++ b/CGI/index.cgi @@ -1,13 +1,13 @@ -#!C:\Strawberry\perl\bin\perl.exe +#!/usr/bin/env perl use strict; -use FindBin qw($Bin); +use FindBin qw($RealBin $Bin); # use lib ('CGI/api/lib/perl5'); # use lib ('CGI/api/lib'); use lib ($Bin.'/CGI/api/lib/perl5'); use lib ($Bin.'/CGI/api/lib'); -# use lib ('./api/lib/perl5'); -# use lib ('./api/lib'); +use lib ($RealBin.'/api/lib/perl5'); +use lib ($RealBin.'/api/lib'); use File::Basename qw/dirname basename/; use Template; # use Template::Constants qw( :debug ); @@ -62,8 +62,13 @@ if ($vars->{suffix} eq ".js"){ } print $cgi->header(-type=>$ctype, -charset=>"utf-8"); - -my $template = Template->new({INCLUDE_PATH => [$Bin.'/CGI/tmpl']}); +my $tmplincpath = $RealBin.'/CGI/tmpl'; +if (basename($RealBin) eq "CGI" ){ + $tmplincpath = $RealBin.'/tmpl'; +} +#print $Bin.'
'; +#print $tmplincpath.'
'; +my $template = Template->new({INCLUDE_PATH => [$tmplincpath]}); my @lv = split(/\//,$vars->{filepath}); my $absnum = scalar(@lv)-1; diff --git a/CGI/tmpl/app/coloradio/module/audio/index.tt b/CGI/tmpl/app/coloradio/module/audio/index.tt index 829c478..686bdea 100644 --- a/CGI/tmpl/app/coloradio/module/audio/index.tt +++ b/CGI/tmpl/app/coloradio/module/audio/index.tt @@ -1,150 +1,78 @@ - - - - - - - - - - -
-
- -
- -
- +[% PROCESS macro/fields.tt %] +
+
+ Audio-List +
+
+ +
-
- Home - - - - - - + +
+ + +
+ Bearbeiten + Löschen +
+ + + +
+
+
+ -
+
+
+
+
+
+ +
+
+
+ [% fieldhidden('id','music','ident','') %] +
+
+ [% fieldeditbox('title','music','Title','','','','') %][% fieldeditbox('artist','music','Artist','','','','') %] [% fieldtagbox('vfolder','music','categories','','','') %][% fieldtagbox('genre','music','Genre','','','') %] [% fieldtagbox('tempo','music','Tempo','','','') + %] [% fieldtagbox('mood','music','Stimmung','','','') %] [% fieldnumberbox('myear','music','Jahr','w3-third','','') %][% fieldtagbox('language','music','Sprache(n)','w3-twothird','','') %] [% fieldtextarea('comment','music','Kommentar','','','50px','') + %]
-
-
- - - -
- -
- - - -
-
- - - -
+
+ [% fieldeditbox('folder','music','Ordner','','readonly','','') %] [% fieldeditbox('filename','music','Datei-Name','','readonly','') %] +
+ [% fieldtimebox('duration','music','Dauer','w3-half','readonly','') %] [% fieldeditbox('filetype','music','Audio-Format','w3-half','readonly','') %] +
[% fieldnumberbox('bitrate','music','Bitrate','w3-half','readonly','') %] [% fieldnumberbox('samplerate','music','Samplerate','w3-half','readonly','') %] [% fieldnumberbox('filesize','music','Größe','w3-half','readonly','') + %] [% fielddatebox('modified','music','Datum','w3-half','readonly','') %]
-
-
- - - -
-
- - - -
-
- - - -
-
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
-
- -
- -
- - - - - - - - - - \ No newline at end of file + +
+
+ \ No newline at end of file diff --git a/bin/playlist_creator/clr_generateplaylist.pl b/bin/clr_generateplaylist.pl old mode 100644 new mode 100755 similarity index 52% rename from bin/playlist_creator/clr_generateplaylist.pl rename to bin/clr_generateplaylist.pl index e677ca2..1038a28 --- a/bin/playlist_creator/clr_generateplaylist.pl +++ b/bin/clr_generateplaylist.pl @@ -16,60 +16,57 @@ use Encode; my $dbfile = "/Users/kilian/Workspace/dksnas/data/coloradio/aral.sqlite"; my $datefrom = "2020-01-01"; my $dateto = "2020-12-31"; -my $cschedule="Default"; -my $musiclistlimit=100; +my $cschedule="2"; +my $limit = 100; my $udf = &getunixdatetime($datefrom." 00:00:00"); my $udt = &getunixdatetime($dateto." 00:00:00"); my $cdt = $udf; -my $musiclists= {}; +#my $musiclists= {}; my $dbh = DBI->connect('DBI:SQLite:dbname='.$dbfile,"","",{PrintError=>1,AutoCommit=>1}) or die "Connection Error!".$!."\n"; &writelog("Generate ".basename($dbfile)." Playlist from ".$datefrom." to ".$dateto); -&dbexec("DELETE from playlist where plistname >='".substr(&getdatetime($cdt),0,10)."' and plistname <= '".substr(&getdatetime($udt),0,10)."' and streamname = '".$cschedule."';"); -while ($cdt <= $udt){ - my $shortdate = substr(&getdatetime($cdt),0,10); - &writelog("Create Playlist for DATE ".$shortdate); - my $rotationdef = &getdayrotationdef($shortdate,$cschedule); - my $mids = (); - foreach my $e (sort {$a <=> $b} keys(%{$rotationdef})){ - my $crot = $rotationdef->{$e}; - my @cats = @{$crot->{categories}}; - #print localtime.": Start at ".$crot->{timefrom}."\n"; - #get first cat - my $timetofill = &getunixdatetime($shortdate." ".$crot->{timeend}.':00')-&getunixdatetime($shortdate." ".$crot->{timebegin}.':00'); - if ($crot->{timeend} <= $crot->{timefrom}){ - $timetofill += 86400; - } - my $ctime = 0; - my $cpos = 0; - my @audiolist = (); - while ($ctime < $timetofill){ - for (my $c=0;$c".$cats[$c]."\n"; - if (!exists($musiclists->{$cats[$c]}) || scalar(@{$musiclists->{$cats[$c]}}) == 0){ - if (scalar(@audiolist) > 0){ - &dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist)); - @audiolist=(); - } - #print "get next music category data ".$cats[$c]."\n"; - &getmusiclist($cats[$c],$shortdate,$musiclistlimit); - } - my $data = shift(@{$musiclists->{$cats[$c]}}); - #my $checksql = "select idmusic from playlist where idmusic='".$data->{idmusic}."' and plistname='".$shortdate."' and streamname='".$schedulename."';"; - #my $rxx = $db->dbquerysorted($checksql); - if (!exists($mids->{$data->{idmusic}})){ - push(@audiolist,"('".$shortdate."',".$cpos.",'".$cschedule."','".$data->{idmusic}."')"); - $cpos++; - $ctime += $data->{duration}; - $mids->{$data->{idmusic}} = ""; - } - } - } - &dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist)); - } - $cdt = $cdt+86400; - } -$dbh->disconnect(); +&dbexec("DELETE from playlists where playdate >= date('".substr(&getdatetime($cdt),0,10)."') and id_schedule='".$cschedule."';"); +my $rdef=&getrotation($cschedule); +#print Dumper($rdef); +my $musiclists = &getallmusiclists($cschedule,$datefrom,$limit); +#print Dumper($musiclists); +#print Dumper(keys(%{$musiclists})); + + while ($cdt <= $udt){ + my $shortdate = substr(&getdatetime($cdt),0,10); + &writelog("Create Playlist for DATE ".$shortdate); + my $timetofill = 86400; + my $ctime = 0; + my $cpos = 0; + my @audiolist = (); + while ($ctime < $timetofill){ + foreach my $r (sort {$a <=> $b } keys(%{$rdef})){ + #print "$r :".Dumper($rdef->{$r}->{id_vfolder})."\n"; + my $aufile = shift(@{$musiclists->{$rdef->{$r}->{id_vfolder}}}); + #print Dumper($aufile); + #print " "; + push(@audiolist,"(date('".$shortdate."'), '".$cpos."', '".$cschedule."', ".$aufile->{id}.")"); + $ctime += $aufile->{seconds}; + $cpos++; + if (scalar(@{$musiclists->{$rdef->{$r}->{id_vfolder}}}) == 0){ + if (scalar(@audiolist) > 0 ){ + &dbexec("INSERT INTO playlists (playdate, playposition, id_schedule, id_music) VALUES ".join(",",@audiolist)); + @audiolist = (); + } + + $musiclists->{$rdef->{$r}->{id_vfolder}} = &getmusiclist($rdef->{$r}->{id_vfolder},$shortdate,$limit); + } + } + #print Dumper(scalar(@audiolist)); + if (scalar(@audiolist) > 0 ){ + &dbexec("INSERT INTO playlists (playdate, playposition, id_schedule, id_music) VALUES ".join(",",@audiolist)); + @audiolist = (); + } + } + $cdt = $cdt+86400; +} +$dbh->disconnect(); +&writelog("End Creation!"); sub getunixdatetime(){ @@ -181,40 +178,37 @@ sub writelog(){ print $logrow; } -sub getdayrotationdef(){ - my $strdate = shift; - my $schedulename = shift; +sub getrotation(){ + my $idschedule = shift; my $rotdef = (); my $cnt = 0; # do we have a schedule? - my $sql = "select * from schedule where weekday = '".&getweekday($strdate)."';"; - my $dayrot = &dbquerysorted($sql); - if (keys(%{$dayrot}) > 0){ - foreach my $i (sort {$a<=>$b} keys(%{$dayrot})){ - $sql = "select * from rotation where rotation='".$dayrot->{$i}->{rotation}."' order by position;"; - my $hrot = &dbquerysorted($sql); - my $trange ={"timefrom" => $dayrot->{$i}->{start}, "timeto" => $dayrot->{$i}->{end}}; - my @rot = (); - foreach my $p (sort {$a<=>$b} keys(%{$hrot})){ - push(@rot,$hrot->{$p}->{owncategory}); - } - $trange->{categories} = \@rot; - $rotdef->{$cnt} = $trange; - $cnt++; - } - } + my $sql = "select id_vfolder from rotations where id_schedule='".$idschedule."' order by rpos;"; + my $rot = &dbquerysorted($sql); + return $rot; +} - return $rotdef; +sub getallmusiclists(){ + my $idschedule = shift; + my $ldate = shift; + my $limit = shift; + my $sql = "select distinct(id_vfolder) as id_vfolder from rotations;"; + my $mcats = (); + my @mxcats = &dbqueryarray($sql); + foreach my $cat (@mxcats){ + # print "CAT:\n"; + # print Dumper($cat); + $mcats->{$cat->{id_vfolder}} = &getmusiclist($cat->{id_vfolder},$ldate,$limit); + } + return $mcats; } sub getmusiclist(){ - my $owncat = shift; - my $date = shift; + my $idvfolder = shift; + my $ldate = shift; my $limit = shift; - my $msql = "select rrm.idmusic,rrm.duration from ( select mc.idmusic,bb.lastplayed,random() as rand - from music mc left join (select max(maxxx) as lastplayed,idmusic from (select pl.plistname || '_' || pl.plposition as maxxx,pl.idmusic from playlist pl left join music rm on (rm.idmusic=pl.idmusic) where pl.idmusic in (select idmusic from music where owncategory='".$owncat."') and plistname <'".$date."') aa group by idmusic) bb on (mc.idmusic=bb.idmusic) where mc.owncategory='".$owncat."' order by bb.lastplayed ASC LIMIT 100) cc left join music rrm on (rrm.idmusic=cc.idmusic) order by cc.rand;"; + my $msql = "select random() as rand,id,title,artist,filepath,seconds from music where id_vfolder=".$idvfolder." and id not in +(select id_music from playlists pl join music mu on (pl.id_music=mu.id) where mu.id_vfolder=".$idvfolder." and pl.playdate <= date('".$ldate."') order by pl.id DESC LIMIT ".$limit.") order by rand"; my @mxdata = &dbqueryarray($msql); - $musiclists->{$owncat} = \@mxdata; - # - #return @data; + return \@mxdata; } \ No newline at end of file diff --git a/bin/newplc.pl b/bin/newplc.pl new file mode 100755 index 0000000..e69de29 diff --git a/bin/ranglescht.pl b/bin/ranglescht.pl new file mode 100644 index 0000000..f8527c3 --- /dev/null +++ b/bin/ranglescht.pl @@ -0,0 +1,90 @@ +#!/usr/bin/env perl +use strict; +use Spreadsheet::XLSX; +use Encode; +use Getopt::Long; +use Data::Dumper; +my $xlsxfile = ""; +GetOptions("xlsx|x=s" => \$xlsxfile); + +my $excel = Spreadsheet::XLSX -> new ($xlsxfile); +my $points = (); +my $cols = (); +my $startrow = 0; +foreach my $sheet (@{$excel -> {Worksheet}}) { + $sheet -> {MaxRow} ||= $sheet -> {MinRow}; + foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { + $sheet -> {MaxCol} ||= $sheet -> {MinCol}; + foreach my $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { + my $cell = $sheet -> {Cells} [$row] [$col]; + if ($cell) { + if ($cell -> {Val} eq "Nom"){ + $cols->{$col} = "name"; + $startrow = $row +1; + } + if (($cell -> {Val} =~ /OLR/) && ($row == $startrow-1)){ + my ($n) = $cell -> {Val} =~ m/.*(\d+).*/; + $cols->{$col} = "rl".$n; + } + if ((exists($cols->{$col}) ) && ($row > $startrow) && ($startrow != 0)){ + if ($cell -> {Val} ne "0"){ + $points->{$row}->{$cols->{$col}} = $cell->{Val}; + } + } + } + } + } + } + #print Dumper($points); + foreach my $p (keys(%{$points})){ + + if (keys(%{$points->{$p}}) > 1){ + my ($surname,$prename) = $points->{$p}->{"name"} =~ m/^(.+)\s(.+)$/; + $points->{$p}->{surname} = $surname; + $points->{$p}->{prename} = $prename; + print Dumper($points->{$p}); + } + + } +# my $xlsx = parsexlsx->new(); +# my @data = $xlsx->sheetdata($p->{file},"Tabelle1"); +# my $dataok = 0; +# my @datax = (); +# my $colnames = (); +# foreach my $c (@data){ + +# if ($dataok == 1){ +# my $nc = (); +# foreach my $r (sort {$a <=> $b} keys(%{$c})){ + +# if ($c->{$r} ne "0"){ +# $nc->{$colnames->{$r}} = $c->{$r}; +# if ($colnames->{$r} eq "Nom"){ +# my ($surname,$prename) = $c->{$r} =~ m/^(.+)\s(.+)$/; +# $nc->{prename} = $prename; +# $nc->{surname} = $surname; +# } +# if ($colnames->{$r} eq "Place"){ +# $nc->{$colnames->{$r}} =~ s/\.//; +# } +# } +# } +# push(@datax,$nc); +# } +# if (exists($c->{3}) && $c->{3} eq "Nom"){ + +# # print $c; +# $dataok = 1; +# foreach my $n (keys(%{$c})){ +# $colnames->{$n} = $c->{$n}; +# } +# #$html->{colnames} = $colnames; +# } + +# } +# foreach my $dx (@datax){ +# if (exists($dx->{"OLR ".$p->{rl}})){ +# print encode("utf-8","select * from rankingdata('".$p->{listname}."','".$p->{season}."',".$p->{rl}.",'".$dx->{surname}."','".$dx->{prename}."',".$dx->{"OLR ".$p->{rl}}.",".$dx->{"Total"}.",".$dx->{"Place"}.");")."\n"; +# #print "select rl2=".$dx->{"OLR ".$p->{rl}}.", WHERE surname='".$dx->{surname}."' and prename='".$dx->{prename}."';" +# } +# } \ No newline at end of file diff --git a/bin/wkhtmltopdf/testdoc.pdf b/bin/wkhtmltopdf/testdoc.pdf index df1ec41..d491d3f 100644 Binary files a/bin/wkhtmltopdf/testdoc.pdf and b/bin/wkhtmltopdf/testdoc.pdf differ diff --git a/bin/wkhtmltopdf/testdoc/content.html b/bin/wkhtmltopdf/testdoc/content.html index dd8f286..f3327fa 100644 --- a/bin/wkhtmltopdf/testdoc/content.html +++ b/bin/wkhtmltopdf/testdoc/content.html @@ -5,98 +5,113 @@ Document + -

TEST DOCUMENT

- - + +
TEST
+ + + + + + + + + +
Rechnung
+ Firma
1, rue Principale
L-1234 Ville

+
+ + + + + +
Rechnungs-Nr.YYYYMMDD-XXXX
DatumDD.MM.YYYY
FälligkeitDD.MM.YYYY
Kundennummer00000000
+
+ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
#Produkt / DienstleistungAnz.Einzel-PreisNetto-Summe
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
row
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
AB12Lange Beschreibung0Stunden0,00 €0,00 €
Total Netto + 0000,00 €
MwSt. (17%) + 0000,00 €
Gesamt zu bezahlen: + 0000,00 €
+
Nous vous prions de virer le montant ci-dessus au compte
+ LU25 0020 1100 2783 8700 (BILLLULL)
\ No newline at end of file diff --git a/bin/wkhtmltopdf/testdoc/dks_500.png b/bin/wkhtmltopdf/testdoc/dks_500.png new file mode 100644 index 0000000..35c6adb Binary files /dev/null and b/bin/wkhtmltopdf/testdoc/dks_500.png differ diff --git a/bin/wkhtmltopdf/testdoc/footer.html b/bin/wkhtmltopdf/testdoc/footer.html index 724a6e3..9ed52d3 100644 --- a/bin/wkhtmltopdf/testdoc/footer.html +++ b/bin/wkhtmltopdf/testdoc/footer.html @@ -20,11 +20,13 @@ function subst() { } } - +
+ - +
DKS, Société à responsabilité limitée, RC B168572 - TVA: LU 25375617 - No. Aut: 10024550 / 0
+ IBAN: LU25 0020 1100 2783 8700; BIC: BILLLULL
- Page of + Seite /
diff --git a/bin/wkhtmltopdf/testdoc/header.html b/bin/wkhtmltopdf/testdoc/header.html index fcdb882..b5596a1 100644 --- a/bin/wkhtmltopdf/testdoc/header.html +++ b/bin/wkhtmltopdf/testdoc/header.html @@ -1,31 +1,21 @@ - - + + + +
- - + + +
- Page of +   +
+ DKS s.à r.l.
+ 8b, rue du Moulin
+ L-6914 Roodt-sur-Syre

+ Tel: +352 691 504 574
+ info@dks.lu / www.dks.lu
+
Database knowledge Solutions - Simplify IT
diff --git a/bin/wkhtmltopdf/testdoc/pdfconfig.conf b/bin/wkhtmltopdf/testdoc/pdfconfig.conf index 5ba2615..0ebe01d 100644 --- a/bin/wkhtmltopdf/testdoc/pdfconfig.conf +++ b/bin/wkhtmltopdf/testdoc/pdfconfig.conf @@ -1,6 +1,6 @@ -PDFTOP="10mm" -PDFBOTTOM="10mm" -PDFLEFT="10mm" +PDFTOP="40mm" +PDFBOTTOM="20mm" +PDFLEFT="20mm" PDFRIGHT="10mm" PDFSIZE="A4" PDFORIENTATION="Portrait" \ No newline at end of file diff --git a/dev/setvendor.pl b/dev/setvendor.pl deleted file mode 100644 index ef11ca7..0000000 --- a/dev/setvendor.pl +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env perl - -use strict; - -opendir \ No newline at end of file diff --git a/dksnas.pl b/dksnas.pl index 9b097cf..095ff06 100644 --- a/dksnas.pl +++ b/dksnas.pl @@ -45,12 +45,12 @@ print $cfgpath."\n"; my $allapp = builder { enable "DirIndex", dir_index => 'index.html'; - mount "/" => Plack::App::WrapCGI->new(script => $RealBin."/CGI/index.cgi")->to_app; + mount "/" => Plack::App::WrapCGI->new(script => $RealBin."/CGI/index.cgi" , execute => 1)->to_app; opendir(API,dirname($0)."/CGI/api"); while (my $s = readdir(API)){ if ($s =~ /\.cgi$/){ - mount "/api/".$s => Plack::App::WrapCGI->new(script => $RealBin."/CGI/api/".$s)->to_app; + mount "/api/".$s => Plack::App::WrapCGI->new(script => $RealBin."/CGI/api/".$s,execute => 1)->to_app; } } closedir(API);