public static function get_page($page = 'formulir')
 {
     // echo 'asuu';
     $str = '<!DOCTYPE html>';
     $str .= '<html>';
     $str .= GameDev::get_html_header();
     $str .= '<body>';
     $str .= GameDev::get_page_nav($page);
     if ($page === 'formulir') {
         $str .= GameDev::get_page_intro();
         $str .= GameDev::get_survey_form();
     } else {
         if ($page === 'hasil') {
             $str .= GameDev::get_data_visualization_page();
         } else {
             $str .= 'tiada parameter';
         }
     }
     $str .= GameDev::get_page_footer();
     $str .= '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>';
     $str .= '<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>';
     // $str .= '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>';
     $str .= '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
     $str .= '<script type="text/javascript" src="js/markerclusterer.js"></script>';
     $str .= '<script type="text/javascript" src="js/gamedev.js"></script>';
     $str .= '</body>';
     $str .= '</html>';
     echo $str;
     unset($str);
 }
示例#2
0
/**
 * Step 3: Define the Slim application routes
 *
 * Here we define several Slim application routes that respond
 * to appropriate HTTP request methods. In this example, the second
 * argument for `Slim::get`, `Slim::post`, `Slim::put`, `Slim::patch`, and `Slim::delete`
 * is an anonymous function.
 */
// GET route
$app->get('/', function () {
    $gamedev = new GameDev();
    $gamedev->get_data_visualization_page();
});
$app->get('/hasil', function () {
    $gamedev = new GameDev();
    $gamedev->get_data_visualization_page();
});
$app->get('/direktori(/:alfabet)', function ($alphabet = 'a') {
    $gamedev = new GameDev();
    $gamedev->get_studios_directory_page($alphabet);
});
$app->get('/formulir(/:kunci)', function ($key = null) {
    $gamedev = new GameDev();
    $gamedev->get_entry_data_form($key);
});
$app->get('/api(/:type)', function ($type = '') {
    // print_r($type);
    $gamedev = new GameDev();
    $options = array('callback' => trim($_GET['callback']));
    if ($type === 'hasil') {
        $gamedev->get_api_results($options);