summaryrefslogtreecommitdiff
path: root/doc/niels-diplom/Dateistruktur/admin/edit_lesson.php
diff options
context:
space:
mode:
authorJan Klemkow <j.klemkow@wemelug.de>2012-11-22 09:19:22 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-24 12:30:09 +0100
commit370168684765919be5da44851060e641fd502dfc (patch)
tree71dd4aea9fb3679921d3f0f7a52615f871718982 /doc/niels-diplom/Dateistruktur/admin/edit_lesson.php
parentbde079b899066bec3b89b3ac659bec00a73afe8c (diff)
downloadsqltutor-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/admin/edit_lesson.php')
-rwxr-xr-xdoc/niels-diplom/Dateistruktur/admin/edit_lesson.php159
1 files changed, 159 insertions, 0 deletions
diff --git a/doc/niels-diplom/Dateistruktur/admin/edit_lesson.php b/doc/niels-diplom/Dateistruktur/admin/edit_lesson.php
new file mode 100755
index 0000000..de1da2d
--- /dev/null
+++ b/doc/niels-diplom/Dateistruktur/admin/edit_lesson.php
@@ -0,0 +1,159 @@
+<?php
+
+include("../header.php");
+
+if ($_SESSION['type'] == 0) // Session Zugangscheck für den Administrator
+ {
+
+ //print "<meta HTTP-EQUIV=\"Refresh\" CONTENT=5; URL=\"/dipl/praktikum.php\">";
+ print "<tr><td class=\"titel_15\">KEINE ADMINSESSION...</td></tr>";
+ print "<tr><td class=\"titel_15\">Bitte Loggen sie sich erneut als Admin ein...</td></tr>";
+ print "</td></tr></table></table>";
+ include("../footer.php");
+ exit;
+
+ }
+
+include("adminfuncs.php");
+
+
+$id = $_GET['id'];
+
+
+if (isset($_POST['delete']))
+{
+
+ $message = less_del($id); //Aufgabe entfernen
+
+ ?>
+
+ <tr>
+ <td class="titel_15">AUFGABENVERWALTUNG</td>
+ </tr>
+
+ <table>
+ <tr></tr>
+
+
+ <?
+
+ print "<tr><td class=text>" . $message . "</td></tr></table>";
+
+}
+
+
+if (isset($_POST['new']))
+{
+
+ less_change($_POST['new_typ'], $_POST['new_text'], $_POST['new_aktiv'], $_POST['new_muster'], $id); //Aufgabe ändern
+
+}
+
+?>
+
+<tr>
+<td class="titel_15">AUFGABENVERWALTUNG</td>
+</tr>
+
+<table>
+
+<form action="<?=$_POST['PHP_SELF'] . "?id=" . $_GET['id'] . "&typ=" . $_GET['typ'] . "&" . SID?>" method="Post">
+
+<?
+
+ $sql = "SELECT typ as TYP, text as TEXT, aktiv as AKTIV, muster as MUSTER FROM lessons WHERE lesson_id = '$id'";
+
+ $stmt = dbconnect($sql);
+
+ OCIExecute($stmt);
+
+ $nrows = OCIFetchStatement($stmt,$results); //Ergebnisse in Array eintragen...
+
+ if ( $nrows == 1 )
+ {
+ OCIExecute($stmt);
+
+ while(OCIFetch($stmt))
+ {
+ $lesson_typ = OCIResult($stmt, "TYP");
+ $lesson_text = OCIResult($stmt, "TEXT");
+ $aktiv = OCIResult($stmt, "AKTIV");
+ $muster = OCIResult($stmt, "MUSTER");
+ }
+
+
+
+ print "<tr><TD colspan=2 class=text><BR>Die von Ihnen gewählte Aufgabe vom Typ " . $_GET['typ'] . " hat folgende Inhalte: <BR> <BR><TABLE Width=550 BORDER=1 colspan=2>\n";
+ print "<TR>\n";
+ while ( list( $key, $val ) = each( $results ) )
+ {
+ print "<TH>$key</TH>\n";
+ }
+
+ print "</TR>\n";
+
+ $column = each($results);
+ $data = $column['value'];
+
+?>
+
+
+
+ <td valign=top>
+ <br>
+ <select class="inputtext" name="new_typ" size="1" >
+ <option <?if($lesson_typ == 'SELECT') {?> selected <?}?>>SELECT
+ <option <?if($lesson_typ == 'INSERT') {?> selected <?}?>>INSERT
+ <option <?if($lesson_typ == 'UPDATE') {?> selected <?}?>>UPDATE
+ <option <?if($lesson_typ == 'CREATE') {?> selected <?}?>>CREATE
+ </select>
+ </td>
+
+<TD><TExtarea name="new_text" cols="25" rows="10"><?print $lesson_text; ?></textarea></TD>
+
+ <TD valign=top>
+ <br>
+ <select class="inputtext" name="new_aktiv" size="1" cols=10>
+ <option value=1 <?if ($aktiv == 1) {?> selected <?}?> >aktiv(1)
+ <option value=0 <?if ($aktiv == 0) {?> selected <?}?> >inaktiv(0)
+ </select>
+ </td>
+
+<TD><TExtarea name="new_muster" cols=15 rows=10><?print $muster;?></textarea></TD>
+
+</TR></td></tr>
+
+</TABLE><BR>
+
+<tr><td><input class="inputsubmit" type="Submit" name="new" value="ändern" valign="center"><BR><br></td></tr>
+
+
+<tr><td colspan=2 class="randoben">&nbsp;</td></tr>
+<tr><td valign="center" class="titel"><br>Die oben angezeigte Aufabe</td>
+<td>
+<input class="inputsubmit" type="Submit" name="delete" value="inaktiv setzen">
+</td></tr>
+<tr><td>&nbsp;</td></tr>
+
+<tr><td id=tdlistl>&nbsp;</td></tr>
+
+<tr><td colspan=30><div id=message><? echo $message; ?></div></td></tr>
+
+
+<tr><td id=tdlistl colspan=30>&nbsp;</td></tr>
+</form>
+</table>
+
+ </td> </tr></table>
+ <tr>
+ <td width="200" align="right" valign="top" class="randmenu"><p>&nbsp;</td>
+ </tr>
+ </table>
+
+<?
+ include("../footer.php");
+ exit;
+ }
+?>
+
+