<!---->
<div id="centre" class="layout">
		<div class="centreInner ">
				<div class="mainInner radius5 "> 
						<!---->
						
						<div class="titleTabBox">
								<div class="titleTab">
										<div class="titleTabB clearfix">
												<dl class="list">
														<dd class="item itemOn"> <a class="link" href="/my_complain/complain/">竞投房源举报</a> </dd>
														<dd class="item"> <a class="link" href="/my_complain/myList/"> 我的举报 </a></dd>
												</dl>
										</div>
								</div>
						</div>
						<!---->
						<div class="belongBox radius3 belongBox_jub">
								<p class="title"><span class="b">举报规则：</span><span class="tex_fg">1、每个经纪人每天最多只能举报5条房源&nbsp;&nbsp;&nbsp; 2、一条房源最多只能被不同公司的三个不同的经纪人投诉</span></p>
								<p class="title"><span class="b">温馨提示：</span>
								1、房源举报经核实后可赢取房豆奖励哦!举报虚假房源冻结可获得<span class="f_color"><?=$credit['bid']?>房豆/条</span>,举报虚假房源删除可获得<span class="f_color"><?=$credit['delete']?>房豆/条</span>。				
								<!--竞投房源举报经核实后可赢取房豆奖励哦!举报竞投房源成功可获得<span class="f_color"><?=$credit['bid']?>房豆/条</span>,举报普通房源成功可获得<span class="f_color"><?=$credit['comman']?>房豆/条</span>。-->	&nbsp;&nbsp;&nbsp;<a  style="color:#2280ff" href="<?=$documentation['complain_rule']?>" target="_blank">详细规则>></a></p> 
								<p class="title"><span class="b">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
								2、因网站搜索规则进行了优化升级，小区名搜索只匹配所属小区，标题内含有多小区名不会增加被搜索机会，<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:red;font-weight:bolder;">故即日起网站不再受理因标题含有多小区名的违规投诉，同时前期未受理的投诉也将予以驳回，感谢您的理解</span></p> 
						</div>
						<!---->
						
						<div class="belongBox radius3 belongBox_jub">
								<div class="forms">
                                    <form action="" id="jsForm_jub" method="post" onsubmit="return false">
												<dl class="list">
														
														<!---->
														
														<dd class="list_item clearfix">
																<label class="label">房源编号：</label>
																<div class="fields">
																		<div class="fgInput jsFgInput">
																				<input id="houseid" type="text" class="input_text w170" name="houseid" value=""  iserror=""/>
																		</div>
																		<div class="textFgErroy" id="houseerror" style="width:370px;"></div>
                                                                        
																</div>
														</dd>
														<!---->
														<dd class="list_item clearfix">
																<label class="label">房东电话：</label>
																<div class="fields">
																		<div class="fgInput jsFgInput">
																				<input id="telno" type="text" class="input_text w170" name="telno" maxlength="20" iserror="" />
																		</div>
																			<div class="textFgErroy" id="telnoerror" style="width:300px;"></div>
																</div>
														</dd>
														<!---->
														<dd class="list_item clearfix">
																<label class="label">房源地址：</label>
																<div class="fields nameInput">
																		<div class="fgInput jsNameInput jsFgInput">
																			<label class="labelPrev labelPrevN jslabelPrev" for="js_fangyuandizhi" >请具体到XX栋XX号</label>
																				<input id="address" type="text" class="input_text w345" name="address"  id="js_fangyuandizhi" iserror="" />
																		</div>
                                                                    <div class="textFgErroy" id="addresserror" style="width:300px;"></div>
																</div>
														</dd>
														<!---->
														<dd class="list_item clearfix">
																<label class="label">投诉原因：</label>
																<div class="fields">
															
																		<div class="fgInput jsFgInput" style="padding-right:25px;">
																				<label class="textFg3 textFg5">
																						<input type="checkbox" style="_margin-top:4px;" class="input_c" name="reason[]" value="1">
																						<span class="tex">&nbsp;面积虚假</span></label>
																		</div>
																		<div class="fgInput jsFgInput" style="padding-right:25px;">
																				<label class="textFg3 textFg5">
																						<input type="checkbox" style="_margin-top:4px;" class="input_c"  name="reason[]" value="2">
																						<span class="tex">&nbsp;价格虚假</span></label>
																		</div>
																		<div class="fgInput jsFgInput" style="padding-right:25px;">
																				<label class="textFg3">
																						<input type="checkbox" style="_margin-top:4px;" class="input_c"  name="reason[]" value="3">
																						<span class="tex">&nbsp;房源已成交</span></label>
																		</div>
																		<div class="fgInput jsFgInput" style="padding-right:25px;">
																				<label class="textFg3">
																						<input type="checkbox" style="_margin-top:4px;" class="input_c"  name="reason[]" value="4">
																						<span class="tex">&nbsp;图片虚假</span></label>
																		</div>
																	
																			<div class="textFgErroy" id="reasonerror"></div>
																		<div class="clear tip_color">备注：目前标题违规，毛坯与简装图片暂不在虚假举报范围内，全景图片只删除全景图片，不赠送房豆，房源虚假情况请详细说明并提供证据以便网站核实，若证据不足，网站可能予以驳回。</div>
																</div>
														</dd>
														<!---->
														<dd class="list_item clearfix">
																<label class="label">投诉说明：</label>
																<div class="fields nameInput ">
																		<div class="fgInput jsNameInput jsFgInput">
																		<label class="labelPrev labelPrevN jslabelPrev" for="js_tousushuoming" >请阐述详细投诉理由，至少20个字哦！</label>
																				<textarea id="description" class="textarea" name="description" id="js_tousushuoming" iserror=""></textarea>
																		</div>
                                                                    <div class="textFgErroy" id="descriptionerror"></div>
																</div>
														</dd>

                                                        <dd class="list_item clearfix">
                                                            <div class="cf">
                                                                <label class="label height0">&nbsp;</label>
                                                                <div class="fields">
                                                                    <div id="thumbnails"></div>
                                                                </div>
                                                            </div>
                                                            <div class="cf">
                                                                <label class="label">添加图片：</label>
                                                                <div class="fields nameInput ">
                                                                    <div class="pre fl cf aupload">
                                                                        <div class="fl">
                                                                            <div id="spanButtonPlaceholder" style="display:none;"></div>
                                                                        </div><span class="fl font13 line34 ml10">最多可传3张照片。支持jpg、png，单张5M以内。</span>
                                                                    </div>
                                                                    <div class="pre fl cf auploadn" style="display: none;">
                                                                        <div class="fl abg"></div><span class="fl font13 line34 ml10">最多可传3张照片。支持jpg、png，单张5M以内。</span>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </dd>

														<dd>
														<!---->
                                                        <?php if($complain_num<5&&!$join_black){?>
                                                        <div class="btnFBbox"><button class="btnB btnSubmit radius5" style="line-height:30px; " type="submit" can="yes">我要举报</button></div>														
                                                        <?php }elseif(!$join_black){?>
                                                        <div class="btnFBbox"><span class="btnB btnColor_p_no radius5" can="no">我要举报</span></div>
														<div class="btnFBbox_errot">很遗憾，您今日已投诉5次，明天再来参与吧！</div>                                                        
                                                        <?php }else{ ?>
                                                         <div class="btnFBbox"><span class="btnB btnColor_p_no radius5" can="no">我要举报</span></div>
														<div class="btnFBbox_errot">很遗憾，您已经加入举报黑名单，不能参与举报！</div>   
                                                        <?php }?>
														</dd>
                                                </dl>
												
												<!---->
										</form>
								</div>
						</div>
						<!----> 
				</div>
		</div>
