Ignore:
Timestamp:
Oct 20, 2009, 12:57:43 PM (15 years ago)
Author:
cljosse
Message:

[mail_supervisor] update help.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Mail_supervisor/include/fonctions.php

    r4059 r4065  
    173173    $data = mysql_fetch_array(pwg_query($query));
    174174        //====================================================================================
    175        
    176 
    177     $mails_periode="+".str_replace($period_search, $period_match, $data['nb_mails_periode']);
    178         $next_day =  strtotime(  $mails_periode,$data['date_mail']);
    179         $data['rest_mail']=  ( $next_day )-time() ;
    180        
     175    $mails_periode = "+" . trim( str_replace($period_search, $period_match, $data['nb_mails_periode']));
     176 
     177        $next_day = $data['date_mail'] + strtotime(  $mails_periode,0);;
     178        $data['rest_mail']=    $next_day - time() ;
     179 
    181180                               
    182181        $spams_periode="+".str_replace($period_search, $period_match, $data['nb_spams_periode']);
    183         $next_day =  strtotime(  $spams_periode,$data['date_spam']);
    184         $data['rest_spam']=  ( $next_day )-time() ;
     182        $next_day = $data['date_spam'] + strtotime(  $spams_periode,0);
     183        $data['rest_spam']=  $next_day -time() ;
    185184
    186185 
    187186        $quarantaine_periode="+".str_replace($period_search, $period_match, $data['quarantaine_periode']);
    188         $next_day =  strtotime( $quarantaine_periode,$data['date_quarantaine']);       
     187        $next_day = $data['date_quarantaine'] + strtotime( $quarantaine_periode,0);     
     188       
    189189        if ($data['quarantaine']) {
    190190        $data['reste'] =   ( $next_day )-time() ;
     
    224224function int_to_heure($int)
    225225{
    226 $week= (int) ($int/(3600*24*7));
    227 $int=$int-($week*(3600*24*7)); 
    228 
    229 $day= (int) ($int/(3600*24));   
    230 $int=$int-($day*(3600*24));
    231 
    232 $heures=(int) ($int/3600);
    233 
    234 $int=$int-($heures*(3600));
    235 
    236 $minutes=(int) ($int/60);
    237 $int= $int - ($minutes*(60));
     226
     227
     228
     229$delta=(7*24*60*60) ;
     230$week = (int) ($int/$delta);
     231
     232$int= $int-($week*$delta) ; 
     233
     234
     235$delta=(24*60*60) ;
     236$day= (int) ($int/$delta);
     237$int=$int-($day*$delta);
     238
     239$delta=(60*60) ;
     240$heures=(int) ($int/$delta);
     241$int=$int-($heures*$delta);
     242
     243$delta=(60) ;
     244$minutes=(int) ($int/$delta);
     245$int= $int - ($minutes*$delta);
     246
    238247
    239248$secondes=(int) ($int);
    240249
    241 $heures= substr ('00'. $heures,-2,2);   
    242 $day= substr ('00'.  $day,-2,2);   
    243 $minutes=substr ('00'.$minutes,-2,2);
    244 $secondes=substr ('00'.$secondes,-2,2);
    245 
     250$day      = substr ('00'.    $day,-2,2);   
     251$heures   = substr ('00'. $heures,-2,2);   
     252$minutes  = substr ('00'.$minutes,-2,2);
     253$secondes = substr ('00'.$secondes,-2,2);
     254
     255   
    246256if ($week > 0 )
    247257{
    248 
    249 return $week. " " .l10n('Week'). " " .  $day . " " .l10n('Day'). "s ". $heures . " ". l10n('Hour'). "s " . $minutes. " " .l10n('minute'). "s ".  $secondes." " .l10n('seconde')."s";
     258        return $week. " " .l10n('Week'). " " .  $day . " " .l10n('Day'). "s ". $heures . " ". l10n('Hour'). "s " .    $minutes. " " .l10n('minute'). "s ".  $secondes." " .l10n('seconde')."s";
    250259}
    251260return $day . " " .l10n('Day'). "s ". $heures . " ". l10n('Hour'). "s " . $minutes. " " .l10n('Minute'). "s ".  $secondes." " .l10n('Seconde')."s";
Note: See TracChangeset for help on using the changeset viewer.