- if (ereg("M", $display) || (empty($display))) {
- $OUT .= " <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MONTHS."</STRONG></TD>\n";
- }
-
- if (ereg("W", $display) || (empty($display))) {
- $OUT .= " <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._WEEKS."</STRONG></TD>\n";
- }
-
- if (ereg("D", $display) || (empty($display))) {
- $OUT .= " <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._DAYS."</STRONG></TD>\n";
- }
-
- if (ereg("h", $display) || (empty($display))) {
- $OUT .= " <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._HOURS."</STRONG></TD>\n";
- }
-
- if (ereg("m", $display) || (empty($display))) {
- $OUT .= " <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MINUTES."</STRONG></TD>\n";
- }
-
- if (ereg("s", $display) || (empty($display))) {
- $OUT .= " <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._SECONDS."</STRONG></TD>\n";
- }
-
- $OUT .= "</TR>\n";
- $OUT .= "<TR>\n";
-
- if (ereg('Y', $display) || (empty($display))) {
- // Generate year selection
- $OUT .= " <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ye\" size=\"1\">\n";
- for ($idx = 0; $idx <= 10; $idx++) {
- $OUT .= " <OPTION class=\"mini_select\" value=\"".$idx."\"";
- if ($idx == $Y) $OUT .= " selected default";
- $OUT .= ">".$idx."</OPTION>\n";
- }
- $OUT .= " </SELECT></TD>\n";
- } else {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ye\" value=\"0\">\n";
- }
-
- if (ereg("M", $display) || (empty($display))) {
- // Generate month selection
- $OUT .= " <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mo\" size=\"1\">\n";
- for ($idx = 0; $idx <= 11; $idx++)
- {
- $OUT .= " <OPTION class=\"mini_select\" value=\"".$idx."\"";
- if ($idx == $M) $OUT .= " selected default";
- $OUT .= ">".$idx."</OPTION>\n";
- }
- $OUT .= " </SELECT></TD>\n";
- } else {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mo\" value=\"0\">\n";
- }
-
- if (ereg("W", $display) || (empty($display))) {
- // Generate week selection
- $OUT .= " <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_we\" size=\"1\">\n";
- for ($idx = 0; $idx <= 4; $idx++) {
- $OUT .= " <OPTION class=\"mini_select\" value=\"".$idx."\"";
- if ($idx == $W) $OUT .= " selected default";
- $OUT .= ">".$idx."</OPTION>\n";
- }
- $OUT .= " </SELECT></TD>\n";
- } else {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_we\" value=\"0\">\n";
- }
-
- if (ereg("D", $display) || (empty($display))) {
- // Generate day selection
- $OUT .= " <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_da\" size=\"1\">\n";
- for ($idx = 0; $idx <= 31; $idx++) {
- $OUT .= " <OPTION class=\"mini_select\" value=\"".$idx."\"";
- if ($idx == $D) $OUT .= " selected default";
- $OUT .= ">".$idx."</OPTION>\n";
- }
- $OUT .= " </SELECT></TD>\n";
- } else {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_da\" value=\"0\">\n";
- }
-
- if (ereg("h", $display) || (empty($display))) {
- // Generate hour selection
- $OUT .= " <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ho\" size=\"1\">\n";
- for ($idx = 0; $idx <= 23; $idx++) {
- $OUT .= " <OPTION class=\"mini_select\" value=\"".$idx."\"";
- if ($idx == $h) $OUT .= " selected default";
- $OUT .= ">".$idx."</OPTION>\n";
- }
- $OUT .= " </SELECT></TD>\n";
- } else {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ho\" value=\"0\">\n";
- }
-
- if (ereg("m", $display) || (empty($display))) {
- // Generate minute selection
- $OUT .= " <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mi\" size=\"1\">\n";
- for ($idx = 0; $idx <= 59; $idx++) {
- $OUT .= " <OPTION class=\"mini_select\" value=\"".$idx."\"";
- if ($idx == $m) $OUT .= " selected default";
- $OUT .= ">".$idx."</OPTION>\n";
- }
- $OUT .= " </SELECT></TD>\n";
- } else {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mi\" value=\"0\">\n";
- }
-
- if (ereg("s", $display) || (empty($display))) {
- // Generate second selection
- $OUT .= " <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_se\" size=\"1\">\n";
- for ($idx = 0; $idx <= 59; $idx++) {
- $OUT .= " <OPTION class=\"mini_select\" value=\"".$idx."\"";
- if ($idx == $s) $OUT .= " selected default";
- $OUT .= ">".$idx."</OPTION>\n";
- }
- $OUT .= " </SELECT></TD>\n";
- } else {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_se\" value=\"0\">\n";
- }
- $OUT .= "</TR>\n";
- $OUT .= "</TABLE>\n";
- $OUT .= "</DIV>\n";
- // Return generated HTML code
- }
- return $OUT;
-}
-//
-function CREATE_TIMESTAMP_FROM_SELECTIONS ($prefix, $POST) {
- // Initial return value
- $ret = 0;
-
- // Do we have a leap year?
- $SWITCH = 0;
- $TEST = date('Y', time()) / 4;
- $M1 = date("m", time());
- // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02")) $SWITCH = getConfig('one_day');