<html>
<head>
    <title>用户反馈</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Language" content="zh-CN" />
    <link href="../../Content/style.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/lib/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../../Scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('#product_id').val(window.parent.parent.SoftID);
            $('#feedback').focus();

            //做网络监测
            $.get("http://www.baidu.com", function (data) {
                $("#idNet").html("发送");
                //检测到网络，显示可用的按钮，隐藏不可用的按钮
                $('#divNoActive').hide();
                $('#divActive').show();
            });
            //超过 3秒 没有返回值，提示用户没有网络连接
            setTimeout(function () {
                if ($("#idNet").html() == "网络检测") {
                    //没有检测到网络
                    $("#idNet").html("网络不可用");
                }
            }, 1000 * 2);
        })
        function submitData() {
            if (!(trim($('#feedback').val()))) {
                window.parent.parent.cihoAlert("请填写反馈信息！");
                $('#feedback').focus();
                return;
            }
            var arrFiles = [];
            arrFiles.push($('#file1').val());
            arrFiles.push($('#file2').val());
            arrFiles.push($('#file3').val());
            arrFiles.push($('#file4').val());
            for (var i = 0; i < arrFiles.length; i++) {
                if (arrFiles[i]) {
                    var arrFile = arrFiles[i].split('.');
                    var strExtend = arrFile[arrFile.length - 1].toUpperCase();
                    if (strExtend != "PNG" && strExtend != "JPG" && strExtend != "GIF") {
                        window.parent.parent.cihoAlert("上传截图仅支持PNG/JPG/GIF格式！第" + (i+1)+ "个文件，格式不正确！");
                        return;
                    }
                }
            }
            $('#idSubmit').click();
            //提交数据后隐藏可用的按钮
            $('#divActive').hide();
            //提交数据后显示不可用的按钮
            $('#divNoActive').show();
        }
    </script>
</head>
<body>
    <form action="http://www.ciho.com.cn/sams_server/feedback.php" method="post" enctype="multipart/form-data">
    <p style="color: #666; font-size: 14px; padding-left: 10px; margin: 0px;">
        问题描述</p>
    <textarea style="width: 430px; height: 100px; border: 1px solid #cccccc; margin: 0 0 10px 10px;"
        id="feedback" name="feedback"></textarea>
    <br />
    <input type="file" style="height: 26px; width: 210px; border: 1px solid #cccccc;
        margin: 0 0 0 10px;" name="file1" id="file1" />
    <input type="file" style="height: 26px; width: 210px; border: 1px solid #cccccc;
        margin: 0 0 0 10px;" name="file2" id="file2" />
    <input type="file" style="height: 26px; width: 210px; border: 1px solid #cccccc;
        margin: 0 0 0 10px;" name="file3" id="file3" />
    <input type="file" style="height: 26px; width: 210px; border: 1px solid #cccccc;
        margin: 0 0 0 10px;" name="file4" id="file4" />
    <input type="text" style="display: none;" name="product_id" id="product_id" value="" />
    <input type="submit" id="idSubmit" value="提交" style="display: none;" />
    </form>
    <div id="divActive" class="box_btn_width" style="display: none;">
        <div class="box_btn" style="margin-left: 80px;">
            <div class="btn02">
                <a id="butFs" style="padding-top: 6px; height: 27px;" href="#" onclick="submitData();return false;">
                    发送</a></div>
            <div class="btn03">
                <a id="butQx" href="#" style="padding-top: 7px; height: 26px;" onclick="window.parent.closeMyself()">
                    取消</a></div>
        </div>
    </div>
    <div id="divNoActive" class="box_btn_width">
        <div class="box_btn" style="margin-left: 80px;">
            <div class="btn02">
                <a id="idNet" style="padding-top: 6px; height: 27px; color: Gray;">网络检测</a></div>
            <div class="btn03">
                <a id="A1" href="#" style="padding-top: 7px; height: 26px;" onclick="window.parent.closeMyself()">
                    取消</a></div>
        </div>
    </div>
</body>
</html>
