aboutsummaryrefslogtreecommitdiff
path: root/tests/repetition.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/repetition.php')
-rw-r--r--tests/repetition.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/repetition.php b/tests/repetition.php
index f778275..8bc6388 100644
--- a/tests/repetition.php
+++ b/tests/repetition.php
@@ -6,14 +6,15 @@
// Import requisites.
require_once '../index.php';
+// Get input data.
+$code = CinisisHttpHelper::get_numeric_arg('code');
+$entry = CinisisHttpHelper::get_numeric_arg('entry');
+
// Draw the document.
$display = new CinisisDisplayHelper('Repetition finder');
-$form = $display->form_input_text('code') . $display->form_input_text('entry');
+$form = $display->form_input_text('code', $code) . $display->form_input_text('entry', $entry);
$display->form($form, 'repetition.php');
-// Get field code.
-$code = CinisisHttpHelper::get_numeric_arg('code');
-
// Get a db instance.
$isis = new CinisisDb();
@@ -22,7 +23,7 @@ if ($isis->db) {
// Get the number of entries.
$field = $isis->db->format['fields'][$code]['name'];
$entries = $isis->db->entries();
- $entry = CinisisHttpHelper::get_numeric_arg('entry') - 1;
+ $entry--;
// Query database.
do {
@@ -37,11 +38,11 @@ if ($isis->db) {
// Format output.
echo "<pre>\n";
+ echo "Selected field: $code: $field.\n";
echo "Showing entry $entry from $entries total entries.\n";
- echo "Selected field: $field.\n";
echo "Repetitions found: ". count($result[$field]) ."\n";
echo "\n";
- print_r($result);
+ print_r($result[$field]);
echo '</pre>';
}