diff options
| author | tspitzer | 2013-06-25 13:31:27 +0200 |
|---|---|---|
| committer | tspitzer | 2013-06-25 13:31:27 +0200 |
| commit | 67fe35266f74162ef719efe695d2756524856771 (patch) | |
| tree | d1dced2285d4afa10357e5186e36dbbe8bfaaca8 | |
| parent | new (diff) | |
| download | tutor-module-67fe35266f74162ef719efe695d2756524856771.tar.gz tutor-module-67fe35266f74162ef719efe695d2756524856771.tar.xz tutor-module-67fe35266f74162ef719efe695d2756524856771.zip | |
erste SQL Abfragen
| -rw-r--r-- | Dozentenmodul_V1/WebContent/GUI/de/Home.jsp | 28 | ||||
| -rw-r--r-- | Dozentenmodul_V1/WebContent/GUI/de/createVL_Software.jsp | 49 | ||||
| -rw-r--r-- | Dozentenmodul_V1/WebContent/GUI/de/createVL_System.jsp | 3 | ||||
| -rw-r--r-- | Dozentenmodul_V1/WebContent/GUI/de/createVL_allgemine.jsp | 3 | ||||
| -rw-r--r-- | Dozentenmodul_V1/WebContent/css/Input.css | 36 | ||||
| -rw-r--r-- | Dozentenmodul_V1/WebContent/css/Layout.css | 70 | ||||
| -rw-r--r-- | Dozentenmodul_V1/WebContent/img/openslx-logo.png | bin | 8270 -> 0 bytes | |||
| -rw-r--r-- | Dozentenmodul_V1/WebContent/js/functions.js | 19 | ||||
| -rw-r--r-- | Dozentenmodul_V1/build/classes/db/MySQL.class | bin | 3047 -> 3231 bytes | |||
| -rw-r--r-- | Dozentenmodul_V1/src/db/MySQL.java | 12 |
10 files changed, 161 insertions, 59 deletions
diff --git a/Dozentenmodul_V1/WebContent/GUI/de/Home.jsp b/Dozentenmodul_V1/WebContent/GUI/de/Home.jsp index 970defcf..a242111a 100644 --- a/Dozentenmodul_V1/WebContent/GUI/de/Home.jsp +++ b/Dozentenmodul_V1/WebContent/GUI/de/Home.jsp @@ -19,8 +19,34 @@ <div id="content">
<h2>Aktive VL's</h2>
+ <ul>
+ <%
+ MySQL sql=new MySQL();
+ Connection con= sql.getConnection();
+
+ ResultSet rs=sql.getActiveVLs(con, "tobias.spitzer@hs-offenburg.de");
+
+ while(rs.next()){
+
+ %>
+ <li><%=rs.getString("Laborname") %></li>
+ <%
+ }
+ %>
+ </ul>
<h2>Inaktive VL's</h2>
- <h2>Freigebene VL's</h2>
+ <ul>
+ <%
+ rs=sql.getInactiveVLs(con, "tobias.spitzer@hs-offenburg.de");
+ while(rs.next())
+ {
+ %>
+ <li><%=rs.getString("Laborname") %><img src="/Dozentenmodul_V1/img/Pencil3.png" alt="Bearbeiten"></img></li>
+ <%
+ }
+ %>
+
+ </ul>
</div>
diff --git a/Dozentenmodul_V1/WebContent/GUI/de/createVL_Software.jsp b/Dozentenmodul_V1/WebContent/GUI/de/createVL_Software.jsp index 4da15b52..1f91807a 100644 --- a/Dozentenmodul_V1/WebContent/GUI/de/createVL_Software.jsp +++ b/Dozentenmodul_V1/WebContent/GUI/de/createVL_Software.jsp @@ -1,14 +1,18 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
+ <%@ page language="java" import="db.MySQL"%>
+<%@ page language="java" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
href="/Dozentenmodul_V1/css/Layout.css"></link>
- <link rel="stylesheet" type="text/css"
- href="/Dozentenmodul_V1/css/Input.css"></link>
-<title>Insert title here</title>
+
+ <title>Insert title here</title>
+
+<script language="JavaScript" src="/Dozentenmodul_V1/js/functions.js">
+</script>
</head>
<body>
<jsp:include page="header.html" />
@@ -34,23 +38,42 @@ <fieldset id="sw_chooser">
<legend>Verfügbare Software</legend>
<div class="container">
-
- <label><b>test</b></label><br />
-
- <input type="checkbox">TEst</input>
+
+ <%
+ MySQL sql=new MySQL();
+ Connection con=sql.getConnection();
+ ResultSet h=sql.getHersteller(con);
+ int i=0;
+ while(h.next())
+ {
+ ResultSet sw=sql.getSoftware(con, h.getString("Name"));
+
+
+ %>
+ <label><b><%=h.getString("Name") %></b></label><br />
+ <%
+ while(sw.next())
+ {
+ %>
+ <input name="checkbox" type="checkbox" onChange="refresh();"><%=h.getString("Name")%> <%=sw.getString("Produktname")%> <%=sw.getString("Version") %> <%=sw.getString("Architektur") %>
<br />
-
+ <%
+ }
+ }
+ %>
+
</div>
</fieldset>
<fieldset id="sw_choosed">
<legend>Ausgewählte Software</legend>
- <div class="container">
- <label>dasjhdja</label>
+ <div id="sw" class="container">
+ <label></label>
</div>
</fieldset>
- <br></br>
- <button name="addSW">Software hinzufügen</button>
-
+ <br>
+ <button id="buttonAddSW" name="addSW">Software hinzufügen</button><br><br>
+ <button id="buttonBackSW" type="submit">Zurück</button>
+ <button id="buttonReady" type="submit">Weiter zur VL Erzeugung</button>
</form>
</div>
diff --git a/Dozentenmodul_V1/WebContent/GUI/de/createVL_System.jsp b/Dozentenmodul_V1/WebContent/GUI/de/createVL_System.jsp index 913fd91f..97e8aa94 100644 --- a/Dozentenmodul_V1/WebContent/GUI/de/createVL_System.jsp +++ b/Dozentenmodul_V1/WebContent/GUI/de/createVL_System.jsp @@ -82,7 +82,8 @@ </table>
</fieldset>
</div>
- <button id="buttonweiter" type="submit">Weiter</button>
+ <button id="buttonBackSys" type="submit">Zurück</button>
+ <button id="buttonweiterSys" type="submit">Weiter</button>
</form>
</div>
diff --git a/Dozentenmodul_V1/WebContent/GUI/de/createVL_allgemine.jsp b/Dozentenmodul_V1/WebContent/GUI/de/createVL_allgemine.jsp index f5234350..6e099ed9 100644 --- a/Dozentenmodul_V1/WebContent/GUI/de/createVL_allgemine.jsp +++ b/Dozentenmodul_V1/WebContent/GUI/de/createVL_allgemine.jsp @@ -85,7 +85,8 @@ </table>
</fieldset>
<br />
- <button id="buttonweiter" type="submit">Weiter</button>
+ <button id="buttonBackAllg" type="submit">Zurück</button>
+ <button id="buttonweiterAllg" type="submit">Weiter</button>
</form>
</div>
diff --git a/Dozentenmodul_V1/WebContent/css/Input.css b/Dozentenmodul_V1/WebContent/css/Input.css index 41357090..7a29a5e7 100644 --- a/Dozentenmodul_V1/WebContent/css/Input.css +++ b/Dozentenmodul_V1/WebContent/css/Input.css @@ -76,10 +76,7 @@ article.input section input{ width: 100%;
}
-fieldset{
- margin-top: 10px;
-}
article.input section input{
width: 320px;
@@ -110,44 +107,15 @@ font-family:Ubuntu; width: 50px;
}
-#sort{
- margin-left: 10px;
- margin-top: 10px;
-}
-.container {
- border:2px solid #ccc;
- width:300px;
- height: 550px;
- overflow-y: scroll;
-}
+
#SW_list{
width: 30px;
}
-#choosedSW{
- margin-top: 10px;
- margin-left: 10px;
- width: 300px;
-}
-#SW{
- margin-left: 20px;
- height:500px;
- width: 500px;
- background-color: #c5d2de;
-}
-#sw_chooser{
- width: 310px;
-}
-#sw_choosed{
- width:310px;
- float:right;
-}
-#buttonAddSW{
- margin-left: 30px;
- width: 150px;
+
}
#save{
float:right;
diff --git a/Dozentenmodul_V1/WebContent/css/Layout.css b/Dozentenmodul_V1/WebContent/css/Layout.css index 2d0a57bc..75703ac4 100644 --- a/Dozentenmodul_V1/WebContent/css/Layout.css +++ b/Dozentenmodul_V1/WebContent/css/Layout.css @@ -8,12 +8,17 @@ html,body{ background-image:url('../img/bg.png');
background-repeat:repeat-x;
+ font-family: 'Ubuntu';
+}
+
+button{
+ font-family: 'Ubuntu';
}
#lang{
position: absolute;
top: 0px;
- right: 0px;
+ right: 10px;
}
#logo{
@@ -126,7 +131,66 @@ html,body{ text-decoration:underline;
}
-#buttonweiter{
- position: relative;
+#buttonweiterAllg{
+ position: absolute;
+ left: 200px;
+ width: 200px;
+}
+
+#buttonweiterSys{
+ position: absolute;
+ left: 500px;
+ width: 200px;
+}
+
+#buttonReady{
+ position: absolute;
+ left: 200px;
+ width: 200px;
+}
+#buttonBackAllg{
+ position: absolute;
+ left: 0px;
+ width: 200px;
+}
+#buttonBackSys{
+ position: absolute;
left: 300px;
+ width: 200px;
+}
+#buttonAddSW{
+ left: 0px;
+ width: 200px;
+}
+#buttonBackSW{
+ position: absolute;
+ left: 0px;
+ width: 200px;
+}
+#sw_chooser{
+ width: 310px;
+}
+#sw_choosed{
+ position: relative;
+ margin-left: 350px;
+ margin-top: -593px;
+ width:310px;
+
+
+}
+
+#sort{
+ margin-left: 10px;
+ margin-top: 10px;
+}
+
+fieldset{
+ margin-top: 10px;
+
+}
+.container {
+ border:2px solid #ccc;
+ width:300px;
+ height: 550px;
+ overflow-y: scroll;
}
diff --git a/Dozentenmodul_V1/WebContent/img/openslx-logo.png b/Dozentenmodul_V1/WebContent/img/openslx-logo.png Binary files differdeleted file mode 100644 index 2e2f70e8..00000000 --- a/Dozentenmodul_V1/WebContent/img/openslx-logo.png +++ /dev/null diff --git a/Dozentenmodul_V1/WebContent/js/functions.js b/Dozentenmodul_V1/WebContent/js/functions.js new file mode 100644 index 00000000..666b1e74 --- /dev/null +++ b/Dozentenmodul_V1/WebContent/js/functions.js @@ -0,0 +1,19 @@ +function refresh(){
+
+ var checkbox=document.getElementsByName("checkbox");
+ var pointToAppend=document.getElementById("sw");
+ var label=document.createElement("label");
+ for(var i=0; i<checkbox.length;i++)
+ {
+ if(checkbox[i].checked){
+
+ label.innerHTML="sdaas";
+ pointToAppend.appendChild(label);
+
+ }
+ else{
+ pointToAppend.removeChild(label);
+ }
+ }
+
+}
\ No newline at end of file diff --git a/Dozentenmodul_V1/build/classes/db/MySQL.class b/Dozentenmodul_V1/build/classes/db/MySQL.class Binary files differindex 96aa3208..c5f2bdad 100644 --- a/Dozentenmodul_V1/build/classes/db/MySQL.class +++ b/Dozentenmodul_V1/build/classes/db/MySQL.class diff --git a/Dozentenmodul_V1/src/db/MySQL.java b/Dozentenmodul_V1/src/db/MySQL.java index 64510e82..6e6d84c0 100644 --- a/Dozentenmodul_V1/src/db/MySQL.java +++ b/Dozentenmodul_V1/src/db/MySQL.java @@ -35,7 +35,7 @@ public class MySQL { {
try {
Statement stm=con.createStatement();
- return stm.executeQuery("SELECT distinct Hersteller FROM bwLehrpool.Anwendung order by Hersteller asc;");
+ return stm.executeQuery("SELECT Name FROM bwLehrpool.SWHersteller order by Name asc;");
} catch (SQLException e) {
@@ -52,7 +52,7 @@ public class MySQL { try {
Statement stm=con.createStatement();
- return stm.executeQuery("SELECT Produktname FROM bwLehrpool.Anwendung WHERE Hersteller like '"+Hersteller+"' order by Produktname asc;");
+ return stm.executeQuery("SELECT s.pk,s.Produktname, s.Version, s.Architektur FROM bwLehrpool.Software s left join bwLehrpool.SWHersteller h on s.SWHersteller_pk=h.pk where Name like '"+Hersteller+"' order by s.Produktname;");
} catch (SQLException e) {
@@ -65,12 +65,12 @@ public class MySQL { }
- public ResultSet getActiveVLs(Connection con, int VId)
+ public ResultSet getActiveVLs(Connection con, String Mail)
{
Statement stm;
try {
stm = con.createStatement();
- return stm.executeQuery("SELECT Laborname FROM bwLehrpool.VM where IstAktiv=1 and Verantwortlicher_pk="+VId+";");
+ return stm.executeQuery("Select Laborname from bwLehrpool.VM where IstAktiv=1 and pk=(SELECT VM_pk FROM bwLehrpool.Benutzer_has_VM where Benutzer_pk=(SELECT pk FROM bwLehrpool.Benutzer where EMail like '"+Mail+"'));");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -79,12 +79,12 @@ public class MySQL { }
- public ResultSet getInactiveVLs(Connection con, int VId)
+ public ResultSet getInactiveVLs(Connection con, String Mail)
{
Statement stm;
try {
stm = con.createStatement();
- return stm.executeQuery("SELECT Laborname FROM bwLehrpool.VM where IstAktiv=0 and Verantwortlicher_pk="+VId+";");
+ return stm.executeQuery("Select Laborname from bwLehrpool.VM where IstAktiv=0 and pk=(SELECT VM_pk FROM bwLehrpool.Benutzer_has_VM where Benutzer_pk=(SELECT pk FROM bwLehrpool.Benutzer where EMail like '"+Mail+"'));");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
|
