<?php require APPPATH_MVC.'views/header.php'; ?>
<!--会员中心主体 Start--> 
<div class="w960 clearfix mt10 pepcenterBox">
    <?php require APPPATH_MVC.'views/left.php'; ?>
    <div class="user-main user-main02">
        <div class="hd-bar pos-r">
            <h2>我关注的学校</h2>
        </div>
        <div class="user-main user-main03">
            <div class="mod-list h-source source-manger03">

                <?php 
                if(is_array($collect) && !empty($collect)){
                $n=1;
                foreach($collect as $key=>$value){
                    $value['coverphoto'] = $value['coverphoto'] ? $value['coverphoto'] : 'http://nj.sell.house365.com/images/rentlistnopic1.jpg';
                ?>
                <div class="list-inner clearfix">
                    <div class="clearfix"> <span class="chk">
                            <input style="display: none;" name="rows_id" value="<?php echo $value['id'];?>" type="checkbox">
                            <label class="checkbox"></label>
                        </span> <a href="<?php echo get_school_url($value['collect_id']);?>" target="_blank"><img src="<?php echo $value['coverphoto'];?>" height="85" width="110"></a>
                        <div class="h-source-info">
                            <h3><a href="<?php echo get_school_url($value['collect_id']);?>" target="_blank"><?php echo $value['schoolName'];?></a>

                                <span class="item">
                                    <?php if(isset($vlaue['schoolType'])){?>
                                    <?php echo $vlaue['schoolType'];?><span class="fg">/</span>
                                    <?php }?>
                                    <?php if(isset($vlaue['schoolRank'])){?>
                                    <?php echo $vlaue['schoolRank'];?><span class="fg">/</span>
                                    <?php }?>
                                    <?php if(isset($vlaue['schoolPap'])){?>
                                    <?php echo $vlaue['schoolPap'];?><span class="fg">/</span>
                                    <?php }?>
                                    <?php if(is_array($value['feature'])&&!empty($value['feature'])){?>
                                    <?php foreach($value['feature'] as $key=>$val){ $colorid=$key%2+1;?>
									<?php if($val&&$key<3){?>
                                    <strong class="color0<?php echo $colorid;?>"><?php echo $val;?></strong>
                                    <span class="fg">/</span>
                                     <?php } ?>
                                    <?php }?>
                                    <?php }?>

                            </h3>
                            <p><?php echo $value['district'];?><em class="t-line">|</em><?php echo $value['streetname'];?><em class="t-line">|</em><?php echo $value['address'];?> 
							<em class="t-line">|</em><?php echo $value['telno'];?> </p>
                            <p><span>二手房(<a href="<?php echo get_schoolsell_url($value['collect_id']);?>" target="_blank"><?php echo intval($value['sellNum']);?></a>)</span><span class="ml20">租房(<a href="<?php echo get_schoolrent_url($value['collect_id']);?>" target="_blank"><?php echo intval($value['rentNum']);?></a>)</span><span class="ml20">划片小区(<a href="<?php echo get_schoolblock_url($value['collect_id']);?>" target="_blank"><?php echo intval($value['blockNum']);?></a>)</span></p>
                        </div>
                    </div>
                    <?php if(is_array($value['lastestHouse'])&&!empty($value['lastestHouse'])){?>
                    <div class="new-source-Tip">最新二手房： <a target="_blank" href="<?php echo get_sellinfo_url($value['lastestHouse']['ID']);?>"> <?php echo $value['lastestHouse']['ROOM'];?>室<?php echo $value['lastestHouse']['HALL'];?>厅<em class="t-line">|</em><?php echo $value['lastestHouse']['BUILDAREA'];?>平米<em class="t-line">|</em><?php echo $value['lastestHouse']['FORWARD'];?><em class="t-line">|</em> <?php echo is_array($value['lastestHouse']['FITMENT']) ? $value['lastestHouse']['FITMENT'][0] : $value['lastestHouse']['FITMENT'];?><em class="t-line">|</em> <?php echo $value['lastestHouse']['FLOOR'];?>/<?php echo $value['lastestHouse']['TOTALFLOOR'];?><em class="t-line">|</em><?php echo $value['lastestHouse']['BUILDYEAR'];?>年 </a> <span class="append-Time"><?php echo $value['lastestHouse']['time'];?></span></div>
                    <?php }?>
                    <span class="prices"><i>
					<?php $value['price']['min']=isset($value['price']['min']) ? $value['price']['min']:0;
						$value['price']['max']=isset($value['price']['max']) ? $value['price']['max']:0;
							
					?>
                    <?php if($value['price']['min']==0||$value['price']['max']==0){?>
					暂无价格
                     <?php }else{?>
					<?php echo intval($value['price']['min']);?> - <?php echo intval($value['price']['max']);?>
					<?php }?>
					</i>元/平米</span>
                </div>



                <?php 

                $n++;
                }}else{
                ?>
                <div class="no-result">您没有关注的学校，去看看学区吧。<a href="<?php echo GB_SCHOOL_URL;?>" target="_blank">立即前往&gt;&gt;</a></div>
                <?php
                }
                ?>		


            </div>
            <?php if(is_array($collect) && !empty($collect)){?>
            <div class="solidDiv">&nbsp;</div>
            <div class="handle handle02">
                <a class="handle-btn" id="select-all-btn"><input type="checkbox" value=''  /><label class="sel-all">全选</label></a><a class="handle-btn" id="del-select-btn" href="javascript:submit_all()">删除</a>
            </div>
            <?php }?>
            <div class="cut-page">
                <?php echo page_uri($page,$pages,USER_CENTER.'user/schoollist');?>  
            </div>
            <div class="source-manger02">
                <div class="modListHd modListBd">
                    <h4 class="h4">您可能感兴趣的学区房</h4>
                </div>
                <div class="showHouseBox">
                    <div class="details">
                        <dl class="list">

                         <?php if(is_array($likesell)&&!empty($likesell)){?>
                         <?php foreach($likesell as $value){?>
                            <dd class="item">
                                <div class="pic"><a target="_blank" href="<?php echo get_sellinfo_url($value['ID']);?>"><img width="156" height="118" src="<?php echo $value['PIC1']?$value['PIC1']:USER_CENTER.'images/no_img_small.gif' ;?>"></a></div>
                                <div class="info">
                                    <p class="tex"><a class="name" target="_blank" href="<?php echo get_sellinfo_url($value['ID']);?>"><?php echo csubstr2($value['ADDRESS'],18);?></a></p>
                                    <p class="tex"><?php echo $value['ROOM'];?>室<?php echo $value['HALL'];?>厅/ <?php echo $value['BUILDAREA'];?>㎡/<?php echo is_array($value['FITMENT']) ? $value['FITMENT'][0] : $value['FITMENT'];?></p>
                                    <p class="tex"><strong class="num"><?php echo $value['PRICE'];?></strong>万元</p>
                                </div>
                            </dd>
                        <?php }?>
                        <?php }?>
             
                        </dl>
                    </div>
                </div>
            </div>
        </div>
        <!--会员右侧 End-->
        <form id="action_form" action="http://user.house365.com/user/rentlist" method="post" name="action_form">
            <input value="" name="actionid" type="hidden">
            <input value="del" name="muldel" type="hidden">
        </form>
    </div>
