Ejemplo n.º 1
0
function wpbi_mce_tag($atts, $content = null)
{
    global $wpbi_url, $template_site, $wpdb, $wpbi_sql;
    //    remove_filter('the_content', 'wpautop');
    $template_site->set_filenames(array('iframe' => $wpbi_url['tpl']['root-path'] . $wpbi_url['tpl']['iframe']));
    extract(shortcode_atts(array('type' => 'table', 'id' => NULL, 'iframe' => 'n'), $atts));
    $code = '';
    if ($type == 'table') {
        if ($iframe == 'y') {
            //Get Key
            $vo_table = new vo_table($id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
            $dao_table = new dao_table($wpdb, $wpbi_sql['tname']['tables']);
            $vo_table = $dao_table->select($vo_table);
            $vo_table = $vo_table[0];
            $table_key = $vo_table->table_key;
            //Prepare output
            $template_site->assign_vars(array('IFRAME_JS_AUTOHEIGHT' => $wpbi_url['jquery']['iframe-auto-height'], 'IFRAME_SRC' => $wpbi_url['iframe']['src'] . '?t=' . $table_key, 'IFRAME_WIDTH' => '100%'));
            ob_start();
            $template_site->pparse('iframe');
            $iframe_output = ob_get_contents();
            ob_end_clean();
            $code = $iframe_output;
        } else {
            $code = get_html_4_table($id);
        }
    } else {
        if ($type == 'chart') {
            if ($iframe == 'y') {
                //Get Key
                $selected_charts = $id;
                $vo_chart = new vo_chart(NULL);
                $vo_chart->set_chart_id($selected_charts);
                $vo_chart->set_chart_key($selected_charts);
                $dao_chart = new dao_chart($wpdb, $wpbi_sql['tname']['charts']);
                $vo_chart = $dao_chart->select($vo_chart);
                $vo_chart = $vo_chart[0];
                $chart_key = $vo_chart->chart_key;
                //Prepare output
                $template_site->assign_vars(array('IFRAME_JS_AUTOHEIGHT' => $wpbi_url['jquery']['iframe-auto-height'], 'IFRAME_SRC' => $wpbi_url['iframe']['src'] . '?c=' . $chart_key, 'IFRAME_WIDTH' => is_numeric($vo_chart->width) ? $vo_chart->width . 'px' : '800px'));
                ob_start();
                $template_site->pparse('iframe');
                $iframe_output = ob_get_contents();
                ob_end_clean();
                $code = $iframe_output;
            } else {
                $code = get_html_4_chart($id);
            }
        }
    }
    return $code;
}
Ejemplo n.º 2
0
Archivo: view.php Proyecto: RA2WP/RA2WP
	
	You can find a copy of the GPL licence here:
	http://www.gnu.org/licenses/gpl-3.0.html
	
******************************************************************************/
//This file is used to display the created tables and charts
//import
include_once '../../../wp-load.php';
include_once 'includes.php';
/***********************************************************************************/
//Show sql errors in debug mode
if ($wpbi_settings['parameter']['debug']) {
    $wpdb->show_errors();
    error_reporting(E_ERROR | E_WARNING | E_PARSE);
} else {
    error_reporting(0);
}
if (isset($_GET['t'])) {
    echo '<html><body>';
    echo get_html_4_table($_GET['t']);
    echo '<br>';
    echo '</body></html>';
} else {
    if (isset($_GET['c'])) {
        echo get_iframe_chart_header();
        echo get_html_4_chart($_GET['c']);
        echo get_iframe_chart_footer();
    } else {
        echo 'No values';
    }
}