Ejemplo n.º 1
0
/**
   show error-message and terminate
*/
function show_error($error, $extra = NULL)
{
    _error($error . " : " . $extra);
    // we do not know whether the language module was already loaded
    $errmsg = isset($GLOBALS["error_msg"]) ? $GLOBALS["error_msg"]["error"] : "ERROR";
    $backmsg = isset($GLOBALS["error_msg"]) ? $GLOBALS["error_msg"]["back"] : "BACK";
    show_header($errmsg);
    ?>
	<center>
        <h2><?php 
    echo $errmsg;
    ?>
</h2>
        <?php 
    echo $error;
    ?>
        <h3> <a href="javascript:window.history.back()"><?php 
    echo $backmsg;
    ?>
</a><h3>
        <?php 
    if ($extra != NULL) {
        echo " - " . $extra;
    }
    ?>
    </center>
    <?php 
    show_footer();
    exit;
}
Ejemplo n.º 2
0
function login()
{
    if (isset($_SESSION["s_user"])) {
        _debug("login(): session detected");
        if (!user_activate($_SESSION["s_user"], $_SESSION["s_pass"])) {
            _debug("Failed to activate user " . $_SESSION['s_user']);
            logout();
        }
    } else {
        if (isset($_POST["p_pass"])) {
            $p_pass = $_POST["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($_POST["p_user"])) {
            _debug("login(): login authentication");
            // Check Login
            if (!user_activate($_POST["p_user"], md5($p_pass))) {
                global $error_msg;
                show_error($error_msg["login_failed"] . ": " . htmlspecialchars($_POST["p_user"]));
            }
            // authentication sucessfull
            _debug("user '" . $_POST["p_user"] . "' successfully authenticated");
            // set language
            $_SESSION['language'] = qx_request("lang", "en");
            return;
        } else {
            // Ask for Login
            show_header($GLOBALS["messages"]["actlogin"]);
            echo "<BR><TABLE width=\"300\"><TR><TD colspan=\"2\" class=\"header\" nowrap><B>";
            echo $GLOBALS["messages"]["actloginheader"] . "</B></TD></TR>\n<FORM name=\"login\" action=\"";
            echo make_link("login", NULL, NULL) . "\" method=\"post\">\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscusername"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_user\" type=\"text\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscpassword"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_pass\" type=\"password\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["misclang"] . ":</TD><TD align=\"right\">";
            echo "<SELECT name=\"lang\">\n";
            @(include "./_lang/_info.php");
            echo "</SELECT></TD></TR>\n";
            echo "<TR><TD colspan=\"2\" align=\"right\"><INPUT type=\"submit\" value=\"";
            echo $GLOBALS["messages"]["btnlogin"] . "\"></TD></TR>\n</FORM></TABLE><BR>\n";
            ?>
<script language="JavaScript1.2" type="text/javascript">
                <!--
                if(document.login) document.login.p_user.focus();
            // -->
            </script><?php 
            show_footer();
            exit;
        }
    }
}
Ejemplo n.º 3
0
function show_error($error, $extra = NULL)
{
    // show error-message
    show_header($GLOBALS["error_msg"]["error"]);
    echo "<CENTER><BR>" . $GLOBALS["error_msg"]["error"] . ":" . "<BR><BR>\n";
    echo $error . "\n<BR><BR><A HREF=\"javascript:window.history.back()\">";
    echo $GLOBALS["error_msg"]["back"] . "</A>";
    if ($extra != NULL) {
        echo " - " . $extra;
    }
    echo "<BR><BR></CENTER>\n";
    show_footer();
    exit;
}
Ejemplo n.º 4
0
function relogin()
{
    global $page, $next_page;
    if ($page != 'login') {
        if ($_SERVER['QUERY_STRING']) {
            $next_page = "?" . $_SERVER['QUERY_STRING'];
        } else {
            $next_page = "?page={$page}";
        }
        require_once ABSPATH . "/login.php";
        show_footer(0, false, false);
        exit;
    }
}
Ejemplo n.º 5
0
function show_msg($message, $url_forward = '')
{
    if ($url_forward) {
        $message = "<a href=\"{$url_forward}\">{$message} (跳轉中...)</a><script>setTimeout(\"window.location.href ='{$url_forward}';\", 1);</script>";
    }
    show_header();
    print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t</table>
END;
    show_footer();
    exit;
}
Ejemplo n.º 6
0
			<table width="100%">
				<tr>
					<td class="label">Sticky</td>
					<td>
						<input type="checkbox" name="sticky"<? if($Sticky) { echo ' checked="checked"'; } ?> />
					</td>
					<td class="label">Mark as unread</td>
					<td>
						<input type="checkbox" name="mark_unread" />
					</td>
					<td class="label">Delete conversation</td>
					<td>
						<input type="checkbox" name="delete" />
					</td>

				</tr>
				<tr>
					<td class="center" colspan="6"><input type="submit" value="Manage conversation" /></td>
				</tr>
			</table>
		</div>
	</form>
<?

//And we're done!
?>
</div>
<?
show_footer();
?>
Ejemplo n.º 7
0
function login_page()
{
    show_header();
    $formhash = thash();
    print <<<END
\t\t<span>工具箱登录</span>
\t\t<form action="tools.php?action=login" method="post">
\t\t\t<table class="specialtable">
\t\t\t<tr>
\t\t\t\t<td width="20%"><input class="textinput" type="password" name="toolpassword"></input></td>
\t\t\t\t<td><input class="specialsubmit" type="submit" value="登 录"></input></td>
\t\t\t</tr>
\t\t\t</table>
\t\t\t<input type="hidden" name="action" value="login">
\t\t\t<input type="hidden" name="formhash" value="{$formhash}">
\t\t</form>
END;
    show_footer();
}
Ejemplo n.º 8
0
function show_error($type, $errors = '', $quit = false)
{
    global $lang, $step;
    $title = lang($type);
    $comment = lang($type . '_comment', false);
    $errormsg = '';
    if ($errors) {
        if (!empty($errors)) {
            foreach ((array) $errors as $k => $v) {
                if (is_numeric($k)) {
                    $comment .= "<li><em class=\"red\">" . lang($v) . "</em></li>";
                }
            }
        }
    }
    if ($step > 0) {
        echo "<div class=\"desc\"><b>{$title}</b><ul>{$comment}</ul>";
    } else {
        echo "</div><div class=\"main\" style=\"margin-top: -123px;\"><b>{$title}</b><ul style=\"line-height: 200%; margin-left: 30px;\">{$comment}</ul>";
    }
    if ($quit) {
        echo '<br /><span class="red">' . $lang['error_quit_msg'] . '</span><br /><br /><br /><br /><br /><br />';
    }
    echo '</div>';
    $quit && show_footer();
}
Ejemplo n.º 9
0
		<td class="nobr"><?php 
echo get_size($Data['Size']);
?>
</td>
		<td><?php 
echo number_format($TotalSnatched);
?>
</td>
		<td<?php 
echo $TotalSeeders == 0 ? ' class="r00"' : '';
?>
><?php 
echo number_format($TotalSeeders);
?>
</td>
		<td><?php 
echo number_format($TotalLeechers);
?>
</td>
	</tr>
<?
	}
}
?>
</table>
<div class="linkbox"><?php 
echo $Pages;
?>
</div>
<? show_footer(array('disclaimer'=>false)); ?>
Ejemplo n.º 10
0
/**
 * Main routine to call the various status functions
 */
