48 lines
1.5 KiB
Perl
48 lines
1.5 KiB
Perl
#!/bin/perl
|
|
|
|
use Mysql;
|
|
use strict;
|
|
use CGI qw(:standard);
|
|
|
|
my $save=param('save');
|
|
|
|
my $dd = param('day');
|
|
my $mm = param('month');
|
|
my $yy = param('year');
|
|
my $ftag = param('ftag');
|
|
my $datum;
|
|
|
|
print header();
|
|
|
|
print "<html>\n";
|
|
print "<head>\n";
|
|
|
|
print "</head>\n";
|
|
|
|
print "<body>\n";
|
|
print "Datumsformat dd-mm-yyyy. Ist dd oder mm kleiner als 10,<br>muß eine führende 0 eingegeben werden.<br>\n";
|
|
print "Bei Eingabe eines ungültigen Datums wird 00-00-0000 gespeichert!<br><br>\n";
|
|
my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1});
|
|
|
|
if ($save eq "") {
|
|
my $sth = $dbh->prepare("select description,datum from not_run_on order by datum");
|
|
$sth->execute;
|
|
#print "<form action='notrunon.pl'>\n";
|
|
print "<table>\n";
|
|
while (my $ref = $sth->fetchrow_arrayref()) {
|
|
my ($yy,$mm,$dd) = split /-/,$ref->[1];
|
|
print "<tr><form action='notrunon.pl'><input type='hidden' name='ftag' value='$ref->[0]'><td>$ref->[0]</td><td><input size='1' type='text' name='day' value='$dd'></td><td><input size='1' type='text' name='month' value='$mm'></td><td><input size='3' type='text' name='year' value='$yy'></td><td><input type='submit' name='save' value='Speichern'></td></form></tr>\n";
|
|
}
|
|
print "</table>\n";
|
|
#print "</form>\n";
|
|
}
|
|
if ($save eq "Speichern") {
|
|
$datum="$yy" . "-" . "$mm" . "-" . "$dd";
|
|
$dbh->do("update not_run_on set datum='$datum' where description='$ftag'");
|
|
print "<br><br>Gespeichert\n";
|
|
#print "$ftag $dd $mm $yy";
|
|
}
|
|
|
|
print "</body>\n";
|
|
print "</html>\n";
|