From ad8d8568b683e6935bec64abe88f79bf31706dd7 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 18 Aug 2010 15:22:43 -0300 Subject: Adding audit and finder classes, cleanup and organization --- apps/field.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'apps/field.php') diff --git a/apps/field.php b/apps/field.php index 13320e6..f34bffa 100644 --- a/apps/field.php +++ b/apps/field.php @@ -14,28 +14,19 @@ $field = CinisisHttpHelper::get_numeric_arg('field'); $display = new CinisisDisplayHelper('Field finder'); $form = $display->form_input_text('entry', $entry); $form .= $display->form_input_text('field', $field); -$display->form($form, 'field.php'); +$display->form($form, basename(__FILE__)); // Get a db instance. -$isis = new CinisisDb(); +$isis = new IsisFinder(); // Setup database and entry number. -if ($isis->db) { - // Get the number of entries. - $field_name = $isis->db->format['fields'][$field]['name']; - $entries = $isis->db->entries(); - $entry--; - +if ($isis) { // Query database. - do { - $result = $isis->db->read(++$entry); - if ($entry == $entries) { - break; - } - } while (!isset($result[$field_name])); + $field_name = $isis->getFieldName($field); + $result = $isis->nextField($entry, $field_name); // Navigation bar. - $display->navbar($entry, $entries, $repetition, '&field='. $field); + $display->navbar($entry, $isis->entries, $repetition, '&field='. $field); // Format output. echo "
\n";
-- 
cgit v1.2.3