<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import = "java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="de.tum.sep.*" %>
<%@ page contentType="text/html; charset=UTF-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> Frequenz</title>
</head>
<%
int anzahlSaveData;
int anzahlClose;
String anzahlSaveDataStr = (String)request.getParameter("nSaveData");
String anzahlCloseStr = (String)request.getParameter("anzahlClose");
String fre_DB_Str = (String)request.getParameter("fre_DB");
String anzahlFrequenzStr = (String)request.getParameter("newFrequenz");
%>
<body bgcolor="#DDDDDD">
<form method="post" action="frequenzDB.jsp">
<%
// out.println("Hallo");
if ( anzahlSaveDataStr == null)
{ anzahlSaveData = 0 ;
//######################################################## Hidden die AnzahlFrequenz
%>
<h2><font color="#FF0000">Bitte bestimmen Sie die Daten.</font></h2>
<%
int anzahlFrequenz;
String newFrequenzStr = (String)request.getParameter("newFrequenz");
String newFrequenzAnlegenStr = (String)request.getParameter("newFrequenzAnlegen");
//out.println("FREQ:"+newFrequenzAnlegenStr);
if (newFrequenzAnlegenStr == null && newFrequenzStr == null)
{ anzahlFrequenz = 0;
} else {
anzahlFrequenz = Integer.parseInt(newFrequenzStr, 10);
//++anzahlFrequenz;
// out.println("anzahlFrequenz ="+ anzahlFrequenz);
for (int i = 1, j=1; i <= anzahlFrequenz; ++i){
String frequenz = request.getParameter("frequenz" + i);
String land = request.getParameter("land" + i);
String frequenzVon = request.getParameter("frequenzVon" + i);
String frequenzBis = request.getParameter("frequenzBis" + i);
String kanalabstand = request.getParameter("kanalabstand" + i);
if (frequenz == null ) frequenz = "";
if (land == null ) land = "";
if (frequenzVon == null) frequenzVon = "";
if (frequenzBis == null ) frequenzBis = "";
if (kanalabstand ==
null ) kanalabstand = "";
%>
<table width="600" border="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table>
<tr><font color="#0000FF">FrequenzBereich<%= i%>:</font></tr>
</table>
<%
String einheitFre = (String)request.getParameter("einheitFre"+j+"_"+i);
String fre1 = new String();
String fre2 = new String();
String fre3 = new String();
String fre4 = new String();
String einheit = new String();
if (einheitFre == null)
{
}else if(einheitFre.equals("Bit"))
{
fre1 = "selected";
//einheit = "Bit";
}
else if(einheitFre.equals("kBit"))
{
fre2 = "selected";
//einheit = "KBit";
}
else if(einheitFre.equals("Byte"))
{
fre3 = "selected";
//einheit = "Byte";
}
else if(einheitFre.equals("kByte"))
{
fre4 = "selected";
//einheit = "KByte";
}
%>
<table width="600" border="0">
<tr>
<td width="124">Frequenz: </td>
<td width="147">
<input type="text" name="frequenz<%= i%>" value="<%= frequenz%>"/>
</td>
<td width="420"><select
name="einheitFre<%=j%>_<%=i%>" value="<%=
einheitFre%>" style="WIDTH: 70px" size="">
<option value=""> Einheit</option>
<option value="Bit" <%= fre1%>>Bit/s</option>
<option value="kBit" <%= fre2%>>kBit/s</option>
<option value="Byte" <%= fre3%>>Byte/s</option>
<option value="kByte" <%= fre4%>>kByte/s</option>
</select></td>
</tr>
<tr>
<td width="124"> Land: </td>
<td width="147">
<input type="text" name="land<%= i %>" value="<%= land%>"/>
</td>
<td width="312"> </td>
</tr>
<tr>
<td width="124"> FrequenzVon: </td>
<td width="147">
<input type="text" name="frequenzVon<%= i %>" value="<%= frequenzVon%>"/>
</td>
<td width="312"> </td>
</tr>
<tr>
<td width="124"> FrequenzBis: </td>
<td width="147">
<input type="text" name="frequenzBis<%= i %>" value="<%= frequenzBis%>"/>
</td>
<td width="312"> </td>
</tr>
<tr>
<td width="124">Kanalabstand: </td>
<td width="147">
<input type="text" name="kanalabstand<%= i %>" value="<%= kanalabstand%>"/>
</td>
<td width="312"> </td>
</tr>
</table>
<%
j++;
}
}
}
%>
<table width="600" border="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table>
<tr>
<td><input type = "submit" name="fre_DB" value="Speichern" width="" maxlength="40"/>
<input type="hidden" name = "nSaveData" value="<%//= anzahlSaveData %>"/></td>
<td><input type = "submit" name="close" value="Schliessen" />
<input type="hidden" name="nClose"
value="<%//= anzahlClose
%>"/></td>
</tr>
</table>
</form>
</body>
</html>