   <%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="org.ellectra.gui.utils.JSFUtils"%>
<%@page import="javax.faces.context.FacesContext"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>

<f:view>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    
    %>

<base href="<%=basePath%>">
<title>Ellectra Web</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="Ellectra Web">
<link rel="stylesheet" href="commission.css" type="text/css">
<link rel="stylesheet" href="ellectraweb.css" type="text/css">

</head>
<body>
<a name="top"></a>

<div align="center">

<table border="0" cellspacing="0" cellpadding="0" width="760"
	class="tbl1" summary="Container of page content">

	
	<!-- HEADER LINE -->
	<%@ include file="header.jsp"%>
	</td>
</tr>
<tr>
	<td bgcolor="#ffffff" height="1"></td>
</tr>
<tr>
	<td bgcolor="#330099" height="1"></td>
</tr><!-- END OF HEADER -->

	<!-- MAIN CONTENT -->
	<tr>
		<td valign="top" align="left">
		<table border="0" cellspacing="0" cellpadding="0" width="760"
			height="450" bgcolor="#FFFFFF" id="content" summary="Content of page">
			<tr>
				<!-- MENU CELL -->
				<%@ include file="navigation-menu.jsp"%>
				<!-- END OF MENU CELL -->

				<!-- VERTICAL SEPERATOR CELLS -->
				<td width="1" class="sep" height="100%"></td>
				<td width="15"></td>
<!-- CENTRAL CONTENT CELL -->
				<td width="565" valign="top">
				<br />
	  <%@ include file="hmenu.jsp" %>
	  
  <div class="title14bb"><strong>Open Tenders</strong></div>

                                    <br />
                                    
                                        <div class="text11n">
                                            <h:form>
                                                
                                                
                                                <p>
                                                    
                                                    <%
            Date DateToOpen = new Date();
            String dtemp = (String) JSFUtils.retrieveOnSession(FacesContext.getCurrentInstance(), "CALLTENDERID");
            String dUserloginsignature = (String) JSFUtils.retrieveOnSession(FacesContext.getCurrentInstance(), "LOGINSIGNATURE");
            try {
                org.ellectra.wscheckunlock.CheckUnlockingService service = new org.ellectra.wscheckunlock.CheckUnlockingService();
                org.ellectra.wscheckunlock.CheckUnlockingPortType port = service.getCheckUnlockingPort();
                // TODO initialize WS operation arguments here
                org.ellectra.wscheckunlock.CheckUnlockingRequest part1 = new org.ellectra.wscheckunlock.CheckUnlockingRequest();
                part1.setActorSignature(dUserloginsignature);
                part1.setCallForTenderID(Integer.valueOf(dtemp));
                org.ellectra.wscheckunlock.CheckUnlockingResponse result = port.checkUnlockingOperation(part1);
                java.util.GregorianCalendar g = result.getPhaseEnds().toGregorianCalendar();
                DateToOpen = g.getTime();
            //out.println("Result = "+result);
            } catch (Exception ex) {
                // TODO handle custom exceptions here
            }
                                                    %>
                                                    
                                                          
                                                    Time Left : <span id="countdown1"><%=DateToOpen%></span>
                                                </p>
                                                
                                                
                                                <h:panelGrid border="0" columns="1" style="width: 524px;">
                                                    <h:outputText value="#{unlocktender.unlockingStatusStringText}"/>
                                                    <f:verbatim>&nbsp</f:verbatim>
                                                    
                                                    <h:dataTable id="peopletounlockthiscall" value="#{unlocktender.ulist}" 
                                                                 binding="#{unlocktender.udata}" var="tenderus" 
                                                                 style="width: 524px" border="1"
                                                                 columnClasses="none, none"
                                                                 rowClasses="gridstyle"
                                                                 headerClass="gridstyle">

                                                            <h:column id="POopenFullName">
                                                                    <f:facet name="header">
                                                                        <h:outputText value="Procurement Officer" />
                                                                    </f:facet>
                                                                    <h:outputText value="#{tenderus.fullname}" />
                                                            </h:column>

                                                             <h:column id="Status">
                                                                    <f:facet name="header">
                                                                        <h:outputText value="Status" />
                                                                    </f:facet>
                                                                    <h:outputText value="#{tenderus.status}" rendered="#{tenderus.shows}"/>

                                                                    <h:commandLink id="confirmopent" styleClass="link" immediate="true" action="#{unlocktender.unlockusertender}" rendered="#{tenderus.showb}">
                                                                        <h:outputText value="UNLOCK"/>
                                                                        <f:param name="id" value="#{tenderus.tpid}"/>
                                                                    </h:commandLink>
                                                            </h:column>

                                                    </h:dataTable>
                                                    <f:verbatim>&nbsp</f:verbatim>						

                                                    <h:outputText value="#{unlocktender.unlockStringText}"/>
                                                
                                                </h:panelGrid>
                                                
                                            </h:form>
                                            <br />
                                        </div>
                                    </td>
                                    <!-- END OF CENTRAL CONTENT CELL -->



<!-- VERTICAL SEPERATOR CELL -->
				<td width="14"></td>
			</tr>
		</table>
		</td>
	</tr>

	<%@ include file="footer.jsp"%>
</table>
</div>
</body>

</html>

</f:view>