</div>
<script>
    function submit_all(mark) {
        var arr = new Array();
        $(".mod-list").find("input:checked[name=rows_id]").each(function(i) {
            arr[i] = $(this).val();
        });
        var ids = arr.join(",");
        if (ids) {
            if (mark == 1)
            {
                document.action_form.actionid.value = ids;
                $.ajax({
                    type: 'post',
                    url: 'http://user.house365.com/user/schoollist',
                    data: 'actionid=' + ids + '&muldel=del',
                    dataType: 'html',
                    success: function(msg) {
                        $("#pop_win_1").hide();
                        if (msg == 1)
                            openWin('warning');
                        setTimeout("location.reload()", 3000);
                    }
                });

            } else {
                openWin('pop_win_1');
            }

        }
    }


</script> 
<script>
    var openWin = function(obj) {
        var winHeght = $(document).height();
        var winElemt = $('#' + obj);

        var win = {
            height: function() {
                return winElemt.outerHeight();
            },
            width: function() {
                return winElemt.outerWidth();
            },
            show: function() {
                winElemt.css({
                    'position': 'absolute',
                    'z-index': '9999902',
                    'left': '50%',
                    'margin-left': '-' + win.width() / 2 + 'px',
                    'top': $(window).height() / 2 - (win.height() / 2) + $(window).scrollTop() + 'px'
                }).show();
            },
            hide: function() {
                winElemt.hide();
            }

        };
        win.show();
        $('.close-win').click(function() {
            win.hide();
        });
    };
