function bandwidth_calcular($dominio, $rotacion)
{
    if ($rotacion == 0 or $rotacion == "") {
        $ficherolog = _CFG_APACHE_LOGS . $dominio . _CFG_LOGROTATE_CFG_AWSTATSTRING;
    } else {
        $ficherolog = _CFG_APACHE_LOGS . $dominio . _CFG_LOGROTATE_CFG_AWSTATSTRING . ".{$rotacion}";
    }
    if (file_exists($ficherolog)) {
        $lineas = file($ficherolog);
        foreach ($lineas as $line_num => $linea) {
            list(, , , , , , , , , $tamanio) = explode(" ", $linea, 10);
            if ($tamanio != "-") {
                $total = $total + $tamanio;
            }
        }
        return number_format(bitconversor($total, "byte", "mbyte"), 2, '.', '');
    } else {
        return 0;
    }
}
예제 #2
0
                <td width="12%" align="center"><img src="images/img_info.gif" width="50" height="34"></td>
                <td width="88%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font size="2" color="#FFFFFF">Informaci&oacute;n 
                  General de la Cuenta</font></b></font></td>
              </tr>
            </table>
          </td>
        </tr>
        <tr align="center"> 
          <td colspan="3"> 
            <table width="100%" border="0" cellspacing="2" cellpadding="0">
              <tr align="center"> 
                <td width="51%" align="left" bgcolor="#BFBFBF"><span class="Estilo5">&nbsp;Espacio 
                  usado por WEB</span></td>
                <td bgcolor="#DFDFDF" align="right" width="49%"> 
                  <?php 
echo number_format(bitconversor(pureftpd_quotastatus($_SESSION['SEC_USER_DOMINIOS'][$_GET['dominio']]), "byte", "mbyte"), 2, ',', '.');
?>
                  MB</td>
              </tr>
              <tr align="center"> 
                <td width="51%" align="left" bgcolor="#BFBFBF"><span class="Estilo5">&nbsp;Espacio 
                  usado por SQL</span></td>
                <td bgcolor="#DFDFDF" align="right" width="49%"> 
		          <?php 
db_mysql_showquotas($_GET['dominio']);
?>
		</td>
              </tr>
              <tr align="center"> 
                <td width="51%" align="left" bgcolor="#BFBFBF"><span class="Estilo5">&nbsp;Ancho 
                  de banda usado</span></td>
예제 #3
0
                <td width="34%" align="right"><b><?php 
echo number_format($_SESSION['SEC_USER_TOTAL_ESPACIO'], 2, ',', '.');
?>
 MB</b></td>
              </tr>
              <tr align="center"> 
                <td width="46%" align="left" class="Estilo2">&nbsp;Espacio Usado</td>
                <td width="34%" align="right"><b><?php 
echo number_format(bitconversor($total_espacio_global, "byte", "mbyte"), 2, ',', '.');
?>
 MB</b></td>
              </tr>
              <tr align="center"> 
                <td width="46%" align="left" class="Estilo2"><b>&nbsp;</b>Disponible</td>
                <td width="34%" align="right"><b><?php 
echo number_format($_SESSION['SEC_USER_TOTAL_ESPACIO'] - bitconversor($total_espacio_global, "byte", "mbyte"), 2, ',', '.');
?>
 MB</b></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <br>
      <table width="266" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td colspan="3" valign="top"> 
            <table width="100%" height="39" border="0" cellspacing="0" cellpadding="0" background="images/fnd_trafico.gif">
              <tr> 
                <td width="15%" align="center">&nbsp;</td>
                <td width="85%"><b><font color="#FFFFFF" size="3" face="Verdana, Arial, Helvetica, sans-serif">Transferencia</font></b>
function vpopmail_domainlimits($dominio, $flag)
{
    $exec_cmd = _CFG_VPOPMAIL_DOMAINLIMITS;
    $result = execute_cmd("{$exec_cmd} -S {$dominio}");
    switch ($flag) {
        case "estado":
            $pos = array_search_stringarray($result, _CFG_VPOPMAIL_CFG_ESTADO);
            if ($pos != "") {
                $value_result = 0;
            } else {
                $value_result = 1;
            }
            break;
        case "cuentas":
            $pos = array_search_stringarray($result, _CFG_VPOPMAIL_CFG_CUENTAS);
            $config_string = $result[$pos];
            $value_result = substr($config_string, strlen(_CFG_VPOPMAIL_CFG_CUENTAS) + 1);
            break;
        case "alias":
            $pos = array_search_stringarray($result, _CFG_VPOPMAIL_CFG_ALIAS);
            $config_string = $result[$pos];
            $value_result = substr($config_string, strlen(_CFG_VPOPMAIL_CFG_ALIAS) + 1);
            break;
        case "redirecciones":
            $pos = array_search_stringarray($result, _CFG_VPOPMAIL_CFG_REDIRECCIONES);
            $config_string = $result[$pos];
            $value_result = substr($config_string, strlen(_CFG_VPOPMAIL_CFG_REDIRECCIONES) + 1);
            break;
        case "autorespuesta":
            $pos = array_search_stringarray($result, _CFG_VPOPMAIL_CFG_AUTORESPUESTA);
            $config_string = $result[$pos];
            $value_result = substr($config_string, strlen(_CFG_VPOPMAIL_CFG_AUTORESPUESTA) + 1);
            break;
        case "listas":
            $pos = array_search_stringarray($result, _CFG_VPOPMAIL_CFG_LISTA);
            $config_string = $result[$pos];
            $value_result = substr($config_string, strlen(_CFG_VPOPMAIL_CFG_LISTA) + 1);
            break;
        case "quota":
            $pos = array_search_stringarray($result, _CFG_VPOPMAIL_CFG_QUOTA);
            $config_string = $result[$pos];
            $mQuotaBytes = substr($config_string, strlen(_CFG_VPOPMAIL_CFG_QUOTA) + 1);
            $mQuota = bitconversor($mQuotaBytes, "byte", "mbyte");
            if ($mQuotaBytes == 0) {
                $value_result = "NOQUOTA";
            } elseif ($mQuota < 1) {
                $value_result = bitconversor($mQuotaBytes, "byte", "kbyte") . "K";
            } else {
                $value_result = bitconversor($mQuotaBytes, "byte", "mbyte") . "M";
            }
            break;
    }
    return $value_result;
}
function db_mysql_showquotas($dominio)
{
    $conf = new patConfiguration();
    $conf->setConfigDir(_CFG_XML_CONFIG_DIR);
    $conf->parseConfigFile(_CFG_XML_BASEDATOS);
    $total_registros = count($conf->getConfigValue());
    for ($i = 1; $x < $total_registros; $i++) {
        $rs = $conf->getConfigValue($i);
        if ($rs["DOMINIO"] == $dominio) {
            echo $rs["DATABASE"] . " - " . number_format(bitconversor(db_mysql_quotastatus($rs["DATABASE"]), "byte", "mbyte"), 2, ',', '.') . " MB<br>";
        }
        if ($rs) {
            $x++;
        }
    }
}