How to display voucher remaining time?



  • I'm trying to display remaining voucher time on logout page
    I'm using pfSense 2.3 .

    I tried this code which I found  -> https://forum.pfsense.org/index.php?topic=83385.0

    
       <title>rEdEyEs</title> 
    
             Login Successful! Thank you for using our service.
                         function secondsToWords($seconds)
                {
                    $ret = "";
    
                    /*** get the days ***/
                    $days = intval(intval($seconds) / (3600*24));
                    if($days> 0)
                    {
                        $ret .= "$days days ";
                    }
    
                    /*** get the hours ***/
                    $hours = (intval($seconds) / 3600) % 24;
                    if($hours > 0)
                    {
                        $ret .= "$hours hours ";
                    }
    
                    /*** get the minutes ***/
                    $minutes = (intval($seconds) / 60) % 60;
                    if($minutes > 0)
                    {
                        $ret .= "$minutes minutes ";
                    }
    
                    /*** get the seconds ***/
                    $seconds = intval($seconds) % 60;
                    if ($seconds > 0) {
                        $ret .= "$seconds seconds";
                    }
    
                    return $ret;
                }         
             ?>
    
             Remaining Time: 
    
             [Click to continue](<?=$my_redirurl;?>)
    
    

    Tried  to just echo  $remaining_time variable  in the script but  it doesn't work.  https://forum.pfsense.org/index.php?topic=66311.0

    Any help will be appreciated.



  • Managed to get it working  8) , but another problem  :( , It dosen't display if I refresh the page



  • Visiting the logout page will ….. log out the user ;)

    So, there is no more session - so no more relation between the users's IP, MAC and voucher code.

    Or, all is not lost - visit the 'admin' page where you can check vouchers for remaing time, and (re) use (copie) that code over there to make your own "Voucher to remaining time info page".



  • @redeyes podrias publicar tu codigo php que lograste funcionar??, Gracias.

    Could you publish your php code that you managed to work ??, Thanks




Log in to reply