<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Check_Select.aspx.cs" Inherits="eFrameWork.Application.Check_Select" %>
<%@ Import Namespace="EKETEAM.FrameWork" %>
<%@ Import Namespace="EKETEAM.Data" %>

<div class="nav">您当前位置：<a href="Default.aspx">首页</a> -> 数据上报 -> <%=row["mc"].ToString() %>
<%if (model.Power.Table.Columns.Contains("export") && model.Power["export"].ToString() == "true")
  {%>
<a style="float:right;margin-top:10px;" class="button" href="Check/Check_Export.aspx?AppItem=<%=AppItem %>&PlanID=<%=PlanID %>&type=1" target="_blank"><span><i class="export">导出</i></span></a>
<%}%>
</div>

<script>

    function setJCFS(cjfs, sfzh)
    {

        var url = "?AppItem=<%=AppItem%>&PlanID=<%=PlanID%>&code=<%=code%>&sfzh=" + sfzh + "&cjfs=" + cjfs;
        $.ajax({
            type: "GET",
            async: false,
            url: url,
            dataType: "html",
            success: function (data) {
                layer.msg(data);
            }
        });
    };
    function selectPerson(tr,sfzh)
    {
        var src = getEventObject();
        if (src.tagName == "SELECT" || src.tagName == "OPTION") { return; }
        var input = src.tagName == "INPUT" ? src : $(tr).find("input:eq(0)").get(0);

        if (src.tagName != "INPUT")
        {
            input.checked = !input.checked;
        }

        var url = "?AppItem=<%=AppItem%>&PlanID=<%=PlanID%>&code=<%=code%>&sfzh=" + sfzh + "&value=" + (input.checked ? "1" : "0");

        //layer.msg(input.checked + "::" + src.tagName);
        //alert(url);
        //return;
        $(tr).find("select:eq(0)").attr("disabled", !input.checked);
        $.ajax({
            type: "GET",
            async: false,
            url: url,
            dataType: "html",
            success: function (data){
                
                if (data.indexOf("成功") == -1)
                {
                    input.checked = !input.checked;
                }

                layer.msg(data);
            }
        });
    };
    function selectall(obj)
    {     
        if (obj.checked)
        {
            $("#eDataTable tbody tr input:not(checked)").each(function (i, elem) {
                //alert(i);
                //alert($(this).parent().parent().get(0).tagName);
                $(this).parent().parent().get(0).click();
            });
        }
    };
</script>

<div style="margin:10px;">


<table height="100%" width="100%" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="250" />
<col />
</colgroup>
 <tr valign="top">
     <td width="250"><asp:Literal ID="LitOrgList" runat="server" /></td>
     <td>
         <div class="esearchgroup" style="display:none;">
<a href="javascript:;" onfocus="this.blur();" class="cur">所有</a>
<a href="javascript:;" onfocus="this.blur();">已上报</a>
<a href="javascript:;" onfocus="this.blur();">未上报</a>
</div>    
<dl id="eSearchBox" class="ePanel" style="display:none;">
<dt><h1 onclick="showPanel(this);" class="search"><a href="javascript:;" class="cur" onfocus="this.blur();"></a>搜索</h1></dt>
<dd style="display:none;">
<form id="frmsearch" name="frmsearch" method="post" onsubmit="return goSearch(this);" action="<%=elist.getSearchURL()%>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="eDataView">
<colgroup>
<col width="120" />
<col />
</colgroup>

<tr>
<td class="title">姓名：</td>
<td class="content"><span class="eform"><ev:eSearchControl ID="s3" Name="s3" ControlType="text" Field="XM" Operator="like" FieldName="批次编号" DataType="string" runat="server" /></span></td>
</tr>

<tr>
<td colspan="2" class="title" style="text-align:left;padding-left:125px;">
<a class="button" href="javascript:;" onclick="if(frmsearch.onsubmit()!=false){frmsearch.submit();}"><span><i class="search">搜索</i></span></a>
</td>
</tr>
</table>
</form>
</dd>
</dl>
</div>
<div style="margin:0px;overflow-x:auto;overflow-y:hidden;">

<asp:Repeater id="eDataTable" runat="server">
<HeaderTemplate>
<table id="eDataTable" class="eDataTable" border="0" cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr>
<td width="60">
    <input name="selall" id="selall" type="checkbox" value="checkbox" onclick="selectall(this);" /><label for="selall" style="display:inline-block;margin-left:5px;">全选</label></td>
<td width="110">采集方式</td>
<td >姓名</td>
<td >身份证号</td>
<td >联系电话</td>
<td >性别</td>
<td >民族</td>
<td >地址</td>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr onclick="selectPerson(this,'<%# Eval("SFZH").ToString() %>');">
<td height="35"><input name="checkbox" type="checkbox" value="<%# Eval("PersonID").ToString() %>"<%# Eval("has").ToString() == "true" ? " checked=\"checked\"" : "" %> /></td>
<td><select onChange="setJCFS(this.value,'<%# Eval("SFZH").ToString() %>');"<%# Eval("has").ToString() == "true" ? "" : " disabled=\"disabled\"" %>>
    <%# eOleDB.getOptions("select mc from Dictionaries where ParentID='716ab872-7962-4e1d-9239-094230839562' and delTag=0 order by px,AddTime","mc","mc",Eval("CJFS").ToString())  %>
    </select>
    </td>
<td><%# Eval("XM").ToString() %></td>
<td><%# Eval("SFZH").ToString() %></td>
<td><%# Eval("LXDH").ToString() %></td>
<td><%# Eval("XB").ToString() %></td>
<td><%# Eval("MZ").ToString() %></td>
<td><%# Eval("DZ").ToString() %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
 </tbody>
</table>
</FooterTemplate>
</asp:Repeater>



</div>
<div style="margin:10px;">
<ev:ePageControl ID="ePageControl1" PageSize="20" PageNum="9" runat="server" />
</div>

</td>
 </tr>
</table>