init III
This commit is contained in:
84
Perl CGI C2/admin/edit_conf.pl
Normal file
84
Perl CGI C2/admin/edit_conf.pl
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/bin/perl
|
||||
use strict;
|
||||
use mysql;
|
||||
use CGI qw(:standard);
|
||||
|
||||
my $edit = param('edit');
|
||||
|
||||
my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1});
|
||||
|
||||
my $ci=param('ci');
|
||||
my $we=param('we');
|
||||
my $wri=param('wri');
|
||||
my $url=param('url');
|
||||
my $urla=param('urla');
|
||||
my $path=param('path');
|
||||
my $roi=param('roi');
|
||||
my $wt=param('wt');
|
||||
my $starttime=param('starttime');
|
||||
my $stoptime=param('stoptime');
|
||||
|
||||
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>Konfig editieren</u></b>\n";
|
||||
if ($edit eq "") {
|
||||
my $sth = $dbh->prepare("select check_intervall,web_enable,web_refresh_intervall,web_link,web_template,runs_on_ip,config_url,start_time,stop_time,index_dir from conf");
|
||||
$sth->execute;
|
||||
print "<form action='edit_conf.pl'>\n";
|
||||
print "<table>\n";
|
||||
while (my $ref = $sth->fetchrow_arrayref()) {
|
||||
print "<tr>\n";
|
||||
print "<td>Check Intervall</td><td><input name='ci' type='text' value='$ref->[0]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Web enabled</td>\n";
|
||||
print "<td><select name='we'>\n";
|
||||
if ($ref->[1] eq "1") {
|
||||
print "<option selected value='1'>Ja</option>\n";
|
||||
print "<option value='0'>Nein</option>\n";
|
||||
}
|
||||
if ($ref->[1] eq "0") {
|
||||
print "<option value='1'>Ja</option>\n";
|
||||
print "<option selected value='0'>Nein</option>\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Web refresh Intervall</td><td><input name='wri' type='text' value='$ref->[2]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Web URL</td><td><input size='40' name='url' type='text' value='$ref->[3]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Web Template</td><td><input size='60' name='wt' type='text' value='$ref->[4]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Web-Page</td><td><input size='60' name='path' type='text' value='$ref->[9]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Läuft auf IP</td><td><input name='roi' type='text' value='$ref->[5]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Web Admin URL</td><td><input name='urla' size='40' type='text' value='$ref->[6]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Startzeit</td><td><input name='starttime' size='10' type='text' value='$ref->[7]'></td>\n";
|
||||
print "<tr></tr>\n";
|
||||
print "<td>Stopzeit</td><td><input name='stoptime' size='10' type='text' value='$ref->[8]'></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "<tr><td></td>\n<td><input type='submit' name='edit' value='Speichern'></td></tr>\n";
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
}
|
||||
else {
|
||||
if ($edit eq "Speichern") {
|
||||
$dbh->do("update conf set index_dir='$path',check_intervall='$ci',web_enable='$we',web_refresh_intervall='$wri',web_link='$url',web_template='$wt',runs_on_ip='$roi',config_url='$urla',start_time='$starttime',stop_time='$stoptime' where active='1'");
|
||||
#print "update conf set check_intervall='$ci',web_enable='$we',web_refresh_intervall='$wri',web_link='$url',web_template='$wt',runs_on_ip='$roi',config_url='$urla' where active='1'";
|
||||
# where active='1'
|
||||
print "<br><br>Gespeichert\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "</body>\n";
|
||||
print "</html>\n";
|
||||
Reference in New Issue
Block a user