_getTableStruct($_POST['tbl'], $OutPutType); if ($_POST['savetype'] == 'client') { $sqlfile = date("Y-m-d_H:i:s").'_'.$_POST['tbl'].'.sql'; header("Content-Type: text/plain"); header("Content-Disposition: attachment;filename=\"".$sqlfile."\""); echo $oNewBackup -> sInputs; exit(); } if ($_POST['savetype'] == 'server') { $sqlfile = BX_DIRECTORY_PATH_ROOT . 'backup/'.date("Y-m-d_H-i-s").'_'.$_POST['tbl'].'.sql'; $file = fopen($sqlfile, 'w'); fputs($file, $oNewBackup -> sInputs); $status_text .= "
Data succefully dumped into file {$sqlfile}
\n"; fclose($file); } if ($_POST['savetype'] == 'show') { $status_text = "
"; } } if (isset($_POST['DatabasesBackup'])) { $OutPutType = preg_replace("/[^0-9]/", '', $_POST['db_op']); $oNewBackup = new BxDolDatabaseBackup(); $oNewBackup -> _getAllTables($OutPutType); if ($_POST['savetype'] == 'show') { $status_text = "
"; } if ($_POST['savetype'] == 'server') { $sqlfile = BX_DIRECTORY_PATH_ROOT . 'backup/'.date("Y-m-d_H-i-s").'_all.sql'; $file = fopen($sqlfile, 'w'); fputs($file, $oNewBackup -> sInputs); $status_text .= "
Data succefully dumped into file {$sqlfile}
\n"; fclose($file); } if ($_POST['savetype'] == 'client') { $sqlfile = date("Y-m-d_H:i:s").'_all.sql'; header("Content-Type: text/plain"); header("Content-Disposition: attachment;filename=\"".$sqlfile."\""); echo $oNewBackup -> sInputs; exit(); } } if (isset($_POST['DatabasesRestore'])) { if ($_POST['savetype'] == 'delete') { if(is_file(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file'])) { @unlink(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file']); $status_text .= "
Dump file succefully deleted {$sqlfile}
\n"; } else $status_text .= "
Please select dump file {$sqlfile}
\n"; } if ($_POST['savetype'] == 'restore') { if(is_file(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file'])) { $oNewBackup = new BxDolDatabaseBackup(); $oNewBackup -> _restoreFromDumpFile(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file']); $status_text .= "
Data succefully restored from server dump
\n"; } else $status_text .= "
Please select dump file {$sqlfile}
\n"; } } if (isset($_FILES['sqlfile'])) { if (preg_match("/.sql/", $_FILES['sqlfile']['name'])) { #it is correct $oNewBackup = new BxDolDatabaseBackup(); $oNewBackup -> _restoreFromDumpFile($_FILES['sqlfile']['tmp_name'] ); @unlink($_FILES['sqlfile']['tmp_name']); $status_text .= "
Data succefully restored from your PS
\n"; } else $status_text .= "
Please select correct dump file (only *.sql)
\n"; } TopCodeAdmin(); ContentBlockHead('Tables backup tools'); ?>
Choose operation and table:
   
Choose operation:
   
Select dump file:
   

Database Restore from your PC
Select dump file: