1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
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;
}
?>
|