选择显示字体大小

一段php代码:备份、恢复sql数据库(支持sql文本,zip。。。)


   php代码:--------------------------------------------------------------------------------

<?php


require(&#39;includes/application_top.php&#39;);

if (&#36;http_get_vars[&#39;action&#39;]) {
switch (&#36;http_get_vars[&#39;action&#39;]) {
case &#39;forget&#39;:
tep_db_query(&quot;delete from &quot; . table_configuration . &quot; where configuration_key = &#39;db_last_restore&#39;&quot;);
&#36;messagestack->add_session(success_last_restore_cleared, &#39;success&#39;);
tep_redirect(tep_href_link(filename_backup));
break;
case &#39;backupnow&#39;:
tep_set_time_limit(0);
&#36;schema = &#39;# citespa, open source e-commerce solutions&#39; . &quot;\n&quot; .
&#39;# <a href=&quot;http://www.xxxxxx.com&quot; target=&quot;_blank&quot;>http://www.xxxxxx.com</a>&#39; . &quot;\n&quot; .
&#39;#&#39; . &quot;\n&quot; .
&#39;# database backup for &#39; . store_name . &quot;\n&quot; .
&#39;# copyright (c) &#39; . date(&#39;y&#39;) . &#39; &#39; . store_owner . &quot;\n&quot; .
&#39;#&#39; . &quot;\n&quot; .
&#39;# database: &#39; . db_database . &quot;\n&quot; .
&#39;# database server: &#39; . db_server . &quot;\n&quot; .
&#39;#&#39; . &quot;\n&quot; .
&#39;# backup date: &#39; . date(php_date_time_format) . &quot;\n\n&quot;;
&#36;tables_query = tep_db_query(&#39;show tables&#39;);
while (&#36;tables = tep_db_fetch_array(&#36;tables_query)) {
list(,&#36;table) = each(&#36;tables);
&#36;schema .= &#39;drop table if exists &#39; . &#36;table . &#39;;&#39; . &quot;\n&quot; .
&#39;create table &#39; . &#36;table . &#39; (&#39; . &quot;\n&quot;;
&#36;table_list = array();
&#36;fields_query = tep_db_query(&quot;show fields from &quot; . &#36;table);
while (&#36;fields = tep_db_fetch_array(&#36;fields_query)) {
&#36;table_list[] = &#36;fields[&#39;field&#39;];
&#36;schema .= &#39; &#39; . &#36;fields[&#39;field&#39;] . &#39; &#39; . &#36;fields[&#39;type&#39;];
if (strlen(&#36;fields[&#39;default&#39;]) > 0) &#36;schema .= &#39; default &#39;&#39; . &#36;fields[&#39;default&#39;] . &#39;&#39;&#39;;
if (&#36;fields[&#39;null&#39;] != &#39;yes&#39;) &#36;schema .= &#39; not null&#39;;
if (isset(&#36;fields[&#39;extra&#39;])) &#36;schema .= &#39; &#39; . &#36;fields[&#39;extra&#39;];
&#36;schema .= &#39;,&#39; . &quot;\n&quot;;
}
&#36;schema = ereg_replace(&quot;,\n&#36;&quot;, &#39;&#39;, &#36;schema);

// add the keys
&#36;index = array();
&#36;keys_query = tep_db_query(&quot;show keys from &quot; . &#36;table);
while (&#36;keys = tep_db_fetch_array(&#36;keys_query)) {
&#36;kname = &#36;keys[&#39;key_name&#39;];
if (!isset(&#36;index[&#36;kname])) {
&#36;index[&#36;kname] = array(&#39;unique&#39; => !&#36;keys[&#39;non_unique&#39;],
&#39;columns&#39; => array());
}
&#36;index[&#36;kname][&#39;columns&#39;][] = &#36;keys[&#39;column_name&#39;];
}
while (list(&#36;kname, &#36;info) = each(&#36;index)) {
&#36;schema .= &#39;,&#39; . &quot;\n&quot;;
&#36;columns = implode(&#36;info[&#39;columns&#39;], &#39;, &#39;);
if (&#36;kname == &#39;primary&#39;) {
&#36;schema .= &#39; primary key (&#39; . &#36;columns . &#39;)&#39;;
} elseif (&#36;info[&#39;unique&#39;]) {
&#36;schema .= &#39; unique &#39; . &#36;kname . &#39; (&#39; . &#36;columns . &#39;)&#39;;
} else {
&#36;schema .= &#39; key &#39; . &#36;kname . &#39; (&#39; . &#36;columns . &#39;)&#39;;
}
}
&#36;schema .= &quot;\n&quot; . &#39;);&#39; . &quot;\n\n&quot;;

// dump the data
&#36;rows_query = tep_db_query(&quot;select &quot; . implode(&#39;,&#39;, &#36;table_list) . &quot; from &quot; . &#36;table);
while (&#36;rows = tep_db_fetch_array(&#36;rows_query)) {
&#36;schema_insert = &#39;insert into &#39; . &#36;table . &#39; (&#39; . implode(&#39;, &#39;, &#36;table_list) . &#39;) values (&#39;;
reset(&#36;table_list);
while (list(,&#36;i) = each(&#36;table_list)) {
if (!isset(&#36;rows[&#36;i])) {
&#36;schema_insert .= &#39;null, &#39;;
} elseif (&#36;rows[&#36;i] != &#39;&#39;) {
&#36;row = addslashes(&#36;rows[&#36;i]);
&#36;row = ereg_replace(&quot;\n#&quot;, &quot;\n&quot;.&#39;#&#39;, &#36;row);
&#36;schema_insert .= &#39;&#39;&#39; . &#36;row . &#39;&#39;, &#39;;
} else {
&#36;schema_insert .= &#39;&#39;&#39;, &#39;;
}
}
&#36;schema_insert = ereg_replace(&#39;, &#36;&#39;, &#39;&#39;, &#36;schema_insert) . &#39;);&#39; . &quot;\n&quot;;
&#36;schema .= &#36;schema_insert;
}
&#36;schema .= &quot;\n&quot;;
}

if (&#36;http_post_vars[&#39;download&#39;] == &#39;yes&#39;) {
&#36;backup_file = &#39;db_&#39; . db_database . &#39;-&#39; . date(&#39;ymdhis&#39;) . &#39;.sql&#39;;
switch (&#36;http_post_vars[&#39;compress&#39;]) {
case &#39;no&#39;:
header(&#39;content-type: application/x-octet-stream&#39;);
header(&#39;content-disposition: attachment; filename=&#39; . &#36;backup_file);
echo &#36;schema;
exit;
break;
case &#39;gzip&#39;:
if (&#36;fp = fopen(dir_fs_backup . &#36;backup_file, &#39;w&#39;)) {
fputs(&#36;fp, &#36;schema);
fclose(&#36;fp);
exec(local_exe_gzip . &#39; &#39; . dir_fs_backup . &#36;backup_file);
&#36;backup_file .= &#39;.gz&#39;;
}
if (&#36;fp = fopen(dir_fs_backup . &#36;backup_file, &#39;rb&#39;)) {
&#36;buffer = fread(&#36;fp, filesize(dir_fs_backup . &#36;backup_file));
fclose(&#36;fp);
unlink(dir_fs_backup . &#36;backup_file);
header(&#39;content-type: application/x-octet-stream&#39;);
header(&#39;content-disposition: attachment; filename=&#39; . &#36;backup_file);
echo &#36;buffer;
exit;
}
break;
case &#39;zip&#39;:
if (&#36;fp = fopen(dir_fs_backup . &#36;backup_file, &#39;w&#39;)) {
fputs(&#36;fp, &#36;schema);
fclose(&#36;fp);
exec(local_exe_zip . &#39; -j &#39; . dir_fs_backup . &#36;backup_file . &#39;.zip &#39; . dir_fs_backup . &#36;backup_file);
unlink(dir_fs_backup . &#36;backup_file);
&#36;backup_file .= &#39;.zip&#39;;
}
if (&#36;fp = fopen(dir_fs_backup . &#36;backup_file, &#39;rb&#39;)) {
&#36;buffer = fread(&#36;fp, filesize(dir_fs_backup . &#36;backup_file));
fclose(&#36;fp);
unlink(dir_fs_backup . &#36;backup_file);
header(&#39;content-type: application/x-octet-stream&#39;);
header(&#39;content-disposition: attachment; filename=&#39; . &#36;backup_file);
echo &#36;buffer;
exit;
}
}
} else {
&#36;backup_file = dir_fs_backup . &#39;db_&#39; . db_database . &#39;-&#39; . date(&#39;ymdhis&#39;) . &#39;.sql&#39;;
if (&#36;fp = fopen(&#36;backup_file, &#39;w&#39;)) {
fputs(&#36;fp, &#36;schema);
fclose(&#36;fp);
switch (&#36;http_post_vars[&#39;compress&#39;]) {
case &#39;gzip&#39;:
exec(local_exe_gzip . &#39; &#39; . &#36;backup_file);
break;
case &#39;zip&#39;:
exec(local_exe_zip . &#39; -j &#39; . &#36;backup_file . &#39;.zip &#39; . &#36;backup_file);
unlink(&#36;backup_file);
}
}
&#36;messagestack->add_session(success_database_saved, &#39;success&#39;);
tep_redirect(tep_href_link(filename_backup));
}
break;
case &#39;restorenow&#39;:
case &#39;restorelocalnow&#39;:
tep_set_time_limit(0);

if (&#36;http_get_vars[&#39;action&#39;] == &#39;restorenow&#39;) {
&#36;read_from = &#36;http_get_vars[&#39;file&#39;];
if (file_exists(dir_fs_backup . &#36;http_get_vars[&#39;file&#39;])) {
&#36;restore_file = dir_fs_backup . &#36;http_get_vars[&#39;file&#39;];
&#36;extension = substr(&#36;http_get_vars[&#39;file&#39;], -3);
if ( (&#36;extension == &#39;sql&#39;) (&#36;extension == &#39;.gz&#39;) (&#36;extension == &#39;zip&#39;) ) {
switch (&#36;extension) {
case &#39;sql&#39;:
&#36;restore_from = &#36;restore_file;
&#36;remove_raw = false;
break;
case &#39;.gz&#39;:
&#36;restore_from = substr(&#36;restore_file, 0, -3);
exec(local_exe_gunzip . &#39; &#39; . &#36;restore_file . &#39; -c > &#39; . &#36;restore_from);
&#36;remove_raw = true;
break;
case &#39;zip&#39;:
&#36;restore_from = substr(&#36;restore_file, 0, -4);
exec(local_exe_unzip . &#39; &#39; . &#36;restore_file . &#39; -d &#39; . dir_fs_backup);
&#36;remove_raw = true;
}

if ( (&#36;restore_from) && (file_exists(&#36;restore_from)) && (filesize(&#36;restore_from) > 15000) ) {
&#36;fd = fopen(&#36;restore_from, &#39;rb&#39;);
&#36;restore_query = fread(&#36;fd, filesize(&#36;restore_from));
fclose(&#36;fd);
}
}
}
} elseif (&#36;http_get_vars[&#39;action&#39;] == &#39;restorelocalnow&#39;) {
if (&#36;http_post_files[&#39;sql_file&#39;]) {
&#36;uploaded_file = &#36;http_post_files[&#39;sql_file&#39;][&#39;tmp_name&#39;];
&#36;read_from = basename(&#36;http_post_files[&#39;sql_file&#39;][&#39;name&#39;]);
} elseif (&#36;http_post_vars[&#39;sql_file&#39;]) {
&#36;uploaded_file = &#36;http_post_vars[&#39;sql_file&#39;];
&#36;read_from = basename(&#36;http_post_vars[&#39;sql_file_name&#39;]);
} else {
&#36;uploaded_file = &#36;sql_file;
&#36;read_from = basename(&#36;sql_file_name);
}
if (&#36;uploaded_file != &#39;none&#39;) {
if (tep_is_uploaded_file(&#36;uploaded_file)) {
&#36;restore_query = fread(fopen(&#36;uploaded_file, &#39;r&#39;), filesize(&#36;uploaded_file));
}
}
}

if (&#36;restore_query) {
&#36;sql_array = array();
&#36;sql_length = strlen(&#36;restore_query);
&#36;pos = strpos(&#36;restore_query, &#39;;&#39;);
for (&#36;i=&#36;pos; &#36;i<&#36;sql_length; &#36;i++) {
if (&#36;restore_query[0] == &#39;#&#39;) {
&#36;restore_query = ltrim(substr(&#36;restore_query, strpos(&#36;restore_query, &quot;\n&quot;)));
&#36;sql_length = strlen(&#36;restore_query);
&#36;i = strpos(&#36;restore_query, &#39;;&#39;)-1;
continue;
}
if (&#36;restore_query[(&#36;i+1)] == &quot;\n&quot;) {
for (&#36;j=(&#36;i+2); &#36;j<&#36;sql_length; &#36;j++) {
if (trim(&#36;restore_query[&#36;j]) != &#39;&#39;) {
&#36;next = substr(&#36;restore_query, &#36;j, 6);
if (&#36;next[0] == &#39;#&#39;) {
// find out where the break position is so we can remove this line (#comment line)
for (&#36;k=&#36;j; &#36;k<&#36;sql_length; &#36;k++) {
if (&#36;restore_query[&#36;k] == &quot;\n&quot;) break;
}
&#36;query = substr(&#36;restore_query, 0, &#36;i+1);
&#36;restore_query = substr(&#36;restore_query, &#36;k);
// join the query before the comment appeared, with the rest of the dump
&#36;restore_query = &#36;query . &#36;restore_query;
&#36;sql_length = strlen(&#36;restore_query);
&#36;i = strpos(&#36;restore_query, &#39;;&#39;)-1;
continue 2;
}
break;
}
}
if (&#36;next == &#39;&#39;) { // get the last insert query
&#36;next = &#39;insert&#39;;
}
if ( (eregi(&#39;create&#39;, &#36;next)) (eregi(&#39;insert&#39;, &#36;next)) (eregi(&#39;drop t&#39;, &#36;next)) ) {
&#36;next = &#39;&#39;;
&#36;sql_array[] = substr(&#36;restore_query, 0, &#36;i);
&#36;restore_query = ltrim(substr(&#36;restore_query, &#36;i+1));
&#36;sql_length = strlen(&#36;restore_query);
&#36;i = strpos(&#36;restore_query, &#39;;&#39;)-1;
}
}
}

&#36;tables_query = tep_db_query(&#39;show tables&#39;);
while (&#36;tables = tep_db_fetch_array(&#36;tables_query)) {
list(,&#36;table) = each(&#36;tables);
tep_db_query(&quot;drop table &quot; . &#36;table);
}

for (&#36;i=0; &#36;i<sizeof(&#36;sql_array); &#36;i++) {
tep_db_query(&#36;sql_array[&#36;i]);
}

tep_db_query(&quot;delete from &quot; . table_configuration . &quot; where configuration_key = &#39;db_last_restore&#39;&quot;);
tep_db_query(&quot;insert into &quot; . table_configuration . &quot; values (&#39;&#39;, &#39;last database restore&#39;, &#39;db_last_restore&#39;, &#39;&quot; . &#36;read_from . &quot;&#39;, &#39;last database restore file&#39;, &#39;6&#39;, &#39;&#39;, &#39;&#39;, now(), &#39;&#39;, &#39;&#39;)&quot;);

if (&#36;remove_raw) {
unlink(&#36;restore_from);
}
}

&#36;messagestack->add_session(success_database_restored, &#39;success&#39;);
tep_redirect(tep_href_link(filename_backup));
break;
case &#39;download&#39;:
&#36;extension = substr(&#36;http_get_vars[&#39;file&#39;], -3);
if ( (&#36;extension == &#39;zip&#39;) (&#36;extension == &#39;.gz&#39;) (&#36;extension == &#39;sql&#39;) ) {
if (&#36;fp = fopen(dir_fs_backup . &#36;http_get_vars[&#39;file&#39;], &#39;rb&#39;)) {
&#36;buffer = fread(&#36;fp, filesize(dir_fs_backup . &#36;http_get_vars[&#39;file&#39;]));
fclose(&#36;fp);
header(&#39;content-type: application/x-octet-stream&#39;);
header(&#39;content-disposition: attachment; filename=&#39; . &#36;http_get_vars[&#39;file&#39;]);
echo &#36;buffer;
exit;
}
} else {
&#36;messagestack->add(error_download_link_not_acceptable, &#39;error&#39;);
}
break;
case &#39;deleteconfirm&#39;:
if (strstr(&#36;http_get_vars[&#39;file&#39;], &#39;..&#39;)) tep_redirect(tep_href_link(filename_backup));

tep_remove(dir_fs_backup . &#39;/&#39; . &#36;http_get_vars[&#39;file&#39;]);
if (!&#36;tep_remove_error) {
&#36;messagestack->add_session(success_backup_deleted, &#39;success&#39;);
tep_redirect(tep_href_link(filename_backup));
}
break;
}
}

// check if the backup directory exists
&#36;dir_ok = false;
if (is_dir(dir_fs_backup)) {
&#36;dir_ok = true;
if (!is_writeable(dir_fs_backup)) &#36;messagestack->add(error_backup_directory_not_writeable, &#39;error&#39;);
} else {
&#36;messagestack->add(error_backup_directory_does_not_exist, &#39;error&#39;);
}
?>

<html <?php echo html_params; ?>>
<head>
<meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=<?php echo charset; ?>&quot;>
<title><?php echo title; ?></title>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;includes/stylesheet.css&quot;>
</head>
<body marginwidth=&quot;0&quot; marginheight=&quot;0&quot; topmargin=&quot;0&quot; bottommargin=&quot;0&quot; leftmargin=&quot;0&quot; rightmargin=&quot;0&quot; bgcolor=&quot;#ffffff&quot;>
<!-- header //-->
<?php require(dir_ws_includes . &#39;header.php&#39;); ?>
<!-- header_eof //-->

<!-- body //-->
<table border=&quot;0&quot; width=&quot;100%&quot; cellspacing=&quot;2&quot; cellpadding=&quot;2&quot;>
<tr>
<td width=&quot;<?php echo box_width; ?>&quot; valign=&quot;top&quot;><table border=&quot;0&quot; width=&quot;<?php echo box_width; ?>&quot; cellspacing=&quot;1&quot; cellpadding=&quot;1&quot; class=&quot;columnleft&quot;>
<!-- left_navigation //-->
<?php require(dir_ws_includes . &#39;column_left.php&#39;); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width=&quot;100%&quot; valign=&quot;top&quot;><table border=&quot;0&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;>
<tr>
<td><table border=&quot;0&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td class=&quot;pageheading&quot;><?php echo heading_title; ?></td>
<td class=&quot;pageheading&quot; align=&quot;right&quot;><?php echo tep_draw_separator(&#39;pixel_trans.gif&#39;, heading_image_width, heading_image_height); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border=&quot;0&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td valign=&quot;top&quot;><table border=&quot;0&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;>
<tr class=&quot;datatableheadingrow&quot;>
<td class=&quot;datatableheadingcontent&quot;><?php echo table_heading_title; ?></td>
<td class=&quot;datatableheadingcontent&quot; align=&quot;center&quot;><?php echo table_heading_file_date; ?></td>
<td class=&quot;datatableheadingcontent&quot; align=&quot;right&quot;><?php echo table_heading_file_size; ?></td>
<td class=&quot;datatableheadingcontent&quot; align=&quot;right&quot;><?php echo table_heading_action; ?>&nbsp;</td>
</tr>
<?php
if (&#36;dir_ok) {
&#36;dir = dir(dir_fs_backup);
&#36;contents = array();
while (&#36;file = &#36;dir->read()) {
if (!is_dir(dir_fs_backup . &#36;file)) {
&#36;contents[] = &#36;file;
}
}
sort(&#36;contents);

for (&#36;files=0; &#36;files<sizeof(&#36;contents); &#36;files++) {
&#36;entry = &#36;contents[&#36;files];

&#36;check = 0;

if (((!&#36;http_get_vars[&#39;file&#39;]) (&#36;http_get_vars[&#39;file&#39;] == &#36;entry)) && (!&#36;buinfo) && (&#36;http_get_vars[&#39;action&#39;] != &#39;backup&#39;) && (&#36;http_get_vars[&#39;action&#39;] != &#39;restorelocal&#39;)) {
&#36;file_array[&#39;file&#39;] = &#36;entry;
&#36;file_array[&#39;date&#39;] = date(php_date_time_format, filemtime(dir_fs_backup . &#36;entry));
&#36;file_array[&#39;size&#39;] = number_format(filesize(dir_fs_backup . &#36;entry)) . &#39; bytes&#39;;
switch (substr(&#36;entry, -3)) {
case &#39;zip&#39;: &#36;file_array[&#39;compression&#39;] = &#39;zip&#39;; break;
case &#39;.gz&#39;: &#36;file_array[&#39;compression&#39;] = &#39;gzip&#39;; break;
default: &#36;file_array[&#39;compression&#39;] = text_no_extension; break;
}

&#36;buinfo = new objectinfo(&#36;file_array);
}

if (is_object(&#36;buinfo) && (&#36;entry == &#36;buinfo->file)) {
echo &#39; <tr class=&quot;datatablerowselected&quot; onmouseover=&quot;this.style.cursor=&#39;hand&#39;&quot;>&#39; . &quot;\n&quot;;
&#36;onclick_link = &#39;file=&#39; . &#36;buinfo->file . &#39;&action=restore&#39;;
} else {
echo &#39; <tr class=&quot;datatablerow&quot; onmouseover=&quot;this.classname=&#39;datatablerowover&#39;;this.style.cursor=&#39;hand&#39;&quot; onmouseout=&quot;this.classname=&#39;datatablerow&#39;&quot;>&#39; . &quot;\n&quot;;
&#36;onclick_link = &#39;file=&#39; . &#36;entry;
}
?>
<td class=&quot;datatablecontent&quot; onclick=&quot;document.location.href=&#39;<?php echo tep_href_link(filename_backup, &#36;onclick_link); ?>&#39;&quot;><?php echo &#39;<a href=&quot;&#39; . tep_href_link(filename_backup, &#39;action=download&file=&#39; . &#36;entry) . &#39;&quot;>&#39; . tep_image(dir_ws_icons . &#39;file_download.gif&#39;, icon_file_download) . &#39;</a>&nbsp;&#39; . &#36;entry; ?></td>
<td class=&quot;datatablecontent&quot; align=&quot;center&quot; onclick=&quot;document.location.href=&#39;<?php echo tep_href_link(filename_backup, &#36;onclick_link); ?>&#39;&quot;><?php echo date(php_date_time_format, filemtime(dir_fs_backup . &#36;entry)); ?></td>
<td class=&quot;datatablecontent&quot; align=&quot;right&quot; onclick=&quot;document.location.href=&#39;<?php echo tep_href_link(filename_backup, &#36;onclick_link); ?>&#39;&quot;><?php echo number_format(filesize(dir_fs_backup . &#36;entry)); ?> bytes</td>
<td class=&quot;datatablecontent&quot; align=&quot;right&quot;><?php if ( (is_object(&#36;buinfo)) && (&#36;entry == &#36;buinfo->file) ) { echo tep_image(dir_ws_images . &#39;icon_arrow_right.gif&#39;, &#39;&#39;); } else { echo &#39;<a href=&quot;&#39; . tep_href_link(filename_backup, &#39;file=&#39; . &#36;entry) . &#39;&quot;>&#39; . tep_image(dir_ws_images . &#39;icon_info.gif&#39;, image_icon_info) . &#39;</a>&#39;; } ?>&nbsp;</td>
</tr>
<?php
}
&#36;dir->close();
}
?>
<tr>
<td class=&quot;smalltext&quot; colspan=&quot;3&quot;><?php echo text_backup_directory . &#39; &#39; . dir_fs_backup; ?></td>
<td align=&quot;right&quot; class=&quot;smalltext&quot;><?php if ( (&#36;http_get_vars[&#39;action&#39;] != &#39;backup&#39;) && (&#36;dir) ) echo &#39;<a href=&quot;&#39; . tep_href_link(filename_backup, &#39;action=backup&#39;) . &#39;&quot;>&#39; . tep_image_button(&#39;button_backup.gif&#39;, image_backup) . &#39;</a>&#39;; if ( (&#36;http_get_vars[&#39;action&#39;] != &#39;restorelocal&#39;) && (&#36;dir) ) echo &#39;&nbsp;&nbsp;<a href=&quot;&#39; . tep_href_link(filename_backup, &#39;action=restorelocal&#39;) . &#39;&quot;>&#39; . tep_image_button(&#39;button_restore.gif&#39;, image_restore) . &#39;</a>&#39;; ?></td>
</tr>
<?php
if (defined(&#39;db_last_restore&#39;)) {
?>
<tr>
<td class=&quot;smalltext&quot; colspan=&quot;4&quot;><?php echo text_last_restoration . &#39; &#39; . db_last_restore . &#39; <a href=&quot;&#39; . tep_href_link(filename_backup, &#39;action=forget&#39;) . &#39;&quot;>&#39; . text_forget . &#39;</a>&#39;; ?></td>
</tr>
<?php
}
?>
</table></td>
<?php
&#36;heading = array();
&#36;contents = array();
switch (&#36;http_get_vars[&#39;action&#39;]) {
case &#39;backup&#39;:
&#36;heading[] = array(&#39;text&#39; => &#39;<b>&#39; . text_info_heading_new_backup . &#39;</b>&#39;);

&#36;contents = array(&#39;form&#39; => tep_draw_form(&#39;backup&#39;, filename_backup, &#39;action=backupnow&#39;));
&#36;contents[] = array(&#39;text&#39; => text_info_new_backup);

if (&#36;messagestack->size > 0) {
&#36;contents[] = array(&#39;text&#39; => &#39;<br>&#39; . tep_draw_radio_field(&#39;compress&#39;, &#39;no&#39;, true) . &#39; &#39; . text_info_use_no_compression);
&#36;contents[] = array(&#39;text&#39; => &#39;<br>&#39; . tep_draw_radio_field(&#39;download&#39;, &#39;yes&#39;, true) . &#39; &#39; . text_info_download_only . &#39;*<br><br>*&#39; . text_info_best_through_https);
} else {
&#36;contents[] = array(&#39;text&#39; => &#39;<br>&#39; . tep_draw_radio_field(&#39;compress&#39;, &#39;gzip&#39;, true) . &#39; &#39; . text_info_use_gzip);
&#36;contents[] = array(&#39;text&#39; => tep_draw_radio_field(&#39;compress&#39;, &#39;zip&#39;) . &#39; &#39; . text_info_use_zip);
&#36;contents[] = array(&#39;text&#39; => tep_draw_radio_field(&#39;compress&#39;, &#39;no&#39;) . &#39; &#39; . text_info_use_no_compression);
&#36;contents[] = array(&#39;text&#39; => &#39;<br>&#39; . tep_draw_checkbox_field(&#39;download&#39;, &#39;yes&#39;) . &#39; &#39; . text_info_download_only . &#39;*<br><br>*&#39; . text_info_best_through_https);
}

&#36;contents[] = array(&#39;align&#39; => &#39;center&#39;, &#39;text&#39; => &#39;<br>&#39; . tep_image_submit(&#39;button_backup.gif&#39;, image_backup) . &#39;&nbsp;<a href=&quot;&#39; . tep_href_link(filename_backup) . &#39;&quot;>&#39; . tep_image_button(&#39;button_cancel.gif&#39;, image_cancel) . &#39;</a>&#39;);
break;
case &#39;restore&#39;:
&#36;heading[] = array(&#39;text&#39; => &#39;<b>&#39; . &#36;buinfo->date . &#39;</b>&#39;);

&#36;contents[] = array(&#39;text&#39; => tep_break_string(sprintf(text_info_restore, dir_fs_backup . ((&#36;buinfo->compression != text_no_extension) ? substr(&#36;buinfo->file, 0, strrpos(&#36;buinfo->file, &#39;.&#39;)) : &#36;buinfo->file), (&#36;buinfo->compression != text_no_extension) ? text_info_unpack : &#39;&#39;), 35, &#39; &#39;));
&#36;contents[] = array(&#39;align&#39; => &#39;center&#39;, &#39;text&#39; => &#39;<br><a href=&quot;&#39; . tep_href_link(filename_backup, &#39;file=&#39; . &#36;buinfo->file . &#39;&action=restorenow&#39;) . &#39;&quot;>&#39; . tep_image_button(&#39;button_restore.gif&#39;, image_restore) . &#39;</a>&nbsp;<a href=&quot;&#39; . tep_href_link(filename_backup, &#39;file=&#39; . &#36;buinfo->file) . &#39;&quot;>&#39; . tep_image_button(&#39;button_cancel.gif&#39;, image_cancel) . &#39;</a>&#39;);
break;
case &#39;restorelocal&#39;:
&#36;heading[] = array(&#39;text&#39; => &#39;<b>&#39; . text_info_heading_restore_local . &#39;</b>&#39;);

&#36;contents = array(&#39;form&#39; => tep_draw_form(&#39;restore&#39;, filename_backup, &#39;action=restorelocalnow&#39;, &#39;post&#39;, &#39;enctype=&quot;multipart/form-data&quot;&#39;));
&#36;contents[] = array(&#39;text&#39; => text_info_restore_local . &#39;<br><br>&#39; . text_info_best_through_https);
&#36;contents[] = array(&#39;text&#39; => &#39;<br>&#39; . tep_draw_file_field(&#39;sql_file&#39;));
&#36;contents[] = array(&#39;text&#39; => text_info_restore_local_raw_file);
&#36;contents[] = array(&#39;align&#39; => &#39;center&#39;, &#39;text&#39; => &#39;<br>&#39; . tep_image_submit(&#39;button_restore.gif&#39;, image_restore) . &#39;&nbsp;<a href=&quot;&#39; . tep_href_link(filename_backup) . &#39;&quot;>&#39; . tep_image_button(&#39;button_cancel.gif&#39;, image_cancel) . &#39;</a>&#39;);
break;
case &#39;delete&#39;:
&#36;heading[] = array(&#39;text&#39; => &#39;<b>&#39; . &#36;buinfo->date . &#39;</b>&#39;);

&#36;contents = array(&#39;form&#39; => tep_draw_form(&#39;delete&#39;, filename_backup, &#39;file=&#39; . &#36;buinfo->file . &#39;&action=deleteconfirm&#39;));
&#36;contents[] = array(&#39;text&#39; => text_delete_intro);
&#36;contents[] = array(&#39;text&#39; => &#39;<br><b>&#39; . &#36;buinfo->file . &#39;</b>&#39;);
&#36;contents[] = array(&#39;align&#39; => &#39;center&#39;, &#39;text&#39; => &#39;<br>&#39; . tep_image_submit(&#39;button_delete.gif&#39;, image_delete) . &#39; <a href=&quot;&#39; . tep_href_link(filename_backup, &#39;file=&#39; . &#36;buinfo->file) . &#39;&quot;>&#39; . tep_image_button(&#39;button_cancel.gif&#39;, image_cancel) . &#39;</a>&#39;);
break;
default:
if (is_object(&#36;buinfo)) {
&#36;heading[] = array(&#39;text&#39; => &#39;<b>&#39; . &#36;buinfo->date . &#39;</b>&#39;);

&#36;contents[] = array(&#39;align&#39; => &#39;center&#39;, &#39;text&#39; => &#39;<a href=&quot;&#39; . tep_href_link(filename_backup, &#39;file=&#39; . &#36;buinfo->file . &#39;&action=restore&#39;) . &#39;&quot;>&#39; . tep_image_button(&#39;button_restore.gif&#39;, image_restore) . &#39;</a> <a href=&quot;&#39; . tep_href_link(filename_backup, &#39;file=&#39; . &#36;buinfo->file . &#39;&action=delete&#39;) . &#39;&quot;>&#39; . tep_image_button(&#39;button_delete.gif&#39;, image_delete) . &#39;</a>&#39;);
&#36;contents[] = array(&#39;text&#39; => &#39;<br>&#39; . text_info_date . &#39; &#39; . &#36;buinfo->date);
&#36;contents[] = array(&#39;text&#39; => text_info_size . &#39; &#39; . &#36;buinfo->size);
&#36;contents[] = array(&#39;text&#39; => &#39;<br>&#39; . text_info_compression . &#39; &#39; . &#36;buinfo->compression);
}
break;
}

if ( (tep_not_null(&#36;heading)) && (tep_not_null(&#36;contents)) ) {
echo &#39; <td width=&quot;25%&quot; valign=&quot;top&quot;>&#39; . &quot;\n&quot;;

&#36;box = new box;
echo &#36;box->infobox(&#36;heading, &#36;contents);

echo &#39; </td>&#39; . &quot;\n&quot;;
}
?>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(dir_ws_includes . &#39;footer.php&#39;); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(dir_ws_includes . &#39;application_bottom.php&#39;); ?>


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons