From 0956138b3dae192c3bb8db2b769e7526d1ec489e Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 20 Aug 2010 18:49:49 -0300 Subject: Adding simple search app --- apps/search.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 apps/search.php (limited to 'apps') diff --git a/apps/search.php b/apps/search.php new file mode 100644 index 0000000..cd75339 --- /dev/null +++ b/apps/search.php @@ -0,0 +1,48 @@ +formInputText('entry', $entry); +$form .= $display->formInputText('fid', $fid); +$form .= $display->formInputText('sid', $sid); +$form .= $display->formInputText('text', $text); +$script = basename(__FILE__); +$display->form($form, $script); + +// Get a db instance. +$isis = new IsisFinder(); + +// Setup database and entry number. +if ($isis) { + // Query database. + $field = $isis->getFieldArray($fid); + $item = ($sid == 'main') ? 'main' : $isis->getSubfieldName($fid, $sid); + list($entry, $result) = $isis->nextResult($field, $item, $text, $entry); + + // Navigation bar. + $display->navbar($entry, $isis->entries, $script, '&fid='. $fid . '&sid='. $sid . '&text='. $text); + + // Format output. + $display->pre("Selected field: $fid: ". $field['name'] ."."); + $display->pre("Selected item: $sid: $item."); + $display->pre("Showing entry ". $display->entryLink($entry) ." from ". $isis->entries ." total entries."); + $display->pre("Repetitions found: ". count($result[$field['name']]) ."."); + $display->dump($result[$field['name']]); +} + +$display->footer(); -- cgit v1.2.3