Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Graphing reports mod


nick

Recommended Posts

Posted

Ok I tried this in the developers forum and didn't get anywhere so lets try the general community ... ** ahem **

 

I'm busy working on a graphing module for the reports section (my wife loves nice pretty graphs :) and this would make a nice addon for displaying sales, etc.). I also intend to try add some more reports in the future like sales by month, sales versus sales forecasts, etc.

 

What I'm having a small problem with is limiting graph dataset just to MAX_DISPLAY_SEARCH_RESULTS or more specifically the results returned in page2 of the search. I just can't get my head around the way the dataset for results in page2 are limited to just that page. Currently my graphs always come back with page 1's dataset.

 

The code below is what I'm using for getting the data into array $data (this is obviously for Best Viewed Products).

 

  if ($HTTP_GET_VARS['page'] > 1) $rows = $HTTP_GET_VARS['page'] * 20 - 20; 

 $products_query_raw = "select p.products_id, pd.products_name, pd.products_viewed, l.name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l where p.products_id = pd.products_id and l.languages_id = pd.language_id [b]and pd.products_viewed != '0' [/b]order by pd.products_viewed DESC"; 



 $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); 

 $products_query = tep_db_query($products_query_raw); 

 while ($products = tep_db_fetch_array($products_query)) { 



   $data['products_viewed'][$rows] = $products['products_viewed']; 

   $legend_name['products_name'][$rows] = $products['products_name']; 

   $rows++; 

 }

 

This is what the graph currently looks like ...

 

graph.jpg

 

Any help (or anyone wanting to help with the mod) would be greatly appreciated.

 

Thanks

 

Nick

Posted

jpgraph. It's under QPL so should be o.k. to use with OSC. It's a bit of a pain to get going if you don't have GD compiled into php but a wicked package none the less.

Posted
jpgraph. It's under QPL so should be o.k. to use with OSC. It's a bit of a pain to get going if you don't have GD compiled into php but a wicked package none the less.

 

Unfortunately the QPL license is on the list of incompatible GPL licenses noted here:

 

http://www.gnu.org/licenses/license-list.h...patibleLicenses

 

This may be ok to use for a personal thing, but no such contribution or distribution can be made possible.

 

That is why I chose phplot for the Administration Tool banner statistics page, it is not as pretty but it works :)

:heart:, osCommerce

Posted

It's also covered by a professional licence which I am awaiting details on.

 

From their website ...

 

Software license

JpGraph is release under a dual license:

QPL 1.0 (Qt Free Licensee)

 

I will try out phplot as well as hunt around and see if I can find any other "compatible" graphing packages to use if that is not ok.

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...