<?php require (APPPATH . 'views/'.TEMPLATE_NAME.'/header.php'); ?>
<!--头部 结束--> 
<!--左边 导航 开始-->
<div id="asideBox">
    <div class="layout asideBox">
        <div class="aside">
            <dl class="listM">
                <dd class="item"><a class="link link1" href="#">发布出售</a></dd>
                <dd class="item"><a class="link link2" href="#">管理出售</a></dd>
                <dd class="item itemOn"><a class="link link3" href="#">求购匹配</a></dd>
                <dd class="item"><a class="link link4" href="#">发布出租</a></dd>
                <dd class="item"><a class="link link5" href="#">管理出租</a></dd>
                <dd class="item"><a class="link link6" href="#">求租匹配</a></dd>
            </dl>
        </div>
    </div>
</div>
<!--左边 导航 结束--> 
<!---->
<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 itemOn"> <a class="link" href="#"> 求租需求</a> </dd>
                            <dd class="item "> <a class="link" href="#"> 已匹配需求 </a></dd>
                        </dl>
                    </div>
                </div>
            </div>
            <div class="forms "></div>
            <!---->
            <div class="fgTitleBox radius4">
                <table class="table">
                    <tr>
                        <td class="w260">房源位置</td>
                        <td class="w280">要求</td>
                        <td class="w210">备注</td>
                        <td>操作</td>
                    </tr>
                </table>
            </div>
            <!---->
            <?php 
            if( is_array( $demands_info ) && !empty( $demands_info ) )
            { 
                foreach($demands_info as $key => $value)
                {
                    //$totday_matched_num = $value['totday_matched_num'];
           ?>
            <div class="itemInfoBach itemInfoBachAuto radius4">
                <table class="table">
                    <tr>
                        <td class="td second"><div class="itemTex itemTex3"><?php echo $value['address']; ?></div></td>
                        <td class="td w280">
                            <div class="itemTex3"><?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['buildyear1'];?>-<?php echo $value['buildyear2'];?>年
                            </div>
                        </td>
                        <td class="td w210"><div class="itemTex3"><?php echo $value['remark'];?></div></td>
                        <td class="td" id='match_{$value[id]}'>
                        <?php if( empty($matched_arr) || (!in_array( $value['id'] , $matched_arr ))) { ?>
                           <?php  if( $value['totday_matched_num'] < 0 ){ ?>
                            <a href="javascript:void(0)" onClick="openWin('js_open_house','<?php echo $value[id];?>')" class="link">匹配房源</a>
                           <?php }else{ ?>
                            <div class="timeSata"><?php echo $value['next_match_time'];?></div>
                            <a style="display:none;" href="javascript:void(0)" onClick="openWin('js_open_house','<?php echo $value['id'];?>')" class="link">匹配房源</a>
                            <?php  } ?>
                        <?php }else{ ?>
                        <span class="onPcolor">已匹配</span>
                        <?php } ?>
                        </td>
                    </tr>
                </table>
            </div>
            <?php } ?>
            <script>
            $(".timeSata").each(function() {
                var x = $(this).html();
                if(x.length) {
                    $(this).countdown({
                            htmlTemplate:'<strong class="num">%h时</strong><strong class="num">%i分</strong><strong class="num">%s秒</strong><br>后可匹配',
                            date: x,
                            yearsText:'年',
                            monthsText:'月',
                            daysText:'天',
                            hoursText:'时',
                            minutesText:'分',
                            secondsText:'秒',
                            servertime:'<?php echo microtime(true)*1000; ?>',
                            onComplete:function(event)
                            {
                                $(this).hide();
                                $(this).siblings('.link').show(); 	
                            }
                    });
                }
            });
            </script>
            <?php } ?>
            <!--翻页-->
            <div class="picPreviewPagBox pagBoxBorderTop">
                <div class="picPreviewPag">
                    <p class="pag"><a href="#" class="lin prev">&lt;上一页</a></p>
                    <p class="pag"><a href="#" class="lin current">01</a></p>
                    <p class="pag"><a href="#" class="lin">02</a></p>
                    <p class="pag"><a href="#" class="lin">03</a></p>
                    <p class="pag"><a href="#" class="lin">04</a></p>
                    <p class="pag"><a href="#" class="lin">05</a></p>
                    <p class="pag"><a href="#" class="lin">06</a></p>
                    <p class="pag"><a href="#" class="lin">07</a></p>
                    <p class="pag"><a href="#" class="lin">08</a></p>
                    <p class="pag"><a href="#" class="lin">09</a></p>
                    <p class="pag"><a href="#" class="lin">10</a></p>
                    <p class="pag"><a href="#" class="lin next">下一页&gt;</a></p>
                </div>
            </div>

            <!---->
            <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>
<!--会员中心主体 End-->
<?php require ( APPPATH . 'views/'.TEMPLATE_NAME.'/footer.php'); ?>