init III
This commit is contained in:
94
Perl CGI C2/admin/new_todo.pl
Normal file
94
Perl CGI C2/admin/new_todo.pl
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/bin/perl
|
||||
|
||||
use Mysql;
|
||||
use strict;
|
||||
use CGI qw(:standard);
|
||||
|
||||
my $gruppe = param('gruppe');
|
||||
my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1});
|
||||
my ($sth,$ref);
|
||||
print header();
|
||||
|
||||
print "<html>\n";
|
||||
print "<head>\n";
|
||||
print "<style type='text/css'>\n";
|
||||
print "select { font-size:8pt }\n";
|
||||
#print "td { font-size:10pt }\n";
|
||||
print "</style>\n";
|
||||
|
||||
print "</head>\n";
|
||||
print "<body>\n";
|
||||
print "<b><u>Todo hinzufügen</u></b>\n";
|
||||
print "<form action='save_todo.pl'>\n";
|
||||
print " <table border='1'>\n";
|
||||
|
||||
print " <tr>\n";
|
||||
print " <td>Host</td>\n";
|
||||
print " <td>Service</td>\n";
|
||||
print " <td>Prüfung</td>\n";
|
||||
print " <td>Alarm</td>\n";
|
||||
print " <td>Aktiv?</td>\n";
|
||||
print " <td>Beschreibung</td>\n";
|
||||
print " </tr>\n";
|
||||
|
||||
print " <tr>\n";
|
||||
|
||||
print " <td>\n";
|
||||
print " <select name='host'>\n";
|
||||
# hosts
|
||||
$sth = $dbh->prepare("select ind,hostname,ip from hosts order by hostname");
|
||||
$sth->execute;
|
||||
while ($ref = $sth->fetchrow_arrayref()) {
|
||||
print " <option value='$ref->[0]'><font size='-1'>$ref->[1] ($ref->[2])</font></option>\n";
|
||||
}
|
||||
print " </select>\n";
|
||||
print " </td>\n";
|
||||
|
||||
print " <td>\n";
|
||||
print " <select name='service'>\n";
|
||||
# services
|
||||
$sth = $dbh->prepare("select distinct service_ind, description from services");
|
||||
$sth->execute;
|
||||
while ($ref = $sth->fetchrow_arrayref()) {
|
||||
print " <option value='$ref->[0]'>$ref->[1]</option>\n";
|
||||
}
|
||||
print " </select>\n";
|
||||
print " </td>\n";
|
||||
|
||||
print " <td>\n";
|
||||
print " <select name='check'>\n";
|
||||
#checks
|
||||
$sth = $dbh->prepare("select description,beding,wert,ind from checks");
|
||||
$sth->execute;
|
||||
while ($ref = $sth->fetchrow_arrayref()) {
|
||||
print " <option value='$ref->[3]'>$ref->[0] ($ref->[1] $ref->[2])</option>\n";
|
||||
}
|
||||
print " </select>\n";
|
||||
print " </td>\n";
|
||||
|
||||
print " <td>\n";
|
||||
print " <select name='alert'>\n";
|
||||
# alerts
|
||||
$sth = $dbh->prepare("select description,alert_type,ind from alerts");
|
||||
$sth->execute;
|
||||
while ($ref = $sth->fetchrow_arrayref()) {
|
||||
print " <option value='$ref->[2]'>$ref->[0] ($ref->[1])</option>\n";
|
||||
}
|
||||
print " </select>\n";
|
||||
print " </td>\n";
|
||||
|
||||
print " <td><select name='active'><option value='1'>ja</option><option value='0'>nein</option></select></td>\n";
|
||||
print " <td><input maxlength='255' name='descr' type='text' value=''></td>\n";
|
||||
print " </tr>\n";
|
||||
print " </table>\n";
|
||||
print " <input type='submit' value='speichern'>\n";
|
||||
print "</form>\n";
|
||||
print "\n";
|
||||
|
||||
# $sth = $dbh->prepare($sel);
|
||||
# $sth->execute;
|
||||
# while ($ref = $sth->fetchrow_arrayref()) {
|
||||
# print "$ref->[1], $ref->[2] $ref->[3] <a target='rechts' href='forum_rechts.pl?index=$ref->[0]'>$ref->[4]</a>";
|
||||
# }
|
||||
|
||||
print "</body>\n</html>\n";
|
||||
Reference in New Issue
Block a user