Exemplo n.º 1
0
     if (strlen($bakstr) > $fsizeb) {
         $fp = fopen($backup_file, 'w');
         fwrite($fp, $bakstr);
         fclose($fp);
         $tmsg .= "<span class='red'>完成到{$m}条记录的备份,继续备份{$nowtable}表...</span>";
         $doform = "<form name='gonext' method='post' action='?action={$action}'>\n\t\t\t\t<input type='hidden' name='dopost' value='backup' />\n\t\t\t\t<input type='hidden' name='isstruct' value='{$isstruct}' />\n\t\t\t\t<input type='hidden' name='tbname' value='{$tables}' />\n\t\t\t\t<input type='hidden' name='nowtable' value='{$nowtable}' />\n\t\t\t\t<input type='hidden' name='fsize' value='{$fsize}' />\n\t\t\t\t<input type='hidden' name='startpos' value='{$m}'>\n\t\t\t\t<input type='hidden' name='backup_date' value='{$backup_date}' /></form>\n\t\t\t\t{$dojs}";
         PutInfo($tmsg, $doform);
         exit;
     }
     //形成插入样式
     $line = $intable;
     for ($j = 0; $j <= $fsn; $j++) {
         if ($j < $fsn) {
             $line .= "'" . RpLine(addslashes($row[$fields[$j]])) . "',";
         } else {
             $line .= "'" . RpLine(addslashes($row[$fields[$j]])) . "');\r\n";
         }
     }
     $bakstr .= $line;
     $m++;
 }
 //如果数据比卷设置值小
 if ($bakstr != '') {
     $fp = fopen($backup_file, 'w');
     fwrite($fp, $bakstr);
     fclose($fp);
 }
 //执行下一个表
 $tbnum = count($tbname);
 for ($i = 0; $i < $tbnum; $i++) {
     if ($tbname[$i] == $nowtable) {
Exemplo n.º 2
0
     if (strlen($bakStr) > $fsizeb) {
         $fp = fopen($bakfilename, "w");
         fwrite($fp, $bakStr);
         fclose($fp);
         $tmsg = "<font color='red'>完成到{$m}条记录的备份,继续备份{$nowtable}...</font>";
         $doneForm = "<form name='gonext' method='post' action='sys_data_done.php'>\r\n                <input type='hidden' name='isstruct' value='{$isstruct}' />\r\n                <input type='hidden' name='dopost' value='bak' />\r\n                <input type='hidden' name='fsize' value='{$fsize}' />\r\n                <input type='hidden' name='tablearr' value='{$tablearr}' />\r\n                <input type='hidden' name='nowtable' value='{$nowtable}' />\r\n                <input type='hidden' name='startpos' value='{$m}' />\r\n                <input type='hidden' name='iszip' value='{$iszip}' />\r\n</form>\r\n{$dojs}\r\n";
         PutInfo($tmsg, $doneForm);
         exit;
     }
     //正常情况
     $line = $intable;
     for ($j = 0; $j <= $fsd; $j++) {
         if ($j < $fsd) {
             $line .= "'" . RpLine(addslashes($row2[$fs[$j]])) . "',";
         } else {
             $line .= "'" . RpLine(addslashes($row2[$fs[$j]])) . "');\r\n";
         }
     }
     $m++;
     $bakStr .= $line;
 }
 //如果数据比卷设置值小
 if ($bakStr != '') {
     $fp = fopen($bakfilename, "w");
     fwrite($fp, $bakStr);
     fclose($fp);
 }
 for ($i = 0; $i < count($tables); $i++) {
     if ($tables[$i] == $nowtable) {
         if (isset($tables[$i + 1])) {
             $nowtable = $tables[$i + 1];