".strtoupper($lang["Export"])."

".$lang["tables"].">".$lang["Export"]."
- - -
"; if (!$vmi) { echo "

".$lang["Export"].":


".$lang["Zip_sql_file"]."
"; } elseif ($vmi=='ionutvmi') { /* backup the db OR just a table */ function backup_tables($tables = '*',$dt,$zx) { global $k,$lang,$conn; //get all of the tables if($tables == '*') { $tables = array(); $result = mysqli_query($conn,'SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } //cycle through foreach($tables as $table) { $result = mysqli_query($conn,'SELECT * FROM `'.$table.'`'); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE `'.$table.'`;'; $row2 = mysqli_fetch_row(mysqli_query($conn,'SHOW CREATE TABLE `'.$table.'`')); $return.= "\n\n".$row2[1].";\n\n"; if($dt=="full"){ for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ");\n"; } } } $return.="\n\n\n"; } //save file $dd="backup-".date('d_M_Y')."_".time().".sql"; $handle = fopen("data/$dd","w+"); fwrite($handle,$return); fclose($handle); if ($zx==1) { fopen("data/$dd.zip","w"); $zip = new ZipArchive; if ($zip->open("data/$dd.zip") === TRUE) { $zip->addFile("data/$dd", "$dd") or die('error'); } $zip->close(); echo "- ".$lang["File"]." $dd.zip ".$lang["created"].".

- ".$lang["DOWNLOAD"]." $dd.zip

- ".$lang["delete"]." ".$lang["File"]." $dd.zip
"; } else { echo "- ".$lang["File"]." $dd ".$lang["created"].".

- ".$lang["DOWNLOAD"]." $dd

- ".$lang["delete"]." ".$lang["File"]." $dd
"; } echo $f; } $tbs=$_POST['extb']; if(!$tbs) die($lang["No_Table_Selected"]); $z=0; if (isset($_POST['zip'])) { $z=1; } // echo $_POST['tp']; backup_tables($tbs,$_POST['tp'],$z); } if ($vmi=='del') { $f=$_GET['f']; $g= @unlink("data/$f"); if ($g) { printf($lang["FILE_DELETED"],$f); } else { echo $lang["Error"]; } } echo ""; include('foot.php'); ?>