function generate_status()
{
    global $context, $command_line, $db_show_debug;
    $context['debug'] = empty($db_show_debug) ? false : true;
    show_header();
    if (strpos(strtolower(PHP_OS), 'win') === 0) {
        get_windows_data();
    } else {
        get_linux_data();
    }
    get_mysql_data();
    if ($command_line) {
        if (!empty($context['operating_system']['name'])) {
            echo 'Operating System:   ', trim($context['operating_system']['name']), "\n";
        }
        if (!empty($context['cpu_info'])) {
            echo 'Processor:          ', trim($context['cpu_info']['model']), ' @ ', trim($context['cpu_info']['hz']), $context['cpu_info']['frequency'], ' (may report lower if power saving is enabled)', "\n";
        }
        if ($context['debug'] && !empty($context['lastserverreboot'])) {
            echo 'Server Last Reboot:        ', date(DATE_RSS, $context['lastserverreboot']), "\n";
        }
        if (isset($context['load_averages'])) {
            echo 'Load averages:      ', implode(', ', $context['load_averages']), "\n";
        }
        if (!empty($context['running_processes'])) {
            echo 'Current processes:  ', count($context['running_processes']), ' (', !empty($context['num_sleeping_processes']) ? $context['num_sleeping_processes'] . ' sleeping, ' : '', $context['num_running_processes'], ' running, ', $context['num_zombie_processes'], ' zombie)', "\n";
        }
        if (!empty($context['top_cpu_usage'])) {
            echo 'Processes by CPU:   ';
            $temp = array();
            foreach ($context['top_cpu_usage'] as $proc) {
                $temp[$proc['percent']] = $proc['name'] . ($proc['number'] > 1 ? ' (' . $proc['number'] . ') ' : ' ') . number_format($proc['percent'], 1) . '%';
            }
            krsort($temp);
            echo implode(', ', $temp), "\n";
        }
        if (!empty($context['memory_usage'])) {
            echo 'Memory usage:       ', round($context['memory_usage']['used'] * 100 / $context['memory_usage']['total'], 3), '% (', formatBytes($context['memory_usage']['used']), ' / ', formatBytes($context['memory_usage']['total']), ')', "\n";
        }
        if (isset($context['memory_usage']['swap_used'])) {
            echo 'Swap usage:         ', round($context['memory_usage']['swap_used'] * 100 / max(1, $context['memory_usage']['swap_total']), 3), '% (', formatBytes($context['memory_usage']['swap_used']), ' / ', formatBytes($context['memory_usage']['swap_total']), ')', "\n";
        }
        if (!empty($context['mysql_processes']) || !empty($context['mysql_num_sleeping_processes']) || !empty($context['mysql_num_locked_processes'])) {
            echo 'MySQL processes:    ', $context['mysql_num_running_processes'] + $context['mysql_num_locked_processes'] + $context['mysql_num_sleeping_processes'], ' (', $context['mysql_num_sleeping_processes'], ' sleeping, ', $context['mysql_num_running_processes'], ' running, ', $context['mysql_num_locked_processes'], ' locked)', "\n";
        }
        if (!empty($context['mysql_statistics'])) {
            echo "\n", 'MySQL statistics:', "\n";
            foreach ($context['mysql_statistics'] as $stat) {
                $warning = isset($stat['max']) && $stat['value'] > $stat['max'] || isset($stat['min']) && $stat['value'] < $stat['min'];
                $warning = $warning ? '(should be ' . (isset($stat['min']) ? '>= ' . $stat['min'] . ' ' : '') . (isset($stat['max'], $stat['min']) ? 'and ' : '') . (isset($stat['max']) ? '<= ' . $stat['max'] : '') . ')' : '';
                echo sprintf('%-34s%-6.6s %34s', $stat['description'] . ':', round($stat['value'], 4), $warning), "\n";
            }
        }
        return;
    }
    echo '
		<div class="panel">
			<h2>Basic Information</h2>
			<div class="righttext">', $context['current_time'], '</div>
			<table class="status_table">';
    if (!empty($context['operating_system']['name'])) {
        echo '
				<tr>
					<th style="text-align: left;">Operating System:</th>
					<td>', $context['operating_system']['name'], '</td>
				</tr>';
    }
    if (!empty($context['cpu_info'])) {
        echo '
				<tr>
					<th style="text-align: left;">Processor:</th>
					<td>', strtr($context['cpu_info']['model'], array('(R)' => '&reg;')), ' (', $context['cpu_info']['hz'], $context['cpu_info']['frequency'], ')</td>
				</tr>';
    }
    if ($context['debug'] && !empty($context['lastserverreboot'])) {
        echo '
				<tr>
					<th style="text-align: left;">Server Last Reboot:</th>
					<td>', date(DATE_RSS, $context['lastserverreboot']), '</td>
				</tr>';
    }
    if (isset($context['load_averages'])) {
        echo '
				<tr>
					<th style="text-align: left;">Load averages:</th>
					<td>', implode(', ', $context['load_averages']), '</td>
				</tr>';
    }
    if (!empty($context['running_processes'])) {
        echo '
				<tr>
					<th style="text-align: left;">Current processes:</th>
					<td>', count($context['running_processes']), ' (', !empty($context['num_sleeping_processes']) ? $context['num_sleeping_processes'] . ' sleeping, ' : '', $context['num_running_processes'], ' running, ', $context['num_zombie_processes'], ' zombie)</td>
				</tr>';
    }
    if (!empty($context['top_cpu_usage'])) {
        echo '
				<tr>
					<th style="text-align: left;">Processes by CPU:</th>
					<td>';
        $temp = array();
        foreach ($context['top_cpu_usage'] as $proc) {
            $temp[$proc['percent']] = htmlspecialchars($proc['name']) . ' <em>(' . $proc['number'] . ')</em> ' . number_format($proc['percent'], 1) . '%';
        }
        krsort($temp);
        echo implode(', ', $temp);
        echo '
					</td>
				</tr>';
    }
    if (!empty($context['memory_usage'])) {
        echo '
				<tr>
					<th style="text-align: left;">Memory usage:</th>
					<td>
						Main: ', round($context['memory_usage']['used'] * 100 / $context['memory_usage']['total'], 3), '% (', formatBytes($context['memory_usage']['used']), ' / ', formatBytes($context['memory_usage']['total']), ')';
        if (isset($context['memory_usage']['swap_used'])) {
            echo '<br />
						Swap: ', round($context['memory_usage']['swap_used'] * 100 / max(1, $context['memory_usage']['swap_total']), 3), '% (', formatBytes($context['memory_usage']['swap_used']), ' / ', formatBytes($context['memory_usage']['swap_total']), ')';
        }
        echo '
					</td>
				</tr>';
    }
    echo '
			</table>
		</div>';
    if (!empty($context['mysql_processes']) || !empty($context['mysql_num_sleeping_processes']) || !empty($context['mysql_num_locked_processes'])) {
        echo '
		<div class="panel">
			<h2>MySQL processes</h2>

			<table class="status_table">
				<tr>
					<th style="text-align: left;">Total processes:</th>
					<td>', $context['mysql_num_running_processes'] + $context['mysql_num_locked_processes'] + $context['mysql_num_sleeping_processes'], ' (', $context['mysql_num_sleeping_processes'], ' sleeping, ', $context['mysql_num_running_processes'], ' running, ', $context['mysql_num_locked_processes'], ' locked)</td>
				</tr>
			</table>';
        if (!empty($context['mysql_processes'])) {
            echo '
			<br />
			<h2>Running processes</h2>

			<table class="status_table">
				<tr>
					<th style="width: 14ex;">State</th>
					<th style="width: 8ex;">Time</th>
					<th>Query</th>
				</tr>';
            foreach ($context['mysql_processes'] as $proc) {
                echo '
				<tr>
					<td>', $proc['state'], '</td>
					<td style="text-align: center;">', $proc['time'], 's</td>
					<td><div style="width: 100%; ', strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ? 'max-' : '', 'height: 7em; overflow: auto;"><pre style="margin: 0; border: 1px solid gray;">';
                $temp = explode("\n", $proc['query']);
                $min_indent = 0;
                foreach ($temp as $line) {
                    preg_match('/^(\\t*)/', $line, $x);
                    if (strlen($x[0]) < $min_indent || $min_indent == 0) {
                        $min_indent = strlen($x[0]);
                    }
                }
                if ($min_indent > 0) {
                    $proc['query'] = '';
                    foreach ($temp as $line) {
                        $proc['query'] .= preg_replace('~^\\t{0,' . $min_indent . '}~i', '', $line) . "\n";
                    }
                }
                // Now, let's clean up the query.
                $clean = '';
                $old_pos = 0;
                $pos = -1;
                while (true) {
                    $pos = strpos($proc['query'], '\'', $pos + 1);
                    if ($pos === false) {
                        break;
                    }
                    $clean .= substr($proc['query'], $old_pos, $pos - $old_pos);
                    $str_pos = $pos;
                    while (true) {
                        $pos1 = strpos($proc['query'], '\'', $pos + 1);
                        $pos2 = strpos($proc['query'], '\\', $pos + 1);
                        if ($pos1 === false) {
                            break;
                        } elseif ($pos2 == false || $pos2 > $pos1) {
                            $pos = $pos1;
                            break;
                        }
                        $pos = $pos2 + 1;
                    }
                    $str = substr($proc['query'], $str_pos, $pos - $str_pos + 1);
                    $clean .= strlen($str) < 12 ? $str : '\'%s\'';
                    $old_pos = $pos + 1;
                }
                $clean .= substr($proc['query'], $old_pos);
                echo strtr(htmlspecialchars($clean), array("\n" => '<br />', "\r" => ''));
                echo '</pre></div></td>
				</tr>';
            }
            echo '
			</table>';
        }
        echo '
		</div>';
    }
    if (!empty($context['mysql_statistics'])) {
        echo '
		<div class="panel">
			<h2>MySQL Statistics</h2>
			<div class="roundframe">It is extremely important you fully understand each change you make to a MySQL database server. If you don\'t understand the output, or if you don\'t understand the recommendations, you should consult a knowledgeable DBA or system administrator that you trust. Always test your changes on staging environments, and always keep in mind that improvements in one area can negatively affect MySQL in other areas.</div>
			<table class="status_table">';
        // Has this server been running less than 2 days?
        if (!empty($context['mysql_status']['Uptime']['value']) && $context['mysql_status']['Uptime']['value'] < 86400 * 2) {
            echo '
				<tr>
					<th  colspan="2" style="color:red;">We have detected MySQL was restarted less than 48 Hours ago. These recommendations may not be accurate.</th>
				</tr>';
        } elseif (!empty($context['mysql_status']['Uptime']['value'])) {
            $days = floor($context['mysql_status']['Uptime']['value'] / 86400);
            $hours = floor(($context['mysql_status']['Uptime']['value'] - $days * 86400) / (60 * 60));
            $min = floor(($context['mysql_status']['Uptime']['value'] - ($days * 86400 + $hours * 3600)) / 60);
            echo '
				<tr>
					<th style="text-align: left;">MySQL Uptime:</th>
					<td>', $days, ' Day(s), ', $hours, ':', $min, ' Hour(s)</td>
				</tr>';
        }
        foreach ($context['mysql_statistics'] as $stat) {
            echo '
				<tr>
					<th style="text-align: left;">';
            // Good, Bad or Ugly
            if (isset($stat['health'])) {
                if ($stat['health'] == 0) {
                    echo '<i class="fa fa-check good"></i>';
                } elseif ($stat['health'] == 1) {
                    echo '<i class="fa fa-exclamation-triangle pass"></i>';
                } else {
                    echo '<i class="fa fa-times bad"></i>';
                }
            }
            // Show the cnf setting that this refers to
            echo $stat['description'], ':', isset($stat['setting']) ? '<br />
						<em style="font-size: smaller;">(' . $stat['setting'] . ')</em>' : '', '
					</th>
					<td>';
            // Show the value
            if (isset($stat['format'])) {
                echo '[ <em>' . $stat['format'] . '</em> ] ';
            } else {
                echo '[ <em>' . round($stat['value'], 3) . '</em> ] ';
            }
            // Let them know what it all means
            if (!empty($stat['note'])) {
                echo $stat['note'];
            }
            if (!empty($stat['explain'])) {
                echo '<br /><i class="fa fa-info-circle info"></i>' . $stat['explain'];
            }
            echo '
					</td>
				</tr>';
        }
        echo '
			</table>';
        if (isset($_GET['mysql_info'])) {
            echo '
			<br />
			<h2>MySQL status</h2>
			<table width="100%" cellpadding="2" cellspacing="0" border="0">';
            foreach ($context['mysql_status'] as $var) {
                echo '
				<tr>
					<th style="text-align: left;">', $var['name'], ':</th>
					<td>', $var['value'], '</td>
				</tr>';
            }
            echo '
			</table>

			<br />
			<h2>MySQL variables</h2>

			<table class="status_table>';
            foreach ($context['mysql_variables'] as $var) {
                echo '
				<tr>
					<th style="text-align: left;">', $var['name'], ':</th>
					<td>', $var['value'], '</td>
				</tr>';
            }
            echo '
			</table>';
        } else {
            echo '
			<br />
			<a href="', $_SERVER['PHP_SELF'], '?mysql_info=1">Show more information...</a><br />';
        }
        echo '
		</div>';
    }
    show_footer();
}
Ejemplo n.º 11
0
function show_msg($message, $next=0, $jump=0) {
	global $theurl;

	$nextstr = '';
	$backstr = '';

	obclean();
	if(empty($next)) {
		$backstr .= "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
	} elseif ($next == 999) {
	} else {
		$url_forward = "$theurl?step=$next";
		if($jump) {
			$nextstr .= "<a href=\"$url_forward\">请稍等...</a><script>setTimeout(\"window.location.href ='$url_forward';\", 1000);</script>";
		} else {
			$nextstr .= "<a href=\"$url_forward\">继续下一步</a>";
			$backstr .= "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
		}
	}

	show_header();
	print<<<END
	<table>
	<tr><td>$message</td></tr>
	<tr><td>&nbsp;</td></tr>
	<tr><td>$backstr $nextstr</td></tr>
	</table>
END;
	show_footer();
	exit();
}
Ejemplo n.º 12
0
        <button type="submit" class="btn btn-default">Cari</button>
    </form>
    </div>
  </div>
