Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/12/2005, 08:34
Avatar de vivinet
vivinet
 
Fecha de Ingreso: diciembre-2005
Mensajes: 4
Antigüedad: 18 años, 4 meses
Puntos: 0
Holass!! nuevita y con problemas... (por eso estoy aca)
Tengo un caso muy similar al de Al3jo, tengo que mostrar en pantalla subtotales por mes, pero la variable donde está el mes 2005-09-12 13:33:43, es decir que tendria que extraer el mes de ahi. ya tengo este código
Código PHP:
<?php
$query 
mysql_query("SELECT SUM(AcctSessionTime) as total FROM radacct WHERE UserName = '$nickUsuarioL'");
$tiempo_total mysql_result($query0);

echo
"<table width=600>
<tr>
    <td width=30%><b>Inicio de Conexión</b></td>
    <td width=30%><b>Fin de Conexión</b></td>
    <td width=10%><b>Tiempo en Seg.</b></td>
    <td width=30%><b>Subtotal</b></td>
</tr>"
;
while(
$row=mysql_fetch_row($result)){
// [7] AcctStartTime - [8] AcctStopTime - [9] AcctSessionTime
$inicio $row[7];
$fin $row[8];
$seg $row[9];
  echo
"<tr>
     <td width=30%>"
; echo strftime("%d/%m/%Y - %H:%M:%S",strtotime("$inicio"))."\n"; echo"</td>
    <td width=30%>"
; echo strftime("%d/%m/%Y - %H:%M:%S",strtotime("$fin"))."\n"; echo"</td>
    <td width=10% align=right>$seg</td>
    <td width=30% align=right>"
//calcula el tiempo --> convierte los segundos en Hs:min:seg.
        
if($seg 60) {
        echo 
strftime("%S seg.",$seg)."\n";}
        else {
            if(
$seg >= 60 && $seg 3600){
            echo 
strftime("%M min. %S seg.",$seg)."\n";}
            else {
                if(
$seg >= 3600) {
                
$hora intval($seg/3600);
                
$temp intval($seg - (3600*$hora));
                
$minutos intval($temp/60);
                
$segundos intval($temp - (60*$minutos));
                echo 
"$hora h. $minutos min. $segundos seg.";}
                }
            }
    echo
"</td>
    
    </tr>"
;
?>
que sería mas conveniente? hacer un form, y que elija el usuario el mes (ya ahi tengo que evaluar año tambien) o hacer un select, pero donde hacerlo??
Gran dilema!!
Podrán ayudarme?
Gracias.