</div>

<div id="complainSuccess" class="dialog radius5" style="display:none;">
	<div class="hd">
		<h3 class="h3">提示</h3>
		<p title="关闭" class="close close-win">关闭 </p>
	</div>
	<div class="mod">
		<div class="text text_jub text_jub02">
				提交成功！我们会尽快审核！<br>
				请密切关注<a href="/my_complain/myList/" class="link">我的举报</a>中的状态，<br>
				感谢您的支持！
			</div>
	</div>
</div>

<div class="dialog radius5" style="display:none;">
	<div class="hd">
		<h3 class="h3">提示</h3>
		<p title="关闭" class="close close-win">关闭 </p>
	</div>
	<div class="mod">
		<div class="text text_jub">
				很抱歉，由于您的竞投房源为虚假<br>
				房源，现取消您参与付费推广的资格。<br>
				限制期至：<span class="jub_color">2014年12月12日 12:12:34</span>
		</div>
	</div>
</div>

<div id="complainFailure" class="dialog radius5" style="display:none;">
	<div class="hd">
		<h3 class="h3">提示</h3>
		<p title="关闭" class="close close-win">关闭 </p>
	</div>
	<div class="mod">
		<div class="text text_jub">
				提交失败！可能有以下原因：<br>
				1. 该房源已被举报下架。<br>
				2. 该房源已被您所在公司的小伙伴<br>举报过了。
		</div>
	</div>
