Deprecated: Non-static method FfMessageHelper::getQuestionMessage() should not be called statically in
/hermes/walnacweb05/walnacweb05ac/b2615/moo.bdinc/FORMfields/examples/searchResults/searchResults2.php on line
26
Deprecated: Non-static method FfMenuHelper::getSectionHeader() should not be called statically in
/hermes/walnacweb05/walnacweb05ac/b2615/moo.bdinc/FORMfields/src/FfMessageHelper.php on line
92
Deprecated: Non-static method FfMenuHelper::getSectionFooter() should not be called statically in
/hermes/walnacweb05/walnacweb05ac/b2615/moo.bdinc/FORMfields/src/FfMessageHelper.php on line
114
| | |
|  | This example demonstrates how to pagify data, sort it and select it. |
| |
| | |
$resultsForm = new FfForm();
// This is our query. It can be any valid SQL query
$sql = "
SELECT
id,
CONCAT('

') AS 'Thumbnail',
CONCAT('
',url,'',description) As 'Description',
CONCAT('
',DATE_FORMAT(inserted_on,'%Y-%m-%d %h:%i %p'),'') AS 'Inserted On'
FROM ffce_websites
";
// Create the SearchResultsField and add it to our FfForm
$resultsForm->addField(new SearchResultsField("websites", "Websites", $sql, 5));
// Enable column sorting
$resultsForm->formFields["websites"]->tableSet->enableSort = true;
$resultsForm->formFields["websites"]->tableSet->sortTranslations = array("Inserted On" => "inserted_on", "Description" => "url");
$resultsForm->formFields["websites"]->tableSet->sortableHeadings = array("Description", "Inserted On");
// Capture and process any button presses
$resultsForm->getParameters();
$resultsForm->formFields["websites"]->addCheckboxColumn();
//$resultsForm->formFields["websites"]->hideBorder = true;
$resultsForm->formFields["websites"]->tableSet->hideColumns["id"] = true;
$values = $resultsForm->formFields["websites"]->getCheckboxValues();
if (sizeof($values) > 0) {
echo "Selected IDs: ";
print_r($values);
}
echo $resultsForm->getFieldTag("websites");
$ffForm = new FfForm();
$ffForm->addField(new SubmitField("ff_submit", "Print Selected"));
echo $ffForm->getTableTag();
?>