<div id="centre" class="layout">
    <div class="centreInner ">
        <div class="mainInner radius5 zsbreal">
            <div class="belongBox radius5">
                <div class="personalPInner fdPayInner clearfix">
                    <div class="nameBox clearfix">
                        <span class="bold left">放心看状态：</span>
                        <b class="f20 orange left mr5"><?php if($real_status >0){?>
                            已开通
                            <?php }else{?>
                            未开通
                            <?php }?>
                        </b>
                    </div>
                    <div class="nameBox clearfix">
                        <span class="bold left">保证金余额：</span>
                        <b class="f20 orange left mr5"><?=$realHouseMoney?></b>&nbsp;
                        <span class="color1 left mr45"> 元</span>

                        <div class="btnFBbox btnLJCZbox left">
                            <!--ka用户都没有提现和缴纳按钮-->
                            <?php if($real_status != 1){?>
                            <?php  if ($realHouseMoney == 0 && $isApplying == 0) {?>
                                <a class="btnB btnSubmit radius5" href="javascript:void(0)" onclick="topay2()">缴纳</a>
                            <?php } else if($realHouseMoney == 0 && $isApplying == 1){?>
                                <a class="btnB radius5" style="background-color: grey;border: 1px solid grey;text-decoration: none;" href="javascript:void(0)">申请提现</a>
                            <?php } else {?>
                                <a class="btnB btnSubmit radius5" href="javascript:void(0)" onclick="remit(0)">申请提现</a>
                            <?php } ?>
                            <?php } ?>

                            <?php if($study_status == 0){?>
                            <a class="btnB btnSubmit radius5" href="/realHouse/paper_index" target="_blank">学规免罚</a>
                            <?php }elseif($study_status == 2){?>
                                <a class="btnB btnSubmit radius5" href="javascript:void(0)" id="tom_test">学规免罚</a>
                            <?php }?>
                        </div>
                    </div>
                    <?php if ($realHouseMoney == 0 && $real_status != 1) {?>
                        <div class="mt10 pb10">
                            缴纳 <span class="orange">299</span> 元保证金即可参与真房源计划。<a class="blue" target="_blank" href="http://zsb.house365.com/help/nj/?p=1373">查看详细介绍</a>
                        </div>
                    <?php } ?>
                </div>
            </div>
            <div class="personal_title"><strong class="title">保证金变动明细</strong></div>

            <div class="branchCommon branchCommon_pay radius5 ">
                <div class="hd">
                    <table class="tableExpert">
                        <tr>
                            <td class="td f w160">
                                <div class="">时间</div>
                            </td>
                            <td class="td w110">
                                <div class="">操作</div>
                            </td>
                            <td class="td w160">
                                <div class="">原因说明</div>
                            </td>
                            <td class="td w70">
                                <div class="">状态</div>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="mod">
                    <table class="tableExpert tableExpert_no">
                        <!--无记录-->
                        <?php if (empty($brokerLog)) {?>
                            <tr>
                                <td colspan="4">
                                    <div class="ptb30 acenter">暂无账单记录</div>
                                </td>
                            </tr>
                        <?php } else { ?>
                            <?php foreach($brokerLog as $item) { ?>
                                <tr>
                                    <td class="td f w160">
                                        <div class=""><?=date('Y-m-d H:i:s', $item['create_time'])?></div>
                                    </td>
                                    <td class="td w110">
                                        <div class="">
                                            <span style="color: <?=$item['money'] > 0 ? 'red' : 'green';?>;"><?=$item['money'] > 0 ? '+'.$item['money'] : $item['money'];?></span>
                                        </div>
                                    </td>
                                    <td class="td w160">
                                        <div class=""><?=$item['reason']?></div>
                                    </td>
                                    <td class="td w70">
                                        <div class=""><?=$statusList[$item['status']]?></div>
                                    </td>
                                </tr>
                            <?php } ?>
                        <?php } ?>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="dialogtc2" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text" id="dialogSaveDiv2"></div>
        <div style="padding:20px 0 0 65px;">
            <a href="###" class="btn savePrjoect btnConColor radius5" id="dialog_url2">继续提现</a>
            <a href="####" class="btn btnCon radius5 close-win">取消</a>
            <!--<input type="hidden" id="dialog2_id" value="" />-->
        </div>
    </div>
</div>

<!--操作结果弹出提示框-->
<div id="dialogts" class="dialog radius5" style="width: 350px;">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text" id="dialog_tip"></div>
    </div>
</div>
<!---->
<div id="dialogtc3" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text" id="dialogSaveDiv3"></div>
        <div style="padding:20px 0 0 65px;">
            <a href="###" class="btn savePrjoect btnConColor radius5" id="dialog_url3">确定</a>
            <a href="####" class="btn btnCon radius5 close-win">取消</a>
            <!--<input type="hidden" id="dialog2_id" value="" />-->
        </div>
    </div>
</div>

<div id="dialogtc4" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text" id="dialogSaveDiv4"></div>
        <div style="padding:20px 0 0 65px;">
            <a href="###" class="btn savePrjoect close-win btnConColor radius5" id="dialog_url4">确定</a>
            <a href="####" class="btn btnCon radius5 close-win">取消</a>
            <!--<input type="hidden" id="dialog2_id" value="" />-->
        </div>
    </div>
</div>
<script>
    function exConfirm(msg) {
        $("#dialogSaveDiv2").html(msg);
        $('#dialog_url2').bind('click', function () {
            remit(1);
        });

        openWin("dialogtc2");
    }
    function exAlert(msg) {
        $("#dialog_tip").html(msg);
        openWin('dialogts');
    }
    function topay2(){
        //判断时间节点条件
        $.ajax({
            type: "post",
            url:"/realHouse/pay_six_month/",
            dataType : 'json',
            data:{},
            success: function(data){
                //直接跳支付页面
                if (data.status == 1){
                    topay();
//                    window.location.href = "/realHouse/recharge/";
                    //六个月内多次退出，期限内不可以再次参加
                } else if (data.status == 2) {
                    exConfirmjump2(data.msg);
                }
            }
        })
    }

    function exConfirmjump(msg){
        $("#dialogSaveDiv3").html(msg);
        $('#dialog_url3').bind('click', function () {
//            $("#dialogtc3").hide();
            window.location.href = "/realHouse/recharge/";
        });
        openWin("dialogtc3");
    }
    function exConfirmjump2(msg){
        $("#dialogSaveDiv4").html(msg);
        openWin("dialogtc4");
    }

    function topay(){
        var msg = '放心看计划目前仅支持主城区域内房源的发布(更多区域陆续开放中), 请确认是否继续参与';
        exConfirmjump(msg);
    }
    var clickFalg = true; //防止疯狂点击
    function remit(type) {
        if(clickFalg){
            clickFalg=false;
        } else{
            return false;
        }
        $.ajax({
            type: "post",
            url: "/realHouse/applyRemit/",
            dataType : 'json',
            data:{type:type},
            success: function(data){
                clickFalg = true;
                if (data.status == 1) {
                    $(".dialog").css('display','none');
                    exAlert(data.msg);
                    setTimeout("window.location.reload();", 3000);
                } else if (data.status == 2) {
                    exConfirm(data.msg);
                } else {
                    exAlert(data.msg);
                }
            },
            error:function(){
                clickFalg = true;
            }
        });
    }
    $('#tom_test').click(function(){
        alert("休息一下，请您明天继续参与!");
    })
</script>