Thread Hinzufügen von Spalten in einer Tabelle (105 answers)
Opened by piero at 2004-04-26 12:59

piero
 2004-05-10 12:54
#2224 #2224
User since
2004-03-03
98 Artikel
BenutzerIn
[default_avatar]
Hallo,
wenn ich es compiliere, dann kommt die Fehlermeldung:

Bareword "start_html" not allowe.
Bareword "end_html" not allowed .

Ich will nur eine mit Rahmen formatiere Tabelle für die Ausgabe.

So sieht der Code aus:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#! /usr/bin/perl -w                                                             
use MIME::Base64;                                                              
use strict;                                                                    
use warnings;                                                                  
use diagnostics;                                                                
use CGI;                                                                        
use CGI::Carp qw(fatalsToBrowser);                                              
use HTML::Template;                                                            
                                                                               
my $cgi = CGI->new();                                                          
my %params = $cgi->Vars();                                                      
print $cgi->header(-type => 'text/html');                                      
                                                                               
my $template = HTML::Template->new(filename =>  '/home/webmaster/docs/deutsch/Be
darfsmeldung/bedarfsmeldung2.htm');                                            
                                                                               
if($params{add}){ # wenn artikel hinzugefügt werden soll                        
my @loop = ();                                                                  
if($params{alt}){                                                              
my @artikel = split(/;/,$params{alt});                                          
foreach(@artikel){                                                              
 my ($art_name,$stueck,$euro) = split(/#/,$_);                                
 push(@loop,{ARTIKEL => $art_name, STUECK => $stueck, EURO => $euro});        
}                                                                              
}                                                                              
push(@loop,{ARTIKEL => $params{ARTIKEL}, STUECK => $params{STUECK}, EURO => $par
ams{EURO}});                                                                    
my $alte = $params{alt}.";$params{ARTIKEL}#$params{STUECK}#$params{EURO}";      
$template->param(ALT => $alte,                                                  
                    ARTIKELLISTE => \@loop,                                    
                                                                               
                    ABTEILUNG => $params{ABTEILUNG},                          
                                                                               
                    KOSTENSTELLE => $params{KOSTENSTELLE},                    
                                                                               
                    DATUM => $params{DATUM},                                  
BENUTZER => $params{BENUTZER});                            
}                                                                              
elsif($params{submit}){                                                        
my $sendmail = '/usr/sbin/sendmail -t';                                        
my $sender = 'Piero <gior@imap.de>';                                            
my $empfaenger = 'Du <gior@imap>';                                              
my $betreff = 'Artikelliste';                                                  
my $body = "Artikel\tStueck\tPreis\n";                                          
my @artikel = split(/;/,$params{alt});      
foreach(@artikel){                          
my ($art,$st,$eur) = split(/#/,$_);        
$body .= $art."\t".$st."\t".$eur."\n";    
}                                          
start_html,                                
table(                                      
Tr(                                        
[                                          
td(['Benutzer:',$params{BENUTZER}]),        
td(['Abteilung:',$params{ABTEILUNG}]),      
td(['Kostenstelle:',$params{KOSTENSTELLE}]),
td(['Datum:',$params{DATUM}]),              
td(['Artikel:',$params{ARTIKEL}]),          
td(['Stueck:',$params{STUECK}]),            
td(['Euro:',$params{EURO}]),                
]                                          
),#Tr                                      
),#table                                    
end_html;                                  
                                           
open(MAIL,"| $sendmail") or print $!;      
print MAIL "To: $empfaenger\n";            
print MAIL "From: $sender\n";                          
print MAIL "Subject: $betreff\n\n";                    
print MAIL $body;                                      
close MAIL;                                            
$template->param(MESSAGE => 'E-Mail wurde abgeschickt');
}                                                      
print $template->output();


edit renee: schließendes [code]-Tag spendiert ;)\n\n

<!--EDIT|renee|1084185121-->

View full thread Hinzufügen von Spalten in einer Tabelle