<style>
.addPicRight .addBtnnew{float: left;border: 1px solid #bfbfbf;height: 26px;line-height: 26px;margin-top:6px; ;overflow: hidden;text-align: center;margin-right:20px;}
.bigPicLin{background:rgba(0, 0, 0, 0) url("http://esf.s.house365.com/zsb/images/v1.0/toBigImg_zhou_2.png") no-repeat scroll 0 0}
</style>
<script type="text/javascript" src="http://esf.s.house365.com/zsb/js/v1.0/house.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/zsb/js/v1.0/uploadpic_free_house.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/common/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/common/js/jquery_ui_autocomplete/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/common/js/jquery_ui_autocomplete/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/common/js/jquery_ui_autocomplete/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/common/js/jquery_ui_autocomplete/ui/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/common/js/jquery.ui.mouse.min.js"></script>
<script type="text/javascript" src="http://esf.s.house365.com/common/js/jquery.ui.sortable.min.js"></script>
<!--左边 导航 结束-->
<div id="centre" class="layout">
    <div class="centreInner ">
        <div class="mainInner radius5 "> 
        <?php include 'sell_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;?>/sell/manage/active/"> 激活房源</a> </dd>
                            <dd class="item "> <a class="link" href="<?php echo GB_WO_URL;?>/sell/manage/invalid/"> 失效房源 </a></dd>
                            <dd class="item"> <a class="link" href="<?php echo GB_WO_URL;?>/sell/manage/frozen/"> 违规房源(<?php echo $statistic_data['forzen_house_num']; ?>)</a> </dd>
                            <dd class="item itemOn"> <a class="link" href="<?php echo GB_WO_URL;?>/sell/manage/sysfrozen/">系统拦截</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;?>/sell/manage/sysfrozen/">
            <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_sellname" class="imitate imitateIe" readonly value="<?php if(!isset($post_param['price_sellname'])){echo '价格';}else{echo $post_param['price_sellname'];} ?>"/>
                                    <input type="hidden" name="price_sell" class="jsImitateHidden" value="<?php if(isset($post_param['price_sell'])){ echo $post_param['price_sell']; } else { echo 0;}?>"/>
                                    <div class="listImitate">
                                        <dl class="inner">
                                            <dd><a class="link" oid="0">不限</a></dd>
                                           <?php foreach($house['price_sell'] 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 class="fgTitleBox radius4">
                <table class="table">
                    <tr>
                        <td class="w10">&nbsp;</td>
                        <td class="w260" style="width:300px;">房源基本信息</td>
                        <td class="w75">创建时间</td>
                        <td class="w75">更新时间</td>
                        <td class="w75">拦截原因</td>
                        <td class="w85">拦截处理</td>
                        <td class="w75">处理时间</td>
                        <td>操作</td>
                    </tr>
                </table>
            </div>
            <!---->
            <?php if( is_array($data_info) && !empty($data_info)){ 
                $sell_appeal = DAO::instance('sell_appeal');
				//var_dump($sell_appeal->primaryKey);
			?>
            <?php foreach ($data_info as $key => $value ) { 
			
					$query_struct = array(
						'where' => array(
							'city' => 'nj',
							'id'   => $value['id']
						),
					);

					$house['sysfrozen_esta'] = $sell_appeal->get_all($query_struct);
					//print_r($house['sysfrozen_esta']);
			?>
            <div class="itemInfoBach radius4">
                <table class="table">
                    <tr>
                        <td class="td w10"></td>
                        <td class="td second" style="width:300px;">
                            <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 } ?>

								  <?php if($value['is360'] == 2) {  ?>
                                  <img alt="全景房源" title="全景房源" src="http://esf.s.house365.com/zsb/images/v1.0/new_360.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 class="fg_z">/</span></span><?php echo $value['price'];?>万
                            </div>
                            <div class="itemTex itemTex2">
                                <span>房源编号：<?php echo $value['id'];?></span>
                                <?php if (!empty($value['ownid'])) { echo '内部编号:'.$value['ownid']; } ?>
                            </div>
                        </td>
                        <td class="td w75">
                            <p><?php echo date( 'm-d H:i' , $value['creattime']); ?></p>
                        </td>
                        <td class="td w75">
                            <p><?php if($value['updatetime'] > 0) { echo date( 'm-d H:i' , $value['updatetime']);}else{echo '未刷新';}?></p>
                        </td>
                        <td class="td w75">价格预警</td>
                        <td class="td w75">拦截</td>
                        <td class="td w85">
                            <p>
                                <?php
                                if ($house['sysfrozen_esta']){
                                    if ($house['sysfrozen_esta'][0]['result'] == 0){
                                        echo '未处理';
                                    }else {
                                        echo substr($house['sysfrozen_esta'][0]['upd_time'],0,16);
                                    }
                                }else {
                                    echo '未处理';
                                }
                                ?>
                            </p>
                        </td>
                        <td class="td">
                            <div class="fun">
                                <div class="linkBox">
                                <a href="<?php echo $value['modify_url'];?>" target="_blank" class="link">查看</a>
                                <span class="fg">|</span>
                                <?php if( $house['sysfrozen_esta'][0] ) { ?>
                                    <?php if ($house['sysfrozen_esta'][0]['result']==20) : ?>
                                        申诉失败
                                    <?php elseif ($house['sysfrozen_esta'][0]['result']==10) : ?>
                                        申诉成功
                                    <?php elseif ($house['sysfrozen_esta'][0]['result']==1) : ?>
                                        <a href="###" class="link" onclick="appeal(<?php echo $value['id'];?> , '<?php echo date("Y-m-d H:i",$value['updatetime']);?>','价格预警','<?php  echo md5("HOUSE365_SELL_APPEAL_".$value["id"]);?>');">申诉</a>
                                    <?php else : ?>
                                        受理中
                                    <?endif;?>
                                <?php } else{ ?>
                                 <a href="###" class="link" onclick="appeal(<?php echo $value['id'];?> , '<?php echo date("Y-m-d H:i",$value['updatetime']);?>','价格预警','<?php  echo md5("HOUSE365_SELL_APPEAL_".$value["id"]);?>');">申诉</a>
                                <?php }?>
                            </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 }?>
          </form>
			<!--申诉表单div开始-->
		 <div class="branchCommon radius5 " id="jsDialogNeighborhoodComplain">
			<div class="hd">
				<h3 class="h3">我要申诉</h3>
				<a href="javascript:void(0)" class="right close-sq j-close-sq">关闭</a>
			</div>
			 <form  class="frozen-form"name="house_appeal_form" action="" >
				<ul class="frozen-sq clearfix">
					<li><label class="label">冻结房源：</label><label class="label" id="houseid"></label></li>
					<li class="middle"><label class="label">冻结时间：</label><label class="label" id="time"></label></li>
					<li><label class="label">冻结原因：</label><label class="label" id="reason"></label></li>
				</ul>
				<div class="clr"></div>
    				  <div class="reason-sq">
                        <div class="must-sq left">*</div><label class="label left">申诉理由：</label>
                        <textarea class="textarea left" id="jsReason" onkeyup="words_deal();"></textarea>
                        <label class="error" style="display:none;color:red;margin-left:70px;">请填写申诉理由!</label>
                        <div class="clearfix">
                        <p class="right"><lable>剩余<span class="colorR" id="jsReasonNum">50</span>字</lable></p>
                        </div>
				 </div>
				 <div style="float:left;margin-top:10px;"><div class="must-sq left">*</div>上传图片:</div>
				 <?php require_once 'pic_inc_house_free.php'; ?>

		    <div class="clr"></div>   
			<div class="sq-subt-fields">
						 <a href="#" class="btn-sq btnCon radius5" onclick="appeal_add();">提交</a> 
						 <a href="javascript:void(0)" class="btn-sq btnCon radius5 j-reset-sq" > 取消</a>
				</div> 
									
			   <input type="hidden" name="secret_key" id="secret_key" value="">
										
											
			 </form>
		 </div>
	  <!--申诉表单div结束-->
            <!--翻页-->
            <?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 } ?>
    </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>

<script type="text/javascript">
function words_deal()
{

var curLength=$("#jsReason").val().length;

if(curLength>50)
{
var num=$("#jsReason").val().substr(0,50);
	$("#jsReason").val(num);
//alert("超过字数限制，多出的字将被截断！" );
}
else
{
$("#jsReasonNum").text(50-$("#jsReason").val().length);
}
}
</script> 


<script>
function appeal(rowid  ,time , reason , secret_key)
{
    $("#reason").html(reason);
    $("#houseid").html(rowid);
    $("#time").html(time);
    $("#secret_key").val(secret_key);
    $('#jsDialogNeighborhoodComplain').slideDown(500) ;
}	


//关闭申诉表单div
$(".j-close-sq").click(function(){
    $("#jsDialogNeighborhoodComplain").slideUp(500);
});
//申诉表单重置按钮
$(".j-reset-sq").click(function(){
    $("#jsReason").val('');
    $("#jsReasonNum").text('50');
    $("#pic_show_sq").empty();
    $("#jsDialogNeighborhoodComplain").slideUp(500);
})
//点击已上传图片的删除按钮 触发事件
$(".j-delete-sq").click(function(){
    $(this).parents(".picBox-sq").remove();
})

function appeal_add () 
{
    var rowid = $("#houseid").html();
    var reason = encodeURI($("#jsReason").val());
    var secret_key = $("#secret_key").val();

    //2015-7-9 获取图片的地址 ----------start ------------>
    var p_filenames = $("input[name='p_filename[]']");	
    if(p_filenames.length == 0){
        alert('请上传证据，以便核实！');
    }
	var p_filenames_img = '';
	p_filenames.each(function(){
		var value = $(this).val()+',';
		p_filenames_img += value;
	});
	//2015-7-9 获取图片的地址 ----------end ------------>



	//2015-7-9 获取图片的描述 ----------start ------------>
	/*
	var p_title = $("input[name='p_title[]']");	
	var p_titles = '';
	p_title.each(function(){
			var value_title = $(this).val()+'++++';
			p_titles += value_title;
		});
	*/
	//2015-7-9 获取图片的描述 ----------end ------------>


	

    if(reason == '')
    {
        $(".error").show();
        return false;
    }else{
        $(".error").hide();
    }
    
    var form = $("#search_form");
    $.ajax({
        type: 'get',
        url : '<?php echo GB_WO_URL;?>/sell_li/house_sys_appeal/',
        data:  {'secret_key':secret_key , 'rowid':rowid ,'reason':reason,'p_filenames':p_filenames_img},
        dataType:'json',
        success: function(data)
        {
            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();
           }
        }
    });
    $("#jsDialogNeighborhoodComplain").hide();
    $("#gTipsCoverjsDialogNeighborhoodComplain").remove();
}
</script>