<!DOCTYPE html>
<!-- 
'========================================================================================
' 文 件 名: m_search.asp
' 版    本: 岭峰网行业专用留言系统3.10.0 (LFMessS 2020 - 3.10.0.F Build 200604)
' 说    明: 移动端留言审核文件 | 请勿自行修改该处文件，以确保程序正确的执行
' 文件日期: 2020-06-04
' 设 计 者: 疾风之狼
'========================================================================================
' 郑州文达岭峰网络科技有限公司.
'========================================================================================
' Copyright (C) 2001-2020 岭峰网. All rights reserved.
' 网    站: http://www.lfmesss.com
' 电子邮件: support@lfmesss.com
' 联系ＱＱ: 85112407
'========================================================================================
-->
<%@ language="vbscript" codepage="936" %>
<!-- #include file="../common/contencrypt.asp" -->
<!-- #include file="../common/m_sub_inc.asp" -->
<!-- #include file="../common/commfun.asp" -->
<!-- #include file="../common/ip_purview.asp" -->
<!-- #include file="../common/purview_default.asp" -->
<!-- #include file="../common/connect.asp" -->
<!-- #include file="../common/checkru.asp" -->
<!-- #include file="../common/md5_32.asp" -->
<%
keyword = Trim(Request("keyword"))
fenword = Trim(Request("fenword"))
todopass = Trim(Request("todopass"))
fenword_bbs = Trim(Request.QueryString("fenword_bbs"))

IF fenword_bbs <> "" and fenword = "" Then
	fenword = fenword_bbs
End IF

IF keyword = "" or fenword = "" Then
	Response.Write "<meta http-equiv=Content-Type content=text/html;charset="& LingFengNet_MS_language_meta_mes_1 &"><script>alert('"& LingFengNet_MS_language_Warning_search_1 &"');window.close();</script>"
	Response.End
End IF

IF todopass = "todopass" Then
	keyword = Lcase(keyword)
	sql = "SELECT * FROM lfmessb WHERE enpass = '"& LFW_md5_32_pass(keyword) &"' ORDER BY addtime desc"
Else
	IF Left(keyword, 7) = "lfmesss" Then 
		keyword = Clng(Right(keyword, Len(keyword) - 7))
	Else
		sql = "SELECT * from lfmessb WHERE "& fenword &" like '%"& keyword &"%'"
		Set rs = Server.CreateObject("ADODB.Recordset")
		rs.open sql,conn,1,1
		IF rs.eof and rs.bof Then
			keyword = DeCrypt(keyword)
		End IF
		rs.close
		Set rs = Nothing
	End IF

	IF Session("LingFengNet_MS_admin_flg") <> "3" and fenword = "ip" Then
		Response.Write "<meta http-equiv=Content-Type content=text/html;charset="& LingFengNet_MS_language_meta_mes_1 &"><script>alert('"& LingFengNet_MS_language_Warning_search_2 &"');window.close();</script>"
		Response.End
	End IF	

	IF Session("LingFengNet_MS_admin") = "ok" Then
		sql = "SELECT * FROM lfmessb WHERE "& fenword &" like '%"& keyword &"%' ORDER BY id desc"
	ElseIF fenword = "id" Then
		sql = "SELECT * FROM lfmessb WHERE id="& keyword &" and (Auditing=2 or Auditing=5) and enpass='0'"
	ElseIF Session("LingFengNet_MS_admin") <> "ok" and LingFengNet_MS_ss = 0 and LingFengNet_MS_sousuo_lx = 0 Then
		sql = "SELECT * FROM lfmessb WHERE "& fenword &" = '"& keyword &"' and (Auditing=2 or Auditing=5) and enpass='0' ORDER BY addtime desc"
	ElseIF Session("LingFengNet_MS_admin") <> "ok" and LingFengNet_MS_sousuo_lx = 1 Then
		sql = "SELECT * FROM lfmessb WHERE "& fenword &" like '%"& keyword &"%' and (Auditing=2 or Auditing=5) and enpass='0' ORDER BY addtime desc"
	End IF 

End IF

Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
total = rs.RecordCount
page = Request("page")
Response.Write "<html>"&_
"<head>"&_
"<title>"& LingFengNet_MS_web_name &"--"& LingFengNet_MS_sys_name &"--"&  LingFengNet_MS_language_title_search &"   - powered by LFMessS</title>"
Call htmlmeta() 
Response.Write "<link rel=""stylesheet"" href=""../style/css/"& LingFengNet_MS_web_css &".css"" type=""text/css"">"&_
"<link rel=""stylesheet"" href=""../style/css/m_common.css"" type=""text/css"" >"&_	
"<style>.wdlf_page{margin-bottom:60px;}</style></head>"&_
"<body>"
Call htmlmain() 
Response.Write "</body>"&_
"</html>"
rs.close
conn.close
Set rs = Nothing
Set conn = Nothing
Call html_liuyanend()
%>
<script src="../common/jquery-3.2.1.min.js" ></script>
<script>	
//根据密码查询
function wdlf_search_by_password(id){
	$('#wdlf_search_by_password').show();
	$('#wdlf_search_bg').show();
}

//根据输入的内容来查询
function wdlf_search_by_content(){
	$('#wdlf_search_by_content').show();
	$('#wdlf_search_bg').show();
}

