001  <%
002  Response.Expires=0
003  Response.AddHeader "Pragma","no-cache"
004  Response.AddHeader "cache-control", "no-store"%>

005  <!-- Datenbank-Verbindung herstellen -->
006  <!--#include file="strconn.asp"-->
007  
008  <html>
009  <head>
010   <title>Umfrage - Administration</title>
011  <script language="JavaScript">
012  <!--
013  function new_submit()
014   {
015   document.umfrage_form.form_action.value = "new"
016   document.umfrage_form.submit();
017   }// end function new_submit
018  function delete_submit()
019   {
020  if(document.umfrage_form.id.selectedIndex==-1)
021   {
022   alert("Sie haben keinen Eintrag gewählt!");
023   }
024  
025  else
026   {
027  
028   Check = confirm("Soll der Eintrag wirklich gelöscht werden?");
029  if (Check == false)
030   {
031   document.umfrage_form.form_action.value = "back"
032   document.umfrage_form.submit();
033   }
034  else
035   document.umfrage_form.form_action.value = "del"
036   document.umfrage_form.submit();
037   }
038  }// end function delete_submit
039  function change_submit()
040   {
041  if(document.umfrage_form.id.selectedIndex==-1)
042   {
043   alert("Sie haben keinen Eintrag gewählt!");
044   }
045  
046  else
047   {
048   document.umfrage_form.form_action.value = "chg"
049   document.umfrage_form.submit();
050   }
051  }// end function change_submit
052  function submit_params()
053   {
054  Ende_Eintraege=document.params_form.Ende_Eintraege.value;
055  Ende_Eintraege=Number(Ende_Eintraege);
056  if(isNaN(Ende_Eintraege))
057   {
058   alert("Sie haben für die Anzahl der am Ende angezeigten Einträge keine Zahl eingegeben!");
059   }
060  else
061   {
062   if (document.params_form.Standard_Header.value=="")
063   {
064   alert("Sie haben keine Standard-Kopfzeile eingegeben!");
065   }
066   else
067   {
068   if(document.params_form.Gewaehlt_Header.value=="")
069   {
070   alert("Sie haben keine Kopfzeile für den Status gewählt eingegeben!");
071   }
072   else
073   {
074   if(document.params_form.Ende_Header.value=="")
075   {
076   alert("Sie haben keine Kopfzeile für den Status Ende eingegeben!");
077   }
078   else
079   {
080   document.params_form.submit();
081   }
082   }
083   }
084   }
085  }// end function submit_params
086  // -->
087  </script>
088  </head>
089  <body>
090  <table width="480" border="0" align="center" style="border-bottom: 1px solid;border-left: 1px solid;border-right: 1px solid;border-top: 1px solid;">
091  <tr>
092   <td colspan="3" align="center" bgcolor="#0000FF">
093   <font size="4" face="Arial" color="#FFFFFF"><b>Umfrage - Administration</b></font>
094   </td>
095   <form name="umfrage_form" method="POST" action="logik.asp">
096  </tr>
097  <tr>
098   <td colspan="3"><br></td>
099  </tr>
100  <tr>
101   <td colspan="3" bgcolor="#FEF8E0">
102   <font size="2" face="Arial" color="#000000"><b>Umfrage - Einträge</b></font>
103   </td>
104  </tr>
105  <tr>
106   <td colspan="3"><br></td>
107  </tr>
108  <tr>
109   <td width="232"><font face="Arial" size="2"><b>Homepage</b></font></td>
110   <td width="248"><font face="Arial" size="2"><b>Betreiber</b></font></td>
111  </tr>
112  </tr>
113  <tr>
114   <td colspan=2>
115   <select name="id" size=10 style="font-family:Courier New;font-size:9pt;width:480px">
116   <%
117   strSQL = "SELECT * FROM vote order by homepage"
118   Set rs = Conn.Execute(strSQL)
119   Do While Not(rs.EOF)
120   Response.Write "<option value='" & rs("id") & "'>"
121   ueberschrift=rs("homepage")
122   uelaenge=Len(ueberschrift)
123   If uelaenge > 30 Then
124   Response.Write Left(ueberschrift,30) & "..."
125   Else
126   Response.Write ueberschrift
127   For i = 1 To (33-uelaenge)
128   Response.Write " "
129   Next
130   End If
131   ueberschrift=rs("betreiber")
132   uelaenge=Len(ueberschrift)
133   If uelaenge > 30 Then
134   Response.Write Left(ueberschrift,30) & "..."
135   Else
136   Response.Write ueberschrift
137   For i = 1 To (33-uelaenge)
138   Response.Write " "
139   Next
140   End If
141   rs.MoveNext
142   Loop
143   rs.Close
144   %>

