Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?
2
	require_once "page_functions.php";
3
?>
4
<html>
5
<head>
6
<title>Content-Management-System - Webagentur Niewerth</title>
7
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
8
<script language="JavaScript">
9
<!--
10
function MM_swapImgRestore() { //v3.0
11
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
12
}
13
 
14
function MM_preloadImages() { //v3.0
15
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
16
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
17
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
18
}
19
 
20
function MM_swapImage() { //v3.0
21
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
22
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
23
}
24
 
25
function MM_openBrWindow(theURL,winName,features) { //v2.0
26
  window.open(theURL,winName,features);
27
}
28
 
29
function MM_findObj(n, d) { //v4.01
30
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
31
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
32
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
33
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
34
  if(!x && d.getElementById) x=d.getElementById(n); return x;
35
}
36
 
37
function MM_validateForm() { //v4.0
38
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
39
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
40
    if (val) { nm=val.name; if ((val=val.value)!="") {
41
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
42
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss eine E-Mail Adresse sein.\n';
43
      } else if (test!='R') {
44
        if (isNaN(val)) errors+='- '+nm+' muss eine Zahl sein.\n';
45
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
46
          min=test.substring(8,p); max=test.substring(p+1);
47
          if (val<min || max<val) errors+='- '+nm+' muss eine Zahl zwischen '+min+' und '+max+' sein.\n';
48
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' wird benötigt.\n'; }
49
  } if (errors) alert('Folgende Fehler sind aufgetreten:\n'+errors);
50
  document.MM_returnValue = (errors == '');
51
}
52
//-->
53
</script>
54
<meta name="author" content="Webagentur Niewerth - www.weban.de">
55
<meta name="description" content="Redaktionssystem">
56
<meta name="robots" content="noindex">
57
<link rel="stylesheet" href="redaktion.css" type="text/css">
58
<style type="text/css"><? require_once "redaktion.css"?></style>
59
</head>
60
 
61
<body bgcolor="#FFFFFF" leftmargin="20" topmargin="10 marginwidth="20" marginheight="10" onLoad="MM_preloadImages('images/navigation/bt_neu_f2.gif','images/navigation/bt_bearbeiten_f2.gif','images/navigation/bt_delete_f2.gif')" >
62
<form method="post" action="#" name="formname" enctype="multipart/form-data">
63
  <table width="740" border="0" cellspacing="0" cellpadding="0">
64
    <tr valign="top">
65
      <td class="frame">
66
        <?  if ($action=="delete")
67
	{
68
	$result = mysql_query ("SELECT * FROM $Tab where site = '$site' order by $sort") or die (mysql_errno().": ".mysql_error());
69
	if (mysql_num_rows($result) == 0)
70
	{
71
	?>
72
        <p class="error">Es sind keine Daten eingetragen !</p>
73
<p></p>
74
 
75
	<?
76
	}
77
	else
78
	{
79
	?>
80
	    <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
81
          <tr bgcolor="#000096">
82
            <td colspan="3" class="headline">Seite: L&ouml;schen</td>
83
          </tr>
84
          <tr>
85
            <td width="5%" bgcolor="#000096">&nbsp;</td>
86
            <td width="90%"><b><a href="<? echo $self?>?action=delete&sort=Titel">Titel</a>
87
              / <a href="<? echo $self?>?action=delete&sort=Dateiname">Datei</a>
88
              / <a href="<? echo $self?>?action=delete&sort=Navigationspunkt">Navigationspunkt</a>
89
			  / <a href="<? echo $self?>?action=delete&sort=Rang">Rang</a></b></td>
90
            <td align="center" valign="middle" width="5%" bgcolor="#000096">&nbsp;</td>
91
          </tr>
92
          <?
93
	while ($zeile=mysql_fetch_array($result))
94
	{
95
  	$zeile[von]=join(".",array_reverse(preg_split("/-/",$zeile[von])));
96
   	$zeile[bis]=join(".",array_reverse(preg_split("/-/",$zeile[bis])));
97
	$zeile[Eingangsdatum]=join(".",array_reverse(preg_split("/-/",$zeile[Eingangsdatum])));
98
	?>
99
          <tr>
100
            <td width="5%" bgcolor="#000096">&nbsp; </td>
101
            <td width="90%" >
102
              <? echo $zeile[Titel]?>
103
              /
104
              <? echo $zeile[Dateiname]?>
105
              /
106
              <? echo $zeile[Navigationspunkt]?>
107
              /
108
              <? echo $zeile[Rang]?>
109
            </td>
110
            <td align="center" valign="middle" width="5%" bgcolor="#000096">
111
              <input type="checkbox" name="ID[]" value="<?  echo $zeile[ID] ?>">
112
            </td>
113
          </tr>
114
          <?
115
	}
116
	?>
117
          <tr align="right" bgcolor="#000096">
118
            <td colspan="3">
119
              <input type="hidden" name="action" value='delete'>
120
              <input type="submit" value="LÖSCHEN">
121
              <input type="reset" name="Button22" value="Zur&uuml;cksetzen">
122
            </td>
123
          </tr>
124
        </table>
125
        <?
126
	}
127
?>
128
        <?
129
 	}
