aboutsummaryrefslogtreecommitdiff
path: root/apps/repetition.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-08-18 15:22:43 -0300
committerSilvio <silvio@devlet.com.br>2010-08-18 15:22:43 -0300
commitad8d8568b683e6935bec64abe88f79bf31706dd7 (patch)
tree43d00493cf8676acbcf4bec74bf44c717107ecd6 /apps/repetition.php
parent219aa7f6b4a19b723b0c25683801b1b5d502e9f4 (diff)
downloadcinisis-ad8d8568b683e6935bec64abe88f79bf31706dd7.tar.gz
cinisis-ad8d8568b683e6935bec64abe88f79bf31706dd7.tar.bz2
Adding audit and finder classes, cleanup and organization
Diffstat (limited to 'apps/repetition.php')
-rw-r--r--apps/repetition.php21
1 files changed, 6 insertions, 15 deletions
diff --git a/apps/repetition.php b/apps/repetition.php
index 7c7f245..6b7f9de 100644
--- a/apps/repetition.php
+++ b/apps/repetition.php
@@ -14,28 +14,19 @@ $field = CinisisHttpHelper::get_numeric_arg('field');
$display = new CinisisDisplayHelper('Repetition finder');
$form = $display->form_input_text('entry', $entry);
$form .= $display->form_input_text('field', $field);
-$display->form($form, 'repetition.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]) || count($result[$field_name]) < 2);
+ $field_name = $isis->getFieldName($field);
+ $result = $isis->nextRepetition($entry, $field_name);
// Navigation bar.
- $display->navbar($entry, $entries, $repetition, '&field='. $field);
+ $display->navbar($entry, $isis->entries, $repetition, '&field='. $field);
// Format output.
echo "<pre>\n";