Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Show only selected records in FrontEnd Collection 26 Jan 2012 01:50 #1089

  • iconvisual
  • iconvisual's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
Is there a way to have a Front End Collection Layout that only displays selected records from the SQL Select..
i.e. Showing a list of Properties (houses) I only want to show the ones that belong to the currently logged in User (jos_user.id) = landlord_id ??

Am I asking the wrong question?

Thank you,

Edward
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.

Please Log in or Create an account to join the conversation.

Last edit: by iconvisual. Reason: Need Further Information Please

Re: Show only selected records in FrontEnd Collection 26 Jan 2012 11:06 #1094

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Let's write inside.

TODO :
view.html.php :
$model->addWhere("a.landlord_id = " . (int)$user->id);
Coding is now a piece of cake
The following user(s) said Thank You: iconvisual

Please Log in or Create an account to join the conversation.

Re: Show only selected records in FrontEnd Collection 26 Jan 2012 11:41 #1096

  • iconvisual
  • iconvisual's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
Thank you Jocelyn. I appreciate your level of commitment and support.

Kind Regards,

Edward.
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.

Please Log in or Create an account to join the conversation.

Re: Show only selected records in FrontEnd Collection 23 Feb 2012 01:25 #1437

  • iconvisual
  • iconvisual's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
Hi Jocelyn,

Ok, finally got around to properly looking into this.. and I'm in view.html.php for com_easypropmgr, in views for properties, and I tried to insert:
$model->addWhere("a.landlord_id = " . (int)$user->id);

in function display_propertieslist($tpl = null) to no avail. Output still listed all properties.

I've looked, banged my head, sharpened my scissors, and am lost. Are you able to point out a little more specifically where I should add the WHERE clause?

Thank you kindly,

Edward.
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.

Please Log in or Create an account to join the conversation.

Re: Show only selected records in FrontEnd Collection 23 Feb 2012 05:55 #1438

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 132
  • Thank you received: 19
at my site works this:

in model folder
. $this->addWhere('`my_user` = ' . (int)$user->id)

and do not forget to check this:
$user =& JFactory::getUser();
The following user(s) said Thank You: admin, iconvisual, BTB300, edwardcox

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.088 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started