<?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>
            <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 clearfix">		 
                            <?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'] = '';
                                            }
                                            ?>
                                            <input  type="text" class="input_text w90" 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">
                                                <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>
                                </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>
                                                <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>
                                </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">
                                            <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>
                                </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">
                                            <label for="ownid" class="labelPrev labelPrevN jslabelPrev">最多15个字</label>
                                            <?php
                                            if (!isset($house_detail['ownid'])) {
                                                $house_detail['ownid'] = '';
                                            }
                                            ?>
                                            <input type="text" id="ownid" name="ownid" class="input_text w90" maxlength="15" value="<?php echo $house_detail['ownid']; ?>"/>
                                        </div>
                                        <div class="fgInput textFgErroy"></div>
                                    </div>
                                  </div>
                            </dd>
                            
                        </dl>
                    </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)
        {
            $("#jsCheckboxBox").find(".input_c").attr("checked", false)
        }
        else
        {
            $("#jsCheckboxBox").find(".input_c").attr("checked", true)
            //$("#jsCheckboxBox").find(".input_c").attr("checked",false)
        }
    })
</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> 