<%-- 
    Document   : ConfirmCount
    Created on : Dec 1, 2008, 4:50:11 PM
    Author     : Varun
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <TITLE> Confirm Count </TITLE>
        <META NAME="Generator" CONTENT="EditPlus">
        <META NAME="Author" CONTENT="">
        <META NAME="Keywords" CONTENT="">
        <META NAME="Description" CONTENT="">
        <%@ page import ="java.sql.*" %>
        <%@ page import="dbqueries.*" %>
        <%@ page import="java.text.SimpleDateFormat" %>
        <script type='text/javascript' src='zapatec.js'></script>        
        <!-- Custom includes -->	
        <!-- import the calendar script -->
        <script type="text/javascript" src="calendar.js"></script>
        
        <!-- import the language module -->
        <script type="text/javascript" src="calendar-en.js"></script>
        
        <!-- Theme css -->
        <link href="forest.css" rel="stylesheet" type="text/css"> 
    </HEAD>
    
    <jsp:include page="banner.html"></jsp:include>
    </head>
    <body>
        <p align="left">&nbsp;</p>
        <p align="left">&nbsp;</p>
        <p align="center"><b><font size="4">Confirm Meetings are :-</font></b></p>
        
        <div align="center">
            <center>
                <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="54%">
                    <tr>
                        <td width="25%" bgcolor="#FFFF00" align="center"><b>Meeting ID</b></td>
                        <td width="25%" bgcolor="#FFFF00" align="center"><b>Count</b></td>
                        <td width="25%" bgcolor="#FFFF00" align="center"><b>Start Date</b></td>
                        <td width="25%" bgcolor="#FFFF00" align="center"><b>End Date</b></td>
                    </tr>
                    
                    <%
       
        String a = (String)session.getAttribute("meetingAgenda");
        String a1 = (String) session.getAttribute("id");
        session.setAttribute("id", a1);
        
    Connection con = DataBase.getConnection();
    Statement st = con.createStatement();
    String q = "select count(meetingid) as count, meetingid,startDateTime,endDateTime from sdms.scheduledmeetings where status = 1 and agenda in (select agenda from sdms.scheduledmeetings where empid='"+a1+"' and status=5 and agenda = '" +a+"') group by meetingid order by count desc";
    
   ResultSet rs = st.executeQuery(q);
   
                 
            while (rs.next()) {
                
                int i = rs.getInt("count");
                int s = rs.getInt("meetingid");
                Timestamp startdatetime = rs.getTimestamp("startDateTime");
                Timestamp enddatetime = rs.getTimestamp("endDateTime");

                SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy [hh:mm]");
                String s1 = sdf.format(startdatetime);
                String s2 = sdf.format(enddatetime);

                    %>
                    <tr>
                        <td width="25%" align="center"><a href="MeetingConfirmed?meetingid=<%=s%>"><%=s%></a></td>
                        <td width="25%" align="center"><%=i%></td>
                        <td width="25%" align="center"><%=s1%></td>
                         <td width="25%" align="center"><%=s2%><%}%></td>
                    </tr>
                </table>
            </center>
        </div>
        
        
        
        
    </body>
</html>
