added missing files, added README, refactored Database.php
authorSven Hecht <sven@sven-laptop.(none)>
Wed, 24 Jun 2009 20:39:13 +0000 (22:39 +0200)
committerSven Hecht <sven@sven-laptop.(none)>
Wed, 24 Jun 2009 20:39:13 +0000 (22:39 +0200)
web/cgi/validate [new file with mode: 0755]
web/img/icons/arrow_refresh.png [new file with mode: 0755]
web/img/icons/award.png [new file with mode: 0755]
web/php/Season.php [new file with mode: 0644]
web/php/SeasonScore.php [new file with mode: 0644]
web/php/page/season.pg [new file with mode: 0644]
web/setup/README [new file with mode: 0644]

diff --git a/web/cgi/validate b/web/cgi/validate
new file mode 100755 (executable)
index 0000000..a96d454
Binary files /dev/null and b/web/cgi/validate differ
diff --git a/web/img/icons/arrow_refresh.png b/web/img/icons/arrow_refresh.png
new file mode 100755 (executable)
index 0000000..0de2656
Binary files /dev/null and b/web/img/icons/arrow_refresh.png differ
diff --git a/web/img/icons/award.png b/web/img/icons/award.png
new file mode 100755 (executable)
index 0000000..658c711
Binary files /dev/null and b/web/img/icons/award.png differ
diff --git a/web/php/Season.php b/web/php/Season.php
new file mode 100644 (file)
index 0000000..8118d0f
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+       
+       class Season
+       {
+           public $ID;
+               public $IsRunning;
+               public $DataBase;
+               
+               public function __construct($id, $isrunning, $database) {
+                       $this->ID = $id;
+                       $this->IsRunning = $isrunning;
+                       $this->DataBase = $database;
+               }
+       }
+?>
diff --git a/web/php/SeasonScore.php b/web/php/SeasonScore.php
new file mode 100644 (file)
index 0000000..dffc97e
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+       class SeasonScore
+       {
+           public $ID;
+               public $UserID;
+               public $User;
+               public $SeasonID;
+               public $Season;
+               public $Score;
+               public $DataBase;
+               
+               public function __construct($id, $userid, $seasonid, $score, $database) {
+                       $this->ID = $id;
+                       $this->UserID = $userid;
+                       $this->SeasonID = $seasonid;
+                       $this->Score = $score;
+                       $this->DataBase = $database;
+               }
+
+               public function ToJson() {
+                       $running = 'false';
+                       $username = 'unknown';
+                       if ($this->User) { $username = $this->User->Name; }
+                       if ($this->Season) { if ($this->Season->IsRunning) { $running = 'true'; } else { $running = 'false'; } }
+                       return "{ ID: " . $this->ID . ", User: '" . $username . "', IsRunning: " . $running . ", Score: " . sprintf("%f", $this->Score) . " }";
+               }
+       }
+?>
+
diff --git a/web/php/page/season.pg b/web/php/page/season.pg
new file mode 100644 (file)
index 0000000..8145c61
--- /dev/null
@@ -0,0 +1,65 @@
+{
+       id: 'ContentPanel_season'
+       ,closable: true
+       ,style: 'padding: 5px;'
+       ,title: 'Aktuelle Staffel'
+       ,layout: 'fit'
+       ,items: [{
+               id: "seasonlistgrid"
+               ,title: "Mein Pflanzen"
+               ,xtype: 'grid'
+               ,autoExpandColumn: 'User'
+               ,view: new Ext.grid.GroupingView({
+                       markDirty: false  
+               })
+               ,tbar: [{
+                       id: 'seasonlistRefresh'
+                       ,text: 'Refresh'
+                       ,icon: 'img/icons/arrow_refresh.png'
+                       ,cls: 'x-btn-text-icon'
+                       ,handler: communication.GetSeasonList.createDelegate(communication)
+               }]
+               ,store: new Ext.data.GroupingStore({
+                       reader: new Ext.data.JsonReader({fields: Lseed.Season})
+                       ,sortInfo: {field: 'User', direction: 'ASC'}
+                       ,data: []
+               })
+               ,columns: [
+                       new Ext.grid.RowNumberer()
+                       ,{
+                               id: 'ID'
+                               ,header: 'ID'
+                               ,width: 200
+                               ,sortable: true
+                               ,dataIndex: 'ID'
+                       },{
+                               id: 'User'
+                               ,header: 'User'
+                               ,width: 200
+                               ,sortable: true
+                               ,dataIndex: 'User'
+                       },{
+                               id: 'IsRunning'
+                               ,header: 'IsRunning'
+                               ,width: 200
+                               ,sortable: true
+                               ,dataIndex: 'IsRunning'
+                       },{
+                               id: 'Score'
+                               ,header: 'Score'
+                               ,width: 200
+                               ,sortable: true
+                               ,dataIndex: 'Score'
+                       }
+               ]
+               ,sm: new Ext.grid.RowSelectionModel({
+                       singleSelect:true
+                       ,listeners: {
+                               rowselect: function() {
+                               }
+                               ,rowdeselect: function() {
+                               }
+                       }
+               })
+       }]
+}
diff --git a/web/setup/README b/web/setup/README
new file mode 100644 (file)
index 0000000..aec9e12
--- /dev/null
@@ -0,0 +1,17 @@
+Folgende Ordner und ihre Unterordner im Verzeichnis web müssen im webroot existieren:
+cgi, css, ext, img, js, php
+
+Zudem natürlich noch die index.php
+Der Ordner tests unter php sollte nach erfolgreicher Installation und aufrufen der all_tests.php gelöscht oder gesperrt werden, da die Tests die Datenbank plätten.
+
+Die Dateien im cgi Ordner brauchen das executable Recht.
+
+Die Datei Database.php im Order php enthält in den ersten Zeilen die Informationen zur verbindung mit der mysql-Datenbank.
+
+Der Webserver muss php und dieses mysqli installiert haben. Zum ausführen der Tests wird SimpleTest benötigt. 
+http://www.simpletest.org/ falls kein Paket vorhanden. Sollte aber zumindest via pear verfügbar sein.
+
+Die Datei validateTest.php im Ordner cgi sollte nach erfolgreichem testen der validierung gesperrt oder gelöscht werden.
+Im Ordner cgi liegen bereits 2 kompilate des validierers. Bei Änderungen an diesem oder einer nicht kompatiblen Platform muss hier eine Datei Namens validate oder validate.exe liegen.
+
+