|
|
|
@@ -29,19 +29,19 @@ if (empty($import_list)) {
|
|
|
|
|
<iframe id="import_upload_iframe" name="import_upload_iframe" width="1" height="1" style="display: none"></iframe>
|
|
|
|
|
<div id="import_form_status" style="display: none;"></div>
|
|
|
|
|
<div id="importmain">
|
|
|
|
|
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" style="display: none;" />
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
//<![CDATA[
|
|
|
|
|
window.addEvent('domready', function() {
|
|
|
|
|
<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" style="display: none;" />
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
//<![CDATA[
|
|
|
|
|
$(document).ready( function() {
|
|
|
|
|
// add event when user click on "Go" button
|
|
|
|
|
$('buttonGo').addEvent('click', function() {
|
|
|
|
|
$('upload_form_form').setStyle("display", "none"); // hide form
|
|
|
|
|
$('upload_form_status').setStyle("display", "inline"); // show progress bar
|
|
|
|
|
$('upload_form_status_info').setStyle("display", "inline"); // - || -
|
|
|
|
|
$('#buttonGo').bind('click', function() {
|
|
|
|
|
$('#upload_form_form').css("display", "none"); // hide form
|
|
|
|
|
$('#upload_form_status').css("display", "inline"); // show progress bar
|
|
|
|
|
$('#upload_form_status_info').css("display", "inline"); // - || -
|
|
|
|
|
<?php
|
|
|
|
|
if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
|
|
|
|
?>
|
|
|
|
|
$('upload_form_status').set('html', '<div class="upload_progress_bar_outer"><div id="status" class="upload_progress_bar_inner"></div></div>'); // add the progress bar
|
|
|
|
|
if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
|
|
|
|
?>
|
|
|
|
|
$('#upload_form_status').html('<div class="upload_progress_bar_outer"><div id="status" class="upload_progress_bar_inner"></div></div>'); // add the progress bar
|
|
|
|
|
|
|
|
|
|
var finished = false;
|
|
|
|
|
var percent = 0.0;
|
|
|
|
@@ -51,85 +51,83 @@ window.addEvent('domready', function() {
|
|
|
|
|
var perform_upload;
|
|
|
|
|
var periodical_upload;
|
|
|
|
|
|
|
|
|
|
var request_upload = new Request({
|
|
|
|
|
url: 'import_status.php?id=<?php echo $upload_id ; ?>&<?php echo PMA_generate_common_url(); ?>', // the "&" is causing problems for webkit browsers
|
|
|
|
|
method: 'get',
|
|
|
|
|
update: 'upload_form_status',
|
|
|
|
|
onComplete: function(response) {
|
|
|
|
|
objectsReturned = JSON.decode(response);
|
|
|
|
|
var request_upload = [];
|
|
|
|
|
|
|
|
|
|
$each(objectsReturned, function(item, index) {
|
|
|
|
|
perform_upload = function () {
|
|
|
|
|
new $.getJSON(
|
|
|
|
|
'import_status.php?id=<?php echo $upload_id ; ?>&<?php echo PMA_generate_common_url(); ?>',
|
|
|
|
|
{},
|
|
|
|
|
function(response) {
|
|
|
|
|
finished = response.finished;
|
|
|
|
|
percent = response.percent;
|
|
|
|
|
total = response.total;
|
|
|
|
|
complete = total.complete;
|
|
|
|
|
|
|
|
|
|
if (total==0 && complete==0 && percent==0) {
|
|
|
|
|
$('#upload_form_status_info').html('<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo PMA_jsFormat($strImportLargeFileUploading); ?>');
|
|
|
|
|
$('#upload_form_status').css("display", "none");
|
|
|
|
|
} else {
|
|
|
|
|
$('#upload_form_status_info').html(' '+Math.round(percent)+'%, '+complete+'/'+total);
|
|
|
|
|
$('#status').animate({width: Math.round(percent)*2+'px'},150);
|
|
|
|
|
} // else
|
|
|
|
|
|
|
|
|
|
if (index=="finished") {
|
|
|
|
|
finished = item;
|
|
|
|
|
if (finished==true) {
|
|
|
|
|
$clear(periodical_upload);
|
|
|
|
|
$('importmain').setStyle('display', 'none');
|
|
|
|
|
$('import_form_status').setStyle('display', 'inline');
|
|
|
|
|
$('import_form_status').set('html', '<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo $strImportProceedingFile; ?> ');
|
|
|
|
|
$('import_form_status').load('import_status.php?message=true&<?php echo PMA_generate_common_url(); ?>'); // loads the message, either success or mysql error
|
|
|
|
|
$('#importmain').css('display', 'none');
|
|
|
|
|
$('#import_form_status').css('display', 'inline');
|
|
|
|
|
$('#import_form_status').html('<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo $strImportProceedingFile; ?> ');
|
|
|
|
|
$('#import_form_status').load('import_status.php?message=true&<?php echo PMA_generate_common_url(); ?>'); // loads the message, either success or mysql error
|
|
|
|
|
<?php
|
|
|
|
|
// reload the left sidebar when the import is finished
|
|
|
|
|
$GLOBALS['reload']=true;
|
|
|
|
|
PMA_reloadNavigation(true);
|
|
|
|
|
?>
|
|
|
|
|
} // if finished==item
|
|
|
|
|
} // if index==finished
|
|
|
|
|
if (index=="percent")
|
|
|
|
|
percent = item;
|
|
|
|
|
if (index=="total")
|
|
|
|
|
total = item;
|
|
|
|
|
if (index=="complete")
|
|
|
|
|
complete = item;
|
|
|
|
|
}); // $each
|
|
|
|
|
if (total==0 && complete==0 && percent==0) {
|
|
|
|
|
$('upload_form_status_info').set('html', '<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo PMA_jsFormat($strImportLargeFileUploading); ?>');
|
|
|
|
|
$('upload_form_status').setStyle("display", "none");
|
|
|
|
|
} else {
|
|
|
|
|
$('upload_form_status_info').set('html', ' '+Math.round(percent)+'%, '+complete+'/'+total);
|
|
|
|
|
$('status').tween('width', Math.round(percent)*2+'px');
|
|
|
|
|
} // else
|
|
|
|
|
} // onComplete
|
|
|
|
|
}); // [equest
|
|
|
|
|
perform_upload = function () {
|
|
|
|
|
request_upload.send('r=' + $time() + $random(0, 100)); // hack for IE7,8 & webkit (Safari, Chrome, Arora...)
|
|
|
|
|
|
|
|
|
|
} // if finished
|
|
|
|
|
else {
|
|
|
|
|
window.setTimeout(perform_upload, 1000);
|
|
|
|
|
}
|
|
|
|
|
periodical_upload = perform_upload.periodical(1000);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
window.setTimeout(perform_upload, 1000);
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
} else { // no plugin avaliable
|
|
|
|
|
?>
|
|
|
|
|
$('upload_form_status_info').set('html', '<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo $strImportUploadInfoNotAvailable . PMA_showDocu('faq2_9'); ?>');
|
|
|
|
|
$('upload_form_status').setStyle("display", "none");
|
|
|
|
|
$('#upload_form_status_info').html('<img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" /> <?php echo $strImportUploadInfoNotAvailable . PMA_showDocu('faq2_9'); ?>');
|
|
|
|
|
$('#upload_form_status').css("display", "none");
|
|
|
|
|
<?php
|
|
|
|
|
} // else
|
|
|
|
|
?>
|
|
|
|
|
}); // if click
|
|
|
|
|
}); // domready
|
|
|
|
|
} // else
|
|
|
|
|
?>
|
|
|
|
|
}); // onclick
|
|
|
|
|
}); // domready
|
|
|
|
|
|
|
|
|
|
document.write('<form action="import.php" method="post" enctype="multipart/form-data" name="import"<?php if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") echo ' target="import_upload_iframe"'; ?>>');
|
|
|
|
|
//]]>
|
|
|
|
|
</script>
|
|
|
|
|
<noscript>
|
|
|
|
|
//]]>
|
|
|
|
|
</script>
|
|
|
|
|
<noscript>
|
|
|
|
|
<form action="import.php" method="post" enctype="multipart/form-data" name="import">
|
|
|
|
|
</noscript>
|
|
|
|
|
<input type="hidden" name="<?php echo $ID_KEY; ?>" value="<?php echo $upload_id ; ?>" />
|
|
|
|
|
<?php
|
|
|
|
|
if ($import_type == 'server') {
|
|
|
|
|
</noscript>
|
|
|
|
|
<input type="hidden" name="<?php echo $ID_KEY; ?>" value="<?php echo $upload_id ; ?>" />
|
|
|
|
|
<?php
|
|
|
|
|
if ($import_type == 'server') {
|
|
|
|
|
echo PMA_generate_common_hidden_inputs('', '', 1);
|
|
|
|
|
} elseif ($import_type == 'database') {
|
|
|
|
|
} elseif ($import_type == 'database') {
|
|
|
|
|
echo PMA_generate_common_hidden_inputs($db, '', 1);
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
echo PMA_generate_common_hidden_inputs($db, $table, 1);
|
|
|
|
|
}
|
|
|
|
|
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />'."\n";
|
|
|
|
|
echo PMA_pluginGetJavascript($import_list);
|
|
|
|
|
?>
|
|
|
|
|
}
|
|
|
|
|
echo ' <input type="hidden" name="import_type" value="' . $import_type . '" />'."\n";
|
|
|
|
|
echo PMA_pluginGetJavascript($import_list);
|
|
|
|
|
?>
|
|
|
|
|
<fieldset class="options">
|
|
|
|
|
<legend><?php echo $strFileToImport; ?></legend>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if ($GLOBALS['is_upload']) {
|
|
|
|
|
if ($GLOBALS['is_upload']) {
|
|
|
|
|
$uid = uniqid("");
|
|
|
|
|
?>
|
|
|
|
|
<div class="formelementrow" id="upload_form">
|
|
|
|
@@ -146,10 +144,10 @@ if ($GLOBALS['is_upload']) {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
PMA_Message::warning('strUploadsNotAllowed')->display();
|
|
|
|
|
}
|
|
|
|
|
if (!empty($cfg['UploadDir'])) {
|
|
|
|
|
}
|
|
|
|
|
if (!empty($cfg['UploadDir'])) {
|
|
|
|
|
$extensions = '';
|
|
|
|
|
foreach ($import_list as $key => $val) {
|
|
|
|
|
if (!empty($extensions)) {
|
|
|
|
@@ -172,11 +170,11 @@ if (!empty($cfg['UploadDir'])) {
|
|
|
|
|
echo ' </select>' . "\n";
|
|
|
|
|
}
|
|
|
|
|
echo '</div>' . "\n";
|
|
|
|
|
} // end if (web-server upload directory)
|
|
|
|
|
} // end if (web-server upload directory)
|
|
|
|
|
|
|
|
|
|
// charset of file
|
|
|
|
|
echo '<div class="formelementrow">' . "\n";
|
|
|
|
|
if ($cfg['AllowAnywhereRecoding']) {
|
|
|
|
|
echo '<div class="formelementrow">' . "\n";
|
|
|
|
|
if ($cfg['AllowAnywhereRecoding']) {
|
|
|
|
|
echo '<label for="charset_of_file">' . $strCharsetOfFile . '</label>';
|
|
|
|
|
reset($cfg['AvailableCharsets']);
|
|
|
|
|
echo '<select id="charset_of_file" name="charset_of_file" size="1">';
|
|
|
|
@@ -189,33 +187,33 @@ if ($cfg['AllowAnywhereRecoding']) {
|
|
|
|
|
echo '>' . htmlentities($temp_charset) . '</option>';
|
|
|
|
|
}
|
|
|
|
|
echo ' </select><br />';
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
echo '<label for="charset_of_file">' . $strCharsetOfFile . '</label>' . "\n";
|
|
|
|
|
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE);
|
|
|
|
|
} // end if (recoding)
|
|
|
|
|
echo '</div>' . "\n";
|
|
|
|
|
} // end if (recoding)
|
|
|
|
|
echo '</div>' . "\n";
|
|
|
|
|
|
|
|
|
|
// zip, gzip and bzip2 encode features
|
|
|
|
|
$compressions = $strNone;
|
|
|
|
|
$compressions = $strNone;
|
|
|
|
|
|
|
|
|
|
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
|
|
|
|
|
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
|
|
|
|
|
$compressions .= ', gzip';
|
|
|
|
|
}
|
|
|
|
|
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
|
|
|
|
|
}
|
|
|
|
|
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
|
|
|
|
|
$compressions .= ', bzip2';
|
|
|
|
|
}
|
|
|
|
|
if ($cfg['ZipDump'] && @function_exists('zip_open')) {
|
|
|
|
|
}
|
|
|
|
|
if ($cfg['ZipDump'] && @function_exists('zip_open')) {
|
|
|
|
|
$compressions .= ', zip';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// We don't have show anything about compression, when no supported
|
|
|
|
|
if ($compressions != $strNone) {
|
|
|
|
|
if ($compressions != $strNone) {
|
|
|
|
|
echo '<div class="formelementrow">' . "\n";
|
|
|
|
|
printf($strCompressionWillBeDetected, $compressions);
|
|
|
|
|
echo '</div>' . "\n";
|
|
|
|
|
}
|
|
|
|
|
echo "\n";
|
|
|
|
|
?>
|
|
|
|
|
}
|
|
|
|
|
echo "\n";
|
|
|
|
|
?>
|
|
|
|
|
</fieldset>
|
|
|
|
|
<fieldset class="options">
|
|
|
|
|
<legend><?php echo $strPartialImport; ?></legend>
|
|
|
|
@@ -255,25 +253,25 @@ echo "\n";
|
|
|
|
|
|
|
|
|
|
<fieldset class="options">
|
|
|
|
|
<legend><?php echo $strImportFormat; ?></legend>
|
|
|
|
|
<?php
|
|
|
|
|
<?php
|
|
|
|
|
// Let's show format options now
|
|
|
|
|
echo '<div style="float: left;">';
|
|
|
|
|
echo PMA_pluginGetChoice('Import', 'format', $import_list);
|
|
|
|
|
echo '</div>';
|
|
|
|
|
echo '<div style="float: left;">';
|
|
|
|
|
echo PMA_pluginGetChoice('Import', 'format', $import_list);
|
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
|
|
echo '<div style="float: left;">';
|
|
|
|
|
echo PMA_pluginGetOptions('Import', $import_list);
|
|
|
|
|
echo '</div>';
|
|
|
|
|
?>
|
|
|
|
|
echo '<div style="float: left;">';
|
|
|
|
|
echo PMA_pluginGetOptions('Import', $import_list);
|
|
|
|
|
echo '</div>';
|
|
|
|
|
?>
|
|
|
|
|
<div class="clearfloat"></div>
|
|
|
|
|
</fieldset>
|
|
|
|
|
<?php
|
|
|
|
|
<?php
|
|
|
|
|
// Encoding setting form appended by Y.Kawada
|
|
|
|
|
if (function_exists('PMA_set_enc_form')) {
|
|
|
|
|
if (function_exists('PMA_set_enc_form')) {
|
|
|
|
|
echo PMA_set_enc_form(' ');
|
|
|
|
|
}
|
|
|
|
|
echo "\n";
|
|
|
|
|
?>
|
|
|
|
|
}
|
|
|
|
|
echo "\n";
|
|
|
|
|
?>
|
|
|
|
|
<fieldset class="tblFooters">
|
|
|
|
|
<input type="submit" value="<?php echo $strGo; ?>" id="buttonGo" />
|
|
|
|
|
</fieldset>
|
|
|
|
|