<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ResultExam.aspx.cs" Inherits="RM.Web.jiabi.ResultExam" %>

<!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 id="Head1" runat="server">
    <title>学员考试记录</title>
    <link href="../Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    
    <script type="text/javascript">

        var wzInfo = "", bzInfo = "", cbInfo="",bzprop="";
        window.onload = function () {
            var reStr = '<%=resultObj %>';
            if (reStr != "" && reStr != undefined && reStr != 'null' && reStr != '[]') {
                rjson = eval(<%=resultObj %>);
                $("#txtzbNum").val(rjson.ZbNum);
                $("#txtjbNum2").val(rjson.JbNum);
                $("#txtexamNum").val(rjson.ExamNum);                
                $("#txtjbNum").val(rjson.JbNumStr);
                $("#txtwzNum").val(rjson.WzNumStr);
                $("#txtbzNum").val(rjson.BzNumStr);
                wzInfo = rjson.WzInfo;
                bzInfo = rjson.BzInfo;
                cbInfo = rjson.CbInfo;
                bzprop = rjson.BzProp;
                //addwzb(); 
                //addbzb();
                addCurProp("addwzb","1");
                addCurProp("addbzb","2");
                addCurProp("addbzbprop","3");

            } else {
                alert("试卷异常！");
                window.location.href="/jiabi/jbResult.aspx";
            }
        }

        
        //假币的特征和方式
        function addCurProp(actionStr,typeid){
            $.ajax({
                url: "/jiabi/AddQuestions.aspx",
                type: "post",
                data: { action: actionStr,tid:typeid , a: Math.random() },
                dataType: "json",
                success: function (data) {
                    var qjson = data;
                    if (qjson != "" && qjson != undefined && qjson != null && qjson != '[]') {
                    if(typeid=="1"){jsontohtml(eval(qjson),"quehtml");}
                    if(typeid=="2"){jsontohtml2(eval(qjson));}
                    if(typeid=="3"){jsontohtml(eval(qjson),"quehtml3");}
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("网络异常" + XMLHttpRequest.status.toString());
                }
            });
        }


        //添加伪造币
        function addwzb() {
            $.ajax({
                url: "/jiabi/AddQuestions.aspx",
                type: "post",
                data: { "action": "addwzb", a: Math.random() },
                dataType: "json",
                success: function (data) {
                    var qjson = data;
                    if (qjson != "" && qjson != undefined && qjson != null && qjson != '[]') {
                        jsontohtml(eval(qjson));
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("网络异常" + XMLHttpRequest.status.toString());
                }
            });
        }

        //添加变造币
        function addbzb() {
            $.ajax({
                url: "/jiabi/AddQuestions.aspx",
                type: "post",
                data: { "action": "addbzb", a: Math.random() },
                dataType: "json",
                success: function (data) {
                    var qjson = data;
                    if (qjson != "" && qjson != undefined && qjson != null && qjson != '[]') {
                        jsontohtml2(eval(qjson));
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("网络异常" + XMLHttpRequest.status.toString());                    
                }
            });
        }

        var queNum = 0;
        //将JSON转成html
        function jsontohtml(data,htmlstr) {
            if (data.length > 0) {
                var quehtml = "";
                if(htmlstr=="quehtml"){quehtml = "<strong>伪造币特征</strong><font color=\"red\">(选5项,前2项必选)</font><br/>";}
                if(htmlstr=="quehtml3"){quehtml = "<strong>变造币特征</strong><font color=\"red\">(选2项)</font><br/>";}
                for (var i = 0; i < data.length; i++) {
                    quehtml += "<ul data=\"" + data[i].feat_id + "\" >" + data[i].feat_Name;
                    if (data[i].option.length > 0) {
                        for (var j = 0; j < data[i].option.length; j++) {
                            if(htmlstr=="quehtml"){
                                if (wzInfo!=null && wzInfo.indexOf(data[i].option[j]) >= 0) {
                                    quehtml += "<li><input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\" data=\"" + data[i].option[j] + "\" name=\"sss_" + queNum + "\"/>" + data[i].option[j] + "</li>";
                                } else {
                                    quehtml += "<li><input type=\"checkbox\" disabled=\"disabled\" data=\"" + data[i].option[j] + "\" name=\"sss_" + queNum + "\"/>" + data[i].option[j] + "</li>";
                                }
                            }else if(htmlstr=="quehtml3"){
                                if (bzprop!=null && bzprop.indexOf(data[i].option[j]) >= 0) {
                                    quehtml += "<li><input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\" data=\"" + data[i].option[j] + "\" name=\"sss_" + queNum + "\"/>" + data[i].option[j] + "</li>";
                                } else {
                                    quehtml += "<li><input type=\"checkbox\" disabled=\"disabled\" data=\"" + data[i].option[j] + "\" name=\"sss_" + queNum + "\"/>" + data[i].option[j] + "</li>";
                                }
                            }
                        }
                        queNum++;
                    }
                    quehtml += "</ul>";
                }
                quehtml += "</div>";
                $("#"+htmlstr).html(quehtml);
            }
        }

        function jsontohtml2(data) {
            if (data.length > 0) {
                var quehtml = "<strong>变造方式选项</strong><font color=\"red\">(选1项)</font><br/><br/>";
                for (var i = 0; i < data.length; i++) {
                    quehtml += "<ul data=\"" + data[i].feat_id + "\">";// + data[i].feat_Name
                    if (data[i].option.length > 0) {
                        var strque = "";
                        for (var j = 0; j < data[i].option.length; j++) {
                            if (bzInfo!=null && bzInfo.indexOf(data[i].option[j]) >= 0) {
                                quehtml += "<li><input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\" data=\"" + data[i].option[j] + "\" name=\"sss_" + queNum + "\"/>" + data[i].option[j] + "</li>";
                            } else {
                                quehtml += "<li><input type=\"checkbox\" disabled=\"disabled\" data=\"" + data[i].option[j] + "\" name=\"sss_" + queNum + "\"/>" + data[i].option[j] + "</li>";
                            }
                        }
                        queNum++;
                    }
                    quehtml += "</ul>";
                }
                quehtml += "</div>";
                $("#quehtml2").html(quehtml);
            }
        }
                
    </script>
    
    <style type="text/css">        
        *{ font-size:12px; }
    li{ list-style: none; padding-left:20px; }
    table{border-top:1px solid #ccc;border-left:1px solid #ccc;}
    table td{ border-bottom: 1px solid #ccc; border-right: 1px solid #ccc;padding:5px; }
    .txt_hid{ overflow:hidden; }
    .txt{ width:180px; }
    </style>

</head>
<body  style="overflow:scroll;" >

    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            考试记录
        </div>
    </div>

    <div style="width:70%; padding:5px;">
    
    <div style="width:100%; padding:5px 5px 15px 5px; text-align:center; font-size:18px ; font-weight:bold; ">反假货币实操考试记录    
    </div>

    <table style="width:100%;" cellpadding="0" cellspacing="0" >
    <tr  style="text-align:center;" >
    <td>姓名</td><td><label id="lbluname" runat="server" ></label></td>
    <td>身份证号码</td><td><label id="lblcarno" runat="server" >&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;</label></td>
    <td>单位名称</td><td><label id="lbldwmc" runat="server">&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;</label></td>
    </tr>
    <tr>
    <td style="text-align:center;">考试编号</td><td colspan="2"><input type="text" id="txtexamNum"  disabled="disabled" class="txt"  /></td>
    <td rowspan="3" style="text-align:center;">假币冠字号码</td><td colspan="2" rowspan="3">
        <asp:TextBox ID="txtjbNum" runat="server" TextMode="MultiLine" Height="70px" 
            Width="180px" CssClas="txt_hid" disabled="disabled"></asp:TextBox>
            <br /> <font color="red" size="2" >多张假币冠字号码需换行</font>
    </td>
    </tr>
    
    <tr>
    <td style="text-align:center;">假币张数</td><td colspan="2"><input type="text" id="txtjbNum2" maxlength="2" disabled="disabled" class="txt" /></td>
    </tr>

    <tr>
    
    <td style="text-align:center;">真币张数</td><td colspan="2"><input disabled="disabled"  type="text" id="txtzbNum" maxlength="2" class="txt"/></td>
    </tr>

    <tr>
    <td style="text-align:center;">伪造币冠字号码</td><td colspan="2"><input type="text" id="txtwzNum" runat="server" maxlength="10" disabled="disabled" class="txt"/>
    <br /><font color="red" size="2" >挑出假币中任意填写挑选的一张伪造币</font>
    </td>    
    <td style="text-align:center;">变造币冠字号码</td><td colspan="2"><input type="text" id="txtbzNum" runat="server" maxlength="10" disabled="disabled" class="txt"/>
    <br /><font color="red" size="2" >挑出假币中任意填写挑选的一张变造币</font>
    </td>
    </tr>

    <tr>
        <td colspan="3" id="quehtml" valign="top" style="padding-left:20px;" ></td>
        <td id="quehtml3" valign="top" style="padding-left:10px;" ></td>
        <td colspan="2" id="quehtml2" valign="top" style="padding-left:20px;" ></td>
    </tr>    
    </table>
    </div>
    </form>
</body>
</html>
