aboutsummaryrefslogtreecommitdiffstats
path: root/functions/list_weeks.php
blob: 4de03d84bf1ca8cf4fb7552098b2915a4e8fc0b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php


ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3]; 
$this_month = $day_array2[2];
$this_year = $day_array2[1];

$check_week = strtotime($getdate);

$start_week_time = strtotime(dateOfWeek(date("Ymd", strtotime("$this_year-01-01")), $week_start_day));
$end_week_time = $start_week_time + (6 * 25 * 60 * 60);

print "<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value);\">\n";

// build the <option> tags
do {
	$weekdate = date ("Ymd", $start_week_time);
	$select_week1 = localizeDate($dateFormat_week_jump, $start_week_time);
	$select_week2 = localizeDate($dateFormat_week_jump, $end_week_time);

	if (($check_week >= $start_week_time) && ($check_week <= $end_week_time)) {
		print "<option value=\"week.php?cal=$cal&amp;getdate=$weekdate\" selected>$select_week1 - $select_week2</option>\n";
	} else {
		print "<option value=\"week.php?cal=$cal&amp;getdate=$weekdate\">$select_week1 - $select_week2</option>\n";
	}
	$start_week_time =  strtotime ("+1 week", $start_week_time);
	$end_week_time = $start_week_time + (6 * 25 * 60 * 60);
} while (date("Y", $start_week_time) <= $this_year);

// finish <select>
print "</select>";
?>

© 2014-2024 Faster IT GmbH | imprint | privacy policy