</div>

<?php 
unset($ret);
if ($mod == 'home') {
    $ret .= '<div class="container">' . LF;
}
//$ret .= show_header();
$ret .= '<div class="container">' . LF;
$ret .= $body;
$ret .= '</div>' . LF;
$ret .= show_footer();
if ($mod == 'home') {
    $ret .= '</div>' . LF;
}
// stats
if ($allow_stat) {
    $ret .= get_external_stat();
}
echo $ret;
?>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-2254800-2']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
Ejemplo n.º 13
0
<td align="center">     
<?php 
include "shout.inc.php";
?>
</td>

</tr>


<?php 
if ($logged_in) {
    ?>
<table align="center" width=100%>
<tr>
<td width=90%>
<br><br>
<?php 
    ranks();
    ?>
	
</td>
</tr>
</table>
<?php 
}
?>
</table>
</td>  </center>      
<?php 
show_footer($start_time);
Ejemplo n.º 14
0
function show_msg($message, $next = 0, $jump = 0)
{
    global $theurl, $LNG, $lang;
    $nextstr = '';
    $backstr = '';
    obclean();
    if (empty($next)) {
        $backstr .= "<a href=\"javascript:history.go(-1);\">{$LNG['go_back']}</a>";
    } elseif ($next == 999) {
    } else {
        $url_forward = "{$theurl}?step={$next}\\&lang={$lang}";
        if ($jump) {
            $nextstr .= "<a href=\"{$url_forward}\">{$LNG['wait_please']}</a>\r\n                                     <script>setTimeout(\"window.location.href ='{$url_forward}';\", 2000);</script>";
        } else {
            $nextstr .= "<a href=\"{$url_forward}\">{$LNG['continue_next_step']}</a>";
            $backstr .= "<a href=\"javascript:history.go(-1);\">{$LNG['go_back']}</a>";
        }
    }
    show_header();
    print <<<END
\t<table>
\t  <tr><td>{$message}</td></tr>
\t  <tr><td>&nbsp;</td></tr>
\t  <tr><td>{$backstr} {$nextstr}</td></tr>
\t</table>
END;
    show_footer();
    exit;
}
Ejemplo n.º 15
0
function show_msg($message, $url_forward='', $time = 1, $noexit = 0, $notice = '') {

	if($url_forward) {
		$url_forward = $_GET['from'] ? $url_forward.'&from='.rawurlencode($_GET['from']).'&frommd5='.rawurlencode($_GET['frommd5']) : $url_forward;
		$message = "<a href=\"$url_forward\">$message (Tiếp theo...)</a><br>$notice<script>setTimeout(\"window.location.href ='$url_forward';\", $time);</script>";
	}

	show_header();
	print<<<END
	<table>
	<tr><td>$message</td></tr>
	</table>
END;
	show_footer();
	!$noexit && exit();
}
Ejemplo n.º 16
0
function show_sql_result()
{
    show_header();
    echo '<div class="step">
<ul>
    <li class="on"><em>1</em>检测环境</li>
    <li class="current"><em>2</em>创建数据</li>
    <li class="on"><em>3</em>完成安装</li>
</ul>
<div class="server_1" style="overflow:auto;" id="kays">
    <dl>
    </dl>
</div>
</div>
<div class="bottom">
<input type="submit"  value="正在安装..." name="submit" style="border:none; background:url(images/an.jpg) no-repeat;width:95px;height:25px;color:#fff;font-weight:bold;">
</div>';
    show_footer();
}
Ejemplo n.º 17
0
function show_form(&$form_items, $error_msg)
{
    global $step;
    if (empty($form_items) || !is_array($form_items)) {
        return;
    }
    show_header();
    show_setting('start');
    show_setting('hidden', 'step', $step);
    show_select_db();
    $is_first = 1;
    echo '<div id="form_items_' . $step . '" ' . ($step == 5 ? 'style="display:none"' : '') . '><br />';
    foreach ($form_items as $key => $items) {
        global ${'error_' . $key};
        if ($is_first == 0) {
            echo '</table>';
            echo '</div>';
        }
        echo '<div id="' . $key . '_feilds">';
        if (!${'error_' . $key}) {
            show_tips('tips_' . $key);
        } else {
            show_error('tips_admin_config', ${'error_' . $key});
        }
        echo '<table class="tb2">';
        foreach ($items as $k => $v) {
            $value = '';
            if (!empty($error_msg)) {
                $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : '';
            }
            if (empty($value)) {
                if (isset($v['value']) && is_array($v['value'])) {
                    if ($v['value']['type'] == 'constant') {
                        $value = defined($v['value']['var']) ? constant($v['value']['var']) : $v['value']['var'];
                    } else {
                        $value = isset($GLOBALS[$v['value']['var']]) ? $GLOBALS[$v['value']['var']] : '';
                    }
                } else {
                    $value = '';
                }
            }
            show_setting($k, $key . '[' . $k . ']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key . '_' . $k . '_invalid' : '');
        }
        if ($is_first) {
            $is_first = 0;
        }
    }
    echo '</table>';
    echo '</div>';
    echo '<table class="tb2">';
    show_setting('', 'submitname', 'new_step', 'submit');
    show_setting('end');
    show_footer();
}
Ejemplo n.º 18
0
function show_language($lang_list=array(), $lng='en') {
	global $self, $uchidden, $step;
/*vot*/	global $language;

	$next = $step + 1;

	show_header();

	echo <<<EOT
</div>

<div class="main" style="margin-top:-123px;">

	<h2>Choose your language:</h2>
<br/>

	Select the installation language from existing in your package.
<br/>
<br/>
If a desired language is disabled or you want more language packs,
<br/>please visit the CodersClub x2.5 language repository: <a href="http://code.google.com/p/discuz-lang/">CodersClub Discuz!X Language Packs</a>
<br/>
All the language packs must be placed inside the "source/language" folder at your site.
<br/>
<br/>
	For more info and for get help please visit the <a href="http://codersclub.org/discuzx/">CodersClub Support Forum</a>
<br/>
<br/>
<br/>

	<div class="btnbox marginbot">
		<form method="get" autocomplete="off" action="index.php">
		Language:
		<select id='language' name='language'>
EOT;
	foreach($lang_list as $id => $l) {
		$disabled = $l['available'] ? '' : ' disabled';
		$selected = $id==$lng ? ' selected' : '';
		echo '<option value="', $id, '"', $disabled, $selected, '>';
		echo $l['name'], ' (', $l['title'], ') </option>';
	}

	echo <<<EOT
		</select>
		<input type="hidden" name="step" value="$next">
		<input type="submit" name="submit" value="OK" style="padding: 2px">&nbsp;
		</form>
	</div>

EOT;
	show_footer();

}
Ejemplo n.º 19
0
function show_form(&$form_items, $error_msg)
{
    global $step;
    if (empty($form_items) || !is_array($form_items)) {
        return;
    }
    show_header();
    show_setting('start');
    show_setting('hidden', 'step', $step);
    $is_first = 1;
    foreach ($form_items as $key => $items) {
        global ${'error_' . $key};
        if ($is_first == 0) {
            echo '</table>';
        }
        if (!${'error_' . $key}) {
            show_tips('tips_' . $key);
        } else {
            show_error('tips_admin_config', ${'error_' . $key});
        }
        echo '<table class="tb2">';
        foreach ($items as $k => $v) {
            global ${$k};
            if (!empty($error_msg)) {
                $value = isset($_POST[$key][$k]) ? $_POST[$key][$k] : '';
            } else {
                if (isset($v['value']) && is_array($v['value'])) {
                    if ($v['value']['type'] == 'constant') {
                        $value = defined($v['value']['var']) ? constant($v['value']['var']) : '';
                    } else {
                        $value = $GLOBALS[$v['value']['var']];
                    }
                } else {
                    $value = '';
                }
            }
            if ($v['type'] == 'checkbox') {
                $value = '1';
            }
            show_setting($k, $key . '[' . $k . ']', $value, $v['type'], isset($error_msg[$key][$k]) ? $key . '_' . $k . '_invalid' : '');
        }
        //当为环境配置的步骤时,单独输出是否增加演示数据
        if ($step == 2 && $key == 'dbinfo') {
            if ($_POST['demo_date'] == '1') {
                $demo_check = "checked='checked'";
            }
            echo "&nbsp;</td>\n<td>&nbsp;";
            if ($error) {
                $comment = '<span class="red">' . (is_string($error) ? lang($error) : lang($setname . '_error')) . '</span>';
            } else {
                $comment = lang($setname . '_comment', false);
            }
            echo "{$comment}</td>\n</tr>\n";
        }
        if ($is_first) {
            $is_first = 0;
        }
    }
    show_setting('', 'submitname', 'new_step', 'submit');
    show_setting('end');
    show_footer();
}
Ejemplo n.º 20
0
function main()
{
    show_header();
    show_form();
    show_footer();
}
Ejemplo n.º 21
0
<?php

echo show_header();
if (!$user[perm]) {
    die(redirect_js("index.php"));
}
echo "<span class='name'>Запросы</span><br>\n<center><form method='POST'>\nSELECT <br>\n<textarea name='sql' cols=30 rows=4>" . ($_POST[sql] ?: "* FROM rt_merchant") . "</textarea><br>\n<input type=submit value='OK'>\n</form>\n</center>\n";
if ($_POST[sql]) {
    $sql = make_sql($_POST[sql]);
    echo "<table><tr>";
    if ($sql) {
        foreach ($sql[0] as $k => $v) {
            echo "<td>{$k}</td>";
        }
        echo "</tr>";
        foreach ($sql as $r) {
            echo "<tr>";
            foreach ($r as $k => $v) {
                echo "<td>{$v}</td>";
            }
            echo "</tr>";
        }
    } else {
        echo "Ничего нет!";
    }
    echo "</center>";
}
echo show_footer();
Ejemplo n.º 22
0
echo $GroupID;
?>
" />
					<input type="text" name="sort" value="<?php 
echo $Sort;
?>
" size="4" title="The collage is sorted order of this number" />
				</td>
				<td>
					<?php 
echo $DisplayName;
?>
				</td>
				<td>
					<?php 
echo format_username($UserID, $Username);
?>
				</td>
				<td>
					<input type="submit" name="submit" value="Edit" />
					<input type="submit" name="submit" value="Remove" />
				</td>
			</form>
		</tr>
<?
}
?>
	</table>
