<?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'] = '';
        }
    } 
    ?>
	<?php var_dump($infotype);echo $infotype;?>
    <!--补充信息 开始-->
    <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">房屋设备：</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 } ?>
                            <!---->
                            <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">最多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>
                            </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> 