<!--左边 导航 结束-->
<div id="centre" class="layout">
    <div class="centreInner ">
        <div class="mainInner radius5 "> 
            <?php include 'rent_manage_statics.php'; ?>
            <!---->
            <div class="titleTabBox">
                <div class="titleTab">
                    <div class="titleTabB clearfix">
                        <dl class="list">
                            <dd class="item "> <a class="link" href="<?php echo GB_WO_URL;?>/rent/manage/active/"> 激活房源</a> </dd>
                            <dd class="item itemOn"> <a class="link" href="<?php echo GB_WO_URL;?>/rent/manage/invalid/"> 失效房源 </a></dd>
                            <dd class="item"> <a class="link" href="<?php echo GB_WO_URL;?>/rent/manage/frozen/"> 违规房源(<?php echo $statistic_data['forzen_house_num']; ?>)</a> </dd>
                            <dd class="itemLast"><a href="<?php echo $documentation['house_manage_rule'];?>" target="_blank">使用说明&gt;&gt;</a></dd>
                        </dl>
                    </div>
                </div>
            </div>
            <!---->
            <form id="search_form" name="search_form" method="post" action="<?php echo GB_WO_URL;?>/rent/manage/invalid/">
            <div class="forms functionBox">
                <dl class="list">
                    <dd class="list_item clearfix">
                        <div class="fields">
                            <div class="fgInput jsFgInput">
                                <div class="imitateSelect">
                                    <label class="labelImitate">房源类型</label>
                                    <input type="text" name="infotypename" class="imitate imitateIe" readonly value="<?php if(isset($post_param['infotypename'])){ echo $post_param['infotypename'];}else{ echo '房源类型';} ?>"/>
                                    <input type="hidden" name="infotype" class="jsImitateHidden" value="<?php if(isset($post_param['infotype'])){ echo $post_param['infotype']; } else { echo 0;}?>"/>
                                    <div class="listImitate">
                                        <dl class="inner">
                                            <dd><a class="link" oid="0">不限</a></dd>
                                            <?php foreach($house['infotype'] as $key=>$value){ ?>
                                                <dd><a class="link" oid="<?php echo $key; ?>" href="####"><?php echo $value;?></a></dd>
                                            <?php } ?>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                            <!---->
                            <p class="textFg textFg2">&nbsp;</p>
                            <div class="fgInput jsFgInput">
                                <div class="imitateSelect">
                                    <label class="labelImitate">租金</label>
                                    <input type="text" name="price_rentname" class="imitate imitateIe" readonly value="<?php if(!isset($post_param['price_rentname'])){echo '租金';}else{echo $post_param['price_rentname'];} ?>"/>
                                    <input type="hidden" name="price_rent" class="jsImitateHidden" value="<?php if(isset($post_param['price_rent'])){ echo $post_param['price_rent']; } else { echo 0;}?>"/>
                                    <div class="listImitate">
                                        <dl class="inner">
                                            <dd><a class="link" oid="0">不限</a></dd>
                                           <?php foreach($house['price_rent'] as $key=>$value){ ?>
                                                <dd><a class="link" oid="<?php echo $key;?>" href="####"><?php echo $value;?></a></dd>
                                            <?php } ?>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                            <p class="textFg textFg2">&nbsp;</p>
                            <div class="fgInput jsFgInput">
                                <div class="imitateSelect">
                                    <label class="labelImitate">面积</label>
                                    <input type="text" name="buildareaname" class="imitate imitateIe" value="<?php if(!isset($post_param['buildareaname'])){echo '面积';}else{echo $post_param['buildareaname'];} ?>" readonly/>
                                    <input type="hidden" name="buildarea" class="jsImitateHidden" value="<?php if(isset($post_param['buildarea'])){ echo $post_param['buildarea']; } else { echo 0;}?>"/>
                                    <div class="listImitate">
                                        <dl class="inner">
                                            <dd><a class="link" oid="0">不限</a></dd>
                                           <?php foreach($house['buildarea'] as $key=>$value){ ?>
                                                <dd><a class="link" oid="<?php echo $key;?>" href="####"><?php echo $value;?></a></dd>
                                            <?php } ?>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                            <p class="textFg textFg2">&nbsp;</p>
                            <div class="fgInput jsFgInput">
                                <div class="imitateSelect">
                                    <label class="labelImitate">户型</label>
                                    <input type="text" name="roomtypename" class="imitate imitateIe" value="<?php if(!isset($post_param['roomtypename'])){echo '户型';}else{echo $post_param['roomtypename'];} ?>" readonly/>
                                    <input type="hidden" name="roomtype" class="jsImitateHidden" value="<?php if(isset($post_param['roomtype'])){ echo $post_param['roomtype']; } else { echo 0;} ?>"/>
                                    <div class="listImitate">
                                        <dl class="inner">
                                            <dd><a class="link" oid="0">不限</a></dd>
                                           <?php foreach($house['roomtype'] as $key=>$value){ ?>
                                                <dd><a class="link" oid="<?php echo $key; ?>" href="####"><?php echo $value; ?></a></dd>
                                            <?php } ?>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                            <p class="textFg textFg2">&nbsp;</p>
                            <div class="fgInput jsFgInput">
                                <div class="imitateSelect">
                                    <label class="labelImitate">小区名称</label>
                                        <input type="text" class="imitate imitateIe imitate2" readonly name="k_name" value="<?php if(isset($post_param['k_name'])){echo $post_param['k_name'];} ?>"/>
                                        <input type="hidden"  class="jsImitateHidden" name="k_id" value="<?php if(isset($post_param['k_id'])){ echo $post_param['k_id'];}else{ echo 1; } ?>"/>
                                    <div class="listImitate">
                                        <dl class="inner inner2">
                                            <dd><a class="link" href="####" onClick="addThisText('请输入小区名称')" oid="1">小区名称</a></dd>
                                            <dd><a class="link" href="####" onClick="addThisText('请输入房源编号')" oid="2">房源编号</a></dd>
                                            <dd><a class="link" href="####" onClick="addThisText('请输入房源内部编号')" oid="3">内部编号</a></dd>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                            <!---->
                            <div class="fgInput nameInput " >
                                <div class="fgInput jsNameInput jsFgInput">
                                    <label id="jsHouseNume" for="jsNameInputNF" class="labelPrev labelPrevN jslabelPrev">请输入小区名称</label>
                                    <input  type="text" class="input_text w170" id="jsNameInputNF" name="keywords" value="<?php if(isset($post_param['keywords'])){ echo $post_param['keywords'];}?>"/>
                                </div>
                            </div>
                            <!---->
                            <p class="textFg textFg2">&nbsp;</p>
                            <div class="fgInput" >
                                <input type="submit" style="cursor: pointer;" class="btn btnCon radius5" value="搜索"> 
                            </div>
                            <!----> 
                        </div>
                    </dd>
                </dl>
            </div>
            <!---->
            <div id="jsHideFun" class="forms functionBox functionBox2">
                <dl class="list">
                    <dd class="list_item clearfix">
                        <div class="fields"> 
                            <!---->
                            <div class="fgInput jsFgInput" id="selectFun">
                                <div class="imitateSelect">
                                    <div class="imitate imitateIe" >
                                       <input type="checkbox" class="jsSelectItem jsALLinput_c input_c" name="rows_id"/>
                                    </div>
                                    <div class="listImitate">
                                        <dl class="inner">
                                            <dd><a class="link" href="#" onClick="selectALL()">全选</a></dd>
                                            <dd><a class="link" href="#" onClick="selectALLf()">反选</a></dd>
                                            <dd><a class="link" href="#" onClick="selectALLn()">不选</a></dd>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                            <p class="textFg textFg2">&nbsp;</p>
                             <div class="fgInput"> <a class="btn autoBtn btnCon" onclick="submit_all('multi_delete_house',this)"  href="####">删除</a> </div>
                            <p class="textFg textFg2">&nbsp;</p>
                            <div class="fgInput fgInputRight"> 
                            <!---->
                            <div class="fgInput jsFgInput">
                                    <div class="imitateSelect">
                                            <label class="labelImitate">全部房源</label>
                                            <input type="text" name="roomcategoryname" id="roomcategoryname" class="imitate imitateIe imitate2" value="<?php if(!isset($post_param['roomcategoryname'])){echo '全部房源';}else{echo $post_param['roomcategoryname'];} ?>" readonly/>
                                            <input type="hidden" name="roomcategory" id="roomcategory" class="jsImitateHidden" value="<?php if(isset($post_param['roomcategory'])){echo $post_param['roomcategory'];}?>"/>
                                            <div class="listImitate">
                                                    <dl class="inner inner2">
                                                    <dd><a class="link" onclick="document.getElementById('roomcategoryname').value='不限';document.getElementById('roomcategory').value=0;document.search_form.submit();" oid="0">不限</a></dd>
                                                    <?php foreach($house['roomcategory'] as $key=>$value){ ?>
                                                            <dd><a href="####" class="link" oid="<?php echo $key; ?>" onclick="document.getElementById('roomcategoryname').value='<?php echo $value;?>';document.getElementById('roomcategory').value=<?php echo $key; ?>;document.search_form.submit();"><?php echo $value; ?></a></dd>
                                                    <?php } ?>
                                                    </dl>
                                            </div>
                                    </div>
                            </div>
                            <!---->

                                <div class="fgInput jsFgInput">
                                    <div class="imitateSelect">
                                        <label class="labelImitate">默认排序</label>
                                        <input type="text" name="roomordername" id="roomordername" class="imitate imitateIe imitate3" readonly value="<?php if(!isset($post_param['roomordername'])){ echo '默认排序'; }else{ echo $post_param['roomordername']; } ?>"/>
                                        <input type="hidden" name="roomorder" id="roomorder" class="jsImitateHidden" value="<?php if(isset($post_param['roomorder'])){ echo $post_param['roomorder']; } ?>"/>
                                        <div class="listImitate">
                                            <dl class="inner inner3">
                                                <?php foreach($house['rent_order'] as $key=>$value){ ?>
                                                <dd><a href="####" class="link" oid="<?php echo $key;?>" onclick="document.getElementById('roomorder').value='<?php echo $key;?>';document.getElementById('roomordername').value='<?php echo $value;?>';document.search_form.submit();"><?php echo $value;?></a></dd>
                                                <?php }?>
                                            </dl>
                                        </div>
                                    </div>
                                </div>
                                <!----> 
                            </div>
                        </div>
                    </dd>
                </dl>
            </div>
            <!---->

            <div class="fgTitleBox radius4">
                <table class="table">
                    <tr>
                        <td class="w30">&nbsp;</td>
                        <td class="w260">房源基本信息</td>
                        <td class="w104">创建时间</td>
                        <td class="w104">更新时间</td>
                        <td class="w90">剩余天数</td>
                        <td class="w130">点击情况</td>
                        <td>操作</td>
                    </tr>
                </table>
            </div>
            <!---->
            <?php if( is_array($data_info) && !empty($data_info)){ ?>
            <?php foreach ($data_info as $key => $value ) { ?>
            <div class="itemInfoBach itemInfoBachAuto radius4">
                <table class="table">
                    <tr>
                        <td class="td first"><input class="jsSelectItem" type="checkbox" name="rows_id" value="<?php echo $value['id'];?>"/></td>
                        <td class="td second">
                            <div class="itemTex">
								<a class="name" title = "<?php echo $value['address'];?>" href="<?php echo $value['info_url'];?>" target="_blank"><?php echo $value['address_str'];?></a>
							</div>
							<div class="itemTex">
                                  <?php if($value['is_star_result'] === TRUE) {  ?>
                                  <img alt="多图房源" title="多图房源" src="http://esf.s.house365.com/zsb/images/v1.0/new_duotu.gif" />
                                  <?php } ?>
                            </div>
                            <div class="itemTex"><span class="name"><?php if(isset($value['block_url']) && $value['block_url'] !='') {?> <a class="name" href="<?php echo $value['block_url'];?>" target="_blank"><?php echo $value['blockshowname'];?></a><?}else{echo $value['blockshowname'];}?></span><span class="fg_z">/</span><span><?php echo $value['room'];?>室<?php echo $value['hall'];?>厅</span><span class="fg_z">/</span><span><?php echo $value['floor_str'];?>层</span><span class="fg_z">/</span><span><?php echo $value['buildarea'];?>㎡</span><span class="fg_z">/</span><span><?php echo $value['price'];?><?php echo $house['shoppriceunit'][$value['priceunit']];?></span>
                            </div>
                            <div class="itemTex itemTex2">
                                <span>房源编号：<?php echo $value['id'];?></span>
                                <?php if (!empty($value['ownid'])) { echo '内部编号：'.$value['ownid']; } ?>
                            </div>
                        </td>
                        <td class="td w104">
                            <p><?php echo date( 'm-d H:i' , $value['creattime']); ?></p>
                        </td>
                        <td class="td w104">
                            <p><?php if($value['updatetime'] > 0) { echo date( 'm-d H:i' , $value['updatetime']);}?></p>
                        </td>
                        <td class="td w90">
                            <p>房源：<span class="color"><?php echo $value['exipire_days'];?></span></p>
                        </td>
                        <td class="td w130">
                            <p>昨日：<span class="color"><?php echo $value['click_num_y'];?></span>次</p>
                            <p><a class="link" href="/statistics_analysis/click/" target="_blank">详细</a></p>
                        </td>
                        <td class="td">
                            <div class="fun">
							<div class="linkBox">
									<a class="link" href="<?php echo $value['modify_url'];?>" target="_blank">修改</a>
                                    <span class="fg">|</span>
									<?php if($value['expiretime'] > time()){ ?>
                                    <a id="change_esta" onclick="active_house(<?php echo $value['id']; ?>,'<?php echo md5("HOUSE365_ACTIVE_HOUSE_".$value["id"]);?>')" class="link" href="####">激活</a>
                                    <span class="fg">|</span>
									<?php } ?>
                                    <a class="link" onclick="delete_house(<?php echo $value['id']; ?>,'<?php echo md5("HOUSE365_DELETE_HOUSE_".$value["id"]);?>');" href="####">删除</a> 
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <?php }?>
            <?php }else{ ?>		
            <div class="itemInfoBach radius4">
                <table class="table">
                    <tbody>
                        <tr>
                            <td class="td">没有符合条件的记录</td>
                        </tr>
                     </tbody>
                </table>
			</div>
            <?php }?>
           <div class="forms functionBox ">
                <dl id="jsFixed" class="list">
                    <dd class="list_item clearfix">
                        <div class="fields"> 
                            <!---->
                            <div class="fgInput jsFgInput" id="selectFun2">
                                <div class="imitateSelect">
                                    <div class="imitate imitateIe" >
                                  <input type="checkbox" class="jsSelectItem jsALLinput_c input_c" />
                                    </div>
                                    <div class="listImitate">
                                        <dl class="inner">
                                            <dd><a class="link" href="#" onClick="selectALL()">全选</a></dd>
                                            <dd><a class="link" href="#" onClick="selectALLf()">反选</a></dd>
                                            <dd><a class="link" href="#" onClick="selectALLn()">不选</a></dd>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                            <p class="textFg textFg2">&nbsp;</p>
                            <div class="fgInput"><a class="btn autoBtn btnCon" onclick="submit_all('multi_delete_house',this)"  href="####">删除</a></div>
                        </div>
                    </dd>
                </dl>
            </div>
          <input type = 'hidden' name ='page' value='1'>
		  <input type = 'hidden' name ='blockid' value="<?php if(isset($post_param['blockid'])){ echo $post_param['blockid'];}else{ echo '';}?>">
          </form>

            <!--翻页-->
            <?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 } ?>
			<?php if (is_array($publish_block) && !empty($publish_block)) { ?>
			<div class="personalBox_top">
				<div class="personalBox radius5 inner">
					<div class="hotWord">
						<div class="nameWord">我的小区：</div>
							<div class="infoWord">
							<a href="<?php echo GB_WO_URL;?>/rent/manage/invalid/"><span>全部小区</span></a>
							<?php foreach($publish_block as $b_key => $b_val) { ?>
							<a onclick="document.search_form.blockid.value='<?php echo $b_val['blockid'];?>';document.search_form.submit();return false;" href="#"><span><?php echo $b_val['blockshowname'];?></span></a>
							<? } ?>
							</div>
					</div>
				</div>
			</div>
			<? } ?>
            <form action="<?php echo GB_WO_URL;?>/rent/do_action" method="post" name="action_form">
            <input type=hidden name="actiontype" value="">
            <input type=hidden name="actionid" value="">
            <input type=hidden name="infotype" value="">
            <input type=hidden name="pid" value="">
            <input type=hidden name="pg" value="<?php echo $page; ?>">
            </form>
    </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" onclick="closeP()">确定</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">
    <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="dialogts" 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="dialog_tip"></div>
    </div>
