function getTimezoneOption() { $list = DateTimeZone::listAbbreviations(); $idents = DateTimeZone::listIdentifiers(); $data = $offset = $added = array(); foreach ($list as $abbr => $info) { foreach ($info as $zone) { if (!empty($zone['timezone_id']) and !in_array($zone['timezone_id'], $added) and in_array($zone['timezone_id'], $idents)) { $z = new DateTimeZone($zone['timezone_id']); $c = new DateTime(null, $z); $zone['time'] = $c->format('H:i'); $data[] = $zone; $offset[] = $z->getOffset($c); $added[] = $zone['timezone_id']; } } } array_multisort($offset, SORT_ASC, $data); $options = array(); foreach ($data as $key => $row) { $options[$row['timezone_id']] = formatOffset($row['offset']) . ' ' . $row['timezone_id']; } return $options; }
$sign = ' '; } return $sign . str_pad($hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($minutes, 2, '0'); } $utc = new DateTimeZone('UTC'); $dt = new DateTime('now', $utc); echo '<select class="form-control input-sm" name="user_timezone" id="user_timezone">'; foreach (DateTimeZone::listIdentifiers() as $tz) { $current_tz = new DateTimeZone($tz); $offset = $current_tz->getOffset($dt); $transition = $current_tz->getTransitions($dt->getTimestamp(), $dt->getTimestamp()); $abbr = $transition[0]['abbr']; if ($html['user_timezone'] == $tz) { echo '<option selected="selected" value="' . $tz . '">' . $tz . ' [' . $abbr . ' ' . formatOffset($offset) . ']</option>'; } echo '<option value="' . $tz . '">' . $tz . ' [' . $abbr . ' ' . formatOffset($offset) . ']</option>'; } echo '</select>'; ?> </div> </div> <div class="form-group"> <label for="user_daily_email" class="col-xs-4 control-label">Daily Email Report: </label> <div class="col-xs-8"> <select class="form-control input-sm" id="user_daily_email" name="user_daily_email"> <option value="" <?php if ($html['user_daily_email'] == '') { echo 'selected'; } ?>
function exec_ogp_module() { require_once 'includes/form_table_class.php'; global $db, $view; if (isset($_REQUEST['update_settings'])) { $settings = array("panel_name" => $_REQUEST['panel_name'], "header_code" => $_REQUEST['header_code'], "maintenance_mode" => $_REQUEST['maintenance_mode'], "maintenance_title" => $_REQUEST['maintenance_title'], "maintenance_message" => $_REQUEST['maintenance_message'], "panel_language" => $_REQUEST['panel_language'], "time_zone" => $_REQUEST['time_zone'], "charset" => $_REQUEST['charset'], "page_auto_refresh" => $_REQUEST['page_auto_refresh'], "smtp_server" => $_REQUEST['smtp_server'], "smtp_port" => $_REQUEST['smtp_port'], "smtp_login" => $_REQUEST['smtp_login'], "smtp_passw" => $_REQUEST['smtp_passw'], "smtp_ssl" => $_REQUEST['smtp_ssl'], "panel_email_address" => $_REQUEST['panel_email_address'], "feed_enable" => $_REQUEST['feed_enable'], "feed_url" => $_REQUEST['feed_url'], "query_cache_life" => $_REQUEST['query_cache_life'], "query_num_servers_stop" => $_REQUEST['query_num_servers_stop'], "steam_user" => $_REQUEST['steam_user'], "steam_pass" => $_REQUEST['steam_pass'], "steam_guard" => $_REQUEST['steam_guard'], "editable_email" => $_REQUEST['editable_email'], "old_dashboard_behavior" => $_REQUEST['old_dashboard_behavior'], "rsync_available" => $_REQUEST['rsync_available']); $db->setSettings($settings); echo "<h2>" . get_lang('settings') . "</h2>"; print_success(get_lang('settings_updated')); $view->refresh("?m=settings"); return; } function formatOffset($offset) { $hours = $offset / 3600; $remainder = $offset % 3600; $sign = $hours > 0 ? '+' : '-'; $hour = (int) abs($hours); $minutes = (int) abs($remainder / 60); if ($hour == 0 and $minutes == 0) { $sign = ' '; } return $sign . str_pad($hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($minutes, 2, '0'); } $utc = new DateTimeZone('UTC'); $dt = new DateTime('now', $utc); if (!method_exists($dt, 'getTimestamp')) { $dt = new DateTime_52('now', $utc); } foreach (DateTimeZone::listIdentifiers() as $tz) { $current_tz = new DateTimeZone($tz); $offset = $current_tz->getOffset($dt); $transition = $current_tz->getTransitions($dt->getTimestamp(), $dt->getTimestamp()); $abbr = $transition[0]['abbr']; $zones["{$tz}"] = $tz . '[' . $abbr . ' ' . formatOffset($offset) . ']'; } $rsync_options = array("1" => get_lang('all_available_servers'), "2" => get_lang('only_remote_servers'), "3" => get_lang('only_local_servers')); echo "<h2>" . get_lang('settings') . "</h2>"; $row = $db->getSettings(); $ft = new FormTable(); $ft->start_form("?m=settings", "post", "autocomplete=\"off\""); $ft->start_table(); $ft->add_field('string', 'panel_name', @$row['panel_name']); $locale_files = makefilelist("lang/", ".|..|.svn", true, "folders"); $locale_files = array('' => "-") + $locale_files; $ft->add_custom_field('panel_language', create_drop_box_from_array($locale_files, "panel_language", @$row['panel_language'])); $zones = array('' => "-") + $zones; $ft->add_custom_field('time_zone', create_drop_box_from_array($zones, "time_zone", @$row['time_zone'], false)); $ft->add_field('string', 'charset', @$row['charset']); $ft->add_field('text', 'header_code', @$row['header_code']); $ft->add_field('on_off', 'maintenance_mode', @$row['maintenance_mode']); $ft->add_field('string', 'maintenance_title', @$row['maintenance_title']); $ft->add_field('text', 'maintenance_message', @$row['maintenance_message']); $ft->add_field('on_off', 'page_auto_refresh', @$row['page_auto_refresh']); $ft->add_field('string', 'panel_email_address', @$row['panel_email_address']); $ft->add_field('string', 'smtp_server', @$row['smtp_server']); $ft->add_field('string', 'smtp_port', @$row['smtp_port']); $ft->add_field('on_off', 'smtp_ssl', @$row['smtp_ssl']); $ft->add_field('string', 'smtp_login', @$row['smtp_login']); $ft->add_field('string', 'smtp_passw', @$row['smtp_passw']); $ft->add_field('on_off', 'feed_enable', @$row['feed_enable']); $ft->add_field('string', 'feed_url', @$row['feed_url']); $query_cache_life = (isset($row['query_cache_life']) and $row['query_cache_life'] != "") ? $row['query_cache_life'] : "30"; $ft->add_field('string', 'query_cache_life', $query_cache_life); $query_num_servers_stop = (isset($row['query_num_servers_stop']) and $row['query_num_servers_stop'] != "") ? $row['query_num_servers_stop'] : "15"; $ft->add_field('string', 'query_num_servers_stop', $query_num_servers_stop); $ft->add_field('string', 'steam_user', @$row['steam_user']); $ft->add_field('password', 'steam_pass', @$row['steam_pass']); $ft->add_field('password', 'steam_guard', @$row['steam_guard']); $mail_setting = isset($row['editable_email']) ? $row['editable_email'] : "1"; $ft->add_field('on_off', 'editable_email', $mail_setting); $ft->add_field('on_off', 'old_dashboard_behavior', @$row['old_dashboard_behavior']); $ft->add_custom_field('rsync_available', create_drop_box_from_array($rsync_options, "rsync_available", @$row['rsync_available'], false)); $ft->end_table(); $ft->add_button("submit", "update_settings", get_lang('update_settings')); $ft->end_form(); }
} $regions = array(); foreach (DateTimeZone::listIdentifiers() as $line) { $pieces = explode("/", $line); if (isset($pieces[1])) { $regions[$pieces[0]][] = $line; } } $tzmenu = '<ul id="tzmenu">'; foreach ($regions as $country => $cityarray) { $tzmenu .= "\t<li>{$country}\n\t\t<ul>"; foreach ($cityarray as $key => $city) { $z = new DateTimeZone($city); $c = new DateTime(null, $z); $adjustedtime = $c->format('H:i a'); $offset = formatOffset($z->getOffset($c)); $tzmenu .= "\t\t\t<li><a href=\"#\" data=\"{$city}\">{$adjustedtime} - {$offset} {$city}</a></li>\n"; } $tzmenu .= "\t\t</ul>\t</li>"; } $tzmenu .= '</ul>'; // Build list of cable color codes $cablecolors = ""; $colorselector = '<select name="mediacolorcode[]"><option value="0"></option>'; $codeList = ColorCoding::GetCodeList(); if (count($codeList) > 0) { foreach ($codeList as $cc) { $colorselector .= '<option value="' . $cc->ColorID . '">' . $cc->Name . '</option>'; $cablecolors .= '<div> <div><img src="images/del.gif"></div> <div><input type="text" name="colorcode[]" data=' . $cc->ColorID . ' value="' . $cc->Name . '"></div>
$hour = (int) abs($hours); $minutes = (int) abs($remainder / 60); if ($hour == 0 and $minutes == 0) { $sign = ' '; } return $sign . str_pad($hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($minutes, 2, '0'); } $utc = new DateTimeZone('UTC'); $dt = new DateTime('now', $utc); $tzselect = '<select id="userTimezone" name="userTimezone" class="form-control">'; foreach (DateTimeZone::listIdentifiers() as $tz) { $current_tz = new DateTimeZone($tz); $offset = $current_tz->getOffset($dt); $transition = $current_tz->getTransitions($dt->getTimestamp(), $dt->getTimestamp()); $abbr = $transition[0]['abbr']; $tzselect = $tzselect . '<option ' . ($settings['userTimezone'] == $tz ? "selected" : "") . ' value="' . $tz . '">' . $tz . ' [' . $abbr . ' ' . formatOffset($offset) . ']</option>'; } $tzselect = $tzselect . '</select>'; include 'head.php'; include 'menu.php'; ?> <div class="container"> <h2>Settings</h2> <!-- ######################## --> <form name="timezone" action="/settings.php" method="post" class="form-horizontal"> <fieldset> <legend>TimeZone</legend> <div class="form-group"> <label for="userTimezone" class="control-label col-lg-3">Timezone</label>
aasort($tzArray, "offset"); foreach ($tzArray as $tz) { if ($tz["tz"] == $TimeZone) { $sel = 'selected="selected" style="background-color: yellow;"'; } else { $sel = ""; } ?> <option <?php echo $sel; ?> value="<?php echo $tz["tz"]; ?> "> (<?php echo formatOffset($tz["offset"]); ?> <?php echo $tz["abbr"]; ?> ) <?php echo $tz["tz"]; ?> </option><?php } ?> </select> </td> </tr> <tr class="row"> <td>Date Format:</td>
$abbr = $transition[0]['abbr']; ?> <option name="timeZone" value="<?php echo $tz; ?> "<?php $tz == $timeZone ? print " selected" : ""; ?> ><?php echo $tz; ?> [<?php echo $abbr; ?> <?php echo formatOffset($offSet); ?> ]</option> <?php } ?> </select> </div> <div class="form-group"> <label for="defaultPage">Date Format - 12 Hour Format</label> <div class="radio"> <label><input type="radio" name="dateFormatSlelection" value="F jS, Y g:i A"<?php $dateFormat == "F jS, Y g:i A" ? print ' checked' : ''; ?> >October 16, 2015 5:00 PM</label> </div>
</div> <p id="required-p">(*) Required</p> </section> <h2>Portal Settings</h2> <section> <div class="form-group"> <label for="timeZone">Time Zone</label> <select class="form-control" id="timeZone" name="timeZone"> <?php foreach (DateTimeZone::listIdentifiers() as $timeZone) { $currentTimeZone = new DateTimeZone($timeZone); $offSet = $currentTimeZone->getOffset($dt); $transition = $currentTimeZone->getTransitions($dt->getTimestamp(), $dt->getTimeStamp()); $abbr = $transition[0]['abbr']; echo '<option name="timeZone" value="' . $timeZone . '">' . $timeZone . ' [' . $abbr . ' ' . formatOffset($offSet) . ']</option>'; } ?> </select> </div> </section> <h2>Administrator Account</h2> <section> <div class="form-group"> <label for="adminName">Administrator Name *</label> <input type="text" class="form-control" name="name" required> </div> <div class="form-group"> <label for="adminEmail">Administrator Email Address *</label> <input type="email" class="form-control" name="email" required>