コード例 #1
0
if (isset($_REQUEST["record"]) && $_REQUEST['record'] != '') {
    $recordid = vtlib_purify($_REQUEST["record"]);
    $oReport = new Reports($recordid);
    $oRep = new Reports();
    $secondarymodule = '';
    $secondarymodules = array();
    if (!empty($oRep->related_modules[$oReport->primodule])) {
        foreach ($oRep->related_modules[$oReport->primodule] as $key => $value) {
            if (isset($_REQUEST["secondarymodule_" . $value])) {
                $secondarymodules[] = vtlib_purify($_REQUEST["secondarymodule_" . $value]);
            }
        }
    }
    $secondarymodule = implode(":", $secondarymodules);
    $oReport->secmodule = $secondarymodule;
    $BLOCK1 = $oReport->sgetColumntoTotalSelected($oReport->primodule, $oReport->secmodule, $recordid);
    $report_column_tot->assign("BLOCK1", $BLOCK1);
    $report_column_tot->assign("RECORDID", $recordid);
} else {
    $primarymodule = vtlib_purify($_REQUEST["primarymodule"]);
    $oReport = new Reports();
    $secondarymodule = array();
    if (!empty($ogReport->related_modules[$primarymodule])) {
        foreach ($ogReport->related_modules[$primarymodule] as $key => $value) {
            $secondarymodule[] = vtlib_purify($_REQUEST["secondarymodule_" . $value]);
        }
    }
    $BLOCK1 = $oReport->sgetColumntoTotal($primarymodule, $secondarymodule);
    $report_column_tot->assign("BLOCK1", $BLOCK1);
}
//added to avoid displaying "No data avaiable to total" when using related modules in report.