Example #1
0
function msg()
{
    if (isset($_POST["id"])) {
        //redirect search by id
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/menu.php/message/search/" . $_POST["id"]);
        die;
    }
    // search message template
    include_once "template/search.tpl";
    // leave message template
    include_once "template/form.tpl";
    // list everyone's msg
    html_div(100, 0, "#812919", 30);
    echo "Message Board";
    html_div_end();
    html_div(100, 40, "#ffffff", 15);
    for ($id = 1; $id < 50; $id++) {
        if (file_exists("./message/" . $id . ".txt")) {
            // print message from file
            $file = fopen("./message/" . $id . ".txt", "r");
            $fsize = filesize("./message/" . $id . ".txt");
            $message = fread($file, $fsize);
            html_div(100, 0, "#812919", 20);
            echo "Message ID: " . $id . "<br>";
            html_div_end();
            html_div(100, 0, "#ffffff", 20);
            // print message
            echo $message . "<br>";
            html_div_end();
        }
    }
    html_div_end();
}
Example #2
0
function search()
{
    //search form
    if (isset($_POST["id"])) {
        //search by id
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/menu.php/db/id/" . $_POST["id"]);
        die;
    }
    if (isset($_POST["name"])) {
        //search by name
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/menu.php/db/name/" . $_POST["name"]);
        die;
    }
    //include search engine template
    include_once "template/db_id.tpl";
    include_once "template/db_name.tpl";
    //list pokeDex
    html_div(100, 0, "#812919", 30);
    echo "PokeDex";
    html_div_end();
    $query = "SELECT * FROM pm_list";
    mysql_query("SET NAMES UTF8");
    $result = mysql_query($query);
    html_div(100, 25, "#ffffff", 15);
    while ($row = mysql_fetch_assoc($result)) {
        html_div(100, 10, "#ffffff", 20);
        echo $row["id"] . " " . $row["name"];
        html_div_end();
    }
    html_div_end();
}
Example #3
0
function dashboard()
{
    //redirect to search engine
    if (isset($_POST["name"])) {
        //search by name
        header("Location: http://" . $_SERVER['HTTP_HOST'] . "/menu.php/upload/search/" . $_POST["name"]);
        die;
    }
    // Search / Upload Form template
    include_once "template/up_search.tpl";
    include_once "template/upload.tpl";
    // Pokemon Box list
    html_div(100, 0, "#812919", 30);
    echo "PokeMon Box";
    html_div_end();
    $PokemonBoxList = scandir("./pc/");
    foreach ($PokemonBoxList as $value) {
        if ($value == "." || $value == "..") {
            continue;
        }
        echo $value . "<br>";
    }
}
Example #4
0
function include_module()
{
    global $module_name, $debug;
    // for urlencode string
    $module_name = urldecode($module_name);
    // for trace debug msg
    if ($debug == 1) {
        echo "including  module: " . $module_name . "<br>";
    }
    // find the module file inside module folder
    if (file_exists("./module/" . $module_name . ".php")) {
        // use ./menu.php/module/function/
        // to access the website
        include_once "./module/" . $module_name . ".php";
    } else {
        if (file_exists("./module/" . $module_name)) {
            // some people forget to delete .php behind the module name
            // you can also add the .php extension on the URL
            // use ./menu.php/module.php/function/
            // to access the website
            include_once "./module/" . $module_name;
        } else {
            // error to include module
            html_div(100, 0, "#ffffff", 20);
            echo "[Error] Fail to include module :" . $module_name . ".<br>";
            html_div_end();
            return;
        }
    }
}
Example #5
0
<head>
    <title>PokeMon Center</title>
    <link href='http://fonts.googleapis.com/css?family=Black+Ops+One' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="http://<?php 
echo $_SERVER['HTTP_HOST'];
?>
/CSS/style.css">
</head>

<body style="margin:0;">

<?php 
//template
include_once "./template/menu.tpl";
//call function
initial();
//hello message
if ($module_name == "" && $function_name == "") {
    html_div(100, 0, "#ffffff", 30);
    echo "Welcome to Pokemon Center.";
    html_div_end();
    html_img("http://" . $_SERVER['HTTP_HOST'] . "/img/chansey.png");
}
//template
include_once "./template/bottom.tpl";
?>

</body>

</html>