<div id="centre" class="layout">
    <div class="centreInner ">
        <div class="mainInner radius5 "> 
            <div class="titleTabBox">
                <div class="titleTab">
                    <div class="titleTabB clearfix">
                        <dl class="list">
                            <dd class="item "> <a class="link" href="/house_demands/rent/"> 求租需求</a> </dd>
                            <dd class="item itemOn"> <a class="link" href="/house_demands/rent_matched/"> 已匹配需求 </a></dd>
                        </dl>
                    </div>
                </div>
            </div>
            <div class="forms "></div>
            <!---->
            <div class="fgTitleBox radius4">
                <table class="table">
                    <tr>
                        <td class="w335">房源需求</td>
                        <td class="w300">备注</td>
                        <td class="w125">电话</td>
                        <td>操作</td>
                    </tr>
                </table>
            </div>
            <!---->
             <form name='search_form' id ='search_form' method ='post' action =''>
            <?php 
            if( is_array( $matched_info ) && !empty( $matched_info ) )
            { 
                foreach($matched_info as $key => $value)
                {
           ?>
            <div class="itemInfoBach itemInfoBachAuto radius4 jsMatchingHouse">
                <table class="table">
                    <tr>
                        <td class="td second w335">
                            <div class="itemTex itemTex3">
                                <?php echo $value['address'];?><br><?php echo $value['infotype']; ?> 
                                <span class="fg">|</span> <?php echo $value['buildarea1'];?>-<?php echo $value['buildarea2'];?>平米 
                                <span class="fg">|</span> <?php echo $value['price1'];?>-<?php echo $value['price2'];?>元/月
                                <span class="fg">|</span> <?php echo $value['renttype'];?>
                            </div>
                        </td>
                        <td class="td w300"><div class="itemTex3"><?php if($value['remark'] != ''){echo $value['remark'];}else{echo '暂无备注信息';} ?></div></td>
                        <td class="td w125"><div class="itemTex3 texCenter"><?php echo $value['telno'];?></div></td>
                        <td class="td tdLast"><a href="javascript:void(0)" class="link jsShowHouse" rowid="<?php echo $value['id'];?>">查看匹配房源</a></td>
                    </tr>
                </table>

                <div class="matchingHouse">
                    <h5 class="h5">已匹配房源</h5>
                    <table class="tableHouse" id="jsTableHouse_<?php echo $value['id'];?>">
                        <tr>
                            <td>
                                <img src ="<?= STATIC_SOURCE_URL ?>/zsb/images/v1.0/loading.gif">&nbsp;数据加载中……
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <?php } ?>
            <?php } else { ?>
                <div class="itemInfoBach itemInfoBach02 radius4">
                    <p style="text-align:center; line-height:64px;">暂无符合条件的求租匹配记录！</p>	
                </div>
            <?php } ?>
            <!--翻页-->
            <?php if( !empty($pagination) ){ ?>
            <div class="picPreviewPagBox pagBoxBorderTop">
                <div class="picPreviewPag">
                <?php echo $pagination; ?>
                </div>
                <input type='hidden' name='page' value='<?php echo $page;?>'>
            </div>
            <?php } ?>
            </form>
            <!---->
            <div class="itemInfoBach kindlyReminder radius4">
                <div class="hd">
                    <h4 class="h4">温馨提示：</h4>
                    <a href="#" class="more">查看详细说明&gt;&gt;</a></div>
                <div class="list">
                    <p>1、列表里面出现的均为租房用户发布求租信息。</p>
                    <p>2、当您有符合该求租条件的房源的时候，您就可以收到该求租需求。</p>
                    <p>3、每条求租需求，您只能匹配一次。</p>
                    <p>4、每条求租需求，每天只能有20个经纪人进行匹配，如果您没匹配到，说明您前面已经超过20个人进行匹配，请24小时之后再进行匹配。</p>
                    <p>5、匹配的房源内容必须与求租需求范围内，方可匹配成功。</p>
                    <p>6、匹配成功将扣除500房豆，房豆不够将无法匹配。</p>
                    <p>7、匹配成功之后，您将获得该用户的联系方式，方便您与其推荐房源。</p>
                </div>
            </div>
            <div class="clear">&nbsp;</div>
            <!----> 

        </div>
    </div>
</div>
<script type="text/javascript">
$(function() { //查看求租匹配房源
    $(".jsShowHouse").toggle(
            function() {
                $(this).text("收起");
                $(this).parents(".jsMatchingHouse").addClass("showMatchingHouse");
                var wantid = $(this).attr('rowid');
                $.ajax({
                    type : 'get',
                    url : '<?php echo GB_WO_URL;?>/ajax/get_rent_details_matched/',
                    data : {'wantid' : wantid},
                    dataType : 'json',
                    success: function(data) 
                    {
                       if( data.id > 0 )
                       {
                           var match_str = '<tr><td class="w440"><div class="textDiv nameDiv">'+data.address+'</div></td><td class="w330"><div class="textDiv">'+data.infotype+' <span class="fg">|</span> '+data.price+'元/月 <span class="fg">|</span> '+data.buildarea+' 平米 <span class="fg">|</span>  '+data.renttype+'</div></td><td><a href="'+data.info_url+'" target = "_blank" class="link">查看详情&gt;&gt;</a></td></tr>';
                       }
                       else
                       {
                            var match_str = '<tr><td>此房源已下架</td></tr>';
                       }
                       $('#jsTableHouse_' + wantid).html(match_str);
                    }
                });
            },
            function() {
                $(this).text("查看匹配房源");
                $(this).parents(".jsMatchingHouse").removeClass("showMatchingHouse");
            }
    );
});
</script>