<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <script src="/Content/static/js/jquery-2.0.3.min.js"></script>
    <link href="/Content/css/f_css.css" rel="stylesheet"/>
    <link href="/YtjCommon/css/style.css" rel="stylesheet"/>

    <script src="/Content/JS/Print.js"></script>
    <script src="/Content/JS/A4Print.js"></script>
    <script src="/Content/JS/main.js"></script>
    <script src="/Content/static/js/public.js"></script>


    <link rel="stylesheet" href="/Content/Alert/js/SyntaxHighlighter/shCoreDefault.css">
    <link rel="stylesheet" href="/Content/Alert/css/alert.css">
    <link rel="stylesheet" href="/Content/Alert/css/style.css">
    <script src='/Content/Alert/js/SyntaxHighlighter/shCore.js'></script>
    <script src='/Content/Alert/js/SyntaxHighlighter/makeSy.js'></script>
    <script src='/Content/Alert/js/alert.min.js'></script>
    <script src='/Content/Alert/js/alert-api.js'></script>


    <style>
        input:disabled {
            color: #232323
        }
    </style>

    <script type="text/javascript">
        //  var JingYingCard = uncompileStr(GetQuery('JingYingCard'));//身份证号

        var BSID = "[[${bsid}]]";
        var prefix = "/Ytj/Printer";
        $(function () {
            // 判断是否已存在，如果已存在则直接显示
        });



        function ZhuanTime(Time) {
            var date = new Date(Time);
            var result, year, month, day;
            year = date.getYear() + 1900;
            month = date.getMonth() + 1;
            day = date.getDate();

            result = year + "年" + month + "月" + day + "日";
            return result;
        }


        function GetQuery(key) {
            var search = location.search.slice(1); //得到get方式提交的查询字符串
            var arr = search.split("&");
            for (var i = 0; i < arr.length; i++) {
                var ar = arr[i].split("=");
                if (ar[0] == key) {
                    if (unescape(ar[1]) == 'undefined') {
                        return "";
                    } else {
                        return unescape(ar[1]);
                    }
                }
            }
            return "";
        }


        function getRootPath_web() {
            //获取当前网址
            var curWwwPath = window.document.location.href;
            //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
            var pathName = window.document.location.pathname;
            var pos = curWwwPath.indexOf(pathName);
            //获取主机地址，如： http://localhost:8083
            var localhostPaht = curWwwPath.substring(0, pos);
            //获取带"/"的项目名，如：/uimcardprj
            // var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
            return (localhostPaht);
        }


        function compileStr(code) { //对字符串进行加密
            var c = String.fromCharCode(code.charCodeAt(0) + code.length);
            for (var i = 1; i < code.length; i++) {
                c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1));
            }
            return escape(c);
        }


        function uncompileStr(code) {       //对字符串进行解密
            code = unescape(code);
            var c = String.fromCharCode(code.charCodeAt(0) - code.length);
            for (var i = 1; i < code.length; i++) {
                c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1));
            }
            return c;
        }


        function getRadioVal(name) {
            var result;
            var radio = document.getElementsByName(name);
            for (var i = 0; i < radio.length; i++) {
                if (radio[i].checked) {
                    result = radio[i].value;
                }
            }
            return result;
        }
    </script>


    <style>
        .qian img {
            width: 200px;
        }

        .chengnuo {
            padding: 50px;
            font-size: 24px;
            line-height: 50px;
            letter-spacing: 3px;
            overflow: hidden;
        }

        .chengnuo li {
            width: 100%;
        }
    </style>

</head>
<body>
<header>
    <h2 class="title fl tit-con"th:text="${city}+'个体企业执照自助打印终端'"></h2>
    <a class="fr fan" href="/Ytj/GsYw">返回首页</a>
</header>
<div class="content">
    <div class="bg_white" style="height: 848px;">

        <div class="chengnuo">
            <ul style="list-style: none">
                <li>
                    <h2 align="center">承诺书</h2>
                </li>
                <li><span style="border-bottom: 1px solid #666;" th:text="${scity}+${city}+'行政审批局：'"></span></li>
                <li style="text-indent: 2em;">
                    <input style="width: 300px; border: 0; background: none; border-bottom: 1px solid #666; font-size: 24px;"
                           th:value="${jingyingren}"
                           disabled="true" id="ShenqingName" name="ShenqingName"/>（个体工商户）郑重承诺：工商部门已告知相关审批事项和审批部门。在领取营业执照后，我（个体工商户）将及时到审批部门办理审批手续，在取得行政审批前不从事相关经营活动。如有超出登记经营范围从事后置审批事项经营的需要，也将先行办理经营范围变更登记和相应的审批手续，未取得相关审批之前不从事相关经营活动。
                </li>
                <!--                <li class="tr qian" style="padding-top: 40px;">签名：-->
                <!--                    <div id="QianMing" style="width:160px;height:80px;float:right"></div>-->
                <!--                </li>-->
                <li class="tr" style="padding-right: 3em;padding-top:60px;">
                    <label id="ShenHeDate"></label>
                </li>

                <li style="text-indent: 2em; padding-top: 50px;">备注：签名人员应为法定代表人（拟任法定代表人、负责人、经营者）或者其委托代理人。</li>
            </ul>

            <div style="text-align: center;">
                <label>
                    <input type="checkbox" checked="checked" name="ischeck" id="ischeck"
                           th:onclick="'javascript:CheckAgree('+this.checked+')'"
                           style="zoom:200%;"/><b style="lin-height: 10px;">&nbsp;我已阅读</b>
                </label>
            </div>
            <div style="text-align: center;">
                <input id="btn_part1" name="btn_part1" type="button" class="btn_Lei btn_x" value="同  意"
                       th:onclick="'javascript:TprintIndex()'"/>
            </div>
        </div>
    </div>
