Example #1
0
$post_vars = filter_input_array(INPUT_POST);
$get_vars = filter_input_array(INPUT_GET);
if (isset($post_vars)) {
    $type = $post_vars['type'];
    $zipFilename = "{$bot_name}.{$type}.zip";
    if (!isset($post_vars['filenames'])) {
        $msg .= 'No files were selected for download. Please select at least one file.';
    } else {
        $fileNames = $post_vars['filenames'];
        unlink(_ADMIN_PATH_ . "downloads/{$zipFilename}");
        // clear out any old zip files to prepare for the new one.
        $zip = new ZipArchive();
        $success = $zip->open(_ADMIN_PATH_ . "/downloads/{$zipFilename}", ZipArchive::CREATE);
        if ($success === true) {
            foreach ($fileNames as $filename) {
                $curZipContent = $type == 'SQL' ? getSQLByFileName($filename) : getAIMLByFileName($filename);
                $filename = $type == 'SQL' ? str_replace('.aiml', '.sql', $filename) : $filename;
                $zip->addFromString($filename, $curZipContent);
            }
            $zip->close();
            $_SESSION['send_file'] = $zipFilename;
            $_SESSION['referer'] = $referer;
            header("Refresh: 5; url=file.php");
            $msg .= "The file {$zipFilename} is being processed. If the download doesn't start within a few seconds, please click <a href=\"file.php\">here</a>.\n";
        }
    }
}
$content .= renderMain();
$showHelp = $template->getSection('DownloadShowHelp');
$topNav = $template->getSection('TopNav');
$leftNav = $template->getSection('LeftNav');
Example #2
0
          case 'none':
            return showMe();
            break;
          case 'block':
            return hideMe();
            break;
          default:
            alert('display = ' + display);
        }
      }
//-->
    </script>
endScript;
$msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : '';
if (isset($_POST['action']) && $_POST['action'] == "AIML") {
    $content .= getAIMLByFileName($_POST['getFile']);
} elseif (isset($_POST['action']) && $_POST['action'] == "SQL") {
    $content .= getSQLByFileName($_POST['getFile']);
} elseif (isset($_GET['file'])) {
    $content .= serveFile($_GET['file'], $msg);
} else {
}
$content .= renderMain();
$showHelp = $template->getSection('DownloadShowHelp');
$topNav = $template->getSection('TopNav');
$leftNav = $template->getSection('LeftNav');
$main = $template->getSection('Main');
$topNavLinks = makeLinks('top', $topLinks, 12);
$navHeader = $template->getSection('NavHeader');
$leftNavLinks = makeLinks('left', $leftLinks, 12);
$FooterInfo = getFooter();
Example #3
0
            break;
          case 'block':
            return hideMe();
            break;
          default:
            alert('display = ' + display);
        }
      }
//-->
    </script>
endScript;
$post_vars = filter_input_array(INPUT_POST);
$get_vars = filter_input_array(INPUT_GET);
$msg = isset($post_vars['msg']) ? $post_vars['msg'] : '';
if (isset($post_vars['action']) && $post_vars['action'] == "AIML") {
    $msg .= getAIMLByFileName($post_vars['getFile']);
} elseif (isset($post_vars['action']) && $post_vars['action'] == "SQL") {
    $msg .= getSQLByFileName($post_vars['getFile']);
} elseif (isset($get_vars['file'])) {
    $msg .= serveFile($get_vars['file'], $msg);
} else {
}
$content .= renderMain();
$showHelp = $template->getSection('DownloadShowHelp');
$topNav = $template->getSection('TopNav');
$leftNav = $template->getSection('LeftNav');
$main = $template->getSection('Main');
$navHeader = $template->getSection('NavHeader');
$FooterInfo = getFooter();
$errMsgClass = !empty($msg) ? "ShowError" : "HideError";
$errMsgStyle = $template->getSection($errMsgClass);