RSS
 

PHP Analytics: Variables

11 Aug

1. Introduction

I want to introduce a new feature that has been added to PHP Analytics: the variables.

In PHP Analytics, variables are keywords that can be used in your queries by using the following syntax: $variable_name

2. Create a Variable

In order to use a variable, first we have to define it trough the administration panel; to define a variable we just have to specify it’s own name and a default value.

At the time of the query execution, every variable that has been previously defined in the administration tool, is replaced with the values passed trough a GET or a POST method; if none of them is used, a default value (specified at the variable definition phase) is used.

Read the rest of this entry »

 

Unix tips #2: Convert all files from DOS to Unix within a directory

10 Jun

Sometimes, while moving text files from a MS Windows system to a Unix one, we can find a ^M character at the end of each file’s line.

This happens especially when the original files have been modified in MS Windows and then moved to Unix.

A new line in MS Windows is interpreted as a CRLF (Carriage Return, Line Feed) with Hex code 0D0A, while in Unix as a LF, Hex code 0A.

So that ^M is just the ASCII translation of the exceeding CR, 0D.

In Unix we can use the dos2unix utility in order to convert DOS text files to Unix.

The only problem of this utility is that  you cannot overwrite directly the file, but you have to redirect the output to a new file and then replace the original one:


$> dos2unix input.txt > output.txt
$> rm input.txt
$> mv output.txt input.txt

You can imagine how could be nasty when you have to convert more than one file in the same directory.

Well, I have been googling for a while to find a solution and finally I have found very useful the following command:


find . -type f -exec dos2unix {} {} \;

By using the command above you can convert all the files within a directory in one shot!

 

 

Oracle BIEE-like reporting tool by using low cost web technologies

06 Jun

1. Introduction

In this interesting post we will see how to mount an OBIEE-like reporting tool by using low cost web technologies.

In the example we are going to see how to combinate PHP Analytics and WordPress templates to get close to that objective.

2. The idea

PHP Analytics is a plugin that transform your WordPress platform in a reporting tool. It allows you to build views (tables and chart) that you can publish in a WordPress page/post.

Once we have our defined reports (see the offical documentation to use PHP Analytics), we just need to modify a WordPress template to give to our platform the OBIEE look&feel.
Moreover we have to play a little bit with the code in order to emulate the OBIEE frontend main logic.

Read the rest of this entry »

 

PHP Analytics’s demo

27 May

1. Introduction

This post will show some examples of PHP Analytics reports; the plugin has been installed on this blog and some views have been created and published below.

2. A report example

I want to show how a report could appear once published on your page. In this example we will see a fake distribution of the employees of a consulting company on the different lines of business.

Consultants per LOBs

LOB CONSULTANTS
BIW 25
EBS 2
Hyperion 18
IDM 6
JDE 4
People Soft 9
SOA 13

Read the rest of this entry »

 

PHP Analytics’s preview: Transform your WordPress Platform in a reporting tool

18 May

Introduction

I am delighted to announce that the first beta version of PHP Analytics will be soon available.
After several months of development the product has come out exactly how I wanted; few enanchements would be needed, but currently it’s working fine and without any critical major issue.

What is PHP Analytics?

PHP Analytics is a WordPress plugin that extends your blog platform’s functionalities by adding the chance to define connections to the database, execute queries and build views over the returned resultset (mainly tables and charts).
The full process to create a report could be resume as follows:
1. Create a Connection
2. Create a query
3. Create a view
4. Publish

Read the rest of this entry »