</div>
<? show_footer() ?>
Ejemplo n.º 23
0
function login()
{
    //print_r($GLOBALS['__SESSION']);
    if (isset($GLOBALS['__SESSION']["s_user"])) {
        if (!activate_user($GLOBALS['__SESSION']["s_user"], $GLOBALS['__SESSION']["s_pass"])) {
            logout();
        }
        $GLOBALS["lang"] = $GLOBALS['__SESSION']["s_lang"];
        $GLOBALS["language"] = $GLOBALS['__SESSION']["s_lang"];
        require "./_lang/" . $GLOBALS["language"] . ".php";
        require "./_lang/" . $GLOBALS["language"] . "_mimes.php";
    } else {
        if (isset($GLOBALS['__POST']["p_pass"])) {
            $p_pass = $GLOBALS['__POST']["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($GLOBALS['__POST']["p_user"])) {
            // Check Login
            if (!activate_user(stripslashes($GLOBALS['__POST']["p_user"]), md5(stripslashes($p_pass)))) {
                logout();
            }
            $GLOBALS['__SESSION']["s_lang"] = $GLOBALS['__POST']["lang"];
            return;
        } else {
            // Ask for Login
            show_header($GLOBALS["messages"]["actlogin"]);
            echo "<BR><TABLE width=\"300\"><TR><TD colspan=\"2\" class=\"header\" nowrap><B>";
            echo $GLOBALS["messages"]["actloginheader"] . "</B></TD></TR>\n<FORM name=\"login\" action=\"";
            echo make_link("login", NULL, NULL) . "\" method=\"post\">\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscusername"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_user\" type=\"text\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscpassword"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_pass\" type=\"password\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["misclang"] . ":</TD><TD align=\"right\">";
            echo "<SELECT name=\"lang\">\n";
            @(include "./_lang/_info.php");
            echo "</SELECT></TD></TR>\n";
            echo "<TR><TD colspan=\"2\" align=\"right\"><INPUT type=\"submit\" value=\"";
            echo $GLOBALS["messages"]["btnlogin"] . "\"></TD></TR>\n</FORM></TABLE><BR>\n";
            ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.login) document.login.p_user.focus();
// -->
</script><?php 
            show_footer();
            exit;
        }
    }
}
Ejemplo n.º 24
0
function login()
{
    global $my;
    if (isset($GLOBALS['__SESSION']["s_user"])) {
        if (!activate_user($GLOBALS['__SESSION']["s_user"], $GLOBALS['__SESSION']["s_pass"])) {
            logout();
        }
    } else {
        if (isset($GLOBALS['__POST']["p_pass"])) {
            $p_pass = $GLOBALS['__POST']["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($GLOBALS['__POST']["p_user"])) {
            // Check Login
            if (!activate_user(stripslashes($GLOBALS['__POST']["p_user"]), md5(stripslashes($p_pass)))) {
                logout();
            }
            return;
        } else {
            // Ask for Login
            show_header($GLOBALS["messages"]["actlogin"]);
            echo "<br><table width=\"300\"><tr><td colspan=\"2\" class=\"header\" nowrap><b>";
            echo $GLOBALS["messages"]["actloginheader"] . "</b></td></tr>\n<form name=\"login\" action=\"";
            echo make_link("login", null, null) . "\" method=\"post\">\n";
            echo "<tr><td>" . $GLOBALS["messages"]["miscusername"] . ":</td><td align=\"right\">";
            echo "<input name=\"p_user\" type=\"text\" value=\"" . $my->username . "\" size=\"25\"></td></tr>\n";
            echo "<tr><td>" . $GLOBALS["messages"]["miscpassword"] . ":</td><td align=\"right\">";
            echo "<input name=\"p_pass\" type=\"password\" size=\"25\"></td></tr>\n";
            echo "<tr><td>" . $GLOBALS["messages"]["misclang"] . ":</td><td align=\"right\">";
            echo "<select name=\"lang\">\n";
            @(include _QUIXPLORER_PATH . "/languages/_info.php");
            echo "</select></td></tr>\n";
            echo "<tr><td colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"";
            echo $GLOBALS["messages"]["btnlogin"] . "\"></td></tr>\n</form></table><br>\n";
            ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.login) document.login.p_user.focus();
// -->
</script><?php 
            show_footer();
            exit;
        }
    }
}
Ejemplo n.º 25
0
function reset() {
	for (i = 0; i < $('#permform').raw().elements.length; i++) {
		element = $('#permform').raw().elements[i];
		if (element.id.substr(0,8) == 'default_') {
			$('#' + element.id.substr(8)).raw().checked = element.checked;
		}
	}
}
</script>
<h2><?php 
echo format_username($UserID, $Username);
?>
 > Permissions</h2>