</div>
<div style="position: absolute; right: 5%; bottom: 100px;">
    <span class="fl dao" id="agree_btn">本页将在60秒后返回首页</span>
    <a class="btn-fan fl" onclick="goBack()">上一步</a>
</div>

<script>
    function CheckAgree(c) {

        var obj = document.getElementById('btn_part1');
        if (c) {
            //obj.disabled = false;
            obj.className = "btn_Lei btn_x";
            obj.value = "同  意";
        } else {
            //obj.disabled = true;
            obj.href = "javascript:void(0)";
            var dialog = jqueryAlert({
                'style': 'wap',
                'icon': '/Content/Alert/img/warning.png',
                'content': '选中“我已阅读”复选框方进行拍照打印',
                'closeTime': 2000,
            });
            obj.value = "请勾选'我已阅读'";
        }
    }

    function TprintIndex() {
        var obj = document.getElementById('btn_part1');
        if ($('#btn_part1').val() == '同  意') {
            obj.className = "btn_Lei btn_x";
            obj.value = "同  意";
            // var info = Get_PCinfo();//获取设备信息
            // info = JSON.parse(info);
            /*            var JiaMiJingYingCard = compileStr(jyCord);
                        var JiaMiBSID = compileStr(BSID);*/

            var JiaMiJingYingCard = "[[${jyCard}]]";
            var JiaMiBSID = ("[[${bsid}]]");
            window.location = "/Ytj/Printer/CheckRen?BSID=" + JiaMiBSID + "&jyCord=" + JiaMiJingYingCard;//上A3，下A4

        } else {
            obj.href = "javascript:void(0)";
            var dialog = jqueryAlert({
                'style': 'wap',
                'icon': '/Content/Alert/img/warning.png',
                'content': '选中“我已阅读”复选框方可进行打印',
                'closeTime': 2000,
            });
            obj.value = "请勾选'我已阅读'";
        }
    }


    function GetPrintSet() {
        //获取打印机的设置状态
        var JiaMiJingYingCard = GetQuery(jyCord);
        var JiaMiBSID = GetQuery(BSID);
        $.ajax({
            type: 'GET',
            contentType: 'application/json',
            url: 'GetPrintSet',
            dataType: 'json',
            success: function (data) {
                if (data.Table.length > 0) {
                    var isGo = false;

                    $.each(data.Table, function (i, item) {
                        if (info.M_Tag.replace(/\s*/g, "") == item.Name.replace(/\s*/g, "")) {
                            isGo = true;
                            if (item.PrintSet == "1") {//上A3，下A4
                                window.location = "PrintIndexSPJ?BSID=" + JiaMiBSID + "&JingYingCard=" + JiaMiJingYingCard;

                            } else {//上A4，下A3
                                window.location = "PrintIndex?BSID=" + JiaMiBSID + "&JingYingCard=" + JiaMiJingYingCard;
                            }
                        }
                    });

                    if (!isGo) {
                        window.location = "PrintIndex?BSID=" + JiaMiBSID + "&JingYingCard=" + JiaMiJingYingCard;
                    }
                }
            }, fail: function () {
                alert("获取信息失败");
            },
            error: function () {
                alert("页面加载失败");
            }
        });
    }

</script>

<script>
    var secs = 180;
    //document.agree.agreeb.disabled=true;
    for (var i = 0; i <= secs; i++) {
        window.setTimeout("update(" + i + ")", i * 1000);
    }

    function update(num) {
        if (num == secs) {
            // 超时返回到首页
            // window.href = "../../index.html";
            location.href = "/Ytj/GsYw";

        } else {
            var printnr = secs - num;
            //document.agree.agreeb.value = "本页受理倒计时:" + printnr+"秒！";
            //document.agree.agreeb.innerHTML = "本页受理倒计时:" + printnr+"秒！";

            var testdiv = document.getElementById("agree_btn");
            testdiv.innerHTML = "本页将在" + printnr + "秒后返回首页";
        }
    }

    function showtime(t) {
        document.myform.phone.disabled = true;
        for (i = 0; i <= t; i++) {
            window.setTimeout("update_p(" + i + "," + t + ")", i * 1000);
        }

    }

    function goBack() {
        history.go(-1);
    }
</script>
</body>
</html>
