<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/lebi_config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_Dvote.asp
'* 最后更新 2013-05-14 by 56770.kingdge
'*****************************************
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_dvote.inc"
CurrentId = 4
CurrentUrl = "admin_dvote.asp"
LB_Head()
LB_Menu()
action = request("action")
state = request("state")
%>
<div class="tabmenu mainwidth">
	  <ul>
		<li <%If action = "" And state = "" Then Response.Write("class=""current""") End If%>><a href="admin_dvote.asp"><span><%=Lang_Menu(119)%></span></a></li>
		<li <%If state = "0" Then Response.Write("class=""current""") End If%>><a href="?state=0"><span><%=Lang_Dvote(7)%></span></a></li>
		<li <%If state = "1" Then Response.Write("class=""current""") End If%>><a href="?state=1"><span><%=Lang_Dvote(8)%></span></a></li>
	  </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If OutSubmit = 1 Then CheckOutSubmit()
Select Case Request("action")
	   Case "del" : del()
	   Case "reply" : reply()
	   Case "save" : save()
	   Case Else
		    list()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

sub save
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",7.3,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
	            adminflag()
        Else
'                if request("replay")="" then
'                        response.write"<SCRIPT language=JavaScript>alert('"& Lang_Dvote(1) &"');javascript:history.go(-1)</SCRIPT>"
'						response.End
'                End If
				conn.execute "update [Lebi_dvote] set replay='"&safereplace(request("replay"))&"',show=1 where id ="&CheckNum(request("id"),0)&""
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				Else
						NewEvent "0"
				End If
				ManageLog Lang_Dvote(2) &" ["& Left(safereplace(request("replay")),50) &"]"
				Call Up_mes(Lang_Menu(119),"·"& Lang_Dvote(3),0,"?",0,0,2,1)
        end if
end sub

sub del
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",7.4,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
	            adminflag()
        Else
                id=safereplace(request("id"))
                if id="" then id=0
                conn.execute "delete from [Lebi_Dvote] where id in ("&id&") "
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				Else
						NewEvent "0"
				End If
				ManageLog Lang_Dvote(4) &" ["&id&"]"
		        m_u="?page="& request("page") &"&pagenum="& request("pagenum") &"&state="& request("state") &"&keyword="& request("keyword") &"&DateFrom="& request("DateFrom") &"&DateTo="& request("DateTo")
		        Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
        end if
end sub

sub list
		admin_flag=",7.3,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
	    keyword = safereplace(request("keyword"))
		state = safereplace(request("state"))
        page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),10)
		datefrom = safeReplace(request("datefrom"))
		dateto = safeReplace(request("dateto"))
		Dim ors
		Set ors=new Cls_vbsPage
		Set ors.Conn=conn
		With ors
		.PageSize=pagenum
		.PageName="Page"
		If IsSqlDataBase = 0 Then
				.DbType="AC"
		Else
				.DbType="MSSQL"
		End If
		.RecType=-1
		.Pkey="id"
		.Field="id,content,vtime,replay,user_id,name,show,downid"
		.Table="[Lebi_Dvote]"
		sql = "1=1"
		if keyword<>"" Then sql = sql &" and (content like '%"& keyword &"%' or name like '%"& keyword &"%' or user_id like '%"& keyword &"%')"
		If state <> "" Then sql = sql &" and show = "& CLng(state) &""
		If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,vtime,'"& datefrom &"')<=0 and DateDiff(d,vtime,'"& dateto &"')>=0"
		If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',vtime,'"& datefrom &"')<=0 and DateDiff('d',vtime,'"& dateto &"')>=0"
		.Condition=sql
		.OrderBy="id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" type="text/javascript" src="inc/js/js_link.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/MyCalendar.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<form name="form" action="?" method="get">
