Report Generator

Guy Fraser guy at incentre.net
Thu Aug 24 19:56:43 CEST 2006


Me too.

I have also built a report generator, into the management system I 
built.

I can provide snippets, but not the whole source until I get
authorization.

Here is a little snippet that allows the PHP output to be 
automatically opened in a spreadsheet :

---begin---
	  // $output contains tab ["\t"] delimited fields 
          // and linefeed ["\n"] delimited records
          $size_in_bytes = strlen($output);

	  if(strstr($_SERVER['HTTP_USER_AGENT'],'Safari') != false){
	    // User Agent is Safari = Broken
            // Document must be opend and saved with a text editor 
            // before excel can open it
            header("Content-type: application/vnd.ms-excel");
	    header("Content-disposition: attachment; filename=report-" .
$_SESSION['report'] . "-" . $syear . $smonth . "_" . $eyear . $emonth .
"-" . $gmatch . "_" . $umatch . "-" . date("Y-m-d") . ".txt; size=
$size_in_bytes");
	  } else {
            header("Content-type: application/vnd.ms-excel");
	    header("Content-disposition: attachment; filename=report-" .
$_SESSION['report'] . "-" . $syear . $smonth . "_" . $eyear . $emonth .
"-" . $gmatch . "_" . $umatch . "-" . date("Y-m-d") . ".tab; size=
$size_in_bytes");
	  }

	  echo $output ;
---End---

Note: When this works, the web page does not change since the data
is output as the attachment.


On Thu, 2006-08-24 at 11:04 -0600, Scott Miller wrote:
> I've also created a report generator - but mine does not require you to
> input the IP address.  It just authenticates the user, asks for the month
> they want to display, and if they want a summary report or a detailed
> report.  It is actually an old ICRadius script (written in PHP) that I found
> and modified to fit my needs.  I'm willing to share this one as well if
> anyone is interested.
> 
> Scott
> 
> -----Original Message-----
> From: freeradius-users-bounces+srmiller=interbel.net at lists.freeradius.org
> [mailto:freeradius-users-bounces+srmiller=interbel.net at lists.freeradius.org]
> On Behalf Of Sean
> Sent: Wednesday, August 23, 2006 1:58 PM
> To: freeradius-users at lists.freeradius.org
> Subject: Report Generator
> 
> Hi,
> 
> Ive written a report generator in PHP and HTML that will allow your
> clients to generate usage reports from the FreeRadius log files. When
> the user logs in he/she is asked for their IP address and the Month that
> they want to display. If anyone wants a copy let me know. If there is
> enough interest I'll make it available for public download.
> 
> Regards,
> 
> Sean Bracken
> 
> http://swarmhotspots.com
> - 
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
> 
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html





More information about the Freeradius-Users mailing list