Exemple #1
0
 /**
  * @Title: getNextSql 
  * @Description: todo(显示) 
  * @return string|boolean  
  * @author laicaixia 
  * @date 2013-5-31 下午5:27:02 
  * @throws 
  */
 public function show()
 {
     $filename = $_GET['filename'];
     $folder = urldecode($_GET['folder']);
     $gbk_folder = @iconv('UTF-8', 'gb2312', $folder);
     $folderdir = R("Backup/getBackupDir");
     $file = $folderdir . '/' . $gbk_folder . '/' . $filename;
     if (file_exists($file)) {
         import("@.ORG.Zip");
         $unzip = new SimpleUnzip($file);
         $unzip->SimpleUnzip();
         $dbname = C('DB_NAME');
         $tables = '';
         $file_count = $unzip->Count();
         for ($i = 0; $i < $file_count; $i++) {
             if ($unzip->GetName($i) == C('BACKUP_RECORD_FILE')) {
                 $tables = $unzip->GetData($i);
                 break;
             }
         }
         $tables = explode(',', $tables);
         $html_show = '';
         foreach ($tables as $table) {
             if ($table != C('BACKUP_TABLE') && $table != C('UPGRADE_TABLE')) {
                 $html_show .= "<label style='width:300px;'><input name='table' type='checkbox' value='{$table}' />{$table}</label>";
             }
         }
         $this->assign('html_show', $html_show);
         $this->assign('file', $filename);
         $this->assign('folder', $folder);
     }
     //还原模式显示
     if (C('RESUME_MODEL') == 'Database') {
         $modelInfo = "当前还原模式为:数据库级<br/>还原失败所有数据均不会被还原!";
     } else {
         if (C('RESUME_MODEL') == 'Table') {
             $modelInfo = "当前还原模式为:数据表级<br/>还原失败只有出错表数据不还原!";
         }
     }
     $this->assign('modelInfo', $modelInfo);
     $this->display();
 }