Example #1
0
 /**
  * 支付方式列表
  *
  * @param 
  * @return array 数字形式的返回结果
  */
 public function getPaymentList()
 {
     $payment_dir = BasePath . DS . 'api' . DS . 'payment';
     $result = readDirList($payment_dir);
     if (is_array($result)) {
         /**
          * 支付方式列表
          */
         $payment_list = array();
         foreach ($result as $k => $v) {
             $info_file = $payment_dir . DS . $v . DS . 'info.php';
             if (file_exists($info_file)) {
                 require_once $info_file;
                 if (is_array($info_array) && !empty($info_array)) {
                     $payment_list[] = $info_array;
                 }
             }
             unset($info_file);
         }
         return $payment_list;
     } else {
         return false;
     }
 }
Example #2
0
 /**
  * 数据库恢复
  */
 public function db_restoreOp()
 {
     $lang = Language::getLangContent();
     /**
      * 删除
      */
     if ($_POST['form_submit'] == 'ok') {
         if (!empty($_POST['dir_name']) && is_array($_POST['dir_name'])) {
             $dir = BASE_ROOT_PATH . DS . 'sql_back';
             foreach ($_POST['dir_name'] as $k => $v) {
                 if (file_exists(BASE_ROOT_PATH . DS . 'sql_back' . DS . $v)) {
                     $file_list = array();
                     readFileList($dir . DS . $v, $file_list);
                     /**
                      * 删除文件
                      */
                     if (is_array($file_list)) {
                         foreach ($file_list as $k_file => $v_file) {
                             @unlink($dir . DS . $v . DS . $v_file);
                         }
                     }
                     /**
                      * 删除目录
                      */
                     @rmdir($dir . DS . $v);
                 } else {
                     showMessage($lang['db_restore_file_not_exists']);
                 }
             }
             showMessage($lang['db_restore_del_succ']);
         } else {
             showMessage($lang['db_restore_choose_file_to_del']);
         }
     }
     $tmp_list = readDirList(BASE_ROOT_PATH . DS . 'sql_back');
     /**
      * 整理内容
      */
     $dir_list = array();
     if (is_array($tmp_list)) {
         foreach ($tmp_list as $k => $v) {
             $dir_list[$k]['name'] = $v;
             $dir_list[$k]['make_time'] = date('Y-m-d H:i:s', filemtime(BASE_ROOT_PATH . DS . 'sql_back' . DS . $v));
             $dir_list[$k]['size'] = number_format(getDirSize(BASE_ROOT_PATH . DS . 'sql_back' . DS . $v) / 1024, 2) . 'KB';
             $dir_list[$k]['file_num'] = count(glob(BASE_ROOT_PATH . DS . 'sql_back' . DS . $v . DS . "*.sql"));
         }
     }
     Tpl::output('dir_list', $dir_list);
     Tpl::showpage('db.restore');
 }
Example #3
0
 /**
  * 获取目录
  * 
  * @param 
  * @return 
  */
 public function getBackDir()
 {
     /**
      * 按照日期进行生成
      */
     $dir_list = readDirList(BASE_ROOT_PATH . DS . 'sql_back');
     $tmp = date('Ymd');
     $check_array = array();
     if (is_array($dir_list)) {
         foreach ($dir_list as $k => $v) {
             if (substr($v, 0, strlen($tmp)) == $tmp) {
                 $check_array[] = substr($v, strlen($tmp) + 1, strlen($v));
             }
         }
     }
     $return = $tmp . '_' . ($check_array[count($check_array) - 1] + 1);
     return $return;
 }
Example #4
0
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n<html>\n  <head>\n  <meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\"/>\n  <title>Index of ", $uri, "</title></head>\n  <body>\n    <h1>Index of ", $uri, "</h1>";
if (isset($setting->HeaderName)) {
    printIncludes($path, $setting->HeaderName);
}
if (isset($_SERVER['LS_FI_OFF']) && $_SERVER['LS_FI_OFF']) {
    $header = "<ul>\n";
} else {
    $header = "<pre><img src=\"{$setting->IconPath}/blank.png\" alt=\"     \"> <a href='?{$NameSort}'>";
    $header .= sprintf($setting->nameFormat, 'Name</a>');
    $header .= " <a href='?{$ModSort}'>Last modified</a>         <a href='?{$SizeSort}'>Size</a>  <a href='?{$DescSort}'>Description </a>\n   <hr>";
}
echo $header;
if (!$path) {
    echo "[ERROR] Auto Index script can not be accessed directly!";
} else {
    $list = readDirList($path, $setting->Exclude_Patterns, $map);
    if ($list === null) {
        print "[ERROR] Can not open directory for URI: {$uri}!";
    } else {
        if ($uri != '/') {
            $fileStat = new FileStat('');
            $fileStat->mtime = filemtime($path);
            $fileStat->img = $map->parent_img;
            $fileStat->size = -1;
            $base = substr($uri, 0, strlen($uri) - 1);
            $off = strrpos($base, '/');
            if ($off !== FALSE) {
                $base = substr($base, 0, $off + 1);
                printOneEntry($base, "Parent Directory", $fileStat, $setting);
            }
        }