<div class="linkbox">
	[<a href="#" onclick="reset();return false;">Defaults</a>]
</div>
<div class="box pad">
	Before using permissions, please understand that it allows you to both add and remove access to specific features. If you think that to add access to a feature, you need to uncheck everything else, <strong>YOU ARE WRONG</strong>. The checkmarks on the left, which are grayed out, are the standard permissions granted by their class, any changes you make to the right side will overwrite this. It's not complicated, and if you screw up, click the defaults link at the top. It will reset the user to their respective features granted by class, then you can check or uncheck the one or two things you want to change. <strong>DO NOT UNCHECK EVERYTHING.</strong> If you need further clarification, ask A9 before using this tool.
</div>
<form name="permform" id="permform" method="post" action="">
<input type="hidden" name="action" value="permissions" />
<input type="hidden" name="id" value="<?php 
echo $_REQUEST['userid'];
?>
" />
<?
permissions_form();
?>
</form>
<? show_footer(); ?>
Ejemplo n.º 26
0
function generate_status()
{
    global $context, $command_line, $db_show_debug;
    $context['debug'] = empty($db_show_debug) ? false : true;
    show_header();
    if (strpos(strtolower(PHP_OS), 'win') === 0) {
        get_windows_data();
    } else {
        get_linux_data();
    }
    get_mysql_data();
    if ($command_line) {
        if (!empty($context['operating_system']['name'])) {
            echo 'Operating System:   ', trim($context['operating_system']['name']), "\n";
        }
        if (!empty($context['cpu_info'])) {
            echo 'Processor:          ', trim($context['cpu_info']['model']), ' (', trim($context['cpu_info']['hz']), $context['cpu_info']['frequency'], ')', "\n";
        }
        if ($context['debug'] && !empty($context['lastserverreboot'])) {
            echo 'Server Last Reboot:        ', date(DATE_RSS, $context['lastserverreboot']), "\n";
        }
        if (isset($context['load_averages'])) {
            echo 'Load averages:      ', implode(', ', $context['load_averages']), "\n";
        }
        if (!empty($context['running_processes'])) {
            echo 'Current processes:  ', count($context['running_processes']), ' (', !empty($context['num_sleeping_processes']) ? $context['num_sleeping_processes'] . ' sleeping, ' : '', $context['num_running_processes'], ' running, ', $context['num_zombie_processes'], ' zombie)', "\n";
        }
        if (!empty($context['top_cpu_usage'])) {
            echo 'Processes by CPU:   ';
            $temp = array();
            foreach ($context['top_cpu_usage'] as $proc) {
                $temp[$proc['percent']] = $proc['name'] . ($proc['number'] > 1 ? ' (' . $proc['number'] . ') ' : ' ') . number_format($proc['percent'], 1) . '%';
            }
            krsort($temp);
            echo implode(', ', $temp), "\n";
        }
        if (!empty($context['memory_usage'])) {
            echo 'Memory usage:       ', round($context['memory_usage']['used'] * 100 / $context['memory_usage']['total'], 3), '% (', $context['memory_usage']['used'], 'k / ', $context['memory_usage']['total'], 'k)', "\n";
        }
        if (isset($context['memory_usage']['swap_used'])) {
            echo 'Swap usage:         ', round($context['memory_usage']['swap_used'] * 100 / max(1, $context['memory_usage']['swap_total']), 3), '% (', $context['memory_usage']['swap_used'], 'k / ', $context['memory_usage']['swap_total'], 'k)', "\n";
        }
        if (!empty($context['mysql_processes']) || !empty($context['mysql_num_sleeping_processes']) || !empty($context['mysql_num_locked_processes'])) {
            echo 'MySQL processes:    ', $context['mysql_num_running_processes'] + $context['mysql_num_locked_processes'] + $context['mysql_num_sleeping_processes'], ' (', $context['mysql_num_sleeping_processes'], ' sleeping, ', $context['mysql_num_running_processes'], ' running, ', $context['mysql_num_locked_processes'], ' locked)', "\n";
        }
        if (!empty($context['mysql_statistics'])) {
            echo "\n", 'MySQL statistics:', "\n";
            foreach ($context['mysql_statistics'] as $stat) {
                $warning = isset($stat['max']) && $stat['value'] > $stat['max'] || isset($stat['min']) && $stat['value'] < $stat['min'];
                $warning = $warning ? '(should be ' . (isset($stat['min']) ? '>= ' . $stat['min'] . ' ' : '') . (isset($stat['max'], $stat['min']) ? 'and ' : '') . (isset($stat['max']) ? '<= ' . $stat['max'] : '') . ')' : '';
                echo sprintf('%-34s%-6.6s %34s', $stat['description'] . ':', round($stat['value'], 4), $warning), "\n";
            }
        }
        return;
    }
    echo '
		<div class="panel">
			<h2>Basic Information</h2>

			<div class="righttext">', $context['current_time'], '</div>
			<table width="100%" cellpadding="2" cellspacing="0" border="0">';
    if (!empty($context['operating_system']['name'])) {
        echo '
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">Operating System:</th>
					<td>', $context['operating_system']['name'], '</td>
				</tr>';
    }
    if (!empty($context['cpu_info'])) {
        echo '
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">Processor:</th>
					<td>', strtr($context['cpu_info']['model'], array('(R)' => '&reg;')), ' (', $context['cpu_info']['hz'], $context['cpu_info']['frequency'], ')</td>
				</tr>';
    }
    if ($context['debug'] && !empty($context['lastserverreboot'])) {
        echo '
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">Server Last Reboot:</th>
					<td>', date(DATE_RSS, $context['lastserverreboot']), '</td>
				</tr>';
    }
    if (isset($context['load_averages'])) {
        echo '
				<tr>
					<th style="text-align: left; width: 30%;">Load averages:</th>
					<td>', implode(', ', $context['load_averages']), '</td>
				</tr>';
    }
    if (!empty($context['running_processes'])) {
        echo '
				<tr>
					<th style="text-align: left; width: 30%;">Current processes:</th>
					<td>', count($context['running_processes']), ' (', !empty($context['num_sleeping_processes']) ? $context['num_sleeping_processes'] . ' sleeping, ' : '', $context['num_running_processes'], ' running, ', $context['num_zombie_processes'], ' zombie)</td>
				</tr>';
    }
    if (!empty($context['top_cpu_usage'])) {
        echo '
				<tr>
					<th style="text-align: left; width: 30%;">Processes by CPU:</th>
					<td>';
        $temp = array();
        foreach ($context['top_cpu_usage'] as $proc) {
            $temp[$proc['percent']] = htmlspecialchars($proc['name']) . ' <em>(' . $proc['number'] . ')</em> ' . number_format($proc['percent'], 1) . '%';
        }
        krsort($temp);
        echo implode(', ', $temp);
        echo '
					</td>
				</tr>';
    }
    if (!empty($context['memory_usage'])) {
        echo '
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">Memory usage:</th>
					<td>
						', round($context['memory_usage']['used'] * 100 / $context['memory_usage']['total'], 3), '% (', $context['memory_usage']['used'], 'k / ', $context['memory_usage']['total'], 'k)';
        if (isset($context['memory_usage']['swap_used'])) {
            echo '<br />
						Swap: ', round($context['memory_usage']['swap_used'] * 100 / max(1, $context['memory_usage']['swap_total']), 3), '% (', $context['memory_usage']['swap_used'], 'k / ', $context['memory_usage']['swap_total'], 'k)';
        }
        echo '
					</td>
				</tr>';
    }
    echo '
			</table>
		</div>';
    if (!empty($context['mysql_processes']) || !empty($context['mysql_num_sleeping_processes']) || !empty($context['mysql_num_locked_processes'])) {
        echo '
		<div class="panel">
			<h2>MySQL processes</h2>

			<table width="100%" cellpadding="2" cellspacing="0" border="0">
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">Total processes:</th>
					<td>', $context['mysql_num_running_processes'] + $context['mysql_num_locked_processes'] + $context['mysql_num_sleeping_processes'], ' (', $context['mysql_num_sleeping_processes'], ' sleeping, ', $context['mysql_num_running_processes'], ' running, ', $context['mysql_num_locked_processes'], ' locked)</td>
				</tr>
			</table>';
        if (!empty($context['mysql_processes'])) {
            echo '
			<br />
			<h2>Running processes</h2>

			<table width="100%" cellpadding="2" cellspacing="0" border="0" style="table-layout: fixed;">
				<tr>
					<th style="width: 14ex;">State</th>
					<th style="width: 8ex;">Time</th>
					<th>Query</th>
				</tr>';
            foreach ($context['mysql_processes'] as $proc) {
                echo '
				<tr>
					<td>', $proc['state'], '</td>
					<td style="text-align: center;">', $proc['time'], 's</td>
					<td><div style="width: 100%; ', strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ? 'max-' : '', 'height: 7em; overflow: auto;"><pre style="margin: 0; border: 1px solid gray;">';
                $temp = explode("\n", $proc['query']);
                $min_indent = 0;
                foreach ($temp as $line) {
                    preg_match('/^(\\t*)/', $line, $x);
                    if (strlen($x[0]) < $min_indent || $min_indent == 0) {
                        $min_indent = strlen($x[0]);
                    }
                }
                if ($min_indent > 0) {
                    $proc['query'] = '';
                    foreach ($temp as $line) {
                        $proc['query'] .= preg_replace('~^\\t{0,' . $min_indent . '}~i', '', $line) . "\n";
                    }
                }
                // Now, let's clean up the query.
                $clean = '';
                $old_pos = 0;
                $pos = -1;
                while (true) {
                    $pos = strpos($proc['query'], '\'', $pos + 1);
                    if ($pos === false) {
                        break;
                    }
                    $clean .= substr($proc['query'], $old_pos, $pos - $old_pos);
                    $str_pos = $pos;
                    while (true) {
                        $pos1 = strpos($proc['query'], '\'', $pos + 1);
                        $pos2 = strpos($proc['query'], '\\', $pos + 1);
                        if ($pos1 === false) {
                            break;
                        } elseif ($pos2 == false || $pos2 > $pos1) {
                            $pos = $pos1;
                            break;
                        }
                        $pos = $pos2 + 1;
                    }
                    $str = substr($proc['query'], $str_pos, $pos - $str_pos + 1);
                    $clean .= strlen($str) < 12 ? $str : '\'%s\'';
                    $old_pos = $pos + 1;
                }
                $clean .= substr($proc['query'], $old_pos);
                echo strtr(htmlspecialchars($clean), array("\n" => '<br />', "\r" => ''));
                echo '</pre></div></td>
				</tr>';
            }
            echo '
			</table>';
        }
        echo '
		</div>';
    }
    if (!empty($context['mysql_statistics'])) {
        echo '
		<div class="panel">
			<h2>MySQL Statistics</h2>

			<div class="righttext">MySQL ', $context['mysql_version'], '</div>
			<table width="100%" cellpadding="2" cellspacing="0" border="0">';
        // Has this server been running less than 1 day?
        if (!empty($context['lastserverreboot']) && time() - $context['lastserverreboot'] < 86400) {
            echo '
				<tr>
					<th valign="top" colspan="2" style="color: red;">We have detected this server was restarted less than 24 Hours ago. These recommendations may not be accurate.</td>
				</tr>';
        }
        foreach ($context['mysql_statistics'] as $stat) {
            $warning = isset($stat['max']) && $stat['value'] > $stat['max'] || isset($stat['min']) && $stat['value'] < $stat['min'];
            echo '
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">
						', $stat['description'], ':', isset($stat['setting']) ? '<br />
						<em style="font-size: smaller;' . ($warning ? 'font-weight: bold;' : '') . '">(' . $stat['setting'] . ')</em>' : '', '
					</th>
					<td>
						', round($stat['value'], 4);
            if (isset($stat['max']) || isset($stat['min'])) {
                echo '
						', $warning ? '<strong>' : '', '(should be ', isset($stat['min']) ? '&gt;= ' . $stat['min'] . ' ' : '', isset($stat['max'], $stat['min']) ? 'and ' : '', isset($stat['max']) ? '&lt;= ' . $stat['max'] : '', ')', $warning ? '</strong>' : '';
            }
            echo '
					</td>
				</tr>';
        }
        echo '
			</table>';
        if (isset($_GET['mysql_info'])) {
            echo '
			<br />
			<h2>MySQL status</h2>

			<table width="100%" cellpadding="2" cellspacing="0" border="0">';
            foreach ($context['mysql_status'] as $var) {
                echo '
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">', $var['name'], ':</th>
					<td>', $var['value'], '</td>
				</tr>';
            }
            echo '
			</table>

			<br />
			<h2>MySQL variables</h2>

			<table width="100%" cellpadding="2" cellspacing="0" border="0">';
            foreach ($context['mysql_variables'] as $var) {
                echo '
				<tr>
					<th valign="top" style="text-align: left; width: 30%;">', $var['name'], ':</th>
					<td>', $var['value'], '</td>
				</tr>';
            }
            echo '
			</table>';
        } else {
            echo '
			<br />
			<a href="', $_SERVER['PHP_SELF'], '?mysql_info=1">Show more information...</a><br />';
        }
        echo '
		</div>';
    }
    show_footer();
}
Ejemplo n.º 27
0
function show_msg($message, $url_forward = '')
{
    global $_SGLOBAL;
    obclean();
    $_SGLOBAL['extrahead'] = $url_forward ? '<meta http-equiv="refresh" content="0; url=' . $url_forward . '">' : '';
    show_header();
    print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t</table>
END;
    show_footer();
    exit;
}
Ejemplo n.º 28
0
<?php

