<%@ Page Language="VB" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Register TagPrefix="uc" TagName="Menu" Src="~/Views/Shared/Menu.ascx" %>
<%@ Register TagPrefix="uc" TagName="CourseMenu" Src="~/Views/Course/CourseMenu.ascx" %>
<%@ Register TagPrefix="uc" TagName="CourseSearch" Src="~/Views/Course/Search.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Index</title>
<style type="text/css">
.table_client tr th {
	text-align: left;
}
</style>
</head>
<body>
    <uc:Menu id="MenuTop" 
        runat="server" 
        MinValue="1" 
        MaxValue="10" />
    <uc:CourseMenu id="SubMenu" 
        runat="server" 
        MinValue="1" 
        MaxValue="10" />
        <a href="<%response.write( global_asax.WebPath)%>Course/Create">Ajouter un cours</a>
    <h2>Liste des cours</h2>
        <form name="SearchForm" id="SearchForm" method="post" action="course/SetCourseFilter" runat="server" >
    <uc:CourseSearch id="SearchPanel" runat="server" />
    </form>
    <div>
   <%  
       Dim dt As CoursE.coursedata.courseDataTable = Me.ViewData.Item("tablecourse")
     
       %><table class="table_client"><tr>
       <th width="250">Cours</th><th width="60">Jour</th><th width="60">Heure</th><th width="180">Endroit</th><th width="120">Professeur</th><th width="180">Nbr. d'inscrits</th><th width="50"></th></tr>
       <%
           For intCpt As Integer = 0 To dt.DefaultView.ToTable.Rows.Count - 1
       %><tr><td><%            
                     'jour semaine , heure , endroit , prof                     
                     Response.Write(dt.DefaultView.Item(intCpt).Item("COURSE_CODE"))
       %></td><td><%
                      Response.Write(WeekdayName(dt.DefaultView.Item(intCpt).Item("COURSE_D_O_W") + 1, False, Microsoft.VisualBasic.FirstDayOfWeek.Monday))
       %></td><td><%
                      Response.Write(CType(dt.DefaultView.Item(intCpt).Item("COURSE_START_HOUR"), TimeSpan).Hours & ":" & Format(CType(dt.DefaultView.Item(intCpt).Item("COURSE_START_HOUR"), TimeSpan).Minutes, "00") & " - " & CType(dt.DefaultView.Item(intCpt).Item("COURSE_END_HOUR"), TimeSpan).Hours & ":" & Format(CType(dt.DefaultView.Item(intCpt).Item("COURSE_END_HOUR"), TimeSpan).Minutes, "00"))
       %></td><td><%
                      Response.Write(dt.DefaultView.Item(intCpt).Item("VENUE_NAME"))
       %></td><td><%
                      Response.Write(dt.DefaultView.Item(intCpt).Item("EMPLOYEE_NAME"))                      
       %></td><td><%
                      Response.Write(dt.DefaultView.Item(intCpt).Item("INSCRIPTION_COUNT"))
                      'Response.Write(dt.Item(intCpt).COURSE_DESCRIPTION)
       %></td><td><a href="Course/Details/<% Response.Write(dt.DefaultView.Item(intCpt).Item("COURSE_ID")) %>">Voir</a></td></tr><%
             Next
                    %></table>
                    <%
                        Response.Write("<br />Total : " & dt.DefaultView.ToTable.Rows.Count)
   %> 
    
    </div>
</body>
</html>