</script>
<div id="warning" class="pop" style=" display:none;z-index:100">
    <div class="hd">
        <h2>提示</h2>
        <a href="javascript:void(0)" class="close-win">关闭</a> </div>
    <div class="bd">
        <div class="warning-inner">
            <div class="war-bg" style="background:url(<?php echo USER_CENTER;?>images/pop-ico.gif)  0 0 no-repeat;"></div>
            <p class="war-text">删除成功</p>
        </div>
        <div class="pop-btn-area"><a href="javascript:location.reload();" class="close-win" style="background:#29B966;color:#fff;padding:7px 15px;margin:0 5px;border:1px solid #26AB5E">确定</a></div>
    </div>
</div>
<div style="display:none;width:390px;height:200px; position:absolute;left:50%;top:50%;margin-left:-85px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca; z-index:9999" id="pop_win_1" class="pop_win">
    <div style="height:40px;background:#FF8400" class="hd">
        <h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">提示</h2>
        <a style="display:block;width:30px;height:30px;background:url(<?php echo USER_CENTER;?>images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" class="close-win" href="javascript:void(0)">关闭</a></div>
    <div style="background:#fff;height:160px" class="bd">
        <div style="width:70px;height:80px;background:url(<?php echo USER_CENTER;?>images/pop-ico.gif) no-repeat -2px -113px; position:absolute;left:70px;top:60px"></div>
        <p style="position:absolute;left:140px;top:85px;font-size:14px">你确定要删除该学校吗？</p>
        <div style="text-align:center;position:absolute;top:155px;width:100%"><a style="*position:relative;background:#29B966;color:#fff;padding:7px 15px;margin:0 5px;border:1px solid #26AB5E" class="refresh-ok" href="javascript:submit_all(1)">确定</a><a style="*position:relative;background:#F5F5F5;color:#666;padding:7px 15px;margin:0 5px;border:1px solid #CCCCCC" class="close-win" href="javascript:void(0)">取消</a></div>
    </div>
</div>
<?php
if($isa_website!=''){
?>
<script type="text/javascript">
	var isa_website = "<?=$isa_website?>";
	var isa_city = "<?=$isa_city?>";
	var isa_addones = "<?=$isa_addones?>";

	var _analyze365 = (('https:' == document.location.protocol) ? ' https://': ' http://');
	document.write(unescape('%3Cscript src="'+ _analyze365 + '<?=$isa_url?>" type="text/javascript"%3E%3C/script%3E'));
</script>
<?php
}
?>
<script type='text/javascript'>
	var website="2";
    var ga_city = "<?=$isa_city?>";
    var ga_channel = 'center';
    var ga_page= "/个人中心/我关注的学校";
</script>
<script language="javascript" src="http://stat.house365.com/365count.js"></script>

<?php require APPPATH_MVC.'views/footer.php'; ?>