$crosstableObj = new CrossTableReport($cross_array, $strSQL); if (postvalue("crosstable_refresh")) { $crosstableObj->ajax_refresh_crosstable(); exit(); } $xt->assign("select_group_x", "<select id=select_group_x onchange=\"refresh_group('" . postvalue("rname") . "', '" . $reportFilename . "');\">" . $crosstableObj->getGroupFields("x") . "</select>"); $xt->assign("select_group_y", "<select id=select_group_y onchange=\"refresh_group('" . postvalue("rname") . "', '" . $reportFilename . "');\">" . $crosstableObj->getGroupFields("y") . "</select>"); $grid_row["data"] = $crosstableObj->getCrossTableData(); $arr_res = $crosstableObj->getValuesControl(); $res = $arr_res[0]; $first_field = $arr_res[1]; if ($res) { $xt->assign("data_value", true); $xt->assign("select_data", "<select name=select_data id=select_data onchange='refresh_crosstable(true);return false;'>" . $res . "</select>"); $xt->assign("group_func", $crosstableObj->getRadioGroupFunctions()); //$arr_value=$crosstableObj->getSelectedValue(); //$field = $arr_value[postvalue("field")]; //$group_func=$crosstableObj->getTotalsName($crosstableObj->getGroupFunction($field,postvalue("group_func"))); $group_func = $crosstableObj->getTotalsName($crosstableObj->getCurrentGroupFunction()); $xt->assign("totals", $group_func); } if (count($grid_row["data"]) > 0) { $xt->assign("grid_row", $grid_row); $xt->assignbyref("group_header", $crosstableObj->getCrossTableHeader()); $sum_x = $rpt_array["group_fields"][count($rpt_array["group_fields"]) - 1]["sum_x"]; $sum_y = $rpt_array["group_fields"][count($rpt_array["group_fields"]) - 1]["sum_y"]; if ($sum_y) $xt->assign("td_row_summary", true); if ($sum_x) $xt->assign("td_col_summary", true);
$cross_array = array("tables" => $rpt_array["tables"], "group_fields" => $rpt_array["group_fields"], "totals" => $rpt_array["totals"], "table_type" => $rpt_array["table_type"]); $crosstableObj = new CrossTableReport($cross_array, $strSQL); if (postvalue("crosstable_refresh")) { $crosstableObj->ajax_refresh_crosstable(); exit; } $xt->assign("select_group_x", "<select id=select_group_x onchange=\"refresh_group('" . postvalue("rname") . "', '" . $reportFilename . "');\">" . $crosstableObj->getGroupFields("x") . "</select>"); $xt->assign("select_group_y", "<select id=select_group_y onchange=\"refresh_group('" . postvalue("rname") . "', '" . $reportFilename . "');\">" . $crosstableObj->getGroupFields("y") . "</select>"); $grid_row["data"] = $crosstableObj->getCrossTableData(); $arr_res = $crosstableObj->getValuesControl(); $res = $arr_res[0]; $first_field = $arr_res[1]; if ($res) { $xt->assign("data_value", true); $xt->assign("select_data", "<select name=select_data id=select_data onchange=\"refresh_crosstable('" . $reportFilename . "?rname=" . postvalue("rname") . "');return false;\">" . $res . "</select>"); $xt->assign("group_func", $crosstableObj->getRadioGroupFunctions($reportFilename . "?rname=" . postvalue("rname"))); $group_func = $crosstableObj->getTotalsName($crosstableObj->getCurrentGroupFunction()); $xt->assign("totals", $group_func); } if (count($grid_row["data"]) > 0) { $xt->assign("grid_row", $grid_row); $xt->assignbyref("group_header", $crosstableObj->getCrossTableHeader()); $sum_x = $rpt_array["group_fields"][count($rpt_array["group_fields"]) - 1]["sum_x"]; $sum_y = $rpt_array["group_fields"][count($rpt_array["group_fields"]) - 1]["sum_y"]; if ($sum_y) { $xt->assign("td_row_summary", true); } if ($sum_x) { $xt->assign("td_col_summary", true); } if ($sum_x && $sum_y) {