createAggregate($_REQUEST['name'], $_REQUEST['basetype'], $_REQUEST['sfunc'], $_REQUEST['stype'], $_REQUEST['ffunc'], $_REQUEST['initcond'], $_REQUEST['sortop'], $_REQUEST['aggrcomment']); if ($status == 0) { $_reload_browser = true; doDefault($lang['straggrcreated']); } else { doCreate($lang['straggrcreatedbad']); } } /** * Displays a screen for create a new aggregate function */ function doCreate($msg = '') { global $data, $misc; global $lang; if (!isset($_REQUEST['name'])) $_REQUEST['name'] = ''; if (!isset($_REQUEST['basetype'])) $_REQUEST['basetype'] = ''; if (!isset($_REQUEST['sfunc'])) $_REQUEST['sfunc'] = ''; if (!isset($_REQUEST['stype'])) $_REQUEST['stype'] = ''; if (!isset($_REQUEST['ffunc'])) $_REQUEST['ffunc'] = ''; if (!isset($_REQUEST['initcond'])) $_REQUEST['initcond'] = ''; if (!isset($_REQUEST['sortop'])) $_REQUEST['sortop'] = ''; if (!isset($_REQUEST['aggrcomment'])) $_REQUEST['aggrcomment'] = ''; $misc->printTrail('schema'); $misc->printTitle($lang['strcreateaggregate'], 'pg.aggregate.create'); $misc->printMsg($msg); echo "
\n"; } /** * Function to save after altering an aggregate */ function doSaveAlter() { global $data, $lang; // Check inputs if (trim($_REQUEST['aggrname']) == '') { doAlter($lang['straggrneedsname']); return; } $status = $data->alterAggregate($_REQUEST['aggrname'], $_REQUEST['aggrtype'], $_REQUEST['aggrowner'], $_REQUEST['aggrschema'], $_REQUEST['aggrcomment'], $_REQUEST['newaggrname'], $_REQUEST['newaggrowner'], $_REQUEST['newaggrschema'], $_REQUEST['newaggrcomment']); if ($status == 0) doDefault($lang['straggraltered']); else { doAlter($lang['straggralteredbad']); return; } } /** * Function to allow editing an aggregate function */ function doAlter($msg = '') { global $data, $misc; global $lang; $misc->printTrail('aggregate'); $misc->printTitle($lang['stralter'], 'pg.aggregate.alter'); $misc->printMsg($msg); echo "\n"; } /** * Show confirmation of drop and perform actual drop of the aggregate function selected */ function doDrop($confirm) { global $data, $misc; global $lang, $_reload_browser; if ($confirm) { $misc->printTrail('aggregate'); $misc->printTitle($lang['strdrop'], 'pg.aggregate.drop'); echo "", sprintf($lang['strconfdropaggregate'], htmlspecialchars($_REQUEST['aggrname'])), "
\n"; echo "\n"; } else { $status = $data->dropAggregate($_POST['aggrname'], $_POST['aggrtype'], isset($_POST['cascade'])); if ($status == 0) { $_reload_browser = true; doDefault($lang['straggregatedropped']); } else doDefault($lang['straggregatedroppedbad']); } } /** * Show the properties of an aggregate */ function doProperties($msg = '') { global $data, $misc; global $lang; $misc->printTrail('aggregate'); $misc->printTitle($lang['strproperties'],'pg.aggregate'); $misc->printMsg($msg); $aggrdata = $data->getAggregate($_REQUEST['aggrname'], $_REQUEST['aggrtype']); if($aggrdata->recordCount() > 0 ) { // Display aggregate's info echo "{$lang['strname']} | \n"; echo "\t", htmlspecialchars($_REQUEST['aggrname']), " | \n
---|---|
{$lang['straggrbasetype']} | \n"; echo "\t", htmlspecialchars($_REQUEST['aggrtype']), " | \n
{$lang['straggrsfunc']} | \n"; echo "\t", htmlspecialchars($aggrdata->fields['aggtransfn']), " | \n
{$lang['straggrstype']} | \n"; echo "\t", htmlspecialchars($aggrdata->fields['aggstype']), " | \n
{$lang['straggrffunc']} | \n"; echo "\t", htmlspecialchars($aggrdata->fields['aggfinalfn']), " | \n
{$lang['straggrinitcond']} | \n"; echo "\t", htmlspecialchars($aggrdata->fields['agginitval']), " | \n
{$lang['straggrsortop']} | \n"; echo "\t", htmlspecialchars($aggrdata->fields['aggsortop']), " | \n
{$lang['strowner']} | \n"; echo "\t", htmlspecialchars($aggrdata->fields['usename']), " | \n
{$lang['strcomment']} | \n"; echo "\t", $misc->printVal($aggrdata->fields['aggrcomment']), " | \n
{$lang['strnodata']}
\n"; echo "