예제 #1
0
//$tblFriend->displayAddFormTop();
#order the table by any field you want
$tblFriend->addOrderBy("ORDER BY fldName");
#add a button at the bottom of the table which simply goes to another page
$tblFriend->addButton("No More Friends. Take Me Home", "./");
//$tblFriend->turnOffSorting(); //turns off ajax sorting by pressing header links
//$tblFriend->disableTableHeaders(); //disables table headers from displaying
//$tblFriend->turnOffAjaxEditing(); //turns of ajax editing of all data
#some logic if we want to add a field automatically on add
$state = "";
if (isset($_REQUEST['state'])) {
    $state = $_REQUEST['state'];
}
if ($state) {
    $tblFriend->addWhereClause("WHERE fldState = \"{$state}\"");
    $tblFriend->omitAddField("fldState");
    $tblFriend->addValueOnInsert("fldState", $state);
}
echo "<h3>Example3 tests FormatFieldWithFunction, defineRelationship, Multiple Filters, and a Date Picker</h3>\n";
$tblFriend->showTable();
echo "<p>Above is a table of my friends. The javascript masking and validation are in the fields 'phone' and 'zip' (required). There's a datapicker on the 'Date we Met' field.</p>\n";
#self-defined functions used for formatFieldWithFunction
function addDollarSign($val)
{
    return "\$" . $val;
}
function displayImage($val)
{
    return "<img src=\"uploads/{$val}\" width=\"90\">";
}
function myFunctionAfterAdd($array)