145   </select>
146   </td>
147  </tr>
148  <tr>
149   <td colspan="2" align="center">
150   <input type="button" value="Neu" onclick="new_submit()">
151   <input type="button" value="Ändern" onclick="change_submit()">
152   <input type="button" value="Löschen" onClick="delete_submit()">
153   </td>
154   <input type="HIDDEN" name="form_action">
155  </tr>
156  </form>
157  <tr>
158   <td colspan="2">
159   <br><br>
160   </td>
161  </tr>
162  <tr>
163   <td colspan="2" bgcolor="#FEF8E0">
164   <font size="2" face="Arial" color="#000000"><b>Umfrage - Parameter</b></font>
165   </td>
166  </tr>
167  <tr>
168   <td colspan="2">
169   <br>
170   </td>
171  </tr>
172  <tr>
173   <form method="POST" action="logik.asp" name="params_form">
174   <td colspan="2">
175   <%
176   strSQL = "SELECT * FROM vote_parameter"
177   Set rs = Conn.Execute(strSQL)
178   If not rs.EOF Then
179   %>

180   <table width="480" border="0" cellspacing="0" cellpadding="0">
181   <tr>
182   <td colspan=2><font face="Arial" size="2"><b>Enddatum:</b></font></td>
183   <td colspan=2><font face="Arial" size="2"><b>Angezeigte Einträge am Ende:</b></font></td>
184   </tr>
185   <tr>
186   <td colspan=2>
187   <%
188   datum=rs.Fields("ende")
189   %>

