<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>


<!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=cp1250">
<title>Time Expression - Enter Hours</title>
<link href="includes/timex.css" rel="stylesheet" type="text/css">
</head>


<form method="post">
<table width="85%" border="1" align="center" cellpadding="0"
    cellspacing="0">
  <tr>
    <td>
    <table width="100%" border="0" align="center" cellpadding="4"
        cellspacing="0" bordercolor="#CCCCCC">
      <tr bgcolor="#C2DCEB" valign="middle">
          <td width="90%" height="60">
          <h1>Wprowadź godziny</h1>
          </td>
          <td align="right" nowrap="nowrap"><a href="signout.htm">Wyloguj się</a></td>
      </tr>
      <tr>
        <td colspan="2" align="center">
        <center><spring:bind path="command.*">
            <c:if test="${not empty status.errorMessages}">
                <c:forEach var="error" items="${status.errorMessages}">
                    <font color="red"><c:out value="${error}" escapeXml="false" /> </font>
                    <br />
                </c:forEach>
            </c:if>
        </spring:bind> <!-- status messages --> <c:if
            test="${not empty message}">
            <font color="green"><c:out value="${message}" /></font>
            <c:set var="message" value="" scope="session" />
        </c:if></center>
        </p>
        <p>Koniec okresu: <fmt:formatDate
            value="${command.periodEndingDate}" type="date"
            pattern="MMMM dd, yyyy" /></p>
        <table border="1" align="center" cellpadding="8" cellspacing="0">
         <tr>
             <th>Wydział</th>
             <th>Pn</th>
             <th>Wt</th>
             <th>Śr</th>
             <th>Cz</th>
             <th>Pt</th>
             <th>So</th>
             <th>Ni</th>
             <th>Razem</th>
         </tr>
         <tr>
           <td><spring:bind path="command.departmentCode">
             <select name='<c:out value="${status.expression}"/>'>
                 <option value=""></option>
                <c:forEach items="${departments}" var="department">
                 <option value='<c:out value="${department.departmentCode}"/>'
                    <c:if 
                    test="${department.departmentCode == status.value}">SELECTED
   				</c:if>
   				><c:out
                     value="${department.name}" /></option>
               </c:forEach>
             </select>
           </spring:bind></td>
           <td><spring:bind path="command.minutesMon">
               <input name='<c:out value="${status.expression}"/>'
                   value='<c:out value="${status.value}"/>' type="text" size="4"
                   maxlength="6">
           </spring:bind></td>
           <td><spring:bind path="command.minutesTue">
               <input name='<c:out value="${status.expression}"/>'
                   value='<c:out value="${status.value}"/>' type="text" size="4"
                   maxlength="6">
           </spring:bind></td>
           <td><spring:bind path="command.minutesWed">
               <input name='<c:out value="${status.expression}"/>'
                   value='<c:out value="${status.value}"/>' type="text" size="4"
                   maxlength="6">
           </spring:bind></td>
           <td><spring:bind path="command.minutesThu">
               <input name='<c:out value="${status.expression}"/>'
                   value='<c:out value="${status.value}"/>' type="text" size="4"
                   maxlength="6">
           </spring:bind></td>
           <td><spring:bind path="command.minutesFri">
               <input name='<c:out value="${status.expression}"/>'
                   value='<c:out value="${status.value}"/>' type="text" size="4"
                   maxlength="6">
           </spring:bind></td>
           <td><spring:bind path="command.minutesSat">
               <input name='<c:out value="${status.expression}"/>'
                   value='<c:out value="${status.value}"/>' type="text" size="4"
                   maxlength="6">
           </spring:bind></td>
           <td><spring:bind path="command.minutesSun">
               <input name='<c:out value="${status.expression}"/>'
                   value='<c:out value="${status.value}"/>' type="text" size="4"
                   maxlength="6">
           </spring:bind></td>
           <td><spring:bind path="command.totalMinutes">
               <c:out value="${status.value}" />
           </spring:bind></td>
          </tr>
        </table>
        <p align="center"><input name="save" type="submit" value="Zapisz"> <input
            name="cancel" type="button" value="Anuluj"
            onClick="javascript:window.location='timesheetlist.htm'"> <br>
        <br>
        </p>
        </td>
      </tr>
      <tr>
          <td colspan="2" bgcolor="#C2DCEB">&nbsp;</td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</form>
<p>&nbsp;</p>
</body>
</html>
