if (!$action) {
    // products content
    // load products_ids into array
    $products_id_query = olc_db_query("SELECT DISTINCT\n                                pc.products_id,\n                                pd.products_name\n                                FROM " . TABLE_PRODUCTS_CONTENT . " pc, " . TABLE_PRODUCTS_DESCRIPTION . " pd\n                                WHERE pd.products_id=pc.products_id and pd.language_id='" . SESSION_LANGUAGE_ID . APOS);
    $products_ids = array();
    while ($products_id_data = olc_db_fetch_array($products_id_query)) {
        $products_ids[] = array('id' => $products_id_data['products_id'], 'name' => $products_id_data['products_name']);
    }
    // while
    ?>
 <div class="pageHeading"><br/><?php 
    echo HEADING_PRODUCTS_CONTENT;
    ?>
<br/></div>
  <?php 
    olc_spaceUsed(DIR_FS_CATALOG . 'media/products/');
    echo '<div class="main">' . USED_SPACE . olc_format_filesize($total) . '</div></br>';
    ?>
 <table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr class="dataTableHeadingRow">
     <td class="dataTableHeadingContent" nowrap="nowrap" width="5%" ><?php 
    echo TABLE_HEADING_PRODUCTS_ID;
    ?>
</td>
     <td class="dataTableHeadingContent" width="95%" align="left"><?php 
    echo TABLE_HEADING_PRODUCTS;
    ?>
</td>
</tr>
<?php 
    for ($i = 0, $n = sizeof($products_ids); $i < $n; $i++) {
예제 #2
0
function olc_spaceUsed($dir)
{
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
            while (($file = readdir($dh)) !== false) {
                if (is_dir($dir . $file) && $file != '.' && $file != '..') {
                    olc_spaceUsed($dir . $file . '/');
                } else {
                    $GLOBALS['total'] += filesize($dir . $file);
                }
            }
            closedir($dh);
        }
    }
}