Esempio n. 1
0
<?php

header('Content-Type: text/html; charset=utf8');
include "DBcontent.php";
include "menu.php";
//var_dump($_REQUEST);
if (!isset($_REQUEST["menu_op"])) {
    $_REQUEST["menu_op"] = "總覽";
}
//use for test
//var_dump($_REQUEST);
//echo "<br>";
//default DB=full display
$DB_display = array("full", array());
//retrieve column names
$col_names = get_column_name();
//make menu
$menu = new menu();
//retrieve menu operation
if (isset($_GET["ID"])) {
    $menu->create_profile($_GET["ID"]);
} else {
    $menu->switchform($_REQUEST["menu_op"]);
}
function make_page($menu, $form, $DBcontent, $message)
{
    $page = "\n    <html>\n    <head>\n    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n    <title>尚肯產品資料庫</title>\n    </head>\n    <body>\n    <div id='wrapper'> \n    <div id='menu' style='text-align:center'>\n    {$menu}\n    </div>\n\n    <div id='message' style='text-align:center'>\n    {$message}\n    </div>\n    \n    <div id='form' style='text-align:center'>\n    {$form}\n    </div>\n    \n    <div id='DB' style='text-align:center'>\n    {$DBcontent}\n    </div>\n    \n    </div>\n    </body>\n    </html>";
    return $page;
}
echo make_page($menu->display_menu(), $menu->form, DB_content($DB_display), $menu->message);