</div>

<!--页面处理中弹层-->
<div style="display:none; text-align: center;" id ='docation_loading'>
    <img src ="<?php echo STATIC_SOURCE_URL; ?>/common/images/loading_6.gif">
    <p style="font-size: 16px; font-family:'微软雅黑'; line-height: 30px; color: #fff;">正在处理</p>
</div>

<!--确定操作弹框-->
<div id="dialogtc" 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="dialogSaveDiv"></div>
		<div style="padding:20px 0 0 65px;">
                    <a href='####' class="btn savePrjoect btnConColor radius5" onclick="do_action();close_confirm_window()">确定</a>
                    <a href="####" class="btn btnCon radius5 close-win">取消</a>
                    <input type ="hidden" name='rowid' id = 'rowid' value = ''>
                    <input type ="hidden" name='secret_key' id = 'secret_key' value = ''>
                    <input type ="hidden" name='atction_type' id = 'atction_type' value = ''>
                    <input type ="hidden" name='do_type' id = 'do_type' value = ''>
		</div>
	</div>
</div>
<script>
function closeP()
{
   $("#dialogtc2").hide()
}

//关闭确认窗口
function close_confirm_window()
{
    $("#gTipsCoverdialogtc").remove();
    $("#dialogtc").hide();
}

function close_doaction_loading()
{   
    $('#docation_loading').hide();
}

