
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>


<html>
<head>


<title>
Group G calendar webapp
</title>
</head>
<body bgcolor="white"  text="#400040" link="blue" alink="black" vlink="red">


<h1>Group G schedule for usernames:</h1>

<sql:setDataSource 
 driver="com.mysql.jdbc.Driver"
 url="${initParam.DBconn_string}"
 user="${initParam.DBusername}"
 password="${initParam.DBpassword}" />
 
<sql:query var="result" >
  Select *  from calendar where username = '
</sql:query>
<h2>
<c:forEach items="${result.rows}" var="row">
   ${row.username} </c:forEach> </h2>
   
   

     
 <!-- Get the Calendar string from mysql -->
<sql:query var="result" >
   select sched from calendar
</sql:query>


<jsp:useBean id='controller' class='beans.CombinedSched'/>
   <c:forEach items="${result.rows}" var="row">
<%-- Set properties in bean with a string, then get result --%>.
 <jsp:setProperty name='controller' property='combinedSched' value='${row.sched}'/>    
  </c:forEach>


  
  <table border="1">
          <tr><td>Day </td></td>
  <td>9:00</td><td>9:30</td><td>10:00</td><td>10:30</td><td>11:00</td><td>11:30</td><td>12:00</td><td>12:30</td><td>1:00</td><td>1:30</td><td>2:00</td><td>2:30</td><td>3:00</td><td>3:30</td><td>4:00<td>4:30</td></tr>
   ${controller.combinedSched}
</table> 


</body>
</html>