window.onload = function(){
	
	//留言区只有一条留言时 解决背景不能完全遮罩的问题
	if( $('.wdlf_commonBody').outerHeight() < $(window).height() ){
		$('.wdlf_commonBody').css('height', '100%')
	}
	
	//点击取消
	$('.wdlf_liuYan_cancel_btn').click(function(){
		$(this).parent().parent().parent().parent().hide();
		$('#wdlf_search_bg').hide();
	})
	
	//点击提交
	$('.wdlf_liuYan_tiJiao_btn').click(function(){
		var wdlf_id = $(this).parent().parent().parent().parent().attr('id');
		if(wdlf_id == 'wdlf_search_by_password'){
			if($('#'+wdlf_id).find("input[name='keyword']").val() == ''){
				alert("<% LingFengNet_MS_language_mobile_9 %>");
				return false;
			}
			$("form[name='messpass']").submit();
		}
		if(wdlf_id == 'wdlf_search_by_content'){
			if($('#'+wdlf_id).find("input[name='keyword']").val() == ''){
				alert("<% LingFengNet_MS_language_mobile_10 %>");
				return false;
			}
			$("form[name='form1']").submit();
		}
	})
	
	//控制logo大小
	$('.wdlf_commonHead').css('height', $('.wdlf_commonHead .wdlf_commonHead_right img').css('height'))
	
	//不让其显示 审核多少条
	$('.wdlf_index_showTotal').eq(0).remove();
	
	//查看管理员回复
	$('.wdlf_common_content_left').click(function(){
		var wdlf_content = $(this).parent();
		wdlf_content.find('.wdlf_common_content_admin_date').toggle(400);
		wdlf_content.find('.wdlf_common_content_admin_huiFu').toggle(400, function(){
			var wdlf_content_huiFu = wdlf_content.find('.wdlf_common_content_left').html();
			if (wdlf_content_huiFu.trim() == "<%= LingFengNet_MS_language_mobile_5 %>"){
				wdlf_content.find('.wdlf_common_content_left').html("<%= LingFengNet_MS_language_mobile_6 %>");
			}else{
				wdlf_content.find('.wdlf_common_content_left').html("<%= LingFengNet_MS_language_mobile_5 %>");	
			}
		});
	})
		//点击查看更多
		var wdlf_contentDetail_realHeight = [];
		var wdlf_contentDetail_limitHeight = 59;//四行就隐藏
		var wdlf_content_detail = $('.wdlf_common_content_centerRight_detail');
		for(var i = 0; i< wdlf_content_detail.length; i++){
			wdlf_contentDetail_realHeight[i] = wdlf_content_detail.eq(i).outerHeight();
			
			if(wdlf_contentDetail_realHeight[i] > wdlf_contentDetail_limitHeight){
				wdlf_content_detail.eq(i).addClass('wdlf_plus_shengLue_3');
				wdlf_content_detail.eq(i).after('<div class="wdlf_common_content_centerRight_readMore" ><%= LingFengNet_MS_language_mobile_7 %></div>');
			}else{
				wdlf_content_detail.eq(i).addClass('wdlf_plus_shengLue_4');
			}
		}
		
		$('.wdlf_common_content_centerRight_readMore').click(function(){
			var n = $('.wdlf_common_content_centerRight_detail').index($(this).prev())
			var wdlf_currentHeight = $(this).prev().outerHeight();
			if(wdlf_currentHeight < wdlf_contentDetail_limitHeight){
				// wdlf_common_content_center 最大的div长度变长
				$(this).parent().parent().animate({
					height: wdlf_contentDetail_realHeight[n]+50 
				}, "normal");
				
				// wdlf_common_content_centerLeft 左边
				$(this).parent().parent().find('.wdlf_common_content_centerLeft').animate({
					height: wdlf_contentDetail_realHeight[n]+50 
				}, "normal");
				
				// wdlf_common_content_centerRight 右边
				$(this).parent().parent().find('.wdlf_common_content_centerRight').animate({
					height: wdlf_contentDetail_realHeight[n]+50 
				}, "normal");
				// 具体内容
				$(this).parent().parent().find('.wdlf_common_content_centerRight_detail').animate({
					height: wdlf_contentDetail_realHeight[n] 
				}, "normal");
				
				$(this).parent().parent().find('.wdlf_common_content_centerRight_readMore').html("<%= LingFengNet_MS_language_mobile_8 %>");
				$(this).parent().find('.wdlf_common_content_centerRight_detail').removeClass('wdlf_plus_shengLue_3');

			}else if(wdlf_currentHeight > wdlf_contentDetail_limitHeight){
				//隐藏
				$(this).parent().parent().animate({
					height: wdlf_contentDetail_limitHeight
				}, "normal");
				
				// wdlf_common_content_centerLeft 左边
				$(this).parent().parent().find('.wdlf_common_content_centerLeft').animate({
					height: wdlf_contentDetail_limitHeight
				}, "normal");
				
				// wdlf_common_content_centerRight 右边
				$(this).parent().parent().find('.wdlf_common_content_centerRight').animate({
					height: wdlf_contentDetail_limitHeight
				}, "normal");
				// 具体内容，需限定死
				$(this).parent().parent().find('.wdlf_common_content_centerRight_detail').animate({
					height: 22
				}, "normal");
				$(this).parent().parent().find('.wdlf_common_content_centerRight_readMore').html("<%= LingFengNet_MS_language_mobile_7 %>");
				$(this).parent().find('.wdlf_common_content_centerRight_detail').addClass('wdlf_plus_shengLue_3');
				
			}
		})
	}
</script>