<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="pg_ExamAdd.aspx.cs" Inherits="rl_admins_pg_ExamAdd" 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; width:600px;">
                        <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>
                                                <table border="0" cellpadding="0" cellspacing="5px">
                                                    <tr>
                                                        <td align="left" valign="middle">
                                                            <asp:Label ID="Label1" runat="server" Text="کلاس مربوطه :"></asp:Label>
                                                        </td>
                                                        <td align="right" valign="middle" colspan="4">
                                                            <asp:TextBox ID="tbClassId" runat="server" Font-Names="Tahoma" Font-Size="8pt" Width="50px" ReadOnly="true" BackColor="Control"></asp:TextBox>
                                                            <asp:TextBox ID="tbClassTitle" runat="server" Font-Names="Tahoma" Font-Size="8pt" Width="150px" ReadOnly="true" BackColor="Control"></asp:TextBox>
                                                            <cc1:TextBoxWatermarkExtender ID="tbClassTitle_TextBoxWatermarkExtender" 
                                                                runat="server" Enabled="True" TargetControlID="tbClassTitle" 
                                                                WatermarkCssClass="WaterMarkClass" WatermarkText="اجباری">
                                                            </cc1:TextBoxWatermarkExtender>
                                                        </td>
                                                        <td align="right" valign="middle" colspan="2">
                                                            <asp:LinkButton ID="btnSelectClass" runat="server" CssClass="gridsmallbuttons" 
                                                                Width="60px" Height="20px" style="margin-top:4px;" 
                                                                onclick="btnSelectClass_Click" >انتخاب</asp:LinkButton>
                                                            <asp:Button ID="btnAddClasses2" runat="server" Text="" style="display:none;"/>
                                                            <cc1:ModalPopupExtender ID="mpeClasses" runat="server" 
                                                                 TargetControlID="btnAddClasses2" PopupControlID="panelClasses" 
                                                                 BackgroundCssClass="modalback" CacheDynamicResults="True">
                                                            </cc1:ModalPopupExtender>
                                                        </td>
                                                    </tr> 
                                                    <tr>
                                                        <td align="left" valign="middle">
                                                            <asp:Label ID="Label2" runat="server" Text="عنوان آزمون :"></asp:Label>
                                                        </td>
                                                        <td align="right" valign="middle" colspan="7">
                                                            <asp:TextBox ID="tbExamName" runat="server" Font-Names="Tahoma" Font-Size="8pt" Width="200px"></asp:TextBox>
                                                            <cc1:TextBoxWatermarkExtender ID="tbExamName_TextBoxWatermarkExtender" 
                                                                runat="server" Enabled="True" TargetControlID="tbExamName" 
                                                                WatermarkCssClass="WaterMarkClass" WatermarkText="اجباری">
                                                            </cc1:TextBoxWatermarkExtender>
                                                        </td>
                                                    </tr>  
                                                    <tr>
                                                        <td align="left">
                                                            <asp:Label ID="Label3" runat="server" Text="تاریخ برگزاری :"></asp:Label>
                                                        </td>
                                                        <td align="left">
                                                            <asp:Label ID="Label4" runat="server" Text="روز :"></asp:Label>
                                                        </td>
                                                        <td align="right">
                                                            <asp:DropDownList ID="cmbDayOfWeek" runat="server" Font-Names="Tahoma" Font-Size="8pt" Width="80px">
                                                                <asp:ListItem></asp:ListItem>
                                                                <asp:ListItem>شنبه</asp:ListItem>
                                                                <asp:ListItem>یکشنبه</asp:ListItem>
                                                                <asp:ListItem>دوشنبه</asp:ListItem>
                                                                <asp:ListItem>سه شنبه</asp:ListItem>
                                                                <asp:ListItem>چهارشنبه</asp:ListItem>
                                                                <asp:ListItem>پنجشنبه</asp:ListItem>
                                                                <asp:ListItem>جمعه</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td align="right">
                                                            <asp:DropDownList ID="cmbDay" runat="server" Width="40px" Font-Names="Tahoma" Font-Size="8pt">
                                                                    <asp:ListItem></asp:ListItem>
                                                                    <asp:ListItem>1</asp:ListItem>
                                                                    <asp:ListItem>2</asp:ListItem>
                                                                    <asp:ListItem>3</asp:ListItem>
                                                                    <asp:ListItem>4</asp:ListItem>
                                                                    <asp:ListItem>5</asp:ListItem>
                                                                    <asp:ListItem>6</asp:ListItem>
                                                                    <asp:ListItem>7</asp:ListItem>
                                                                    <asp:ListItem>8</asp:ListItem>
                                                                    <asp:ListItem>9</asp:ListItem>
                                                                    <asp:ListItem>10</asp:ListItem>
                                                                    <asp:ListItem>11</asp:ListItem>
                                                                    <asp:ListItem>12</asp:ListItem>
                                                                    <asp:ListItem>13</asp:ListItem>
                                                                    <asp:ListItem>14</asp:ListItem>
                                                                    <asp:ListItem>15</asp:ListItem>
                                                                    <asp:ListItem>16</asp:ListItem>
                                                                    <asp:ListItem>17</asp:ListItem>
                                                                    <asp:ListItem>18</asp:ListItem>
                                                                    <asp:ListItem>19</asp:ListItem>
                                                                    <asp:ListItem>20</asp:ListItem>
                                                                    <asp:ListItem>21</asp:ListItem>
                                                                    <asp:ListItem>22</asp:ListItem>
                                                                    <asp:ListItem>23</asp:ListItem>
                                                                    <asp:ListItem>24</asp:ListItem>
                                                                    <asp:ListItem>25</asp:ListItem>
                                                                    <asp:ListItem>26</asp:ListItem>
                                                                    <asp:ListItem>27</asp:ListItem>
                                                                    <asp:ListItem>28</asp:ListItem>
                                                                    <asp:ListItem>29</asp:ListItem>
                                                                    <asp:ListItem>30</asp:ListItem>
                                                                    <asp:ListItem>31</asp:ListItem>
                                                                </asp:DropDownList>
                                                        </td>
                                                        <td align="left">
                                                            <asp:Label ID="Label5" runat="server" Text="ماه :"></asp:Label>
                                                        </td>
                                                        <td align="right">
                                                            <asp:DropDownList ID="cmbMonth" runat="server" Width="80px" Font-Names="Tahoma" Font-Size="8pt">
                                                                    <asp:ListItem></asp:ListItem>
                                                                    <asp:ListItem>فروردین</asp:ListItem>
                                                                    <asp:ListItem>اردیبهشت</asp:ListItem>
                                                                    <asp:ListItem>خرداد</asp:ListItem>
                                                                    <asp:ListItem>تیر</asp:ListItem>
                                                                    <asp:ListItem>مرداد</asp:ListItem>
                                                                    <asp:ListItem>شهریور</asp:ListItem>
                                                                    <asp:ListItem>مهر</asp:ListItem>
                                                                    <asp:ListItem>آبان</asp:ListItem>
                                                                    <asp:ListItem>آذر</asp:ListItem>
                                                                    <asp:ListItem>دی</asp:ListItem>
                                                                    <asp:ListItem>بهمن</asp:ListItem>
                                                                    <asp:ListItem>اسفند</asp:ListItem>
                                                                </asp:DropDownList>
                                                        </td>
                                                        <td align="left">
                                                            <asp:Label ID="Label6" runat="server" Text="سال :"></asp:Label>
                                                        </td>
                                                        <td align="right">
                                                            <asp:DropDownList ID="cmbYear" runat="server" Width="60px" Font-Names="Tahoma" Font-Size="8pt">
                                                                    <asp:ListItem></asp:ListItem>
                                                                    <asp:ListItem>1380</asp:ListItem>
                                                                    <asp:ListItem>1381</asp:ListItem>
                                                                    <asp:ListItem>1382</asp:ListItem>
                                                                    <asp:ListItem>1383</asp:ListItem>
                                                                    <asp:ListItem>1384</asp:ListItem>
                                                                    <asp:ListItem>1385</asp:ListItem>
                                                                    <asp:ListItem>1386</asp:ListItem>
                                                                    <asp:ListItem>1387</asp:ListItem>
                                                                    <asp:ListItem>1388</asp:ListItem>
                                                                    <asp:ListItem>1389</asp:ListItem>
                                                                    <asp:ListItem>1390</asp:ListItem>
                                                                    <asp:ListItem>1391</asp:ListItem>
                                                                    <asp:ListItem>1392</asp:ListItem>
                                                                    <asp:ListItem>1393</asp:ListItem>
                                                                    <asp:ListItem>1394</asp:ListItem>
                                                                    <asp:ListItem>1395</asp:ListItem>
                                                                    <asp:ListItem>1396</asp:ListItem>
                                                                    <asp:ListItem>1397</asp:ListItem>
                                                                    <asp:ListItem>1398</asp:ListItem>
                                                                    <asp:ListItem>1399</asp:ListItem>
                                                                    <asp:ListItem>1400</asp:ListItem>
                                                                </asp:DropDownList>
                                                        </td>
                                                    </tr>  
                                                    <tr>
                                                        <td align="left" valign="middle">
                                                            <asp:Label ID="Label7" runat="server" Text="نوع آزمون :"></asp:Label>
                                                        </td>
                                                        <td align="right" valign="middle" colspan="7">
                                                            <asp:DropDownList ID="cmbExamType" runat="server" Font-Names="Tahoma" 
                                                                Font-Size="8pt" Width="200px" 
                                                                onselectedindexchanged="cmbExamType_SelectedIndexChanged" 
                                                                AutoPostBack="True">
                                                                <asp:ListItem></asp:ListItem>
                                                                <asp:ListItem>کتبی</asp:ListItem>
                                                                <asp:ListItem>عملی</asp:ListItem>
                                                                <asp:ListItem>شفاهی</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left" valign="middle">
                                                            <asp:Label ID="Label9" runat="server" Text="نوع سوالات :"></asp:Label>
                                                        </td>
                                                        <td align="right" valign="middle" colspan="4">
                                                            <asp:DropDownList ID="cmbQuestionsType" runat="server" Font-Names="Tahoma" Font-Size="8pt" Width="200px" Enabled="false">
                                                                <asp:ListItem></asp:ListItem>
                                                                <asp:ListItem>تستی</asp:ListItem>
                                                                <asp:ListItem>تشریحی</asp:ListItem>
                                                                <asp:ListItem>تستی-تشریحی</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td align="left" valign="middle">
                                                            <asp:Label ID="Label10" runat="server" Text="نمره از :"></asp:Label>
                                                        </td>
                                                        <td colspan="2" align="right" valign="middle">
                                                            <asp:TextBox ID="tbMaxGrade" runat="server" Font-Names="Tahoma" Font-Size="8pt" Width="50px"></asp:TextBox>
                                                            <cc1:TextBoxWatermarkExtender ID="tbMaxGrade_TextBoxWatermarkExtender" 
                                                                runat="server" Enabled="True" TargetControlID="tbMaxGrade" 
                                                                WatermarkCssClass="WaterMarkClass" WatermarkText="اجباری">
                                                            </cc1:TextBoxWatermarkExtender>
                                                            <asp:RegularExpressionValidator ID="validExpAmount" runat="server" ErrorMessage="عدد" ControlToValidate="tbMaxGrade" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left" valign="top">
                                                            <asp:Label ID="Label8" runat="server" Text="توضیحات :"></asp:Label>
                                                        </td>
                                                        <td align="right" valign="middle" colspan="7">
                                                            <asp:TextBox ID="tbStatements" runat="server" Font-Names="Tahoma" 
                                                                Font-Size="8pt" Width="392px" TextMode="MultiLine" Height="79px"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </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>
                            <tr>
                                <td colspan="3" style="padding-top:5px;">
                                    <table border="0" cellpadding="0" cellpadding="0" width="100%">
                                        <tr>
                                            <td align="center" valign="top">
                                                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                                                    <ContentTemplate>
                                                        <asp:LinkButton ID="btnOk" runat="server"  Height="25px" style="margin-top : 10px;"
                                                            Width="100px" CssClass="buttons" onclick="btnOk_Click" >تأیید</asp:LinkButton>
                                                        <div id="divProgressOkButton" style="width:40px; height:40px; vertical-align:middle; text-align:center;">
                                                        <asp:UpdateProgress ID="UpdateProgressOkButton" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
                                                            <ProgressTemplate>
                                                                <asp:Image ID="Image3" runat="server" ImageUrl="~/images/loading1.gif" Width="40px" Height="40px"/>
                                                            </ProgressTemplate>
                                                        </asp:UpdateProgress>
                                                        </div>
                                                        <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel> 
                                            </td>
                                            <td align="left" valign="top" width="70px">
                                                <asp:LinkButton ID="btnBack" runat="server"  Height="35px" style="position:relative; top: 0px; right: 0px;"
                                                    Width="70px" CssClass="backbutton" onclick="btnBack_Click" ></asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </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="SqlDataSource1" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                    ProviderName="System.Data.SqlClient" 
                                    SelectCommand="SELECT t_Classes.classId, t_Classes.classTitle, t_Classes.status, t_Teachers.fullName, t_Courses.courseName 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"></asp:SqlDataSource>
                                <div style="font-family:Tahoma; font-size:8pt; text-align:right; color:White;">لیست 
                                    کلاس هایی&nbsp; که مدرس آن شما هستید :</div>
                                <div style="margin-top : 10px;">
                                    <asp:GridView ID="GridClasses" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                        DataKeyNames="classId" DataSourceID="SqlDataSource1" CssClass="grid" 
                                        PagerStyle-CssClass="gridPager" onrowcommand="GridClasses_RowCommand" 
                                        onpageindexchanging="GridClasses_PageIndexChanging" >
                                        <Columns>
                                            <asp:BoundField DataField="classId" HeaderText="کد کلاس" InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:TemplateField HeaderText="عنوان کلاس" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnSelect" CommandName="SelectPress" CommandArgument='<%#Eval("classId") %>' runat="server" style="text-decoration:none;"><%#Eval("classTitle").ToString() %></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="fullName" HeaderText="نام مدرس" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:BoundField DataField="courseName" HeaderText="نام دوره" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            
                                        </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>

