Adding the start of a simple module - SimplePortfolio
[AOOS.git] / index.php
blob2fec9a9649bb2ceb92b0aa4ef47e6ff0b101fddd
1 <?php
3 include("tmp/header.php");
4 include("tmp/translatebox.php");
6 $start = microtime();
8 require_once("AOOSCore.php");
9 require_once("AOOSModel.php");
10 require_once("AOOSStorageDevice.php");
12 $core = new AOOSCore();
14 $model = new AOOSModel($core);
15 $s = new AOOSStorageDevice($core);
17 try
19 $index = array(
20 "foo",
21 "bar",
22 "baz"
25 $model->setColumnIndex($index);
27 # ################ #
28 # INSERTTION TEST! #
29 # ################ #
30 /* $model->setData("Nummer 1", -1, "foo");
31 $model->setData("Nummer 2", -1, "bar");
32 $model->setData("Nummer'\"3", -1, "ba");
33 $model->addRow();
34 $model->setData("Foo-value", -1, "foo");
35 $model->addRow();
36 $model->setData("Hejsa", -1, "foo");
37 $model->setData("Nummer 4", -1, "bar");
38 print_r($model->getColumn("foo", -2, -1));
39 print "<br />";
40 print_r($model->columnIndex());
42 $s->setStorageType("mysql");
43 $s->setTable("test");*/
44 // $s->insertModel($model);*/
47 # ############################### #
48 # INSERTION/SELECTION/UPDATE TEST #
49 # ############################### #
50 for ($i = 0; $i <= 10; $i++)
52 $model->addRow();
53 $model->setData($i, -1, "foo");
54 $model->setData($i, -1, "bar");
55 $model->setData($i, -1, "baz");
58 $s->setStorageType("mysql");
59 $s->setTable("test");
60 // $s->deleteFromModel($model, 1);
61 // $s->insertModel($model);
62 // $s->updateFromModel($model, "auto");
63 $f = "*";
64 $m = $s->selectModel($f, null, "0, 6");
65 print_r($m->getColumn("foo"));
67 # ################# #
68 # TIMING/PERFOMANCE #
69 # ################# #
70 /* $end = microtime();
71 $s = split(" ", $start);
72 $e = split(" ", $end);
73 $start = $s[1] + $s[0];
74 $end = $e[1] + $e[0];
75 print "&nbsp;".$start;
76 print "<br />";
77 print "-".$end."<br />";
78 print "----------------------------<br />";
79 print $end-$start;*/
82 catch (AOOSException $e)
86 $core->printExceptions();