예제 #1
0
function process_report($report, $xml)
{
    $report = array();
    $sql = array();
    $query = array();
    $format = array();
    $result = array();
    foreach ($xml as $key => $value) {
        if ($key == 'title') {
            $title = $value;
        }
        if ($key == 'description') {
            $description = $value;
        }
        if ($key == 'query') {
            if (isset($value['_content'])) {
                $sql[$value['name']] = $value['_content'];
                $query[$value['name']] = $value['title'];
            } else {
                foreach ($value as $key_sql => $value_sql) {
                    $sql[$value_sql['name']] = $value_sql['_content'];
                    $query[$value_sql['name']] = $value_sql['title'];
                }
            }
        }
        if ($key == 'column') {
            $format = $value;
        }
    }
    require_once __ROOT__ . '/tpl/report_hdr.tpl';
    $timestamp = date('Ymdhis');
    $chartData = '';
    foreach ($sql as $sql_key => $sql_value) {
        $result = run_query($sql_value, $parms);
        if ($result) {
            foreach ($result as $key => $value) {
                if ($value) {
                    $html .= build_html($html, $chartData, $query, $sql_key, $value, $report_name, $title, $description, $parms, $format, $timestamp);
                }
            }
        }
    }
    echo $chartData;
    echo "</script>\n";
    echo $html;
    require_once __ROOT__ . '/tpl/report_ftr.tpl';
}
예제 #2
0
파일: tropy.php 프로젝트: h16o2u9u/rtoss
function do_random()
{
    global $id_pattern, $main_command, $id_pattern;
    $random_id = get_random_id();
    if (preg_match('/^' . $id_pattern . '$/', $random_id)) {
        build_html($random_id);
        print_jumpto($random_id);
    } else {
        $main_command = 'create';
        do_create();
    }
}
예제 #3
0
function resolve_replay($attachmentid, $attach, $aidencode, $is_archive)
{
    global $_G;
    // check if replay info is already in database
    $exits_attach = DB::fetch_first("select attachmentid from replayinfo where attachmentid=" . $attachmentid);
    if (empty($exits_attach)) {
        $table_att = DB::table(getattachtablebyaid($attachmentid));
        build_replay_info($attachmentid, $table_att);
    }
    $replayinfo_g = get_replayinfo($attachmentid);
    $time_len = get_game_lentime($replayinfo_g['length']);
    $data = get_replayplayerinfo($attachmentid);
    return build_html($replayinfo_g, $time_len, $data, $attach, $aidencode, $is_archive);
}