Dates and Filters - option type 0

Add Date filters and Other Filters to the Table Views, can be combined with searches and cateoires options

To use the date and filters options add the option tyoe 0 (zero). 

$stats->setOption('TRAFFIC,VISITAS,TRAFFIC','aside',"4", 'VFJNCX0',  true);

This will automatically add defaut filters on the top: Quarte, Month and Year, and will create an ASIDE view with two date fileds (from - To), it can be combined with searches and cateoires options

 

 

You can add more filters using addFiled() inside a file that needs to be created in the same folder where your section is created called FILTERS, and the same name file as your section (section_name.php)

By default two variables wil; exist $d1 and $d2, this are the 2 dates in the range selected, either from the dates fields or the filters on the top (Quarte, Month and Year)

 

you can use this values in your where clauses

 

addwhere("VISITS_DATE >= '$d1' and VISITS_DATE <= '$d2'");

 

Remeber, you can add any other field inside the file created in the files in the FILTERS folder (if it exists) and any value will be submitted to itself in GET, and can be used in your where clauses or any conditonal in the page, the PHP variable name will be the sameas the field name.

Since the space is reduced you don't need to add:

<div class="form_div">

Simply add your fileds and they will be nicely arranged:

 

addField('select','LANG','lang:'.$lang,":All Languages,fr:FR,en:EN"); 

$getOptions = array(
"table" => "PRODUCTS",
"op_name" => "title",
"op_val" => "PRID",
"where" => "visible = 1",
"order" => "NAME"
); 

addField('select','PRODUCTS','PRID',$getOptions);

 

You can also determine the size of the aside frame using the following variable:

 

$asideWidth = 400 //the default is 250

 

The aside content will benefit from any other actions of the section and you can also add manual actions to it

 

Get a Quote

Get a Quote