diff options
author | Jan Klemkow <j.klemkow@wemelug.de> | 2012-11-22 09:19:22 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-24 12:30:09 +0100 |
commit | 370168684765919be5da44851060e641fd502dfc (patch) | |
tree | 71dd4aea9fb3679921d3f0f7a52615f871718982 /doc/niels-diplom/Dateistruktur/results/user_result.php | |
parent | bde079b899066bec3b89b3ac659bec00a73afe8c (diff) | |
download | sqltutor-plugin-370168684765919be5da44851060e641fd502dfc.tar.gz sqltutor-plugin-370168684765919be5da44851060e641fd502dfc.tar.bz2 sqltutor-plugin-370168684765919be5da44851060e641fd502dfc.zip |
Add documentation and perl/php code from niels diploma.
Diffstat (limited to 'doc/niels-diplom/Dateistruktur/results/user_result.php')
-rwxr-xr-x | doc/niels-diplom/Dateistruktur/results/user_result.php | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/doc/niels-diplom/Dateistruktur/results/user_result.php b/doc/niels-diplom/Dateistruktur/results/user_result.php new file mode 100755 index 0000000..dc09f63 --- /dev/null +++ b/doc/niels-diplom/Dateistruktur/results/user_result.php @@ -0,0 +1,187 @@ +<?php
+
+ include("../header.php");
+
+ $user = $_SESSION['user'];
+
+ //$sql = "SELECT lesson_ID as Aufgabe, Datum, Statement as Lösung FROM logon WHERE STUD_ID = '$user' order by logon.DATUM";
+
+ $sql ="SELECT LO.NR as Aufgabe, tmp.DATUM, tmp.STATEMENT FROM LESSON_ORDER LO join (SELECT * FROM LOGON WHERE STUD_ID = '$user') tmp ON tmp.LESSON_ID = LO.LESSON_ID order by LO.NR";
+
+ $stmt = dbconnect($sql);
+
+ OCIExecute($stmt);
+
+?>
+
+
+<tr >
+<td class=titel>persönliche Auswertung von <?echo $_SESSION['fname'] . " " . $_SESSION['name']?></td>
+</tr>
+
+<tr>
+<td><br></td>
+</tr>
+
+<tr>
+<td bgcolor=#e99900 colspan=2 class=text>Ihre bisher erfolgreichen Anfragen waren:</td>
+</tr>
+
+<tr>
+<td>
+
+
+
+
+<?
+
+
+$nrows = OCIFetchStatement($stmt,$results); //Ergebnisse in Array eintragen...
+
+
+if ( $nrows > 0 ) {
+ print "<BR><TABLE Border=1 class=text>\n";
+ print "<TR>\n";
+ while ( list( $key, $val ) = each( $results ) ) {
+ print "<TH>$key</TH>\n";
+ }
+ print "</TR>\n";
+
+ for ( $i = 0; $i < $nrows; $i++ ) {
+ reset($results);
+ print "<TR>\n";
+ while ( $column = each($results) ) {
+ $data = $column['value'];
+ print "<TD>$data[$i]</TD>\n";
+ }
+ print "</TR>\n";
+ }
+
+ print "<tr><td colspan=3 class=text>$nrows Datensätzen ausgewählt<BR></td></tr>";
+ print "</TABLE><BR>";
+ }
+
+else
+ {
+ print "<TABLE BORDER=\"1\">\n";
+ print "<tr><td class=text>Bisher wurden noch keine Aufgaben erfolgreich gelöst...<BR>\n</td></tr>";
+ print "</TABLE><BR>";
+
+ }
+?>
+<br><br>
+</td>
+</tr>
+
+<tr>
+<td bgcolor=#e99900 colspan=2 class=text>Anfrageversuche waren:</td>
+</tr>
+
+<tr>
+<td>
+
+<?
+
+//$sql = "SELECT lesson_ID as Aufgabe, Datum, Statement as Lösung FROM ERROR_LOG WHERE STUD_ID = '$user' order by ERROR_LOG.DATUM";
+
+$sql = "SELECT LO.NR as Aufgabe, tmp.DATUM, tmp.STATEMENT FROM LESSON_ORDER LO join (SELECT * FROM ERROR_LOG WHERE STUD_ID = '$user') tmp ON tmp.LESSON_ID = LO.LESSON_ID order by LO.NR";
+
+$stmt = dbconnect($sql);
+
+OCIExecute($stmt);
+
+$nrows = OCIFetchStatement($stmt,$results); //Ergebnisse in Array eintragen...
+
+
+if ( $nrows > 0 ) {
+ print "<BR><TABLE BORDER=\"1\" class=text>\n";
+ print "<TR>\n";
+ while ( list( $key, $val ) = each( $results ) ) {
+ print "<TH>$key</TH>\n";
+ }
+ print "</TR>\n";
+
+ for ( $i = 0; $i < $nrows; $i++ ) {
+ reset($results);
+ print "<TR>\n";
+ while ( $column = each($results) ) {
+ $data = $column['value'];
+ print "<TD>$data[$i]</TD>\n";
+ }
+ print "</TR>\n";
+ }
+
+ print "<tr><td colspan=3 class=text>$nrows Datensätzen ausgewählt<BR></td></tr>";
+ print "</TABLE><BR>";
+ }
+
+else
+ {
+ print "<TABLE BORDER=\"1\">\n";
+ print "<tr><td class=text>Es wurden keine Daten gefunden...<BR>\n</td></tr>";
+ print "</TABLE><BR>";
+
+ }
+
+?>
+<br><br>
+</td>
+</tr>
+
+<tr>
+<td bgcolor=#e99900 colspan=2 class=text>Praktikumsdauer:</td>
+</tr>
+
+<tr>
+<td>
+
+<?
+
+$start = $_SESSION['since'];
+
+$sql = "select round(max(datum) - min(datum),2) as \"BENÖTIGTE ZEIT IN TAGEN\" from (select datum from ERror_log where Stud_id = '$user' union select datum from Logon where Stud_id = '$user')";
+
+$stmt = dbconnect($sql);
+
+OCIExecute($stmt);
+
+$nrows = OCIFetchStatement($stmt,$results); //Ergebnisse in Array eintragen...
+
+
+if ( $nrows > 0 ) {
+ print "<BR><TABLE BORDER=\"1\" class=text>\n";
+ print "<TR>\n";
+ while ( list( $key, $val ) = each( $results ) ) {
+ print "<TH valign=left>$key</TH>\n";
+ }
+ print "</TR>\n";
+
+ for ( $i = 0; $i < $nrows; $i++ ) {
+ reset($results);
+ print "<TR>\n";
+ while ( $column = each($results) ) {
+ $data = $column['value'];
+ print "<TD>$data[$i]</TD>\n";
+ }
+ print "</TR>\n";
+ }
+ print "</TABLE>\n";
+} else {
+ echo "No data found<BR>\n";
+}
+print "$nrows Records Selected<BR>\n";
+
+?>
+
+</td>
+</tr>
+
+</table>
+</table>
+</table>
+
+
+<?
+include("../footer.php");
+?>
+
|