two elements in one range filter

Martooti

Member
Hi,
I have a two separate columns - year and month. I would like to make it possible to filter the table content by range with those two elements, is there a way to make it work? I would like to get a filter : from {month} {year} till {month} {year}.
Any suggestions?
Thanks in advance
 
Since it is about time I thought to make it using a date element. The problem is that some of data are related to the whole month. In this case it would need an extra row with sum under every month, that is generated automaticaly (for the data with daily values) but could be edited (for the data with montly values) . Is it possible to reach?
 
For range filtering, you would need to use a date element.

I'm not sure what you are asking here. You are tlaking about automated sums but which can also be edited by hand ... but Fabrik doesn't have such a thing.

Is this related to your other question involving canEditRow?

As I said in my response on one of your other threads, in order to properly help you, it owuld be really useful to have an overview / specification of what your app needs to do, the workflow involved, the tables it needs, etc.

I'm beginning to get a sense of what you are trying to do, which is log and report on resource usage for properties 9like gas, water, electricity, etc). But we need to better understand what resource types you have, and the differences on how they are logged / summed / filtered, etc, so we can work out whether you can do this with a single generic "resource" table, or whether the resources need to be broken down in to different tables for each type, etc.

You will save yourself a lot of time in the longer term if you take some time now to get the project properly spec'ed, so we all understand what needs doing, and the best way of going about it, than rushing in to developing it "on the fly", without a clear understanding of how it all hangs together.

-- hugh
 
It has been made with custom php code and used after form redirect to the article. I am not sure it is totally correct but seems to work
Code:
if(!empty($data->from_year) && !empty($data->to_year)){
  $query.=" AND year BETWEEN {$data->from_year} AND {$data->to_year}";
}else if(!empty($data->from_year)){
  $query.=" AND year = {$data->from_year}";
}
 
if(!empty($data->from_month) && !empty($data->to_month)){
  $query.=" AND month BETWEEN '{$data->from_month}' AND '{$data->to_month}'";
}else if(!empty($data->from_month)){
  $query.=" AND year = '{$data->from_month}'";
}
 
Are you saying you have solved the issue?

Where is that code being run? In the article? In a pre-filter?

-- hugh
 
Yes, it is working in the article. I didn't make it myself so I cannot really explain that solution, but seems like it is working.
I used a php plugin for joomla articles like you suggested and than added this code.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top