IM building a component and im trying to work out how to do this
Bookings / Orders / Order
I have a bookings view and form I have a orders view and form
However...
Im having trouble getting bookings to show orders based on booking id. I have added to the models file WHERE bid=GET[bid]
However that messes things up when coming back from editing an order.
The steps are
- click bookings
- view orders based on booking id ( my custom hack in the models file for orders )
- open order
- edit order
- click save
- return to orders view where booking id=booking id
I can manage this by adding a little hack into the controllers order.php file
but...
That works for saving and going back and yet it crashes all other actions like publish,archive etc..
There must be a section in the mvc where i can put the additional &bid=$_GET['bid'] and it works across all submission actions.
What is the correct way to build a component with views that are parent to each other.
Im happy to provide code but theres quite a lot. So maybe if you could direct me first.
some other notes:
here is my link to the orders from the bookings view
JRoute::_('index.php?option=com_tourbookings&view=orders&bid='.(int) $row->id)
Here is my hack within the models/orders.php
$query->where('a.bid = '.$_GET['bid']);
So far that works good, if i click it ill get the orders based on bid.
Then i am lost. Because if i try to hack from here i am completely stuck as it wont come back to the orders based on bid without crashing.
If i hack the controllers/order.php ( which has changed again in joomla 3.3+ )
I find that it kind of works and allows me to go back to the previous page with bid=bid attached but if i try to archive,unpublish or do anything of that sort im stuck.
Cheers John
$query->where('a.bid = '.$_GET['bid']);
because you will be hacked. It is called SQL Injection. Second - I do not understand why there is a problem when all other actions does not work. What exactly is wrong?