190   <Select name="tag">
191   <%
192   For i = 1 To 31
193   Response.Write("<OPTION VALUE=" & i)
194   If i=Day(datum) Then Response.Write(" SELECTED")
195   Response.Write(">")
196   Response.Write(i)
197   Next
198   Response.Write("</SELECT><SELECT NAME=monat>")
199   For i = 1 To 12
200   Response.Write("<OPTION VALUE=" & i)
201   If i=Month(datum) Then Response.Write(" SELECTED")
202   Response.Write(">")
203   Response.Write(i)
204   Next
205   Response.Write("</SELECT>")
206   newdate=DateAdd("yyyy",2,datum)
207   backdate=DateAdd("yyyy",-2,datum)
208   newYear=Year(newdate)
209   backYear=Year(backdate)
210   Response.Write("<SELECT NAME=jahr>")
211   For i = backYear To newYear
212   Response.Write("<OPTION VALUE=" & i)
213   If i=Year(datum) Then Response.Write(" SELECTED")
214   Response.Write(">")
215   Response.Write(i)
216   Next
217   Response.Write("</SELECT>")
218  %>
</Select>
219   </td>
220   <td colspan=2>
221   <input type="text" size="5" value="<%=rs("ende_eintraege")%>" name="Ende_Eintraege" id="Ende_Eintraege">
222   </td>
223   </tr>
224   <tr>
225   <td colspan="4"><font face="Arial" size="2"><b><br>Zustand "Standard"<br><br></b></font></td>
226   </tr>
227   <tr>
228   <td><font face="Arial" size="2"><b>Diagramm anzeigen:</b></font></td>
229   <td><input type="checkbox" name="Standard_Diagramm" value="true" <%If rs("Standard_Diagramm") then Response.Write("CHECKED")%>></td>
230   <td><font face="Arial" size="2"><b>Bisherige Stimmenzahl anzeigen:</b></font></td>
231   <td><input type="checkbox" name="Standard_Anzahl" value="true" <%If rs("Standard_Anzahl") then Response.Write("CHECKED")%>></td>
232   </tr>
233  
234   <tr>
235   <td><font face="Arial" size="2"><b>Prozentsätze anzeigen:</b></font></td>
236   <td><input type="checkbox" name="Standard_Prozent" value="true" <%If rs("Standard_Prozent") then Response.Write("CHECKED")%>></td>
237   <td><font face="Arial" size="2"><b>Gesamtstimmenzahl anzeigen:</b></font></td>
238   <td><input type="checkbox" name="Standard_Gesamt" value="true" <%If rs("Standard_Gesamt") then Response.Write("CHECKED")%>></td>
239   </tr>
240   <tr>
241   <td><font face="Arial" size="2"><b>Wählfeld anzeigen:</b></font></td>
242   <td><input type="checkbox" name="Standard_Vote" value="true" <%If rs("Standard_Diagramm") then Response.Write("CHECKED")%>></td>
243   <td> </td>
244   <td> </td>
245   </tr>
246   <tr>
247   <td colspan=4><font face="Arial" size="2"><b>Kopfzeile:</b></font></td>
248   </tr>
249   <tr>
250   <td colspan=4><textarea cols="50" rows="5" name="Standard_Header"><%=rs("Standard_Header")%></textarea></td>
251   </tr>
252   <tr>
253   <td colspan="4"><font face="Arial" size="2"><b><br>Zustand "gewählt"<br><br></b></font></td>
254   </tr>
255   <tr>
256   <td><font face="Arial" size="2"><b>Diagramm anzeigen:</b></font></td>
257   <td><input type="checkbox" name="Gewaehlt_Diagramm" value="true" <%If rs("Gewaehlt_Diagramm") then Response.Write("CHECKED")%>></td>
258   <td><font face="Arial" size="2"><b>Bisherige Stimmenzahl anzeigen:</b></font></td>
259   <td><input type="checkbox" name="Gewaehlt_Anzahl" value="true" <%If rs("Gewaehlt_Anzahl") then Response.Write("CHECKED")%>></td>
260   </tr>
261  
262   <tr>
263   <td><font face="Arial" size="2"><b>Prozentsätze anzeigen:</b></font></td>
264   <td><input type="checkbox" name="Gewaehlt_Prozent" value="true" <%If rs("Gewaehlt_Prozent") then Response.Write("CHECKED")%>></td>
265   <td><font face="Arial" size="2"><b>Gesamtstimmenzahl anzeigen:</b></font></td>
266   <td><input type="checkbox" name="Gewaehlt_Gesamt" value="true" <%If rs("Gewaehlt_Gesamt") then Response.Write("CHECKED")%>></td>
267   </tr>
268   <tr>
269   <td><font face="Arial" size="2"><b>Wählfeld anzeigen:</b></font></td>
270   <td><input type="checkbox" name="Gewaehlt_Vote" value="true" <%If rs("Gewaehlt_Diagramm") then Response.Write("CHECKED")%>></td>
271   <td> </td>
272   <td> </td>
273   </tr>
274   <tr>
275   <td colspan=4><font face="Arial" size="2"><b>Kopfzeile:</b></font></td>
276   </tr>
277   <tr>
278   <td colspan=4><textarea cols="50" rows="5" name="Gewaehlt_Header"><%=rs("Gewaehlt_Header")%></textarea></td>
279   </tr>
280   <tr>
281   <td colspan="4"><font face="Arial" size="2"><b><br>Zustand "Ende"<br><br></b></font></td>
282   </tr>
283   <tr>
284   <td><font face="Arial" size="2"><b>Diagramm anzeigen:</b></font></td>
285   <td><input type="checkbox" name="Ende_Diagramm" value="true" <%If rs("Ende_Diagramm") then Response.Write("CHECKED")%>></td>
286   <td><font face="Arial" size="2"><b>Bisherige Stimmenzahl anzeigen:</b></font></td>
287   <td><input type="checkbox" name="Ende_Anzahl" value="true" <%If rs("Ende_Anzahl") then Response.Write("CHECKED")%>></td>
288   </tr>
289  
290   <tr>
291   <td><font face="Arial" size="2"><b>Prozentsätze anzeigen:</b></font></td>
292   <td><input type="checkbox" name="Ende_Prozent" value="true" <%If rs("Ende_Prozent") then Response.Write("CHECKED")%>></td>
293   <td><font face="Arial" size="2"><b>Gesamtstimmenzahl anzeigen:</b></font></td>
294   <td><input type="checkbox" name="Ende_Gesamt" value="true" <%If rs("Ende_Gesamt") then Response.Write("CHECKED")%>></td>
295   </tr>
296   <tr>
297   <td><font face="Arial" size="2"><b>Wählfeld anzeigen:</b></font></td>
298   <td><input type="checkbox" name="Ende_Vote" value="true" <%If rs("Ende_Diagramm") then Response.Write("CHECKED")%>></td>
299   <td> </td>
300   <td> </td>
301   </tr>
302   <tr>
303   <td colspan=4><font face="Arial" size="2"><b>Kopfzeile:</b></font></td>
304   </tr>
305   <tr>
306   <td colspan=4><textarea cols="50" rows="5" name="Ende_Header"><%=rs("Ende_Header")%></textarea></td>
307   </tr>
308   <tr>
309   <td colspan="4" align="center">
310   <br>
311   <input type="button" value="Parameter ändern" OnClick="submit_params()">
312   </td>
313   </tr>
314   </table>
315   <%
316   rs.Close
317   Conn.Close
318   Else
319   Response.Write("<FONT FACE="& chr(39) & "Arial" & chr(39) & " size=2>Es wurden keine Parameter in der Datenbank definiert oder die Parameter wurden gelöscht!</FONT>")
320   End If
321   %>

322   </form>
323   </td>
324  </tr>
325  </table>
326  </body>
327  </html>