\n"; if(count($_POST)) { $filename = "dump".$_POST["backupdate"]."txt"; $filename = $objConfig->Get("Backup_Path")."/".$filename; } else $filename = $_GET["Filename"]; $FileOffset = (int)$_GET["Offset"]; //echo "FileOffset: $FileOffset
\n"; if(!file_exists($filename)) { echo prompt_language("la_restore_file_not_found")." : $filename"; exit(); } if(!is_readable($filename)) { echo prompt_language("la_restore_access_denied"); exit(); } $TotalSize = filesize($filename); $MaxLines = 200; $PageTitle = admin_language("la_text_Restore_in_progress"); $CancelURL = $rootURL ."admin/backup/restore1.php?env=".BuildEnv(); stats($PageTitle,$FileOffset,$TotalSize); //echo "FileOffset: $FileOffset
\n"; if($FileOffset < $TotalSize) { $FileOffset = RunRestoreFile($conn,$filename,$FileOffset,$MaxLines); if($FileOffset>-1) { if($FileOffset ==0) $FileOffset = $TotalSize; $url = $_SERVER['PHP_SELF']."?env=".BuildEnv()."&Offset=$FileOffset&Filename=$filename"; } else { switch($FileOffset) { case -1: $error = prompt_language("la_restore_file_error"); break; case -2: $error = prompt_language("la_restore_read_error"); break; default: $error = "(".$FileOffset.") ".prompt_language("la_restore_unknown_error"); break; } echo $error; die(); } } else $url = $adminURL."/backup/restore4.php?env=".BuildEnv(); reload($url); echo ""; echo ""; function stats($caption,$myprogress,$totalnum) { global $rootURL, $CancelURL; if($totalnum>0) { $pct=round(($myprogress/ $totalnum)*100); } else $pct = 100; $o .=""; echo "\n"; $o .= int_subsection_title_ret($caption."-".$pct."%"); $o .= "

"; $o .= " "; $o .=" "; $comp_pct = 100-$pct; $o .= " "; $o .= "
 
"; $o .= "
"; echo $o."\n"; echo "
"; } function reload($url) { print ""; echo "$url "; } ?>