diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-30 15:43:52 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-30 15:43:52 +0100 |
commit | 8ea6ea6db019f68436a69f36aae55a9f205efa35 (patch) | |
tree | 5c367520523c42b1935491d199b4e8f3c17b4708 /doc/nils-diplom/Dateistruktur/admin/edit_lesson.php | |
parent | ec6e82dbcdc153b9973240cdff91a03b6d2dc886 (diff) | |
download | sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.tar.gz sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.tar.bz2 sqltutor-plugin-8ea6ea6db019f68436a69f36aae55a9f205efa35.zip |
doc: Nils Weber doesnt have an 'e' in his firstname
Diffstat (limited to 'doc/nils-diplom/Dateistruktur/admin/edit_lesson.php')
-rwxr-xr-x | doc/nils-diplom/Dateistruktur/admin/edit_lesson.php | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/doc/nils-diplom/Dateistruktur/admin/edit_lesson.php b/doc/nils-diplom/Dateistruktur/admin/edit_lesson.php new file mode 100755 index 0000000..de1da2d --- /dev/null +++ b/doc/nils-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"> </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> </td></tr> + +<tr><td id=tdlistl> </td></tr> + +<tr><td colspan=30><div id=message><? echo $message; ?></div></td></tr> + + +<tr><td id=tdlistl colspan=30> </td></tr> +</form> +</table> + + </td> </tr></table> + <tr> + <td width="200" align="right" valign="top" class="randmenu"><p> </td> + </tr> + </table> + +<? + include("../footer.php"); + exit; + } +?> + + |