<?php
require_once('inc/logincheck.php');
CommTool::checkIncludeByAdminPhp();

if("" != $sbumit)
  $action = "onekeybackup";
  include("database/db_action.inc.php");

  include "../inc/thirdpart/phpzip/CreateZipFile.inc.php";
  set_time_limit(0);    //
  $arrDirToZip = array(
    "../config/",
    "../plus/",
    "../template/"
  );

  $outputDir = "/"; //Replace "/" with the name of the desired output directory.
  $zipName = "test.zip";

  $createZipFile = new CreateZipFile;
  foreach($arrDirToZip as $dirName)
  {
    echo $dirName;
    $createZipFile->zipDirectory($dirName,$outputDir);
  }
  $createZipFile->zipDirectory("../plus/",$outputDir);

  $rand=md5(microtime().rand(0,999999));
  $zipName=$rand."_".$zipName;
  $fd=fopen($zipName, "wb");
  $out=fwrite($fd,$createZipFile->getZippedfile());
  fclose($fd);
  $createZipFile->forceDownload($zipName);
  @unlink($zipName);
}

include_once template('zipwebsite.html', $adminTemplateName);
?>