<?php
header('Content-Type:text/html;charset=GB2312');
if (isset($infotype)) {
    if (!isset($house_detail['baseservice'])) {
        $house_detail['baseservice'] = '';
    }
    if ($infotype == 1) {
        //基础设施
        $baseservice = array(
            '管道煤气', '暖气', '电梯', '车位',
            '花园', '地下室', '阁楼', '露台', '阳光房'
        );
    } else if ($infotype == 2) {
        $baseservice = array(
            '管道煤气', '暖气', '电梯', '车位',
            '花园', '地下室', '阁楼', '露台', '阳光房',
            '游泳池'
        );
        //别墅类型
        if (!isset($house_detail['housekind'])) {
            $house_detail['housekind'] = '';
        }
    } else if ($infotype == 3 || $infotype == 4) {
        $baseservice = array(
            '管道煤气', '暖气', '电梯', '车位',
            '卫生间'
        );
        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'] = '';
        }
    } else if ($infotype == 5) {
        $baseservice = array(
            '管道煤气', '暖气', '电梯', '车位',
            '卫生间'
        );
    }
    ?>
    <!--补充信息 开始-->
    <div class="branchCommon radius5 " id="js_bcxx" style="margin:0;">
        <div class="hd ">
            <h3 class="h3">补充信息</h3>
            <?php
                // 真房源逻辑：  1.  nj  && 真房源数量 <= 最大真房源数 && 住宅类型的房源 && 放心看状态
                //             2.  新增  || 修改 && 真房源标识 && 区域覆盖
                //  edit by : wmc$infotype
                if($_SERVER['HTTP_HOST']=='nj.zsb.house365.com' && isset($real_status) && $real_status && isset($realHouseNum) && isset($realNumLimit) && $realNumLimit >0  && $realHouseNum <=$realNumLimit && (!$infotype || $infotype <= 2)){?>
                    <?php if(
                            in_array($house_detail['district'],array('建邺区','雨花台区','秦淮区','栖霞区','鼓楼区','玄武区','江宁区','浦口区'))
                    ){ ?>
                    <div class="fgInput zsbnum4 fxk" <?php if(!isset($house_detail['id'])){?> style="display: none;" <?php }?> >
                        <label for="jsAllcheckbox" class="textFg3 textFg5">
                            <input id="jsAllcheckbox" name="real_house_set" class="input_c" type="checkbox" value=<?php echo $house_detail['is_real_house'];?> <?php if($house_detail['is_real_house']==1){?>checked<?php }?>>
                            <span class="tex">放心看</span>
                        </label>
                    </div>
                    <?php }?>

                    <?php if(!$house_detail['id']): ?>

                        <div class="fgInput zsbnum4 fxk" >
                            <label for="jsAllcheckbox" class="textFg3 textFg5">
                                <input id="jsAllcheckbox" name="real_house_set" class="input_c" type="checkbox" value=0>
                                <span class="tex">放心看</span>
                            </label>
                        </div>
                    <?php endif;?>

            <?php }?>
            <!--<div class="fgInput zsbnum_4 fxk">
                <a target="_blank" href="http://zsb.house365.com/help/nj/?p=1373">放心看规则说明</a>
            </div>-->

            <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 clearfix">
                        <dl class="list zsbnum clearfix fl">
                            <?php if ($infotype == 6) { ?>
                            <dd class="list_item clearfix" id="buildyearShow1">
                                <div style="height:29px;">
                                    <label class="label">建筑年代：</label>
                                    <div class="fields nameInput ">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <label for="jsNameInputN" class="labelPrev labelPrevN jslabelPrev">格式：2010</label>
                                            <?php
                                            if (!isset($house_detail['buildyear'])) {
                                                $house_detail['buildyear'] = '';
                                            }
											if (intval($house_detail['buildyear']) <= 1000) {
                                                    $house_detail['buildyear'] = '';
                                                }
                                            ?>
                                            <input  type="text" class="input_text w215" id="jsNameInputN" name="buildyear1" value="<?= $house_detail['buildyear'] ?>" />
                                        </div>
                                        <p class="textFg">年</p>
                                        <!--<div class="fgInput textFgErroy"></div>-->
                                    </div>
                                </div>
                            </dd>
                            <?php } ?>
                            <!--类型选择别墅显示-->
                            <?php if ($infotype == 2) { ?>
                            <dd class="list_item clearfix">
                                <div style="height:29px;">
                                    <label class="label">别墅类型：</label>
                                    <div class="fields">
                                        <div class="fgInput jsFgInput">
                                            <div class="imitateSelect">
                                                <label class="labelImitate">选择别墅类型</label>
                                                <input type="text" readonly="" value="<?php echo  $house_detail['housekind']; ?>" name="housekind" class="imitate imitateIe" style="width:210px">
                                                <div class="listImitate zsbbieshu" 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"></div>-->
                                    </div>
                                </div>
                            </dd>
                            <?php } ?>
                            <?php if ($infotype == 3 || $infotype == 4) { ?>
                            <dd class="list_item clearfix">
                               <div style="height:29px;">
                                    <label class="label">商业分类：</label>
                                    <div class="fields">
                                        <div class="fgInput jsFgInput">
                                            <div class="imitateSelect">
                                                <label class="labelImitate">选择商业分类</label>
                                            <?php if ($infotype == 3) { ?>
                                                <input type="text" readonly="" value="<?= $house_detail['tradeclass'] ?>"  name="tradeclass" class="imitate imitateIe" style="width: 210px;">
                                                <div class="listImitate">
                                                    <dl class="inner">
                                                    <?php foreach ($tradeclass as $v) { ?>
                                                        <dd><a href="#" class="link"><?= $v ?></a></dd>
                                                    <?php } ?>
                                                    </dl>
                                                </div>
                                            <?php } else {?>
                                                <input type="text" readonly="" value="<?= $house_detail['housekind'] ?>"  name="housekind" class="imitate imitateIe" style="width: 210px;">
                                                <div class="listImitate">
                                                    <dl class="inner">
                                                    <?php foreach ($tradeclass as $v) { ?>
                                                        <dd><a href="#" class="link"><?= $v ?></a></dd>
                                                    <?php } ?>
                                                    </dl>
                                                </div>
                                            <?php } ?>
                                            </div>
                                        </div>

                                        <!--<div class="fgInput textFgErroy"></div>-->
                                    </div>
                                </div>
                            </dd>
                            <?php } ?>

                            <?php
                            //暂时不需要，先注释，防止以后释放
                            if (/**$infotype != 6**/ false) { ?>
                            <dd class="list_item clearfix">
                                <div style="height:29px;">
                                        <label class="label">基础设施：</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 ($baseservice as $v) { ?>
                                            <div class="fgInput">
                                                <label class="textFg3 textFg5">
                                                    <input class="input_c" type="checkbox" name="baseservice[]" value="<?= $v ?>"
                                                    <?php
                                                    if (in_array($v, explode(',', $house_detail['baseservice']))) {
                                                        echo "checked";
                                                    }
                                                    ?>/>
                                                    <span class="tex">
                                                    <?php
                                                    if ($v == '管道煤气') {
                                                        $v = '煤气/天然气';
                                                    }
                                                    echo $v;
                                                    ?>
                                                    </span>
                                                </label>
                                            </div>
                                           <?php } ?>
                                        </div>
                                   </div>
                            </dd>
                            <?php } ?>
                            <dd class="list_item clearfix">
                                <div style="height:29px;">
                                    <label class="label">内部编号：</label>
                                    <div class="fields nameInput">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <div class="fields nameInput">
                                                <div class="fgInput jsNameInput jsFgInput">
                                                    <label for="ownid" class="labelPrev labelPrevN jslabelPrev"></label>
                                                    <?php
                                                    if (!isset($house_detail['ownid'])) {
                                                        $house_detail['ownid'] = '';
                                                    }
                                                    ?>
                                                    <input type="text" id="ownid" name="ownid" class="input_text w215" value="<?php echo $house_detail['ownid']; ?>" />
                                                </div>

                                            </div>

                                        </div>

                                    </div>
                                  </div>
                            </dd>







                            <dd class="list_item clearfix" style="display: none">
                                <label class="label">房产证：</label>
                                <div class="fields nameInput">
                                    <div class="clearfix upbtn">
                                        <span id="spanButtonPlaceholder10"></span>
                                    </div>
                                </div>
                            </dd>
                        </dl>

                        <dl class="list clearfix zsbnum fl">

                            <?php if ($infotype == 3 || $infotype == 4) { ?>
                                <dd class="list_item clearfix">
                                    <div style="height:29px;">
                                        <label class="label">物业费：</label>
                                        <div class="fields">
                                            <div class="fgInput jsFgInput">
                                                <input type="text" name="fee" value="<?= $house_detail['strata_fee'] ?>" class=" input_text w215">元/月*平方米
                                            </div>


                                        </div>
                                    </div>
                                </dd>
                            <?php } ?>




                            <dd class="list_item clearfix" style="display: none">
                                <div style="height:29px;" class="clearfix">
                                    <label class="label">楼栋门牌：</label>
                                    <div class="fields nameInput">
                                        <div class="fgInput jsNameInput jsFgInput">
                                            <input type="text" id="ownid" name="buildingnum" class="input_text w42 " maxlength="5"  value="<?php echo $house_detail['buildingnum']; ?>" />
                                            栋
                                            <input type="text" id="ownid" name="unitnum" class="input_text w42" maxlength="5" value="<?php echo $house_detail['unitnum']; ?>" />
                                            单元
                                            <input type="text" id="ownid" name="roomnum" class="input_text w42" maxlength="5" value="<?php echo $house_detail['roomnum']; ?>" />
                                            室
                                        </div>


                                    </div>
                                </div>

                            </dd>
                        </dl>
                    </div>

                    <div class="zsbnum1" id="jsPicPreviewBoxM10"  style="display: none">
                        <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>
            </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)
        {


            $("#jsAllcheckbox").val(0);
            $("#jsCheckboxBox").find(".input_c").attr("checked", false)
        }
        else
        {

            $("input[type='checkbox']").attr('checked',false)
            $("#dialogSaveDiv3").html("为避免您的放心看保证金受损，请您仔细核对并确认该套房源当前是否可售可看、价格是否为业主最新报价、房源信息填写是否准确（面积、税费、楼层、朝向、装修）、房源标题及描述与房源基本信息是否一致、房源图片及户型图与实际是否一致。");
            openWin("dialog_rest");



        }
    })