130
?>
131
        <?
132
 
133
  if ($action=="select_edit")
134
	{
135
	$result = mysql_query ("SELECT * FROM $Tab where site = '$site' order by $sort") or die (mysql_errno().": ".mysql_error());
136
	if (mysql_num_rows($result) == 0)
137
	{
138
		$action=edit;
139
		$start_call=true;
140
	}
141
	else
142
	{
143
	?>
144
	    <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
145
          <tr bgcolor="#000099">
146
            <td colspan="2" class="headline">Seite: Bearbeiten</td>
147
          </tr>
148
          <tr>
149
            <td width="5%" bgcolor="#000096">&nbsp;</td>
150
            <td width="95%"><b><a href="<? echo $self?>?action=select_edit&sort=Titel">Titel</a>
151
              / <a href="<? echo $self?>?action=select_edit&sort=Dateiname">Datei</a>
152
			  / <a href="<? echo $self?>?action=select_edit&sort=Navigationspunkt">Navigationspunkt</a>
153
              / <a href="<? echo $self?>?action=select_edit&sort=Rang">Rang</a></b></td>
154
          </tr>
155
          <?
156
	while ($zeile=mysql_fetch_array($result))
157
	{
158
	?>
159
          <tr>
160
            <td width="5%" bgcolor="#000096">&nbsp;</td>
161
            <td width="95%" ><a href="<? echo $self?>?action=edit&ID=<? echo $zeile[ID]; ?>">
162
              <? echo $zeile[Titel]?>
163
              /
164
              <? echo $zeile[Dateiname]?>
165
              /
166
              <? echo $zeile[Navigationspunkt]?>
167
              /
168
              <? echo $zeile[Rang]?>
169
              </a> </td>
170
          </tr>
171
          <?
172
	}
173
	?>
174
          <tr bgcolor="#000096">
175
            <td colspan="2"> &nbsp;
176
              <input type="hidden" name="action" value='edit'>
177
            </td>
178
          </tr>
179
        </table>
180
 <?
181
	}
182
?>
183
        <?
184
 	}
185
?>
186
<?
187
	if ($action=="edit")
