init III
This commit is contained in:
44
Perl CGI C2/admin/del_alert.pl
Normal file
44
Perl CGI C2/admin/del_alert.pl
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/perl
|
||||
use strict;
|
||||
use mysql;
|
||||
use CGI qw(:standard);
|
||||
|
||||
my $ind = param('ind');
|
||||
my $del = param('del');
|
||||
|
||||
my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1});
|
||||
|
||||
print header();
|
||||
print "<html>\n";
|
||||
print "<head>\n";
|
||||
print "<style type='text/css'>\n";
|
||||
print "select { font-size:8pt }\n";
|
||||
|
||||
print "</style>\n";
|
||||
|
||||
print "</head>\n";
|
||||
print "<body>\n";
|
||||
print "<b><u>Alarm entfernen</u></b>\n";
|
||||
if ($del eq "") {
|
||||
my $sth = $dbh->prepare("select ind,description,alert_type from alerts order by 'alert_typ','description'");
|
||||
$sth->execute;
|
||||
print "<form action='del_alert.pl'>\n";
|
||||
print "<table>\n";
|
||||
while (my $ref = $sth->fetchrow_arrayref()) {
|
||||
print "<tr>\n";
|
||||
print "<td><input type='radio' name='del' value='$ref->[0]'></td>\n";
|
||||
print "<td><input type='text' readonly value='$ref->[1]'></td>\n";
|
||||
print "<td><input type='text' readonly value='$ref->[2]'></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "<tr><td></td>\n<td><input type='submit' value='Löschen'></td></tr>\n";
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
}
|
||||
else {
|
||||
$dbh->do("delete from alerts where ind='$del'");
|
||||
print "<br>Löschen durchgeführt!";
|
||||
}
|
||||
|
||||
print "</body>\n";
|
||||
print "</html>\n";
|
||||
Reference in New Issue
Block a user