default: $valuevalues[] = '\'' . mysql_escape_string($row[$key]) . '\''; break; } } } $thistableinserts .= $insertstatement . implode(', ', $valuevalues) . ');' . AP_CRLF; WriteBackupFile($fp, $thistableinserts); } } @$db->Disconnect(); @fclose($fp); /**/ if ($BackupIsGood) { echo '<br /><br />Backup file saved in <b>' . BACKUPFILENAME . '</b>'; echo '<br /><font color="' . COLOR_GREEN . '"><b>Backup done!</b></font>'; } else { echo '<br /><br /><font color="' . COLOR_RED . '"><b>Backup failed!</b></font></font>'; } /**/ echo '</body></html>'; myFlush(); ## Functions function myFlush() { @flush(); } function WriteBackupFile(&$fp, $text) { fwrite($fp, $text, strlen($text)); }
/** * Output span with progress. * * @param $current integer Current progress out of total * @param $total integer Total steps required to complete */ function outputProgress($current, $total, $table) { echo "<span style='position: absolute;z-index:{$current};background:#FFF;'>" . $table . " : " . round($current / $total * 100) . "% </span>"; myFlush(); sleep(); }
/** * Output span with progress. * * @param $current integer Current progress out of total * @param $total integer Total steps required to complete */ function outputProgress($current, $total) { echo "<span style='position: absolute;z-index:{$current};background:greenyellow;'>" . round($current / $total * 100) . "% </span>"; myFlush(); sleep(1); }
function ShowDeletingMessageNumber($resetCount = false) { static $msgNumber = 0; static $msgTime = 0; if ($resetCount) { $msgNumber = 0; $msgTime = 0; } else { $msgNumber++; if (time() - $msgTime > 0) { echo '<script>parent.SetDeletingMessageHandler(' . $msgNumber . ');</script>' . CRLF; $msgTime = time(); myFlush(true); } } }