<?php
header('Content-Type:text/html;charset=GB2312');
if (isset($infotype)) {
    if (!isset($house_detail['equipment'])) {
        $house_detail['equipment'] = '';
    }
    //基础设施
	if ($infotype == 4 || $infotype == 3 ) 
	{
		$equipment = array(
			'客梯', '货梯', '扶梯', '暖气',
			'空调', '停车位', '水', '燃气', '网络',
			'办公家具'
		);
		
	}else
	{
		$equipment = array(
			'床', '冰箱', '电视', '空调',
			'洗衣机', '热水器', '家具', '宽带', '可做饭',
			'独立卫生间'
		);
	
	}
    if ($infotype == 2) {
        //别墅类型
        if (!isset($house_detail['housekind'])) {
            $house_detail['housekind'] = '';
        }
    } else if ($infotype == 3 || $infotype == 4) {
        if ($infotype == 3) {
            //商业类型
            $tradeclass = array('甲级', '乙级', '丙级');
        } else {
            $tradeclass = array('住宅底商', '连家店', '商业街商铺', '购物中心/百货');
        }
        //物业费
        if (!isset($house_detail['strata_fee'])) {
            $house_detail['strata_fee'] = '';
        } else {
            $house_detail['strata_fee'] = floatval($house_detail['strata_fee']);
        }
        if (!isset($house_detail['tradeclass'])) {
            $house_detail['tradeclass'] = '';
        }
    } 
    ?>
	
    <!--补充信息 开始-->
    <div class="branchCommon radius5 " id="js_bcxx">
        <div class="hd ">
            <h3 class="h3">补充信息</h3>
            <div id="jsStitle" class="funSZ">
                <p class="jsSQ funSZInner" title="收起" style="display: block;">收起</p>
                <p class="jsZK funSZInner funSZInner2" title="展开"  style="display: none;">展开</p>
            </div>
        </div>
        <div >
            <div class="mod hide showIe6-7" id="jsSmod" style="display: block;">
                <div class="modInner" >
                    <div class="forms">
                        <dl class="list">		 
                            <!--类型选择别墅显示-->
                            <?php if ($infotype == 2) { ?>
                            <dd class="list_item clearfix">
                                <label class="label">别墅类型：</label>
                                <div class="fields">
                                    <div class="fgInput jsFgInput">
                                        <div class="imitateSelect">
                                            <label class="labelImitate">选择别墅类型</label>
                                            <input type="text" readonly="" value="<?= $house_detail['housekind'] ?>" name="housekind" class="imitate imitateIe">
                                            <div class="listImitate" style="display: none;">
                                                <dl class="inner">
                                                    <?php foreach ($house['villatype'] as $v) {?>
                                                    <dd><a href="#" class="link"><?= $v ?></a></dd>
                                                    <?php } ?>
                                                </dl>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="fgInput textFgErroy"><!--jsFgInput--></div>
                                </div>
                            </dd>
                            <?php } ?>
                            <?php if ($infotype == 3 || $infotype == 4) { ?>
                            <dd class="list_item clearfix">
                                <label class="label">商业分类：</label>
                                <div class="fields">
                                    <div class="fgInput jsFgInput">
                                        <div class="imitateSelect">
                                            <label class="labelImitate">选择商业分类</label>
                                            <input type="text" readonly="" value="<?= $house_detail['tradeclass'] ?>"  name="tradeclass" class="imitate imitateIe">
                                            <div class="listImitate">
                                                <dl class="inner">
                                                <?php
                                                    foreach ($tradeclass as $v) {
                                                ?>
                                                        <dd><a href="#" class="link"><?= $v ?></a></dd>
                                                <?php } ?>
                                                </dl>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="fgInput textFgErroy"><!--jsFgInput--></div>
                                </div>
                            </dd>
                            <?php } ?>
                            <?php if ($infotype == 3 || $infotype == 4) { ?>
                            <dd class="list_item clearfix">
                                <label class="label">物业费：</label>
                                <div class="fields">
                                    <div class="fgInput jsFgInput">
                                        <input type="text" name="fee" value="<?= $house_detail['strata_fee'] ?>" class=" input_text w90">
                                    </div>
                                    <p class="textFg">元/月*平方米</p>
                                    <div class="textFg textFgErroy"></div>
                                </div>
                            </dd> 
                            <?php }?>
                            <?php if ($infotype != 6) { ?>
                            <dd class="list_item clearfix">
                                <label class="label w100">房屋设备：</label>
                                <div class="fields" id="jsCheckboxBox">
                                    <div class="fgInput">
                                        <label for="jsAllcheckbox" class="textFg3 textFg5">
                                            <input id="jsAllcheckbox" class="input_c" type="checkbox" />
                                            <span class="tex">全选</span>
                                        </label>
                                    </div>
                                    <?php foreach ($equipment as $v) {?>
                                    <div class="fgInput">
                                        <label class="textFg3 textFg5">
                                            <input class="input_c" type="checkbox" name="equipment[]" value="<?= $v ?>"  
                                        <?php
                                        if (in_array($v, explode(',', $house_detail['equipment']))) {
                                            echo "checked";
                                        }
                                        ?>/>
                                            <span class="tex">
                                        <?php
                                        if ($v == '管道煤气') {
                                            $v = '煤气/天然气';
                                        }
                                        echo $v;
                                        ?>
                                            </span></label>
                                    </div>
                                    <?php } ?>
                                </div>
                            </dd>
                            <?php } ?>
                            <!---->
                        </dl>
                        <div class="clearfix zsbnum2">
                            <dl class="list fl">
                                <dd class="list_item clearfix">
                                    <?php
                                    if (!isset($house_detail['ownid'])) {
                                        $house_detail['ownid'] = '';
                                    }
                                    ?>
                                    <label class="label">内部编号：</label>
                                    <div class="fields nameInput">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <label for="ownid" class="labelPrev labelPrevN jslabelPrev"></label>
                                            <input type="text" id="ownid" name="ownid" class="input_text w215" value="<?php echo $house_detail['ownid']; ?>" />
                                        </div>

<!--                                        <label for="floor" class="error zsbnumerro">-->
<!--                                            <span>请填写正确的内部编号</span>-->
<!--                                        </label>-->
                                    </div>
                                </dd>

                                <dd class="list_item clearfix">
                                    <label class="label">丘权号：</label>
                                    <div class="fields nameInput">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <label for="ownid" class="labelPrev labelPrevN jslabelPrev"></label>
                                            <input type="text" id="ownid" name="owner_land_right_number" class="input_text w215" value="<?php echo $ownerData['land_right_number']; ?>" />
                                        </div>

<!--                                        <label for="floor" class="error zsbnumerro">-->
<!--                                            <span>请填写正确的丘权号</span>-->
<!--                                        </label>-->
                                    </div>
                                </dd>

                                <dd class="list_item clearfix">
                                    <label class="label">产权人姓名：</label>
                                    <div class="fields nameInput">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <label for="ownid" class="labelPrev labelPrevN jslabelPrev"></label>
                                            <input type="text" id="ownid" name="owner_name" class="input_text w215" value="<?php echo $ownerData['name']; ?>" />
                                        </div>


                                    </div>
                                </dd>
                                <dd class="list_item clearfix">
                                    <label class="label">房产证：</label>
                                    <div class="fields nameInput">
                                        <div class="clearfix upbtn">
                                            <span id="spanButtonPlaceholder10"></span>
                                        </div>
                                    </div>
                                </dd>
                            </dl>
                            <dl class="list fl">

                                <dd class="list_item clearfix">
                                    <div class="imitateSelect fl">
                                        <label class="labelImitate" style="display: inline;"><?php if ($ownerData['contract_type']==0){ echo "房屋所有权证";}elseif($ownerData['contract_type']==1){echo "不动产权证书";}else{echo "预/现售合同号";} ?></label>
                                        <input class="imitate imitateIe" readonly="" type="text" name="owner_contract_typename">
                                        <input  name="owner_contract_type" type="hidden" class="jsImitateHidden" value="<?php echo $ownerData['contract_type']; ?>">
                                        <div class="listImitate" style="display: none;">
                                            <dl class="inner">
                                                <dd>
                                                    <a href="####" oid="0" class="link">房屋所有权证</a>
                                                </dd>
                                                <dd>
                                                    <a href="####" oid="1" class="link">不动产权证书</a>
                                                </dd>
                                                <dd>
                                                    <a href="####" oid="2" class="link">预/现售合同号</a>
                                                </dd>
                                            </dl>
                                        </div>
                                    </div>
                                    <div class="fields nameInput">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <label for="ownid" class="labelPrev labelPrevN jslabelPrev"></label>
                                            <input type="text" id="ownid" name="owner_contract_number" class="input_text w215" value="<?php echo $ownerData['contract_number']; ?>" />
                                        </div>

                                    </div>
                                </dd>
                                <dd class="list_item clearfix">
                                    <label class="label">产权人身份证号：</label>
                                    <div class="fields nameInput">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <label for="ownid" class="labelPrev labelPrevN jslabelPrev"></label>
                                            <input type="text" id="owner_identity_card_number" name="owner_identity_card_number" class="input_text w215" value="<?php echo $ownerData['identity_card_number']; ?>" />
                                        </div>
                                        <label for="floor" class="error zsbnumerro" style="display: none;">
                                            <span>请填写正确的产权人身份证号</span>
                                        </label>
                                    </div>

                                </dd>



                            </dl>
                        </div>
                        <div class="zsbnum1" id="jsPicPreviewBoxM10">
                            <div id="thumbnails10" class="cf">


                                <?php if(!empty($p_filename_real)){?>
                                    <?php foreach($p_filename_real as $key =>$rs){?>
                                        <div class="housepic"><img width="130" height="100" alt="" src="<?php echo $rs['filename'];?>"><input type="hidden" name="p_filename_real[]" value="<?php echo $rs['filename'];?>"><div class="funMtext"><div imagesrc="<?php echo $rs['filename'];?>" class="delBtn" id="<?php echo $key;?>" title="删除"></div></div></div>
                                    <?php }?>
                                <?php }?>



                            </div>
                        </div>

                    </div>
                    <style>
                        .zsbnum2{ padding: 0; }
                        .zsbnum2 .label{ width: 100px;}
                        .w215{ width: 215px;}
                        .zsbnum2 .list_item label.error{ margin-left: 5px; float: left; position: relative; background: url(//esf.fz.house365.com/zsb/images/zsberro.png) 0 8px no-repeat;}
                        .zsbnum2 .fields {float: left; width: 315px;}
                        .zsbnum2 dl{width: 420px;}
                        .zsbnumerro span{ display: none; position: absolute; left:18px;top:0px; width: 160px; background: #ffeacc; border-radius: 2px; padding-left: 10px; }
                        .zsbnumerro:hover span{ display: block; z-index: 1002;}
                        .zsbnum2 .imitateSelect .imitate{ width: 85px;}
                        .zsbnum2 .imitateSelect { width: 100px; margin-right: 5px;}
                        .zsbnum2 .listImitate .inner{width: 98px;}
                        .zsbnum2 .listImitate .link{ width: 90px;}
                        .forms .w100{ width: 100px;}
                        .zsbnum2  .zsbbieshu .imitate{ width: 210px;}
                        .zsbnum2  .zsbbieshu .inner{ width: 223px;}
                        .zsbnum2  .zsbbieshu .link{ width: 215px;}

                    </style>

                </div>
            </div>
        </div></div>
    <?php } ?>
<script type="text/javascript" >
    //收起 展开 jsStitle  jsSmod
    function funSZ(hd, mod) {
        $("#" + hd).find(".jsSQ").live('click', function() {
            $(this).hide().siblings(".jsZK").show();
            $("#" + mod).hide();
        })
        $("#" + hd).find(".jsZK").live('click', function() {
            $(this).hide().siblings(".jsSQ").show();
            $("#" + mod).show();
        })
    }
    funSZ("jsStitle", "jsSmod")
    funSZ("jsPicDepotSZBtn", "jsPicDepotSZMod")
    funSZ("jsPicDepotSZBtn2", "jsPicDepotSZMod2")

    //补充信息全选

    $("#jsAllcheckbox").click(function() {
        if ($(this).attr("checked") == false || $(this).attr("checked") == undefined)
        {
            $("#jsCheckboxBox").find(".input_c").attr("checked", false)
        }
        else
        {
            $("#jsCheckboxBox").find(".input_c").attr("checked", true)
        }
    })
</script>
<script type='text/javascript'>
    //模拟Select
    $(".imitateSelect").find(".link").live("click", function() {
        $(this).addClass("linkOn").parent("dd")
                .siblings("dd").find(".link").removeClass("linkOn");
        if ($(this).attr("oid"))
        {
            $(this).parents(".listImitate").siblings(".labelImitate").hide()
                    .siblings(".jsImitateHidden").val($(this).attr("oid")).focus();
        }
        $(this).parents(".listImitate").siblings(".labelImitate").hide()
                .siblings(".imitate").val($(this).text()).focus();
        $(this).parents(".listImitate").hide();
        return false;
    })
    $(".imitateSelect").find(".imitate").each(function(index, element) {
        if ($(this).val() == "")
        {
            $(this).siblings(".labelImitate").show()
        }
    });
    /***点击输入框 关闭提示文字****/
    $(".input_text,.textarea").each(function(index, element) {
        $(this).focus(function() {
            $(this).addClass("input_text_on").prev(".jslabelPrev").hide();
        }).blur(function() {
            $(this).removeClass("input_text_on");
            if ($(this).val() == "")
            {
                $(this).prev(".jslabelPrev").show();
            }
        })
        if ($(this).val() != "")
        {
            $(this).prev(".jslabelPrev").hide();
        }
    });
</script>

<script>
    (function ($) {

        /**
         * Is Identity Card Number
         * @param number
         * @returns {boolean}
         */
        function isIdentityCardNumber(number) {
            var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            return reg.test(number) !== false;
        }

        var domDocument = $(document);
        domDocument.ready(function () {
            domDocument.on('blur', '#owner_identity_card_number', function () {
                var domError = $(this).parent().parent().find('.error');
                isIdentityCardNumber($(this).val()) ? domError.hide() : domError.show();
            });
        });
    })(jQuery);
</script>

<style>
    /*2018 3 19*/
    .zsbnum {width: 420px; }
    .zsbnum .list_item label.zsbnumerro{padding-left: 19px;height: 29px; margin-left: 5px; float: left; position: relative; background: url(//esf.fz.house365.com/zsb/images/v1.0/zsberro.png) 0 8px no-repeat; line-height: 29px; color: #db2031;}
    .zsbnum .label{ width: 100px;}
    .w215{ width: 215px;}
    .w42{ width: 42px;}
    .zsbnum .fields {float: left; width: 315px;}
    .zsbnum1 .upbtn{ width: 225px; background: url(//esf.fz.house365.com/zsb/images/v1.0/btnbg.gif) repeat-x; border: 1px solid #bfbfbf; color: #808080; height: 29px; margin-left: 105px}
    .zsbnum1 img{ width: 181px; height: 139px;  width: 181px;}

    .zsbnum1 .cf{ margin-left: 105px;}
    .zsbupimg{ position: relative; display: block; float: left; margin-right: 21px;}
    .zsbupimg span{ position: absolute; right: 0;top:0; display: none; cursor: pointer;}
    .zsbupimg span img{ width:24px; height: 24px;}
    .zsbnumerro span{ display: none; position: absolute; left:18px;top:0px; width: 160px; background: #ffeacc; border-radius: 2px; padding-left: 10px; }
    .zsbnumerro:hover span{ display: block; z-index: 1002;}
    .zsbnum4{ float: left;}
    .zsbnum4 a{ color: #e67373; padding-left: 36px; cursor: pointer;}
    .zsbnum4 input{ margin: 12px 6px 0 20px;}
    .zsbnum4 span{ background: #e67373; color: #fff; padding: 3px 7px 5px; border-radius: 2px;}
    .zsbnum .imitateSelect .imitate{ width: 85px;}
    .zsbnum .imitateSelect { width: 100px; margin-right: 5px;}
    .zsbnum .listImitate .inner{width: 210px;}
    .zsbnum .listImitate .link{ width: 90px;}
    .zsbnum  .zsbbieshu .imitate{ width: 210px;}
    .zsbnum  .zsbbieshu .inner{ width: 210px;}
    .zsbnum  .zsbbieshu .link{ width: 215px;}
   .zsbnum1 .housepic{ margin: 8px 40px 0 0;  position: relative;  float: left;}
   .zsbnum1 .housepic:hover .funMtext{  display: block;}
   .zsbnum1 .funMtext{display:none;position: absolute;top:1px;right: 1px; background: url(//esf.fz.house365.com/zsb/images/v1.0/zsbdel.png) no-repeat; width: 24px;
        height:24px;
        cursor: pointer;
    }
</style>




<script type="text/javascript">

    var swfu10;
    $(function() {
        swfu10 = new SWFUpload({
            upload_url: "<?=$upload_pic_url?>",
            file_size_limit : "5 MB",	// 5MB
            file_types : "*.jpg;*.png;",
            file_types_description : "Images",
            file_upload_limit : "0",
            file_queue_limit : "5",

            custom_settings : {
                upload_target : "jsPicPreviewBoxM10",
                upload_limit  : 3,
                upload_nail	  : "thumbnails10",
                upload_infotype : 10
            },

            // Event Handler Settings - these functions as defined in Handlers.js
            //  The handlers are not part of SWFUpload but are part of my website and control how
            //  my website reacts to the SWFUpload events.
            swfupload_loaded_handler : swfUploadLoaded,
            file_queue_error_handler : fileQueueError,
            file_dialog_start_handler : fileDialogStart,
            file_dialog_complete_handler : fileDialogComplete,
            upload_progress_handler : uploadProgress,
            upload_error_handler : uploadError,
            upload_success_handler : uploadSuccess,
            upload_complete_handler : uploadComplete,


            // Button Settings
            button_image_url : "<?=STATIC_SOURCE_URL?>/zsb/images/v1.0/2018-upload-5.png",
            button_placeholder_id : "spanButtonPlaceholder10",
            button_width: 225,
            button_height: 29,
            button_cursor: SWFUpload.CURSOR.HAND,
            button_text:"",

            // Flash Settings
            //flash_url : "<?=STATIC_SOURCE_URL?>/common/js/swf/swfupload.swf"
            flash_url : "/swfupload.swf"
            // Debug Settings
            //debug: true
        });

    });
</script>


<script type="text/javascript">
    $(".funMtext").live("click",function() {
        $(this).parents(".housepic").remove();
        swfu10.setButtonDisabled(false);

    })

</script>