<td height="30" align="left" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select name="state">
<option value="">┌ <%=Lang_Dvote(5)%></option>
<option value="">├ <%=Lang_Dvote(6)%></option>
<option value="0"<%=judge2(0,state)%>>├ <%=Lang_Dvote(7)%></option>
<option value="1"<%=judge2(1,state)%>>├ <%=Lang_Dvote(8)%></option>
</select></td>
<td style="padding-left:5px;"><input type="text" name="dateFrom" value="<%=dateFrom%>" size="12" class="form_calendar" onclick="setday(this)" /> - <input type="text" name="dateTo" value="<%=dateTo%>" size="12" class="form_calendar" onclick="setday(this)" /></td>
<td style="padding-left:5px;"><input type="text" name="keyword" value="<%= keyword %>" class="form_query" size="15"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
</tr>
</table>
</td>
</form>
<td class="classhead" align="right">
<%=QuickMenu("Admin_book.asp?action=notice|"& Lang_Menu(118) &"","admin_sms.asp|"& Lang_Menu(110) &"")%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
<tbody>
<form name="form" action="?" method="post">
<tr>
<td height="30" align="left" colspan="2" class="classhead">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('<%=Lang_sys(64)%>')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="hidden" name="page" value="<%=page%>">
<input type="hidden" name="state" value="<%=state%>">
<input type="hidden" name="keyword" value="<%=keyword%>">
<input type="hidden" name="dateFrom" value="<%=dateFrom%>">
<input type="hidden" name="dateTo" value="<%=dateTo%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
<input type="hidden" name="action" value="del">
</td>
<td height="30" class="classhead" align="right" colspan="5"><%=ors.ShowPageHead(page)%></td>
</tr>
<tr>
<td height="30" width="4%" class="classtop" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td width="7%" class="classtop"><%=Lang_Dvote(9)%></td>
<td width="50%" class="classtop"><%=Lang_Dvote(10)%></td>
<td width="10%" class="classtop"><%=Lang_Dvote(11)%></td>
<td width="10%" class="classtop"><%=Lang_Dvote(12)%></td>
<td width="8%" class="classtop"><%=Lang_Dvote(5)%></td>
<td width="8%" class="classtop"><%=Lang_Dvote(13)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
		If Config_Lebi_Eshop(16) = 0 Then
			url = "../showproduct.asp?id="& DataList(7,i)
		Else
			url = "../product/?id="& DataList(7,i)
		End If
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" type="checkbox" value="<%=DataList(0,i)%>"></td>
<td class="classrow"><div class="pro-pic">
<%
Set rspro = conn.execute("select pic,product_name from [lebi_product] where id = "&DataList(7,i)&"")
If Not rspro.eof Then 
%><a href="<%=url%>" target="_blank"><img src='../<%= PicPath %>/<%=trim(rspro(0))%>' align='absmiddle' onMouseover="javascript:ddrivetip('<div style=width:<%=Upload_SPicWidth%>px><img src=../<%= PicPath %>/<%=trim(rspro(0))%> width=<%=Upload_SPicWidth%>></div><div><%=rspro(1)%></div>', '#ffffff', '<%=Upload_SPicWidth%>')" onMouseout="hideddrivetip()" border="0"></a><%
End If 
rspro.close : Set rspro = Nothing 
%>
</div></td>
<td class="classrow">
<%=DataList(1,i)%>(<%=DataList(2,i)%>)
<br>
<%if DataList(3,i)<>"" then response.write"<font color=red>"& Lang_Dvote(14) &"</font>"&DataList(3,i)&"" end if%>
</td>
<td class="classrow"><%If DataList(4,i) = "" Or IsNull(DataList(4,i)) Then response.write"&nbsp;" Else response.write DataList(4,i)%></td>
<td class="classrow"><%If DataList(5,i) = "" Or IsNull(DataList(5,i)) Then response.write"&nbsp;" Else response.write DataList(5,i)%></td>
<td class="classrow"><%if DataList(6,i)=1 then response.write"<font color=red>"& Lang_Dvote(8) &"</font>" else response.write Lang_Dvote(7) end if%></td>
<td class="classrow"><a href="?action=reply&id=<%=DataList(0,i)%>"><%=Lang_Dvote(15)%></a></td>
</tr>
<%
        Next
End If
%>
</form>
<tr>
	<td height="30" class="classfooter" colspan="2"><%=GetPageNum(10,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="5"><%=ors.ShowPageFoot(page)%></td>
</tr>
</tbody>
</table>
<script>tdshow("classtable");</script>
<%
end sub

sub reply
admin_flag=",7.3,"
if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
		adminflag()
Else
		set rs=conn.execute("select * from [Lebi_dvote] where id="& CheckNum(request("id"),0))
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable">
<form action="?" method="post" name="form">
<tr>
	<td height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="action" value="save"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" height="30" colspan="2"><%=Lang_Dvote(2)%></td>
</tr>
<tr class="classrow">
      <td width="15%" class="classrow"><%=Lang_Dvote(16)%></td>
      <td width="85%" class="classrow"><%=rs("content")%>
      </td>
    </tr>
 <tr class="classrow">
      <td class="classrow" valign="top"><%=Lang_Dvote(14)%></td>
      <td class="classrow">
	  <textarea name="replay" rows="10" cols="76" id="replay" class="text"><%=rs("replay")%></textarea>
      </td>
</tr>
<tr>
      <td height="30" colspan="2" align="left" class="classfooter">
       <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
       <input type="hidden" name="id" value="<%=request("id")%>">
      </td>
</tr>
</table>
<script>tdshow("classtable");</script>
<%
end if
end Sub
%>