</script>
<script type='text/javascript'>
    
    
    function do_action() {
        $("input[type='checkbox']").attr('checked',true);

        $("#jsAllcheckbox").val(1);
        $("#jsCheckboxBox").find(".input_c").attr("checked", true)
    }
    //关闭确认窗口
    function close_confirm_window()
    {
        $("#gTipsCoverdialog_rest").remove();
        $("#dialog_rest").hide();
    }
    //模拟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>

<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;}
    .zsbnum button{ width: 225px; background: url(//esf.fz.house365.com/zsb/images/v1.0/btnbg.gif) repeat-x; border: 1px solid #bfbfbf; color: #808080; height: 29px;}
    .zsbnum1 img{ width: 181px; height: 139px; margin: 8px 0;}

    .zsbnum1 div{ 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_4{ float: left;}
    .zsbnum_4 a{ color: #e67373; padding-left: 36px; cursor: pointer;}
    .zsbnum_4 input{ margin: 12px 6px 0 20px;}
    .zsbnum_4 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: 150px;}
    .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>
    $(function(){
        $(".zsbupimg").hover(function(){
            $(this).children("span").show();
        },function(){
            $(this).children("span").hide();
        })
        $(".zsbupimg span").on("click",function(){
            $(this).parent(".zsbupimg").remove();

        })


    })
    //2018 校验电话身份证
    function checkTel(obj){
        var telno = $(obj).val();
        var partten = /^1\d{10}$/;
        if(!partten.test(telno)) {
            $(obj).parent("div").next("label").show();
            return false;
        }
    }
    function hideErro(obj){
        $(obj).parent("div").next("label").hide();
    }

    function checkCard(obj){
        var card = $(obj).val();
        // 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
        var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
        if(reg.test(card) === false)
        {
            $(obj).parent("div").next("label").show();
            return false;
        }
    }

</script>



<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: 230,
            button_height: 28,
            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>



<!--2018 3 19-->