</div>


<script>
$(function(){
   var can = $(".btnB").attr("can");
//真实房源验证
$("#houseid").blur(function(){    
	if(can=='no'){
		return false;
	}
    var houseid = $(this).val();
    reg=/^\d{1,10}$/;   
    if(!reg.test(houseid)){        
        var numerror = "<label for=houseid' class='error' >请输入正确的房源编号！</label>";
		$("#houseerror").html(numerror);
        $(this).attr("iserror","1");
        return false;
    }else{
        var numerror = "";
		$("#houseerror").html(numerror);
    }  
    var url = '/my_complain/judgeHouse/';
    var data = {};    
    data.house = houseid;
    $.post(url,data,function(result){ 

        var errorinfo,error;
        if(result==2){
            errorinfo = "该房源已下架，下次一定要手快哦！";
            error = "<label for=houseid' class='error'>"+errorinfo+"</label>";
             $("#houseid").attr("iserror","1");
        }else if(result==3){
            errorinfo = "该房源已被举报三次，下次一定要手快哦！";
            error = "<label for=houseid' class='error'>"+errorinfo+"</label>";
            $("#houseid").attr("iserror","1");
        }else if(result==4){
            errorinfo = "该房源已被您所在公司的小伙伴举报过了，下次一定要手快哦！";
            error = "<label for=houseid' class='error'>"+errorinfo+"</label>";
            $("#houseid").attr("iserror","1");
        }else if(result==1){
            errorinfo = "该房源是当前推广的竞投房源哦！";
            error = "<label for=houseid' class='' style='color: blue;display: block;height: 29px; line-height: 29px;margin-left: 10px;padding-left: 19px;' >"+errorinfo+"</label>";
			$("#houseid").attr("iserror","");
        }else if(result==5){
            errorinfo = "该房源是非竞投房源哦！";
            error = "<label for=houseid' class='' style='color: blue;display: block;height: 29px; line-height: 29px;margin-left: 10px;padding-left: 19px;'>"+errorinfo+"</label>";
			$("#houseid").attr("iserror","");
            
        }

       $("#houseerror").html(error);
                
    },'json');
});

//真实电话认证
$("#telno").blur(function(){
	if(can!='yes'){
		return false;
	}
    var telno = $(this).val(); 
	if(!telno){
		var numerror = "<label for=telno' class='error'>电话不能为空！</label>";
		$("#telnoerror").html(numerror);
        $(this).attr("iserror","1");
        return false;
	}else if(telno.length>21||telno.length<7){        
        var numerror = "<label for=telno' class='error'>请输入真实的电话号码！</label>";
		$("#telnoerror").html(numerror);
        $(this).attr("iserror","1");
        return false;
    }else{
        var numerror = "";
		$("#telnoerror").html(numerror);
        $(this).attr("iserror","");
        //return false;
    }  
})


$("#address").blur(function(){
	if(can!='yes'){
		return false;
	}
  //地址验证
    var address = $("#address").val();
    if(!address){
		var numerror = "<label for=telno' class='error'>地址不能为空！</label>";
		$("#addresserror").html(numerror); 
		$(this).attr("iserror","1");
        return false;		
    }else if(address.length>30||address.length<5){        
        var numerror = "<label for=telno' class='error'>请输入真实的房源地址！</label>";
		$("#addresserror").html(numerror); 
		$(this).attr("iserror","1");
        return false;
    }else{
        var numerror = "";
		$("#addresserror").html(numerror);  
		$(this).attr("iserror","");
    } 
})


//描述验证   
$("#description").blur(function(){
	if(can!='yes'){
		return false;
	}
    var description = $("#description").val(); 
    if(!description){
		var numerror = "<label for=telno' class='error'>理由不能为空！</label>";
        $("#descriptionerror").html(numerror); 
		$(this).attr("iserror","1");
        return false;		
    }else if(description.length<20){        
        var numerror = "<label for=telno' class='error'>您输入的理由字数不够哦！</label>";
        $("#descriptionerror").html(numerror); 
		$(this).attr("iserror","1");
        return false;
    }else{
        var numerror = "";
        $("#descriptionerror").html(numerror); 
		$(this).attr("iserror","");
    } 
})

$(".btnSubmit").click(function(){   
 
    //房源不为空验证
    var houseid = $("#houseid").val();
    var error1 = $("#houseid").attr("iserror")
    if(!houseid){        
        var numerror = "<label for=houseid' class='error'>房源编号不能为空！</label>";
		$("#houseerror").html(numerror);        
        return false;
    }else if(error1==1){
        return false;//test最后撤销
    }  
    
    //电话不为空验证
    var telno = $("#telno").val();
    var error2 = $("#telno").attr("iserror")
    if(!telno){        
        var numerror = "<label for=houseid' class='error'>电话不能为空！</label>";
		$("#telnoerror").html(numerror);        
        return false;
    }else if(error2==1){
        return false;
    }  
    
    //地址验证
    var address = $("#address").val();
	var error2 = $("#address").attr("iserror")
    if(!address){
        var numerror = "<label for=houseid' class='error'>地址不能为空！</label>";
		$("#addresserror").html(numerror);        
        return false;
    }else if(error2==1){
        return false;
    }    
    
  
   //描述验证   
    var description = $("#description").val(); 
	var error2 = $("#description").attr("iserror")
    if(!description){        
        var numerror = "<label for=telno' class='error'>理由不能为空！</label>";
        $("#descriptionerror").html(numerror);        
        return false;
    }else if(error2==1){
        return false;
    } 
    
    
    //原因
    var reason = [];
    var i=0;
    $(".input_c").each(function(){        
        if($(this).attr("checked")=='checked'){
            reason[i] = $(this).val();
            i++;
        }  
    })
    
	if(i===0){
		var numerror = "<label for=telno' class='error'>投诉原因不能为空！</label>";
        $("#reasonerror").html(numerror);        
        return false;

	}
 
    
    var _address = encodeURI(address,"UTF-8");
    var _description = encodeURI(description,"UTF-8");
    var _telno = encodeURI(telno,"UTF-8");
    var _p_filename = [];
    $("input[name='p_filename[]']").each(function(i){
        _p_filename[i] = $(this).val();
    });
    var _u_filename = [];
    $("input[name='u_filename[]']").each(function(i){
        _u_filename[i] = encodeURI($(this).val(),"UTF-8");
    });
    $.ajax({ 
        type: 'post',
		url : '/my_complain/ajaxComplain/',
		data: {houseid : houseid,telno :_telno,address : _address,description:_description,reason:reason,p_filename:_p_filename,u_filename:_u_filename},
		dataType : 'json',
		success: function(data){    
			if(data.status == 1){
                openWin("complainSuccess");			
               
			}else if(data.status == 2){
				alert("添加数据错误,请重新举报！");
			}else if(data.status == 3){
                openWin("complainFailure");		
            }     
				   
		}
	});
    
})
	
})

$(".close-win").click(function(){
     location.href = "/my_complain/myList/";
})

</script>

</body>
</html>
