2 /* vim: set expandtab sw=4 ts=4 sts=4: */
8 if (! defined('PHPMYADMIN')) {
12 $ID_KEY = "UPLOAD_IDENTIFIER";
14 function PMA_getUploadStatus($id) {
18 if (trim($id) == "") {
22 if (! array_key_exists($id, $_SESSION[$SESSION_KEY])) {
23 $_SESSION[$SESSION_KEY][$id] = array(
32 $ret = $_SESSION[$SESSION_KEY][$id];
34 if (! PMA_import_uploadprogressCheck() ||
$ret['finished']) {
38 $status = uploadprogress_get_info($id);
41 if ($status['bytes_uploaded'] == $status['bytes_total']) {
42 $ret['finished'] = true;
44 $ret['finished'] = false;
46 $ret['total'] = $status['bytes_total'];
47 $ret['complete'] = $status['bytes_uploaded'];
49 if ($ret['total'] > 0) {
50 $ret['percent'] = $ret['complete'] / $ret['total'] * 100;
57 'total' => $ret['total'],
58 'complete' => $ret['total'],
63 $_SESSION[$SESSION_KEY][$id] = $ret;