188
	{
189
		if ($ID)
190
		{
191
			$result = mysql_query ("SELECT * FROM $Tab where ID = $ID and site='$site'") or die (mysql_errno().": ".mysql_error());
192
			if (mysql_num_rows($result) == 0) {unset($ID);}
193
			$zeile=mysql_fetch_array($result);
194
		}
195
	?>
196
	    <table border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#999999" width="100%">
197
          <tr bgcolor="#000096">
198
            <td class="headline" colspan="6">Seite:
199
              <?
200
					if ($ID)
201
					{
202
					 ?>
203
              Bearbeiten
204
              <?
205
					}
206
					else
207
					{
208
					 ?>
209
              Neueintrag
210
              <?
211
					}
212
				?>
213
            </td>
214
          </tr>
215
          <tr>
216
            <td bgcolor="#000096" class="headline" width="18%" valign="top">In
217
              Navigation:</td>
218
            <td class="small" width="16%" nowrap>
219
              <input type="checkbox" name="Navigation" value="1"<? if ($zeile[Navigation]==1 | !$ID) {echo " checked";} ?>>
220
              ver&ouml;ffentlichen<br>
221
              <input type="checkbox" name="externeDatei" value="1" onClick="this.blur();this.focus();" onChange="if (this.checked) {properties.location='page_external.php?action=edit&ID=<? echo $ID ?>'} else {properties.location='page_properties.php?action=edit&ID=<? echo $ID ?>'}"<? if ($zeile[externeDatei] == 1) {echo " checked";} ?>>
222
              Externe Datei</td>
223
            <td bgcolor="#000096" class="small" width="21%" valign="top"><b><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">v</font><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">er&ouml;ffentlichen
224
              als: </font></b></td>
225
            <td class="small" width="21%" valign="top">
226
              <?
227
				if ($start_call) {$zeile[Navigationspunkt]="start";}
228
			?>
229
              <input type="text" name="Navigationspunkt" value="<? echo $zeile[Navigationspunkt] ?>">
230
            </td>
231
            <td class="small" width="17%" bgcolor="#000099" valign="top"><font face="Arial, Helvetica, sans-serif" size="2"><b><font color="#FFFFFF">Position:</font></b></font></td>
232
            <td class="small" width="7%" valign="top">
233
              <input type="text" name="Rang" size="3" value="<? echo $zeile[Rang]; ?>">
234
            </td>
235
          </tr>
236
          <tr>
237
            <td colspan="6" class="frame"><iframe name="properties" width="100%" height=240 align=left hspace=0 vspace=0 frameborder="NO" framespacing="0" scrolling="no" src="page_<? if ($zeile[externeDatei]) {echo "external";} else {echo "properties";} ?>.php?ID=<? echo $ID ?>&start_call=<? echo $start_call ?>"></iframe></td>
238
          </tr>
239
          <tr>
240
            <td bgcolor="#000096" class="headline" nowrap width="18%">erstellt:</td>
241
            <td colspan="5">am:
242
              <?
243
				$zeile[erstellt_am]=preg_split("/ /",$zeile[erstellt_am]);
244
				$datum=join(".",array_reverse(preg_split("/-/",$zeile[erstellt_am][0])));
245
				$zeit=$zeile[erstellt_am][1];
246
			?>
247
              <?
248
				echo $datum;
249
			?>
250
              um:
251
              <?
252
				echo $zeit;
253
			?>
254
              Uhr von:
255
              <? echo $zeile[erstellt_von] ?>
256
            </td>
257
          </tr>
258
          <tr>
259
            <td bgcolor="#000096" class="headline" nowrap width="18%">letzte &Auml;nderung:</td>
260
            <td colspan="5">am:
261
              <?
262
				$zeile[letzteAenderung_am]=preg_split("/ /",$zeile[letzteAenderung_am]);
263
				$datum=join(".",array_reverse(preg_split("/-/",$zeile[letzteAenderung_am][0])));
264
				$zeit=$zeile[letzteAenderung_am][1];
265
			?>
266
              <?
267
				echo $datum;
268
			?>
269
              um:
270
              <?
271
				echo $zeit;
272
			?>
273
              Uhr von:
274
              <? echo $zeile[letzteAenderung_von] ?>
275
            </td>
276
          </tr>
277
          <tr bgcolor="#000099">
278
            <td align="right" colspan="6">
279
              <input type="hidden" name="site" value="<? echo $site ?>">
280
              <input type="hidden" name="ID" value="<? echo $ID ?>">
281
              <input type="hidden" name="action" value="update">
282
              <input type="button" value="OK" onClick="{MM_validateForm('Navigationspunkt','','R'); if (document.MM_returnValue) {properties.go();}} ">
283
              <input type="reset" name="Button" onClick="properties.formname.reset()" value="Zur&uuml;cksetzen">
284
            </td>
285
          </tr>
286
        </table>
287
        <?
288
	}
289
?> </td>
290
      <td width="77" align="right" class="frame">
291
        <table width="67" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#999999">
292
  		<tr>
293
            <td class="frame"><a href="<? echo $self ?>?action=edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('new','','images/navigation/bt_neu_f2.gif',1)"><img name="new" border="0" src="images/navigation/bt_neu.gif" width="67" height="40" alt="Neueintrag"></a></td>
294
  		</tr>
295
 	 	<tr>
296
            <td class="frame"><a href="<? echo $self ?>?action=select_edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('edit','','images/navigation/bt_bearbeiten_f2.gif',1)"><img name="edit" border="0" src="images/navigation/bt_bearbeiten.gif" width="67" height="40" alt="Eintrag bearbeiten"></a></td>
297
  		</tr>
298
  		<tr>
299
            <td class="frame"><a href="<? echo $self ?>?action=delete" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('delete','','images/navigation/bt_delete_f2.gif',1)"><img name="delete" border="0" src="images/navigation/bt_delete.gif" width="67" height="40" alt="Eintrag l&ouml;schen"></a></td>
300
  		</tr>
301
		</table>
302
      </td>
303
</tr>
304
</table>
305
</form>
306
</body>
307
</html>