home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / calendar-2010-08-23.tar.gz / calendar-2010-08-23.tar / calendar / functions / list_months.php < prev    next >
PHP Script  |  2003-10-12  |  808b  |  22 lines

  1. <?php
  2. print "<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value);\">\n";
  3. $month_time = strtotime("$this_year-01-01");
  4. $getdate_month = date("m", strtotime($getdate));
  5.  
  6. // echo "$this_day, $this_year";
  7. // build the <option> tags
  8. for ($i=0; $i<12; $i++) {
  9.     $monthdate = date ("Ymd", $month_time);
  10.     $month_month = date("m", $month_time);
  11.     $select_month = localizeDate($dateFormat_month, $month_time);
  12.     if ($month_month == $getdate_month) {
  13.         print "<option value=\"month.php?cal=$cal&getdate=$monthdate\" selected>$select_month</option>\n";
  14.     } else {
  15.         print "<option value=\"month.php?cal=$cal&getdate=$monthdate\">$select_month</option>\n";
  16.     }
  17.     $month_time = strtotime ("+1 month", $month_time);
  18. }
  19.  
  20. // finish <select>
  21. print "</select>";
  22. ?>