bak_file.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="cn.js.fan.db.*"%>
  4. <%@ page import="cn.js.fan.web.*"%>
  5. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  7. <html>
  8. <head>
  9. <title>Backup Data</title>
  10. <link href="default.css" rel="stylesheet" type="text/css">
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <style type="text/css">
  13. <!--
  14. .style1 {
  15. color: #FFFFFF;
  16. font-weight: bold;
  17. }
  18. .style2 {color: #FFFFFF}
  19. body {
  20. margin-left: 0px;
  21. margin-top: 0px;
  22. }
  23. -->
  24. </style>
  25. </head>
  26. <body bgcolor="#FFFFFF" text="#000000">
  27. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  28. <jsp:useBean id="backup" scope="page" class="cn.js.fan.util.Backup"/>
  29. <jsp:useBean id="cfg" scope="page" class="cn.js.fan.web.Config"/>
  30. <%
  31. if (!privilege.isUserPrivValid(request, "forum.bak"))
  32. {
  33. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  34. return;
  35. }
  36. %>
  37. <table cellSpacing="0" cellPadding="0" width="100%">
  38.   <tbody>
  39.     <tr>
  40.       <td class="head"><lt:Label res="res.label.forum.admin.bak_file" key="data_manage"/></td>
  41.     </tr>
  42.   </tbody>
  43. </table>
  44. <br>
  45. <TABLE 
  46. style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" 
  47. cellSpacing=0 cellPadding=3 width="95%" align=center>
  48.   <!-- Table Head Start-->
  49.   <TBODY>
  50.     <TR>
  51.       <TD class=thead style="PADDING-LEFT: 10px" noWrap width="70%">&nbsp;</TD>
  52.     </TR>
  53.     <TR class=row style="BACKGROUND-COLOR: #fafafa">
  54.       <TD height="175" align="center" style="PADDING-LEFT: 10px"><table width="470" border="0" align="center">
  55.         <tr>
  56.           <td>&nbsp;</td>
  57.           <td>&nbsp;</td>
  58.           <td>&nbsp;</td>
  59.         </tr>
  60.         <tr>
  61.           <td>&nbsp;</td>
  62.           <td align="center"><p>
  63. <%
  64.     String srcpath = application.getRealPath("/") + "forum/upfile/";
  65.     String bakpath = cfg.getProperty("Application.bak_path");;
  66. backup.copyDirectory(application.getRealPath("/")+bakpath+"/file",srcpath);//拷贝至file目录下
  67. out.print(StrUtil.p_center(SkinUtil.LoadString(request, "res.label.forum.admin.bak_file", "copy_success")));
  68. String zipfilepath = application.getRealPath("/")+bakpath+"/bak_file.zip";
  69.     backup.generateZipFile(srcpath, zipfilepath);
  70. out.print(StrUtil.p_center(SkinUtil.LoadString(request, "res.label.forum.admin.bak_file", "zip_success")));
  71. String dbfile = application.getRealPath("/") + bakpath + "/bak_db.bak";
  72. // String dbname = "zjrj";
  73. // if (backup.BackupDB(dbname, Global.defaultDB, dbfile))
  74. // out.print(StrUtil.p_center("备份数据库成功!"));
  75. // else
  76. // out.print(StrUtil.p_center("备份数据库失败!"));
  77. String rootpath = request.getContextPath();
  78. %>
  79.               <a href="<%=rootpath+"/"+bakpath%>/bak_file.zip"><lt:Label res="res.label.forum.admin.bak_file" key="download_zip"/></a> </p>
  80.               <!--<p><a href="<%=rootpath+"/"+bakpath%>/bak_db.bak">下载数据库备份文件</a></p>--></td>
  81.           <td>&nbsp;</td>
  82.         </tr>
  83.         <tr>
  84.           <td height="37">&nbsp;</td>
  85.           <td align="center">&nbsp;</td>
  86.           <td>&nbsp;</td>
  87.         </tr>
  88.       </table></TD>
  89.     </TR>
  90.     <!-- Table Body End -->
  91.     <!-- Table Foot -->
  92.     <TR>
  93.       <TD class=tfoot align=right><DIV align=right> </DIV></TD>
  94.     </TR>
  95.     <!-- Table Foot -->
  96.   </TBODY>
  97. </TABLE>
  98. </body>
  99. </html>