| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2003-04-20 21:12:13 +00:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |  * Smarty plugin | 
					
						
							| 
									
										
										
										
											2003-04-20 21:12:13 +00:00
										 |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage plugins | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Smarty {html_select_date} plugin | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Type:     function<br> | 
					
						
							|  |  |  |  * Name:     html_select_date<br> | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |  * Purpose:  Prints the dropdowns for date selection. | 
					
						
							| 
									
										
										
										
											2002-03-20 16:44:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2003-04-20 21:12:13 +00:00
										 |  |  |  * ChangeLog:<br> | 
					
						
							|  |  |  |  *           - 1.0 initial release | 
					
						
							|  |  |  |  *           - 1.1 added support for +/- N syntax for begin | 
					
						
							| 
									
										
										
										
											2002-03-20 16:44:17 +00:00
										 |  |  |  *                and end year values. (Monte) | 
					
						
							| 
									
										
										
										
											2003-04-20 21:12:13 +00:00
										 |  |  |  *           - 1.2 added support for yyyy-mm-dd syntax for | 
					
						
							| 
									
										
										
										
											2002-04-13 16:15:14 +00:00
										 |  |  |  *                time value. (Jan Rosier) | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  |  *           - 1.3 added support for choosing format for | 
					
						
							| 
									
										
										
										
											2002-05-21 19:41:34 +00:00
										 |  |  |  *                month values (Gary Loescher) | 
					
						
							| 
									
										
										
										
											2003-04-20 21:12:13 +00:00
										 |  |  |  *           - 1.3.1 added support for choosing format for | 
					
						
							| 
									
										
										
										
											2002-12-13 15:40:53 +00:00
										 |  |  |  *                day values (Marcus Bointon) | 
					
						
							| 
									
										
										
										
											2003-04-20 21:12:13 +00:00
										 |  |  |  * @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date} | 
					
						
							|  |  |  |  *      (Smarty online manual) | 
					
						
							| 
									
										
										
										
											2003-12-10 09:05:22 +00:00
										 |  |  |  * @version 1.3.1 | 
					
						
							| 
									
										
										
										
											2003-04-20 21:12:13 +00:00
										 |  |  |  * @author   Andrei Zmievski | 
					
						
							|  |  |  |  * @param array | 
					
						
							|  |  |  |  * @param Smarty | 
					
						
							|  |  |  |  * @return string | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | function smarty_function_html_select_date($params, &$smarty) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2004-07-23 15:34:53 +00:00
										 |  |  |     require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); | 
					
						
							|  |  |  |     require_once $smarty->_get_plugin_filepath('function','html_options'); | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |     /* Default values. */ | 
					
						
							|  |  |  |     $prefix          = "Date_"; | 
					
						
							|  |  |  |     $start_year      = strftime("%Y"); | 
					
						
							|  |  |  |     $end_year        = $start_year; | 
					
						
							|  |  |  |     $display_days    = true; | 
					
						
							|  |  |  |     $display_months  = true; | 
					
						
							|  |  |  |     $display_years   = true; | 
					
						
							|  |  |  |     $month_format    = "%B"; | 
					
						
							| 
									
										
										
										
											2002-05-21 19:41:34 +00:00
										 |  |  |     /* Write months as numbers by default  GL */ | 
					
						
							|  |  |  |     $month_value_format = "%m"; | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |     $day_format      = "%02d"; | 
					
						
							| 
									
										
										
										
											2002-12-13 15:40:53 +00:00
										 |  |  |     /* Write day values using this format MB */ | 
					
						
							|  |  |  |     $day_value_format = "%d"; | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |     $year_as_text    = false; | 
					
						
							|  |  |  |     /* Display years in reverse order? Ie. 2000,1999,.... */ | 
					
						
							|  |  |  |     $reverse_years   = false; | 
					
						
							|  |  |  |     /* Should the select boxes be part of an array when returned from PHP? | 
					
						
							|  |  |  |        e.g. setting it to "birthday", would create "birthday[Day]", | 
					
						
							|  |  |  |        "birthday[Month]" & "birthday[Year]". Can be combined with prefix */ | 
					
						
							|  |  |  |     $field_array     = null; | 
					
						
							|  |  |  |     /* <select size>'s of the different <select> tags. | 
					
						
							|  |  |  |        If not set, uses default dropdown. */ | 
					
						
							|  |  |  |     $day_size        = null; | 
					
						
							|  |  |  |     $month_size      = null; | 
					
						
							|  |  |  |     $year_size       = null; | 
					
						
							|  |  |  |     /* Unparsed attributes common to *ALL* the <select>/<input> tags. | 
					
						
							|  |  |  |        An example might be in the template: all_extra ='class ="foo"'. */ | 
					
						
							|  |  |  |     $all_extra       = null; | 
					
						
							|  |  |  |     /* Separate attributes for the tags. */ | 
					
						
							|  |  |  |     $day_extra       = null; | 
					
						
							|  |  |  |     $month_extra     = null; | 
					
						
							|  |  |  |     $year_extra      = null; | 
					
						
							|  |  |  |     /* Order in which to display the fields. | 
					
						
							|  |  |  |        "D" -> day, "M" -> month, "Y" -> year. */ | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  |     $field_order     = 'MDY'; | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |     /* String printed between the different fields. */ | 
					
						
							|  |  |  |     $field_separator = "\n"; | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  |     $time = time(); | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  |     $all_empty       = null; | 
					
						
							|  |  |  |     $day_empty       = null; | 
					
						
							|  |  |  |     $month_empty     = null; | 
					
						
							|  |  |  |     $year_empty      = null; | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-12-10 09:05:22 +00:00
										 |  |  |     foreach ($params as $_key=>$_value) { | 
					
						
							|  |  |  |         switch ($_key) { | 
					
						
							|  |  |  |             case 'prefix': | 
					
						
							|  |  |  |             case 'time': | 
					
						
							|  |  |  |             case 'start_year': | 
					
						
							|  |  |  |             case 'end_year': | 
					
						
							|  |  |  |             case 'month_format': | 
					
						
							|  |  |  |             case 'day_format': | 
					
						
							|  |  |  |             case 'day_value_format': | 
					
						
							|  |  |  |             case 'field_array': | 
					
						
							|  |  |  |             case 'day_size': | 
					
						
							|  |  |  |             case 'month_size': | 
					
						
							|  |  |  |             case 'year_size': | 
					
						
							|  |  |  |             case 'all_extra': | 
					
						
							|  |  |  |             case 'day_extra': | 
					
						
							|  |  |  |             case 'month_extra': | 
					
						
							|  |  |  |             case 'year_extra': | 
					
						
							|  |  |  |             case 'field_order': | 
					
						
							|  |  |  |             case 'field_separator': | 
					
						
							|  |  |  |             case 'month_value_format': | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  |             case 'month_empty': | 
					
						
							|  |  |  |             case 'day_empty': | 
					
						
							|  |  |  |             case 'year_empty': | 
					
						
							| 
									
										
										
										
											2003-12-10 09:05:22 +00:00
										 |  |  |                 $$_key = (string)$_value; | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             case 'all_empty': | 
					
						
							|  |  |  |                 $$_key = (string)$_value; | 
					
						
							|  |  |  |                 $day_empty = $month_empty = $year_empty = $all_empty; | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-12-10 09:05:22 +00:00
										 |  |  |             case 'display_days': | 
					
						
							|  |  |  |             case 'display_months': | 
					
						
							|  |  |  |             case 'display_years': | 
					
						
							|  |  |  |             case 'year_as_text': | 
					
						
							|  |  |  |             case 'reverse_years': | 
					
						
							|  |  |  |                 $$_key = (bool)$_value; | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2003-12-17 09:32:30 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             default: | 
					
						
							| 
									
										
										
										
											2003-12-17 10:45:57 +00:00
										 |  |  |                 $smarty->trigger_error("[html_select_date] unknown parameter $_key", E_USER_WARNING); | 
					
						
							| 
									
										
										
										
											2003-12-17 09:32:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-12-10 09:05:22 +00:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2002-04-13 16:15:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-08-20 13:48:46 +00:00
										 |  |  |     if(preg_match('!^-\d+$!',$time)) { | 
					
						
							|  |  |  |         // negative timestamp, use date()
 | 
					
						
							|  |  |  |         $time = date('Y-m-d',$time); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  |     // If $time is not in format yyyy-mm-dd
 | 
					
						
							| 
									
										
										
										
											2004-02-13 23:38:08 +00:00
										 |  |  |     if (!preg_match('/^\d{0,4}-\d{0,2}-\d{0,2}$/', $time)) { | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  |         // then $time is empty or unix timestamp or mysql timestamp
 | 
					
						
							|  |  |  |         // using smarty_make_timestamp to get an unix timestamp and
 | 
					
						
							|  |  |  |         // strftime to make yyyy-mm-dd
 | 
					
						
							|  |  |  |         $time = strftime('%Y-%m-%d', smarty_make_timestamp($time)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     // Now split this in pieces, which later can be used to set the select
 | 
					
						
							|  |  |  |     $time = explode("-", $time); | 
					
						
							| 
									
										
										
										
											2004-08-20 13:48:46 +00:00
										 |  |  |      | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  |     // make syntax "+N" or "-N" work with start_year and end_year
 | 
					
						
							|  |  |  |     if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) { | 
					
						
							|  |  |  |         if ($match[1] == '+') { | 
					
						
							|  |  |  |             $end_year = strftime('%Y') + $match[2]; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $end_year = strftime('%Y') - $match[2]; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (preg_match('!^(\+|\-)\s*(\d+)$!', $start_year, $match)) { | 
					
						
							|  |  |  |         if ($match[1] == '+') { | 
					
						
							|  |  |  |             $start_year = strftime('%Y') + $match[2]; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $start_year = strftime('%Y') - $match[2]; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2004-08-20 13:48:46 +00:00
										 |  |  |     if($start_year > $time[0] && !isset($params['start_year'])) { | 
					
						
							|  |  |  |         // force start year to include given date if not explicitly set
 | 
					
						
							|  |  |  |         $start_year = $time[0]; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if($end_year < $time[0] && !isset($params['end_year'])) { | 
					
						
							|  |  |  |         // force end year to include given date if not explicitly set
 | 
					
						
							|  |  |  |         $end_year = $time[0]; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |     $field_order = strtoupper($field_order); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     $html_result = $month_result = $day_result = $year_result = ""; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if ($display_months) { | 
					
						
							|  |  |  |         $month_names = array(); | 
					
						
							| 
									
										
										
										
											2002-05-21 19:41:34 +00:00
										 |  |  |         $month_values = array(); | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  |         if(isset($month_empty)) { | 
					
						
							|  |  |  |             $month_names[''] = $month_empty; | 
					
						
							|  |  |  |             $month_values[''] = ''; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2002-05-21 19:41:34 +00:00
										 |  |  |         for ($i = 1; $i <= 12; $i++) { | 
					
						
							| 
									
										
										
										
											2004-02-13 23:38:08 +00:00
										 |  |  |             $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000)); | 
					
						
							|  |  |  |             $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000)); | 
					
						
							| 
									
										
										
										
											2002-05-21 19:41:34 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $month_result .= '<select name='; | 
					
						
							|  |  |  |         if (null !== $field_array){ | 
					
						
							|  |  |  |             $month_result .= '"' . $field_array . '[' . $prefix . 'Month]"'; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $month_result .= '"' . $prefix . 'Month"'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (null !== $month_size){ | 
					
						
							|  |  |  |             $month_result .= ' size="' . $month_size . '"'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (null !== $month_extra){ | 
					
						
							|  |  |  |             $month_result .= ' ' . $month_extra; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (null !== $all_extra){ | 
					
						
							|  |  |  |             $month_result .= ' ' . $all_extra; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $month_result .= '>'."\n"; | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |         $month_result .= smarty_function_html_options(array('output'     => $month_names, | 
					
						
							| 
									
										
										
										
											2002-05-21 19:41:34 +00:00
										 |  |  |                                                             'values'     => $month_values, | 
					
						
							| 
									
										
										
										
											2004-02-22 23:29:08 +00:00
										 |  |  |                                                             'selected'   => $a=$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '', | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |                                                             'print_result' => false), | 
					
						
							|  |  |  |                                                       $smarty); | 
					
						
							|  |  |  |         $month_result .= '</select>'; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if ($display_days) { | 
					
						
							| 
									
										
										
										
											2002-04-13 16:15:14 +00:00
										 |  |  |         $days = array(); | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  |         if (isset($day_empty)) { | 
					
						
							|  |  |  |             $days[''] = $day_empty; | 
					
						
							|  |  |  |             $day_values[''] = ''; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2002-12-13 15:40:53 +00:00
										 |  |  |         for ($i = 1; $i <= 31; $i++) { | 
					
						
							| 
									
										
										
										
											2002-04-13 16:15:14 +00:00
										 |  |  |             $days[] = sprintf($day_format, $i); | 
					
						
							| 
									
										
										
										
											2002-12-13 15:40:53 +00:00
										 |  |  |             $day_values[] = sprintf($day_value_format, $i); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $day_result .= '<select name='; | 
					
						
							|  |  |  |         if (null !== $field_array){ | 
					
						
							|  |  |  |             $day_result .= '"' . $field_array . '[' . $prefix . 'Day]"'; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $day_result .= '"' . $prefix . 'Day"'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (null !== $day_size){ | 
					
						
							|  |  |  |             $day_result .= ' size="' . $day_size . '"'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (null !== $all_extra){ | 
					
						
							|  |  |  |             $day_result .= ' ' . $all_extra; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (null !== $day_extra){ | 
					
						
							|  |  |  |             $day_result .= ' ' . $day_extra; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $day_result .= '>'."\n"; | 
					
						
							|  |  |  |         $day_result .= smarty_function_html_options(array('output'     => $days, | 
					
						
							| 
									
										
										
										
											2002-12-13 15:40:53 +00:00
										 |  |  |                                                           'values'     => $day_values, | 
					
						
							| 
									
										
										
										
											2002-04-13 16:15:14 +00:00
										 |  |  |                                                           'selected'   => $time[2], | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |                                                           'print_result' => false), | 
					
						
							|  |  |  |                                                     $smarty); | 
					
						
							|  |  |  |         $day_result .= '</select>'; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if ($display_years) { | 
					
						
							|  |  |  |         if (null !== $field_array){ | 
					
						
							|  |  |  |             $year_name = $field_array . '[' . $prefix . 'Year]'; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $year_name = $prefix . 'Year'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if ($year_as_text) { | 
					
						
							| 
									
										
										
										
											2002-04-13 16:15:14 +00:00
										 |  |  |             $year_result .= '<input type="text" name="' . $year_name . '" value="' . $time[0] . '" size="4" maxlength="4"'; | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |             if (null !== $all_extra){ | 
					
						
							|  |  |  |                 $year_result .= ' ' . $all_extra; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             if (null !== $year_extra){ | 
					
						
							|  |  |  |                 $year_result .= ' ' . $year_extra; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             $year_result .= '>'; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $years = range((int)$start_year, (int)$end_year); | 
					
						
							|  |  |  |             if ($reverse_years) { | 
					
						
							|  |  |  |                 rsort($years, SORT_NUMERIC); | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  |             $yearvals = $years; | 
					
						
							|  |  |  |             if(isset($year_empty)) { | 
					
						
							|  |  |  |                 array_unshift($years, $year_empty); | 
					
						
							|  |  |  |                 array_unshift($yearvals, ''); | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |             $year_result .= '<select name="' . $year_name . '"'; | 
					
						
							|  |  |  |             if (null !== $year_size){ | 
					
						
							|  |  |  |                 $year_result .= ' size="' . $year_size . '"'; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             if (null !== $all_extra){ | 
					
						
							|  |  |  |                 $year_result .= ' ' . $all_extra; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             if (null !== $year_extra){ | 
					
						
							|  |  |  |                 $year_result .= ' ' . $year_extra; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             $year_result .= '>'."\n"; | 
					
						
							|  |  |  |             $year_result .= smarty_function_html_options(array('output' => $years, | 
					
						
							| 
									
										
										
										
											2003-12-10 16:43:39 +00:00
										 |  |  |                                                                'values' => $yearvals, | 
					
						
							| 
									
										
										
										
											2002-04-13 16:15:14 +00:00
										 |  |  |                                                                'selected'   => $time[0], | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |                                                                'print_result' => false), | 
					
						
							|  |  |  |                                                          $smarty); | 
					
						
							|  |  |  |             $year_result .= '</select>'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Loop thru the field_order field
 | 
					
						
							|  |  |  |     for ($i = 0; $i <= 2; $i++){ | 
					
						
							| 
									
										
										
										
											2003-12-10 08:50:21 +00:00
										 |  |  |         $c = substr($field_order, $i, 1); | 
					
						
							|  |  |  |         switch ($c){ | 
					
						
							|  |  |  |             case 'D': | 
					
						
							|  |  |  |                 $html_result .= $day_result; | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             case 'M': | 
					
						
							|  |  |  |                 $html_result .= $month_result; | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             case 'Y': | 
					
						
							|  |  |  |                 $html_result .= $year_result; | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         // Add the field seperator
 | 
					
						
							|  |  |  |         if($i != 2) { | 
					
						
							|  |  |  |             $html_result .= $field_separator; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-01-08 17:34:45 +00:00
										 |  |  |     return $html_result; | 
					
						
							| 
									
										
										
										
											2002-01-31 20:49:40 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* vim: set expandtab: */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ?>
 |