Acces to filter data on PHP

Status
Not open for further replies.

oreolana

Member
Please, help me.

Acces to filter data on PHP.

HTML:
<select id="dbme_entity_performance___reporting_yearvalue" name="fabrik___filter[list_58_com_content_58][value][0]" class="inputbox fabrik_filter" size="1">
	<option value="">???? ?????, ???????</option>
	<option value="2012" selected="selected">2012</option>
</select>

I try
PHP:
echo $_POST['fabrik___filter[list_58_com_content_58][value][0]'];

But it's don't work.

I known than on javascript it's

Code:
var val = $('dbme_entity_performance___reporting_yearvalue').value;

But I need on PHP.
 
Please, help me.
Maybe you known.

I need to det data (values) from filter (type - select, dropdown) on php and use it in the my_template/default.php.
 
life is great

I found an answer on russian forum about multidimensional arrays.

So, I want to get data from my filters.

Firsterfull, I wrote

PHP:
var_dump($_POST);

And I'll see my array of filters;

PHP:
array(20) { 
	["fabrik___filter"]=> array(1) { 
		["list_58_com_fabrik_58"]=> array(11) { 
			["value"]=> array(2) { 
				[0]=> string(4) "2012" 
				[1]=> string(1) "1" 
			} 
			["condition"]=> array(2) { 
				[0]=> string(1) "=" 
				[1]=> string(1) "=" 
			} 
			["join"]=> array(2) { 
				[0]=> string(3) "AND" 
				[1]=> string(3) "AND" 
			} 
			["key"]=> array(2) { 
				[0]=> string(42) "`dbme_entity_performance`.`reporting_year`" 
				[1]=> string(45) "`dbme_entity_performance`.`reporting_quarter`" 
			} 
			["search_type"]=> array(2) { 
				[0]=> string(6) "normal" 
				[1]=> string(6) "normal" 
			} 
			["match"]=> array(2) { 
				[0]=> string(1) "1" 
				[1]=> string(1) "1" 
			} 
			["full_words_only"]=> array(2) { 
				[0]=> string(1) "0" 
				[1]=> string(1) "0" 
			} 
			["eval"]=> array(2) { 
				[0]=> string(1) "2" 
				[1]=> string(1) "0" 
			} 
			["grouped_to_previous"]=> array(2) { 
				[0]=> string(1) "0" 
				[1]=> string(1) "0" 
			} 
			["hidden"]=> array(2) { 
				[0]=> string(1) "0" 
				[1]=> string(1) "0" 
			} 
			["elementid"]=> array(2) { 
				[0]=> string(4) "3503" 
				[1]=> string(4) "3504" 
			} 
		} 
	} 
	["limit58"]=> string(2) "10" 
	["limitstart58"]=> string(1) "0" 
	["option"]=> string(10) "com_fabrik" 
	["orderdir"]=> string(0) "" 
	["orderby"]=> string(0) "" 
	["view"]=> string(4) "list" 
	["listid"]=> string(2) "58" 
	["listref"]=> string(16) "58_com_fabrik_58" 
	["Itemid"]=> string(3) "196" 
	["fabrik_referrer"]=> string(43) "/index.php/dodatok-3-mert-zv?resetfilters=0" 
	["58bdaa72aa3c8d03270195fd070b3562"]=> string(1) "1" 
	["format"]=> string(4) "html" 
	["_packageId"]=> string(1) "0" 
	["task"]=> string(11) "list.filter" 
	["fabrik_listplugin_name"]=> string(0) "" 
	["fabrik_listplugin_renderOrder"]=> string(0) "" 
	["fabrik_listplugin_options"]=> string(0) "" 
	["incfilters"]=> string(1) "1" 
	["fabrik_show_in_list"]=> array(0) { 
	} 
}

Then I delete
PHP:
var_dump($_POST);
and
echo values from array!

PHP:
$myarray = $_POST["fabrik___filter"];
$myyear = $myarray ["list_58_com_fabrik_58"]["value"][0];
$myperiod = $myarray ["list_58_com_fabrik_58"]["value"][1];
echo $myyear;
echo "<br>";
echo $myperiod;

And it's work!
If you need, then use this code.

)))
And thanks for Troester for code
PHP:
var_dump($this->filters);
He's help me too.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top