Forums

Sorting via URL

alex305v 16 Sep, 2016
I really need help on this one.

We have a database with almost 1400 entries. We use CC to read those records we call "Member Notes" Our staff can easily type the username of the member on a textbox and search all of their records the username is saved as (stuusername). We need to simplify this transaction and instead of my staff searching for the username i would like the table pull the records for that member based on the URL example (http://vatstar.com/index.php/instructors/member-notes?act=index&orderfld=Notes.stuusername=123456) and with that URL only the entries for the member 123456 will be displayed.

Please Help me, our website works a lot with Chrono and this has so far been our only limitation.

Thanks
GreyHead 17 Sep, 2016
Hi alex305v,

You should be able to do this using the Conditions box in the listing to filter on the value but there is something a bit odd about the value in the URL &orderfld=Notes.stuusername=123456 is that correct? I think that would normally be &orderfld=Notes&stuusername=123456

Bob
alex305v 17 Sep, 2016
I made up the URL to use it as an example. What would I put on the conditions box?
GreyHead 17 Sep, 2016
Hi alex305v,

Please try this in the Conditions box
<?php
return array ('stuusername' => $this->view->controller->data['stuusername']);
?>
assuming that the URL looks like my example and the column name is stuusername

Bob
alex305v 19 Sep, 2016
That didnt do it. Any other ideas?
GreyHead 19 Sep, 2016
Hi alex305v,

What is the actual URL you are using?

Bob
alex305v 19 Sep, 2016
On CC I click preview and at the end add &stuusername=123456
GreyHead 19 Sep, 2016
Hi alex305v,

And what URL does that make?

Bob
alex305v 19 Sep, 2016
http://vatstar.com/index.php?option=com_chronoconnectivity5&cont=lists&act=index&ccname=Notes&stuusername=123456
GreyHead 19 Sep, 2016
Hi alex305v,

Please try this version
<?php
return array ('stuusername' => $this->data['stuusername']);
?>

The URL data does end up in the variable I used before - but apparently not until after the Condition has been run :-(

Bob
alex305v 19 Sep, 2016
You my friend, you are the man. thank you
This topic is locked and no more replies can be posted.