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

<div class="w960 clearfix mt10 pepcenterBox">
<?php require APPPATH_MVC.'views/left.php'; ?>
<!--会员左侧 End-->
<div class="user-main user-main02">
		<div class="hd-bar">
				<div class="tab clearfix"> <a href="<?php echo USER_CENTER.'user/sell_condition';?>" >二手房 (<span class="c-ff8400"><?php echo $this->num_1;?></span>)</a><a href="<?php echo USER_CENTER.'user/rent_condition';?>" class="on">租房 (<span class="c-ff8400"><?php echo $this->num_5;?></span>)</a> </div>
		</div>
		<div class="user-main user-main03">

					<!--2016-8-2 房源列表 tab切换-->
					<style>
						.yzhousetab{ z-index: 0; position: relative; margin-top: 15px; height: 29px; border-bottom: 1px solid #f7f7f7;}
						 
						.yzhousetab span{ border-bottom: 1px solid #f7f7f7; cursor: pointer; height: 29px; line-height: 29px; color: #666666; font-weight: bold; width: 100px; text-align: center; display: block; position: absolute; bottom: -1px;}
						.yzhousetab .hover{ color: #f78000; border-bottom: 1px solid #f78000; z-index: 1;}
						.yztone{ left: 0;}
						.yzttwo{ left: 100px;}
					</style>
					<script>
						$(document).ready(function(){
							$("#test02").css('display','none');
							
							
							//tab切换
							$(".yzhousetab span").live("hover",function(){
								var num = $(this).index();
							
								//alert(num);
								if(num==0 || num==-1)
								{
									$("#test02").css('display','none');
								}
								else
								{
									$("#test02").css('display','block');
								}
								$(".yzhousetab span").removeClass("hover");
								$(this).addClass("hover");
								$(".yzhousel").hide();
								$(".yzhousel").eq(num).show();
							})
							//全选     原全选 class 为 sel-all
							$(".all").on("click",function(){
								var num = $(".yzhousetab .hover").attr("data-num");
								if(!$(this).prev().is(':checked')){
									
									$(".yzhousel").eq(num).find("input").attr('checked',false);
									$(".yzhousel").eq(num).find(".checkbox").removeClass("checked");
								}else{
									$(".yzhousel").eq(num).find("input").attr('checked',true);
									$(".yzhousel").eq(num).find(".checkbox").addClass("checked");
								}
								
							})
						})
					</script>
					<div class="yzhousetab">
						<span class="hover yztone" data-num = "0">租房</span>
						<span class="yzttwo" data-num = "1">直租</span>
					</div>

<div style="display: block;" class="yzhousel"><!--yzhousel开始-->
				<div class="mod-list h-source source-manger03">
						<?php 
        if(is_array($sarr) && !empty($sarr)){
        $n=1;
        foreach($sarr as $key=>$value){
        ?>
						<div class="list-inner clearfix <?php if($n%2==0)echo 'odd';?>"> <span class="chk" style="top:-3px;">
								<input type="checkbox" name="rows_id" value='<?php echo $value['id'];?>' />
								<label></label>
								</span>
								<p class="condition-inner">
										<?=rtrim($value['searchcond'],'<em class="t-line">|</em>');?>
										<?php $house_detail = $this->user_model->getconditionhouse(unserialize($collect[$key]['collect_value']),'rent');
                                        if(isset($house_detail) && !empty($house_detail))
                                        { ?>
										<?php if($n == 1){ $temphouse = $house_detail;} ?>
								</p>
								<div class="new-source-Tip">最新租房：<a href="<?php echo get_rentinfo_url($house_detail['ID']);?>" target="_blank"> <?php echo !empty($house_detail['ROOM'])?$house_detail['ROOM'].'室':'';?><?php echo !empty($house_detail['HALL'])?$house_detail['HALL'].'厅':'';?>
										<?php if(!empty($house_detail['ROOM']) || !empty($house_detail['HALL'])){echo '<em class="t-line">|</em>';}?>
										<?php echo !empty($house_detail['BUILDAREA'])?$house_detail['BUILDAREA'].'平米<em class="t-line">|</em>':'';?><?php echo !empty($house_detail['FORWARD'])?$house_detail['FORWARD'].'<em class="t-line">|</em>':'';?>
                                    <?php  echo !empty($house_detail['FITMENT'])?$house_detail['FITMENT'].'<em class="t-line">|</em>':'';?>
                                        
                                        <?php echo  $house_detail['SUBFLOOR']? $house_detail['SUBFLOOR']."-":""; ?> <?php echo !empty($house_detail['FLOOR'])?$house_detail['FLOOR']:'';?><?php echo !empty($house_detail['TOTALFLOOR'])?'/'.$house_detail['TOTALFLOOR']:'';?> </a><span class="append-Time"><?php echo $house_detail['time'];?></span></div>
								<?php }?>
								<a href="<?php echo $surl[$key];?>" class="lookMore btn1" target="_blank">查看更多</a> </div>
						<?php 
       			 $n++;
						 	echo '<div class="solidDiv">&nbsp;</div>';
        }}else{
        ?>
						<div class="no-result">您没有关注找房条件，去看看吧。<a href="<?php echo GB_CITY_RENTLIST_URL;?>" target="_blank">立即前往&gt;&gt;</a></div>
						<?php
        }
        ?>
				</div>
				<?php if(is_array($sarr) && !empty($sarr)){?>
				<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/rent_condition');?> </div>
		</div><!--yzhousel结束-->


	<!--直租关注开始-->
<?php if(!empty($zzcollect)){ ?>
	<div class="yzhousel" style="display: none;">
						<div class="mod-list h-source source-manger03">
						<?php 
        if(is_array($zzcollect)){
        $n=1;
        foreach($zzcollect as $key=>$value){
			//var_dump($value);
			//$follow_condition = unserialize($value->follow_condition);
			
        ?>
						<div class="list-inner clearfix <?php if($n%2==0)echo 'odd';?>"> 
								<span class="chk" style="top:-3px;">
								<input type="checkbox" name="rows_id_zz" value='<?php echo $value['id'];?>' />
								<label></label>
								</span>
								<p class="condition-inner">
										<?=rtrim($value['searchcond'],'<em class="t-line">|</em>');?>
										<?php $house_detail = $this->user_model->getconditionhouse(unserialize($new_res[$key]['collect_value']),'rent');
										//var_dump($house_detail);
                                        if(isset($house_detail) && !empty($house_detail))
                                        { ?>
										<?php if($n == 1){ $temphouse = $house_detail;} ?>
								</p>
								<div class="new-source-Tip">最新租房：<a href="<?php echo get_rentinfo_url($house_detail['ID']);?>" target="_blank"> <?php echo !empty($house_detail['ROOM'])?$house_detail['ROOM'].'室':'';?><?php echo !empty($house_detail['HALL'])?$house_detail['HALL'].'厅':'';?>
										<?php if(!empty($house_detail['ROOM']) || !empty($house_detail['HALL'])){echo '<em class="t-line">|</em>';}?>
										<?php echo !empty($house_detail['BUILDAREA'])?$house_detail['BUILDAREA'].'平米<em class="t-line">|</em>':'';?><?php echo !empty($house_detail['FORWARD'])?$house_detail['FORWARD'].'<em class="t-line">|</em>':'';?>
                                    <?php  echo !empty($house_detail['FITMENT'])?$house_detail['FITMENT'].'<em class="t-line">|</em>':'';?>
                                        
                                        <?php echo  $house_detail['SUBFLOOR']? $house_detail['SUBFLOOR']."-":""; ?> <?php echo !empty($house_detail['FLOOR'])?$house_detail['FLOOR']:'';?><?php echo !empty($house_detail['TOTALFLOOR'])?'/'.$house_detail['TOTALFLOOR']:'';?> </a><span class="append-Time"><?php echo $house_detail['time'];?></span></div>
								<?php }?>
								<a href="<?php echo $surl[$key];?>" class="lookMore btn1" target="_blank">查看更多</a> </div>
						<?php 
       			 $n++;
						 	echo '<div class="solidDiv">&nbsp;</div>';
        }}else{
        ?>
						<div class="no-result">您没有关注找房条件，去看看吧。<a href="<?php echo GB_CITY_RENTLIST_URL;?>" target="_blank">立即前往&gt;&gt;</a></div>
						<?php
        }
        ?>
						</div>
	
						<div class="solidDiv">&nbsp;</div>
						<div class="handle handle02">
							<a class="handle-btn" id="select-all-btn"><input style="display: none;" value="" type="checkbox"><label class="all checkbox">全选</label></a>
							<a class="handle-btn" id="del-select-btn" href="javascript:submit_all_zz()">删除</a>
						</div>
						<div class="cut-page"> <?php 
						
						$apiurl = "http://mapi.house365.com/taofang/v1.0/zhizu/?method=ApiRent.rentFollowByuid&city=nj&passport_uid=".$this->pass_uid[0]['passport_uid']."&page=".$data['page']."&perpage=5&fromesf=1&t=".time();

						$result = get_api($apiurl);
						
						$tmp = (array)json_decode($result);
					
						$page  =$tmp['page'];
						$pages =$tmp['pages'];
						//echo $page."<br/>";
						//echo $pages."<br/>";
						  echo page_uri($page,$pages,USER_CENTER.'user_li/rent_condition');?> </div>
					</div>
<?php } else {?>
<div class="no-result" id="test02" style="margin-top:40px;">您没有关注找房条件，去看看吧。<a href="http://www.zu365.com/rentlist/index/" target="_blank">立即前往&gt;&gt;</a></div>
<?php }?>
<!--直租关注结束-->

				<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($likerent) && !empty($likerent)){?>
												<?php foreach($likerent as $key=>$value){
												 if(!empty($value)){
												?>
												<dd class="item">
														<div class="pic"><a href="<?php echo get_rentinfo_url($value['ID']);?>" target="_blank"><img src="<?php echo $value['PIC1']?get_big_pic_new($value['PIC1']):USER_CENTER.'images/no_img_small.gif';?>" width="156" height="118" /></a></div>
														<div class="info">
																<p class="tex"><a href="<?php echo get_rentinfo_url($value['ID']);?>" target="_blank" class="name"><?php echo csubstr2($value['ADDRESS'],18);?></a></p>
																<p class="tex"><?php echo !empty($value['ROOM'])?$value['ROOM'].'室':'';?><?php echo !empty($value['HALL'])?$value['HALL'].'厅':'';?> / <?php echo intval($value['BUILDAREA']).'㎡';?> / <?php echo $value['FITMENT'];?></p>
																<p class="tex"><strong class="num"><?php echo intval($value['PRICE']);?></strong>
																		<?php if(!empty($value['PRICEUNIT'])){ echo $priceunit[$value['PRICEUNIT']];}else{echo $priceunit[1]; }?>
																</p>
														</div>
												</dd>
												<?php }} ?>
												<?php } ?>
										</dl>
								</div>
						</div>
				</div>
				<!--会员右侧 End-->
				<form id="action_form" action="<?php echo USER_CENTER.'user/rent_condition'?>" method="post" name="action_form">
						<input type="hidden" value="" name="actionid">
						<input type="hidden" value="del" name="muldel">
				</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 : '<?php echo USER_CENTER;?>user/rent_condition',
     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');
    }
    
    }
}


function submit_all_zz(mark){
    var arr = new Array();
    $(".mod-list").find("input:checked[name=rows_id_zz]").each(function(i) {
    arr[i]=$(this).val();
    });
    var ids=arr.join(",");
	//alert(ids);
    if(ids) {
    if(mark==1)
    {
     document.action_form.actionid.value=ids;
     $.ajax({
     type: 'post',
     url : '<?php echo USER_CENTER;?>user_li/rent_condition',
     data: 'actionid='+ids+'&muldel=delzz',
     dataType:'html',
     success: function(msg){
          $("#pop_win_2").hide();
         if(msg==1)
            
            openWin('warning');
            setTimeout("location.reload()",3000);
        }
       });

    }else{
     openWin('pop_win_2');
    }
    
    }
}


</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;">
		<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>



<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_2" 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_zz(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 require APPPATH_MVC.'views/footer.php'; ?>
