<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->

<% 
 '===========================================================================================
	'软件名称：126 cms 视频影视管理系统
	'程序版权：126电影               '咨询QQ：479025
	'开发作者：magicblack(479025)    '官方网站：http://www.126oo.com/
	'Copyright (C) 2009 - ... 126oo.com  All Rights Reserved.
	'郑重声明:
	'    1、免费版本请在程序首页保留版权信息，并做上本站LOGO友情连接,商业版本无此要求;
	'    2、任何个人或组织不得以盈利为目的发布,修改,本软件及其他副本上一切关于版权的信息；
	'    3、126电影保留此软件的法律追究权利；
'==========================================================================================
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>日文内存溢出修复 - 后台管理中心 - 126电影程序CMS</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="images/css_body.css" type=text/css rel=stylesheet>
<script language="javascript" src="images/admin.js"></script>
</HEAD>
<BODY>
<DIV class=bodytitle>
<DIV class=bodytitleleft></DIV>
<DIV class=bodytitletxt>日文内存溢出修复</DIV>
<DIV class=bodytitletxt2></DIV>
</DIV>

<%
response.Charset="GBK"
dim action
action = SafeData("RQ","action",0)

Select Case action
Case "twodo"
	Call riwen
Case Else
	Call main
End Select

Sub main
%>
<TABLE width="96%" border=0 align=center cellpadding="5" cellSpacing=1 class=tbtitle style="BACKGROUND: #cad9ea;">
<TR bgColor="#f5fafe">
<td><p><br>
  &nbsp;  
  <input type="button" value="点击修复内存溢出" onClick="javascript:location.href='?action=twodo';" name="Input">
  <br>
  <br>
  &nbsp;<strong>&nbsp;网站搜索功能出错时,很有可能是日文所造成的,您可以尝试点击这里修复!</strong></p>
    <font color="#FF0000">&nbsp;<strong> 注意：操作前请备份数据库，以免因以外造成不可逆转的损失！</strong></font><br>
        <br>
          <br>
    </p></td>
</tr>
</table>
<%
End Sub

'替换日文
Function Jencode(byVal iStr)
if isnull(iStr) or isEmpty(iStr) then
  Jencode=""
  Exit function
end if
dim F,i,E
' F=array("ゴ","ガ","ギ","グ","ゲ","ザ","ジ","ズ","ヅ","デ",_
'             "ド","ポ","ベ","プ","ビ","パ","ヴ","ボ","ペ","ブ","ピ","バ",_
'             "ヂ","ダ","ゾ","ゼ")
  E=array("","","","","","","",_
                            "","","","","","","",_
                            "","","","","","","",_
                            "","","","","")
  F=array(chr(-23116),chr(-23124),chr(-23122),chr(-23120),_
    chr(-23118),chr(-23114),chr(-23112),chr(-23110),_
    chr(-23099),chr(-23097),chr(-23095),chr(-23075),_
    chr(-23079),chr(-23081),chr(-23085),chr(-23087),_
    chr(-23052),chr(-23076),chr(-23078),chr(-23082),_
    chr(-23084),chr(-23088),chr(-23102),chr(-23104),_
    chr(-23106),chr(-23108))
  Jencode=iStr
  for i=0 to 25
   Jencode=replace(Jencode,F(i),E(i))
  next
End Function

Sub riwen
		Dim rs : Set rs = Database.GetRecord("Tbl_Datas:D_ID,D_Name,D_Starring,D_Directed,D_Content","1=1","D_id asc")  
        Dim D_Name,D_Starring,D_Directed,D_Content,D_ID,i,stat
		Dim twodo_Name,twodo_Starring,twodo_D_Directed,twodo_Content,twodo_id
		Dim isupdate
		WriteFlush "<TABLE width=""96%"" border=""0"" align=""center""  cellpadding=""5"" cellSpacing= ""1"" class= "" tbtitle"" style=""BACKGROUND: #cad9ea;""><TR bgColor=""#f5fafe""><td>编号</td><td>标题</td><td>主演</td><td>导演</td><td>状态</td></tr>"
		
		do while not rs.eof
			D_Name=Rs("D_name")
			D_Starring=Rs("D_Starring")
			D_Directed=Rs("D_Directed")
			D_Content=Rs("D_Content")
			D_ID=Rs("D_id")
			
			D_Name = Jencode(D_Name)
			D_Starring = Jencode(D_Starring)
			D_Directed = Jencode(D_Directed)
			D_Content = Jencode(D_Content)
			
			if D_Name<>Rs("D_name") or D_Starring<>Rs("D_Starring") or D_Directed <> Rs("D_Directed") or D_Content<> Rs("D_Content") then isupdate = true else isupdate = false
			
		if isupdate then 
		Dim result : result = DataBase.UpdateRecord("Tbl_Datas","D_ID = "& D_ID ,Array("D_Name:"&D_Name, "D_Starring:"&D_Starring,"D_Directed:"&D_Directed,"D_Content:"&D_Content))  
		
		If result <> 0 Then  
			stat = "成功"
		else
			stat = "失败"
		end if
		
		WriteFlush "<tr bgcolor=""#FFFFFF""><td align=""center"">" & D_ID & "</td><td>" & D_Name & "</td><td>" & D_Starring & "</td><td>" & D_Directed & "</td><td><font color=""blue"">"&stat&"</font></td></tr>"
        
		end if
		rs.movenext
		loop
		Database.C(rs)
		
		WriteFlush "<tr bgcolor=""#FFFFFF""><td colspan=""5""><font color=""red"">恭喜，全部搞定！</font></td></tr><script language=javascript>alert(""恭喜，全部搞定！"");</script>"
End Sub
WriteFlush "<tr bgColor=""#f5fafe""><td colspan=4>"
WriteFlush "</td></tr></table>"
 %>
</body>
</html>