예제 #1
0
}
// show a "index" page with general stats. This is the default as well
if ($func == "index") {
    global $useppllist;
    global $b3_status_url;
    // show general data for index page
    welcometext();
    echo "<br/>";
    if ($useppllist == 1) {
        $fp = @fopen($b3_status_url, "r");
        if (@fread($fp, 4096)) {
            currentplayers();
            echo "<br/>";
        }
    }
    menubox(1);
    //echo "<br/>";
    topplayers("skill");
    echo "<br/>";
    global_awards();
    echo "<br/>";
    global_lame_awards();
}
if ($func == "medal") {
    if (isset($_GET['fname'])) {
        $fname = $_GET['fname'];
        eval($fname . "();");
    }
}
// Close the page properly (footer)
displayfooter();
예제 #2
0
파일: utils.php 프로젝트: CSU-GH/gpxe
/**
 * Output html code to display all compile options as a table
 *
 * @param array $flags array of compile options
 *
 * @return void
 */
function echo_flags ( $flags )
{
    global $flag_table;

    echo "<table>\n";

	foreach ( $flag_table as $key => $props ) {

        // Hide parameters from users that should not be changed.
        $hide_from_user = isset ( $props["hide_from_user"] ) ? $props["hide_from_user"] : "******";

        $flag = $props["flag"];
        $type = $props["type"];

        $value = isset ( $flags[$flag] ) ? $flags[$flag] : '';

        if ( $hide_from_user == "yes" ) {

            // Hidden flags cannot not be set by the user.  We use hidden form
            // fields to keep them at their default values.
            if ( $type != "header" ) {
                echo hidden ( $flag, $value );
            }

        } else {

            // Flag (gPXE compile option) should be displayed to user

            if ( $type == "header" ) {

                $label = $props["label"];
                echo "<td colspan=2><hr><h3>$label</h3><hr></td>";

            } else if ($type == "on/off" ) {

                echo "<td>", checkbox ( $flag, $value ), "</td><td><strong>$flag</strong></td>";

            } else {   // don't display checkbox for non-on/off flags

                echo "<td>&nbsp;</td><td><strong>$flag: </strong>";

                if ($type == "choice" ) {
                    $options = $props["options"];
                    echo menubox($flag, $options, $value);

                } else {

                    echo textbox($flag, $value, ($type == "integer" ||
                                                 $type == "integer-hex"
                                                     ? 7 : 25));
                }
                echo "</td>";
            }
            echo "</tr>\n";

            if ( $type != "header" ) {
				echo "<tr><td>&nbsp;</td>";
				echo "<td>\n";
				if ( is_file ( "doc/$flag.html" ) ) {
					include_once "doc/$flag.html";
				}
				echo "\n</td></tr>\n";
            }
        }
    }
    echo "</table>";
}
예제 #3
0
<?php

if (!isset($_SESSION['loginid']) || !isset($_SESSION['username'])) {
    if (isset($_POST['login'])) {
        $username = mysql_real_escape_string(strip_tags($_POST['username']));
        $password = md5(mysql_real_escape_string(strip_tags($_POST['password'])));
        $query = "select * from users where username='******' AND password='******'";
        $result = mysql_query($query);
        if (mysql_num_rows($result) != 1) {
            echo "Username and password is wrong";
            include "login.php";
        } else {
            $row = mysql_fetch_array($result);
            $_SESSION['loginid'] = $row['userid'];
            $_SESSION['username'] = $row['username'];
            menubox();
            echo "login success";
        }
    } else {
        include "login.php";
    }
} else {
    menubox();
    echo "<br>";
    echo "already login";
}