<%@ page language="VB" autoeventwireup="false" enabletheming="false" validaterequest="false" inherits="WebExam.Web.paper_listc, App_Web_4fcdyx4d" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/modul/displayTest.ascx" TagName="displayTest" TagPrefix="uc1" %>
<%@ Register src="~/modul/WebMsg.ascx" tagname="WebMsg" tagprefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link href="../../style/main.css" rel="stylesheet" type="text/css" />
    <script src="../../jslib/requestUrl.js" type="text/javascript"></script>
    <script src="../../jslib/URLDecode.vbs" type="text/vbscript"></script>
      <script type="text/javascript">
   function confirmDel(){return (confirm("确定要删除吗？删除后不可恢复！"))}
   var _testId;
    function edit(testId){
      _testId =testId;document.getElementById("T_insert").value="0";
      document.getElementById("T_testId").value=_testId;
      //location="store_a.aspx"+self.location.search+"&testid="+testId;
      var p=new Array();p[0]=self;
    parent.editTest(testId);//,p,"dialogHeight:500px;dialogWidth:770px;scroll:no;Status:no;help:no")
    
    }
    function appendToPaper(){
     var checkList=checkselect();
     if (checkList.length==0) { alert("请先选择试题！"); return;}
     var op=window.parent.opener;
     if(op==null) { alert("未发现试卷编辑页面，无法添加！"); return;}
     var appendto=targetQueryString(self.top,"append");
     var paperid = targetQueryString(self.top, "paperid");
     
     op.appendToPaper("c",requestQueryString("subjectid"),checkList,appendto,paperid);
    }
   
 
    function checkselect() {
   
   var checkList=new Array();
   if(form1.cb_selected==null)return checkList;
   var checklength=form1.cb_selected.length;
   if (checklength==undefined)
   {
     if (form1.cb_selected.checked)
     {checkList[checkList.length]=form1.cb_selected.value;return checkList;}
   }
  
  for(var i=0; i<checklength;i++)
   {
     if (form1.cb_selected(i).checked)
      checkList[checkList.length]=form1.cb_selected(i).value;
   }
  
  return checkList;
  
}
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name == 'cb_selected')
       e.checked = form.chkall.checked;
    }
    
  }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
  
<uc2:WebMsg ID="WebMsg1" runat="server" />
    <div style="min-width:800px; margin:0">
        
       
        <div style="text-align: center; font-size: large">
            题库管理
        </div>
        <div style="margin: 10px">
            当前科目：<asp:Label ID="L_subjectName" runat="server" Text=""></asp:Label>
            知识点
            <asp:DropDownList ID="D_keyPoint" runat="server" Style="color: navy; background-color: #cccccc">
                <asp:ListItem Value="-1" Text="不限"></asp:ListItem>
            </asp:DropDownList>
            难度
            <asp:DropDownList ID="D_dgree" runat="server" Style="color: navy; background-color: #cccccc">
                <asp:ListItem Value="127" Text="不限"></asp:ListItem>
                <asp:ListItem Value="0" Text="0"></asp:ListItem>
                <asp:ListItem Value="1" Text="1"></asp:ListItem>
                <asp:ListItem Value="2" Text="2"></asp:ListItem>
                <asp:ListItem Value="3" Text="3"></asp:ListItem>
                <asp:ListItem Value="4" Text="4"></asp:ListItem>
                <asp:ListItem Value="5" Text="5"></asp:ListItem>
            </asp:DropDownList>
            <asp:Button ID="Btn_ok" runat="server" Text="确定" />
        </div>
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="id">
            <LayoutTemplate>
                <ul id="itemPlaceholderContainer" runat="server" style="width: 100%; font-family: Verdana, Arial, Helvetica, sans-serif;
                    list-style-type: none; left: 0px; padding: 0px; margin: 0px">
                    <li id="itemPlaceholder" runat="server" />
                </ul>
            </LayoutTemplate>
            <EmptyDataTemplate>
                未返回数据。
            </EmptyDataTemplate>
            <EditItemTemplate>
            </EditItemTemplate>
            <ItemTemplate>
                <li style="background-color: #E0FFFF; color: #333333;">
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td valign="top">
                                <input type="checkbox"  name="cb_selected" value="<%# Eval("id") %>" />
                             
                            </td>
                            <td>
                                <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td valign="top">
                                            <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.id") %>'
                                                Style="vertical-align: top; font-weight: bold;"></asp:Label>.
                                        </td>
                                        <td>
                                            <uc1:displayTest ID="displayTest1" runat="server" text='<%# DataBinder.Eval(Container, "DataItem.timu") %>'
                                                plain='<%# DataBinder.Eval(Container, "DataItem.plaintext") %>' />
                                        </td>
                                    </tr>
                                  
                                </table>
                            </td>
                        </tr>
                    </table>
                </li>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <li style="background-color: #FFFFFF; color: #284775;">
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td valign="top">
                                <input type="checkbox"  name="cb_selected" value="<%# Eval("id") %>" />
                               
                            </td>
                            <td>
                                <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td valign="top">
                                            <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.id") %>'
                                                Style="vertical-align: top; font-weight: bold;"></asp:Label>.
                                        </td>
                                        <td>
                                            <uc1:displayTest ID="displayTest1" runat="server" text='<%# DataBinder.Eval(Container, "DataItem.timu") %>'
                                                plain='<%# DataBinder.Eval(Container, "DataItem.plaintext") %>' />
                                        </td>
                                    </tr>
                                  
                                </table>
                            </td>
                        </tr>
                    </table>
                </li>
            </AlternatingItemTemplate>
            <ItemSeparatorTemplate>
                <br />
            </ItemSeparatorTemplate>
        </asp:ListView>
        <pagers:PageNumbersPager ID="PageNumbersPager1" runat="server" />
        <div style="margin-top: 10px; margin-bottom: 10px; font-size: larger; font-weight: bold">
            <input id="selectAll" name="chkall" onclick="CheckAll(this.form)" type="checkbox" value="on" /><label for="selectAll"><strong>选中所有</strong></label>
             
            <a href="javascript:appendToPaper()">添加到试卷</a>
          
        </div>
    </div>
    </form>
</body>
</html>
