year = $year; $this->month = $month; $this->day = $day; $this->hour = $hour; $this->minute = $minute; $this->second = $second; $this->ampm = $ampm; $this->daySavingsAdjust = $daySavingsAdjust; $this->timezone = $timezone; $this->ntp = $ntp; $this->ntp_1 = $ntp_1; $this->ntp_2 = $ntp_2; } } //define the constant values that will populate the lists $months_array = array("1"=>"January", "2"=>"February", "3"=>"March", "4"=>"April", "5"=>"May","6"=>"June", "7"=>"July", "8"=>"August", "9"=>"September", "10"=>"October","11"=>"November", "12"=>"December"); $months_array31 = array("1"=>"January", "3"=>"March", "5"=>"May", "7"=>"July", "8"=>"August","10"=>"October", "12"=>"December"); $daytimes = array("AM","PM"); for ($d=1;$d<=31;$d++) { if ($d<10) { $days_array31[$d]="0$d"; $days_array29[$d]="0$d"; $days_array28[$d]="0$d"; $days_array30[$d]="0$d"; continue; } $days_array31[$d] = $d; if ($d<30) { $days_array29[$d]=$d; if ($d!=29) { $days_array28[$d]=$d; } } if ($d!=31) { $days_array30[$d]=$d; } } for ($i=0;$i<60;$i++) { if ($i<10) { $min_sec[$i] = "0$i"; continue; } $min_sec[$i] = $i; } for ($i=1;$i<=12;$i++) { if ($i<10) { $hours[$i] = "0$i"; continue; } $hours[$i] = $i; } $displayMessage=0; if ($_SERVER[REQUEST_METHOD] == "POST") { //set the message to be displayed $returnMessage = $_REQUEST['returnMessage']; $errorCode = $_REQUEST['errorCode']; $displayMessage = $_REQUEST['Message']; } //$timezones = array("Pacific","Eastern"); // get the stored date & time to display $date = get_date_and_time($user); $timezones = get_timezones($user); error_log(print_r($date,true)); $month1 = $months_array[$date->month]; if ($date->day<10) { $day1 = "0$date->day"; } else { $day1 = $date->day; } $year1 = $date->year; if (in_array($month1, $months_array31)) { $days_array=$days_array31; } else if (strcmp($month1,"February")==0) { if ($year1%4==0) { $days_array = $days_array29; } else { $days_array = $days_array28; } } else { $days_array = $days_array30; } if ($date->hour < 12) { if ($date->hour == 0) { $hour1 = "12"; } else { if ($date->hour<10) { $hour1 = "0$date->hour"; } else { $hour1 = $date->hour; } } $day_time1="AM"; } else if ($date->hour >= 12) { if ($date->hour==12) { $hour1 = $date->hour; } else { $hour1 = $date->hour - 12; settype($hour1, "string"); } $day_time1="PM"; } error_log("$date_hour:".$date_hour." type:". gettype($date_hour)); if ($date->minute<10) { $min1 = "0$date->minute"; } else { $min1 = $date->minute; } if ($date->second) { $sec1 = "0$date->second"; } else { $sec1 = $date->second; } $timezone = $date->timezone; $visibility = true; // $netConfig->ip = "0001:0002:0003:0004:0005:0006:0007:0008"; $ipv4 = explode(".", $date->ntp_1); $ipv6 = explode(":", $date->ntp_1); $ipv4_length = count($ipv4); $ipv6_length = count($ipv6); if ($date->ntp == 0) { $ntp1 = "0.0.0.0"; $ntp2 = "0.0.0.0"; } else { $ntp1 = $date->ntp_1; if ($date->ntp_2 == "") { $ntp2 = "0.0.0.0"; } else { $ntp2 = $date->ntp_2; } } if (preg_match("/:/", $date->ntp_1)) { $assignment = 'static6'; $text_attributes = 'size="45" maxlength="39"'; } else { $assignment = 'static4'; $text_attributes = 'size="45" maxlength="39"'; //$text_attributes = 'size="32" maxlength="16"'; } ?>