<?php include_once 'include/common.php'; include_once 'include/db.php'; include_once 'include/html_db.php'; include_once 'include/Disk.php'; include_once 'include/File.php'; include_once 'include/Category.php'; include_once 'include/Messages.php'; include_once 'config.inc'; db_open(); $numDisks = db_select_single_value("\r\n\tSELECT COUNT(*)\r\n\tFROM disk\r\n"); $numFiles = "?"; $totalSize = "?"; $numFileCategories = db_select_single_value("\r\n\tSELECT COUNT(*)\r\n\tFROM category\r\n\tWHERE type=" . CATEGORY_FILE . "\r\n"); $numDiskCategories = db_select_single_value("\r\n\tSELECT COUNT(*)\r\n\tFROM category\r\n\tWHERE type=" . CATEGORY_DISK . "\r\n"); $numAssignedDiskCategories = db_select_single_value("\r\n\tSELECT COUNT(*)\r\n\tFROM category_map_disk\r\n"); $numAssignedFileCategories = db_select_single_value("\r\n\tSELECT COUNT(*)\r\n\tFROM category_map\r\n"); if ($_REQUEST["moreDetails"]) { $numFiles = db_select_single_value("\r\n\t\tSELECT COUNT(*)\r\n\t\tFROM directory\r\n\t"); $totalSize = db_select_single_value("\r\n\t\tSELECT SUM(size)\r\n\t\tFROM directory\r\n\t") / (1024 * 1024 * 1024); } include 'stats.php_html';
function getRootOfDisk($diskId) { return db_select_single_value("\r\n \tSELECT directory.id as FileId\r\n \tFROM disk, directory\r\n \tWHERE \r\n \tdisk.id='{$diskId}'\r\n \tAND directory.parent=0\r\n \tAND directory.snapshot=disk.id\r\n "); }