require_once "../config.php";
require_once ABSPATH . "/header.php";
require_once ABSPATH . "/footer.php";
session_start();
date_default_timezone_set(TIMEZONE);
get_login_status();
show_header('api', $is_logged_in, URLROOT);
?>
<div class='content_box'>
    <h3>API pages</h3>
    <ul>
        <li><a href="api/getDepth.php">getDepth.php</a><br/>
        <li><a href="api/getTrades.php">getTrades.php</a><br/>
        <li><a href="api/ticker.php">ticker.php</a><br/>
    </ul>
</div>
<?php 
show_footer($is_logged_in, $is_admin, $is_verified);
Ejemplo n.º 29
0
Archivo: index.php Proyecto: cwcw/cms
function show_msg($message, $next = 0, $jump = 0)
{
    global $theurl;
    $nextstr = '';
    $backstr = '';
    obclean();
    if (empty($next)) {
        $backstr = "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
    } elseif ($next == 999) {
    } else {
        $url_forward = "{$theurl}?step={$next}";
        $nextstr = "<a href=\"{$url_forward}\">继续下一步</a>";
        if ($jump) {
            $nextstr .= "<script>setTimeout(\"window.location.href ='{$url_forward}';\", 1000);</script>";
        }
        $backstr = "<a href=\"javascript:history.go(-1);\">返回上一步</a>";
    }
    show_header();
    print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t<tr><td>&nbsp;</td></tr>
\t<tr><td>{$backstr} {$nextstr}</td></tr>
\t</table>
END;
    show_footer();
    exit;
}
Ejemplo n.º 30
0
function upg_comsenz_stats()
{
    global $db, $tablepre;
    global $language;
    //vot
    static $is_run = false;
    if ($is_run) {
        return;
    }
    if (getgpc('addfounder_contact', 'P')) {
        $email = strip_tags(getgpc('email', 'P'));
        $msn = strip_tags(getgpc('msn', 'P'));
        $qq = strip_tags(getgpc('qq', 'P'));
        if (!preg_match("/^[\\d]+\$/", $qq)) {
            $qq = '';
        }
        if (strlen($email) < 6 || !preg_match("/^[\\w\\-\\.]+@[\\w\\-\\.]+(\\.\\w+)+\$/", $email)) {
            $email = '';
        }
        if (strlen($msn) < 6 || !preg_match("/^[\\w\\-\\.]+@[\\w\\-\\.]+(\\.\\w+)+\$/", $msn)) {
            $msn = '';
        }
        $contact = serialize(array('qq' => $qq, 'msn' => $msn, 'email' => $email));
        $db->query("REPLACE {$tablepre}common_setting (skey, svalue) VALUES ('founder_contact', '{$contact}')");
        $is_run = ture;
        echo '<script type="text/javascript">document.getElementById("laststep").disabled=false;document.getElementById("laststep").value = \'' . lang('install_succeed') . '\';</script><iframe src="../" style="display:none"></iframe>' . "\r\n";
        show_header();
        echo '</div><div class="main" style="margin-top: -123px;"><ul style="line-height: 200%; margin-left: 30px;">';
        echo '<li><a href="../">' . lang('install_succeed') . '</a><br>';
        echo '<script>setTimeout(function(){window.location=\'../\'}, 2000);</script>' . lang('auto_redirect') . '</li>';
        echo '</ul></div>';
        show_footer();
    } else {
        show_header();
        $contact = array();
        $contact = unserialize($db->result($db->query("SELECT svalue FROM {$tablepre}common_setting WHERE skey='founder_contact'"), 0));
        $founder_contact = lang('founder_contact');
        $founder_contact = str_replace(array("\n", "\t"), array('<br>', '&nbsp;&nbsp;&nbsp;&nbsp;'), $founder_contact);
        echo '</div><div class="main" style="margin-top: -123px;">';
        echo $founder_contact;
        echo '<form action="' . $url_forward . '" method="post" id="postform">';
        echo "<input type='hidden' name='language' value='{$language}' />";
        //vot
        echo "<br><table width=\"360\" cellspacing=\"1\" border=\"0\" align=\"center\">" . "<tr height=\"30\"><td align=\"right\" >QQ:</td><td>&nbsp;&nbsp;<input  class=\"txt\" type=\"text\" value=\"{$contact['qq']}\" name=\"qq\" ></td></tr>\r\n\t\t \t\t<tr height=\"30\"><td align=\"right\">MSN:</td><td>&nbsp;&nbsp;<input  class=\"txt\" type=\"text\" value=\"{$contact['msn']}\" name=\"msn\" ></td></tr>\r\n\t\t \t\t<tr height=\"30\"><td align=\"right\">E-mail:</td><td>&nbsp;&nbsp;<input  class=\"txt\" type=\"text\" value=\"{$contact['email']}\" name=\"email\" ></td></tr>\r\n\t\t \t\t<tr align=\"center\" height=\"30\"><td colspan=\"2\"><input type=\"submit\" style=\"padding: 2px;\" name=\"addfounder_contact\" value=\"" . lang('install_submit') . "\"></td></tr></table>";
        echo '</form>';
        echo '<p style="text-align:right"><input type="button" style="padding: 2px;" onclick="window.location=\'index.php?method=ext_info&skip=1&language=' . $language . '\'" value="' . lang('skip_current') . '" /></center></p>';
        //vot
        echo '</div>';
        show_footer();
    }
}