<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="pg_Presence.aspx.cs" Inherits="rl_admins_pg_Presence" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" Runat="Server">
    <div class="contentDiv">
        <table border="0" cellpadding="0" cellspacing="0" >
            <tr id="Tr1">
                <td id="rightTableData" valign="top">
                    <div id="linksPanel" style="margin-right:15px; margin-top : 10px;">
                        <table id="tblpanel" border="0" cellpadding="0" cellspacing="0" style="width:200px;">
                            <tr>
                                <td id="panelheadright" class="panelheadright">
                                </td>
                                <td id="panelheadrepeat" class="panelheadrepeat" align="center" style="width:160px;">
                                    <asp:Label ID="lblpanelHead" runat="server" Text="منوی سایت" style="color:White; font-weight:bold; "></asp:Label>
                                </td>
                                <td id="panelheadleft" class="panelheadleft">
                                </td>
                            </tr>
                            <tr>
                                <td id="panelmarginright" class="panelmarginright">
                                </td>
                                <td valign="top" class="panelcontentback" style="background-image:none; background-color : White; "> <!-- ************ Content Place !-->
                                    <div class="panelcontent" style="margin-top:17px;">
                                        <asp:Panel ID="panelMenues" runat="server">
                                        </asp:Panel>
                                    </div>
                                </td>
                                <td id="panelmarginleft" class="panelmarginleft" align="left">
                                </td>
                            </tr>
                            <tr>
                                <td id="panelbottomright" class="panelbottomright" align="right" >
                                </td>
                                <td id="panelbottomrepeat" class="panelbottomrepeat" style="width:160px;">
                                </td>
                                <td id="panelbottomleft" class="panelbottomleft" align="left";>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
                <td id="contentTableData" style="width:100%; padding-right : 10px;" align="right"; valign="top"; >
                     <div id="frameContainer" style="padding:10px 10px 25px 10px;">
                        <table id="Table2" border="0" cellpadding="0" cellspacing="0" style="width:100%;">
                            <tr>
                                <td id="Td92" class="panelheadright">
                                </td>
                                <td id="Td102" class="panelheadrepeat" align="center" >
                                    <asp:Label ID="lblFrameTitle" runat="server" Text="لیست کلاس های جاری" style="color:White;"></asp:Label>
                                </td>
                                <td id="Td112" class="panelheadleft">
                                </td>
                            </tr>
                            <tr>
                                <td id="Td122" class="panelmarginright">
                                </td>
                                <td valign="top" class="panelcontentback" > <!-- ************ Content Place !-->
                                    <div id="divRoleType" class="panelcontent" style="text-align:center; " runat="server">
                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <div id="gridUsers">
                                                    <asp:GridView ID="GridView1" runat="server" style="width:100%;" 
                                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                                        CssClass="grid" PageSize="15" PagerStyle-CssClass="gridPager"  
                                                        DataSourceID="SqlDataSource1" onrowcommand="GridView1_RowCommand">
                                                        <PagerSettings NextPageText="&gt;" PreviousPageText="&lt;" />
                                                        <Columns>
                                                            <asp:BoundField DataField="classId" HeaderText="کد کلاس" InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                                            <asp:BoundField DataField="classTitle" HeaderText="عنوان کلاس" InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                                            <asp:BoundField DataField="courseName" HeaderText="نام دوره" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                                            <asp:BoundField DataField="fullName" HeaderText="نام مدرس" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                                            <asp:TemplateField HeaderText="حضور غیاب" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="btnPresence" runat="server" CommandName="PresencePress" CommandArgument='<%#Eval("classId") %>' CssClass="gridsmallbuttons" Width="60px" Height="20px" style="margin-top:4px;">حضور غیاب</asp:LinkButton>
                                                                </ItemTemplate>
                                                                <HeaderStyle CssClass="gridHeader" />
                                                                <ItemStyle CssClass="gridCell" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                        <PagerStyle CssClass="gridPager" BorderStyle="None" HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    </asp:GridView>
                                                </div>
                                                <asp:Button ID="btnAddClasses2" runat="server" Text="" style="display:none;"/>
                                                <cc1:ModalPopupExtender ID="mpeSessions" runat="server" 
                                                     TargetControlID="btnAddClasses2" PopupControlID="panelClasses" 
                                                     BackgroundCssClass="modalback" CacheDynamicResults="True">
                                                </cc1:ModalPopupExtender>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                            ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                            ProviderName="System.Data.SqlClient" 
                                            SelectCommand="SELECT t_Classes.classId, t_Classes.classTitle, t_Courses.courseName, t_Teachers.fullName FROM t_Classes INNER JOIN t_Teachers ON t_Classes.teacherId = t_Teachers.teacherId INNER JOIN t_Courses ON t_Classes.courseId = t_Courses.courseId WHERE (t_Classes.status = N'جاری')"></asp:SqlDataSource>
                                    </div>
                                </td>
                                <td id="Td132" class="panelmarginleft" align="left">
                                </td>
                            </tr>
                            <tr>
                                <td id="Td142" class="panelbottomright" align="right" >
                                </td>
                                <td id="Td152" class="panelbottomrepeat" >
                                </td>
                                <td id="Td162" class="panelbottomleft" align="left";>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <!-- *********************************************************************** !-->
                    <asp:Panel ID="panelClasses" runat="server" BorderStyle="Solid" Width="600px" BorderColor="Khaki" BorderWidth="2px" style="padding:10px 10px 10px 10px; background-color:rgb(0,0,0)">
                        <asp:UpdatePanel ID="upClasses" runat="server" >
                            <ContentTemplate> <!-- PANEL COURSES CONTENT : !-->
                                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                    ProviderName="System.Data.SqlClient" 
                                    SelectCommand="SELECT sessionId, classId, sessionDate, sessionTime, classNumber FROM t_ClassSessions WHERE (classId = 10)"></asp:SqlDataSource>
                                <div style="font-family:Tahoma; font-size:8pt; text-align:right; color:White;">لیست جلسات ثبت شده برای این کلاس :</div>
                                <div style="margin-top : 10px;">
                                    <asp:GridView ID="GridSessions" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                        DataKeyNames="sessionId" DataSourceID="SqlDataSource2" CssClass="grid" 
                                        PagerStyle-CssClass="gridPager" 
                                        EmptyDataText="برنامه کلاسی برای این کلاس ثبت نشده است." 
                                        onrowcommand="GridSessions_RowCommand" >
                                        <Columns>
                                            <asp:BoundField DataField="sessionDate" HeaderText="تاریخ جلسه" 
                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="sessionTime" HeaderText="ساعت جلسه" 
                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="classNumber" HeaderText="محل کلاس" 
                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                            <asp:TemplateField HeaderText="انتخاب" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnSelect" runat="server" CommandName="SelectPress" CommandArgument='<%#Eval("sessionId") %>' style="text-decoration:none;">انتخاب</asp:LinkButton>
                                                </ItemTemplate>
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <PagerStyle CssClass="gridPager" />
                                    </asp:GridView>
                                </div>
                                <div style="text-align:left; padding-top:5px; font-family:Tahoma; font-size:8pt; color:White;">
                                    <table border="0" cellpadding="0" cellspacing="5px" width="100%">
                                        <tr>
                                            <td align="left" valign="middle" width="100%">
                                                <asp:LinkButton ID="btnStudentsCancel" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="btnStudentsCancel_Click">انصراف</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                             </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                    <!-- ***************************************************************** !-->
                </td>
            </tr>
        </table>
    </div>
</asp:Content>

