aboutsummaryrefslogtreecommitdiffstats
path: root/functions/list_years.php
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-10-15 05:15:56 +0000
committerChad Little <clittle@users.sourceforge.net>2002-10-15 05:15:56 +0000
commita0bc0753305fafc54e3cec48fb4418fbc24e071c (patch)
tree82662fed87cd0ac7f937c6bd92a7649623ca91a5 /functions/list_years.php
parentde88ab2a5c43d435b4b23ba81ed00ab4eeb55f7f (diff)
downloadphpicalendar-a0bc0753305fafc54e3cec48fb4418fbc24e071c.tar.gz
phpicalendar-a0bc0753305fafc54e3cec48fb4418fbc24e071c.tar.bz2
phpicalendar-a0bc0753305fafc54e3cec48fb4418fbc24e071c.zip
Initial list_years.php inclusion.
Diffstat (limited to 'functions/list_years.php')
-rw-r--r--functions/list_years.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/functions/list_years.php b/functions/list_years.php
new file mode 100644
index 0000000..ab273a1
--- /dev/null
+++ b/functions/list_years.php
@@ -0,0 +1,31 @@
+<?php
+
+$year_time = strtotime("$getdate");
+$getdate_year = date("Y", strtotime($getdate));
+$num_years2 = $num_years;
+//echo "$num_years2";
+print "<form>\n<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value);\">\n";
+// build the <option> tags
+for ($i=0; $i < ($num_years2 +2); $i++) {
+ $year_time2 = strtotime ("-$num_years2 year", $year_time);
+ $yeardate = date("Ymd", $year_time2);
+ $year_year = date ("Y", $year_time2);
+ print "<option value=\"year.php?cal=$cal&getdate=$yeardate\">$year_year</option>\n";
+ $num_years2--;
+}
+$year_time = strtotime("$this_year-01-01");
+$getdate_year = date("Y", strtotime($getdate));
+for ($i=0; $i < ($num_years +1); $i++) {
+ $year_year = date ("Y", $year_time);
+ $yeardate = date("Ymd", $year_time);
+ if ($year_year == $getdate_year) {
+ print "<option value=\"year.php?cal=$cal&getdate=$yeardate\" selected>$year_year</option>\n";
+ } else {
+ print "<option value=\"year.php?cal=$cal&getdate=$yeardate\">$year_year</option>\n";
+ }
+ $year_time = strtotime ("+1 year", $year_time);
+}
+
+// finish <select>
+print "</select>\n</form>";
+?> \ No newline at end of file

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