<?php

include "webpanel/" . $_GET['grupo'] . "/include_permiso.php";
include "webpanel/" . $_GET['grupo'] . "/" . $_GET['seccion'] . "/menu.php";
$array_listado = apache_listdomains();
//Busca dato si se ha solicitado
if (trim($_GET['fndBusqueda']) != "") {
    $array_busqueda = array();
    foreach ($array_listado as $value) {
        if (stripos($value, $_GET['fndBusqueda']) !== false) {
            $array_busqueda[] = $value;
        }
    }
    $array_listado = $array_busqueda;
}
$total_registros = count($array_listado);
$numpage_total = $total_registros;
$numpage_urlweb = "index.php?grupo=" . $_GET['grupo'] . "&seccion=" . $_GET['seccion'] . "&pag=" . $_GET['pag'];
include "include_top_numpage.php";
?>
<div align="center">
  <font size="2" face="Arial, Helvetica, sans-serif">Listado Dominios Apache</font><br>
    <table border="1" width="552" align="center" cellspacing="0" bordercolor="#999999">
      <tr> 
        <td align="center" valign="middle"> 
   <form name="frmBusqueda" action="index.php" method="get" onSubmit="return checkForm(this);">
	<input type="hidden" name="grupo" size="46" maxlength="150" value="<?php 
echo $_GET['grupo'];
?>
">
        <input type="hidden" name="seccion" size="46" maxlength="150" value="<?php 
function bandwidth_cron()
{
    $dominios = apache_listdomains();
    foreach ($dominios as $dominio) {
        $consumido = bandwidth_calcular($dominio, 1);
        $fechaconsumo = DateAdd("d", -1, mktime());
        //Sacamos la fecha de ayer
        bandwidth_grabar(date("j", $fechaconsumo), date("n", $fechaconsumo), date("Y", $fechaconsumo), $dominio, $consumido);
    }
}