Location: PHPKode > projects > HypatiaDB > hypatiadb/aggregate2.php
<?php
include("common_db.php");
include("functions.php");

$db = $_REQUEST['database'];
$table = $_REQUEST['table'];

dbconnect($host, $username, $password); //from common_db.php
$strings = loadStrings($lang, 'AGGR2');
headers();
html();
head($strings['AG2_TITLE']);
menu();
navpane();
?>
	<div id="mainpane">
		<form action="generate-aggregate.php" method="post" class="standalone lblock">
<?php
//get all fields
mysql_select_db($db);
$fields = mysql_query("DESCRIBE `$table`");
while($field = mysql_fetch_array($fields)) {
	echo('<div>');
		echo('<h3>' . $field['Field'] . '</h3>');
		echo('<label for="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-avg"><input class="jig" type="checkbox" name="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-avg" value="" />' . $strings['AG2_AVG'] . '</label>');
		echo('<label for="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-count"><input class="jig" type="checkbox" name="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-count" value="" />' . $strings['AG2_COUNT'] . '</label>');
		echo('<label for="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-min"><input class="jig" type="checkbox" name="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-min" value="" />' . $strings['AG2_MIN'] . '</label>');
		echo('<label for="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-max"><input class="jig" type="checkbox" name="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-max" value="" />' . $strings['AG2_MAX'] . '</label>');
		echo('<label for="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-sum"><input class="jig" type="checkbox" name="' . htmlspecialchars($field['Field'], ENT_QUOTES) . '-sum" value="" />' . $strings['AG2_SUM'] . '</label>');
	echo('</div>');
}

echo('<input type="hidden" name="database" value="' . htmlspecialchars($db, ENT_QUOTES) . '" />');
echo('<input type="hidden" name="table" value="' . htmlspecialchars($table, ENT_QUOTES) . '" />');
echo('<input type="submit" value="' . $strings['AG2_SUBMIT'] . '" />');
?>
		</form>
	</div>
<?php
endhtml();
?>
Return current item: HypatiaDB