aboutsummaryrefslogtreecommitdiff
path: root/samples/read.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-08-18 12:01:13 -0300
committerSilvio <silvio@devlet.com.br>2010-08-18 12:01:13 -0300
commiteb217536079197bd1d17cda2c2adf4ba12bad504 (patch)
treeaa69b49fe3769430c9902fa1bc999c06aed58012 /samples/read.php
parent70539fe94d67cb4bdde7edce8a26873343d3c240 (diff)
downloadcinisis-eb217536079197bd1d17cda2c2adf4ba12bad504.tar.gz
cinisis-eb217536079197bd1d17cda2c2adf4ba12bad504.tar.bz2
Moving some apps to the samples folder
Diffstat (limited to 'samples/read.php')
-rw-r--r--samples/read.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/samples/read.php b/samples/read.php
new file mode 100644
index 0000000..835ae60
--- /dev/null
+++ b/samples/read.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Cinisis - Isis db reading tool.
+ */
+
+// Import requisites.
+require_once '../index.php';
+
+// Draw the document.
+$display = new CinisisDisplayHelper('Isis Reader');
+?>
+
+<table><tr>
+
+<?php
+
+$configs = array(
+ 0 => array(
+ 'implementation' => 'PhpIsis',
+ 'database' => 'dbname',
+ ),
+ 1 => array(
+ 'implementation' => 'BiblioIsis',
+ 'database' => 'dbname',
+ ),
+);
+
+foreach ($configs as $config) {
+ // Get a db instance.
+ $isis = new CinisisDb($config);
+
+ // Test connection.
+ if ($isis->db) {
+ $result = $isis->db->read(1);
+ $entries = $isis->db->entries();
+
+ // Format output.
+ echo '<td>';
+ echo '<pre>';
+ echo 'Implementation: '. $config['implementation'] ."\n";
+ echo "Rows: $entries\n";
+ print_r($result);
+ echo '</pre>';
+ echo '</td>';
+ }
+}
+
+?>
+
+</tr></table>
+</body>