//激活房源
function ajax_active_house()
{   
    var rowid = $("#rowid").val(); 
    var secret_key = $("#secret_key").val();
    
    //弹出处理遮罩层
    openWin('docation_loading');
    var form = $("#search_form");
    $.ajax({
        type: "get",
        url: "<?php echo GB_WO_URL;?>/rent/active_house/",
        data: { 'secret_key':secret_key , 'rowid':rowid},
        dataType: "json",
        success: function(data)
        {   
            //关闭处理遮罩层
           close_doaction_loading();
           
            if(data.errorCode == '401')
            {
                jump_win('<?php echo GB_WO_URL;?>/sell/jump/login/' , '请重新登录');
                return false;
            }
            
           if(data.is_ok == '1')
           {
                $("#dialogts #dialog_tip").html(data.msg);
                openWin('dialogts');
                form.submit();
           }
           else
           {
                $("#dialogts #dialog_tip").html(data.msg);
                openWin('dialogts');
                form.submit();
           }
        }
    });
}

//设置标签房源
function ajax_delete_house()
{   
    var rowid = $("#rowid").val(); 
    var secret_key = $("#secret_key").val();
    
    //弹出处理遮罩层
    openWin('docation_loading');
    var form = $("#search_form");
    
    $.ajax({
        type: "get",
        url: "<?php echo GB_WO_URL;?>/rent/delete_house/",
        data: { 'secret_key':secret_key , 'rowid':rowid},
        dataType: "json",
        success: function(data)
        {  
           //关闭处理遮罩层
           close_doaction_loading();
            if(data.errorCode == '401')
            {
                jump_win('<?php echo GB_WO_URL;?>/sell/jump/login/' , '请重新登录');
            }
            
           if(data.is_ok == '1')
           {
                $("#dialogts #dialog_tip").html(data.msg);
                openWin('dialogts');
                form.submit();
           }
           else
           {
                $("#dialogts #dialog_tip").html(data.msg);
                openWin('dialogts');
                form.submit();
           }
        }
    });  
}

//激活房源
function active_house( rowid , secret_key )
{   
    $('#rowid').val(rowid);
    $('#secret_key').val(secret_key);
    $("#atction_type").val("ajax_active_house");
    
    $("#dialogSaveDiv").html("确定要再发布该记录吗？");
    openWin("dialogtc");
}

//删除房源
function delete_house( rowid , secret_key )
{   
    $('#rowid').val(rowid);
    $('#secret_key').val(secret_key);
    $("#atction_type").val("ajax_delete_house");
    
    $("#dialogSaveDiv").html("确定要删除该记录吗？");
    openWin("dialogtc");
}

function do_action()
{   
    var action_type = $('#atction_type').val();
    switch(action_type)
    {
        case "ajax_delete_house":
            ajax_delete_house();
            break;
        case "ajax_active_house":
            ajax_active_house();
            break;
        default:
            alert('no_doaction');
    }
}
</script>